[Libreoffice-commits] core.git: 2 commits - officecfg/registry sd/source sw/inc sw/sdi sw/source

Armin Le Grand alg at apache.org
Wed Apr 23 03:23:25 PDT 2014


 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    5 
 sd/source/ui/app/sdxfer.cxx                                          |   11 +
 sw/inc/PostItMgr.hxx                                                 |    5 
 sw/inc/cmdid.h                                                       |    2 
 sw/inc/swcommands.h                                                  |    1 
 sw/sdi/_annotsh.sdi                                                  |    6 
 sw/sdi/_textsh.sdi                                                   |    5 
 sw/sdi/swriter.sdi                                                   |   24 +++
 sw/source/core/uibase/docvw/AnnotationMenuButton.cxx                 |    2 
 sw/source/core/uibase/docvw/PostItMgr.cxx                            |   77 +++++++++-
 sw/source/core/uibase/docvw/SidebarWin.cxx                           |    1 
 sw/source/core/uibase/docvw/annotation.hrc                           |    1 
 sw/source/core/uibase/inc/annotsh.hxx                                |    2 
 sw/source/core/uibase/shells/annotsh.cxx                             |   17 +-
 sw/source/core/uibase/shells/textfld.cxx                             |   14 +
 sw/source/ui/app/mn.src                                              |    6 
 sw/source/ui/docvw/annotation.src                                    |    5 
 17 files changed, 176 insertions(+), 8 deletions(-)

New commits:
commit e735b48e2107a0ee1a9553a6bc4d09d1d176b370
Author: Armin Le Grand <alg at apache.org>
Date:   Tue Apr 22 11:45:25 2014 +0000

    Resolves: #i63399# add to clipboard as URL only when...
    
    no fill and no line style, just a simple URL
    
    (cherry picked from commit a91b5943b2c971ff1e69f5c2da45b8a647562676)
    
    Change-Id: Ic8bd02c81663575355a0ca79e4987b5ef0e4a445

diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index c0b58a8..d155f5c 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -225,7 +225,16 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
                     {
                         const SvxURLField* pURL = (SvxURLField*) pData;
 
-                        mpBookmark = new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() );
+                        // #i63399# This special code identifies TextFrames which have just an URL
+                        // as content and directly add this to the clipboard, probably to avoid adding
+                        // an unnecessary DrawObject to the target where paste may take place. This is
+                        // wanted only for SdrObjects with no fill and no line, else it is necessary to
+                        // use the whole SdrObect. Test here for Line/FillStyle and take shortcut only
+                        // when both are unused
+                        if(!pObj->HasFillStyle() && !pObj->HasLineStyle())
+                        {
+                            mpBookmark = new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() );
+                        }
                     }
                 }
             }
commit ebb728c9c01b5e86926381fa816cf69cb3eb1e37
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 22 17:06:26 2014 +0100

    add a 'format all comments' feature
    
    Change-Id: Ie9530f0f58b38d014beda60b9efba3ce93fe5c0e

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 548f9aa..ad9275b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -5308,6 +5308,11 @@
           <value xml:lang="en-US">Delete All Comments</value>
         </prop>
       </node>
+      <node oor:name=".uno:FormatAllNotes" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Format All Comments</value>
+        </prop>
+      </node>
       <node oor:name=".uno:DeleteAuthor" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Delete All Comments by This Author</value>
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 4f99419..438cffa 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -44,6 +44,8 @@ class SfxBroadcaster;
 class SfxHint;
 class SwEditWin;
 class Color;
+class SfxItemPool;
+class SfxItemSet;
 class SvxSearchItem;
 class SvxLanguageItem;
 namespace sw { namespace annotation {
@@ -218,6 +220,9 @@ class SwPostItMgr: public SfxListener
             void Delete(const OUString& aAuthor);
             void Delete();
 
+            void ExecuteFormatAllDialog(SwView& rView);
+            void FormatAll(const SfxItemSet &rNewAttr);
+
             void Hide( const OUString& rAuthor );
             void Hide();
             void Show();
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 2e78df9..d8fdc2e 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -783,7 +783,7 @@ included in c-context files, so c++ style stuff will cause problems.
 
 #define FN_DELETE_COMMENT           (FN_NOTES+6)
 #define FN_REPLY                    (FN_NOTES+7)
-
+#define FN_FORMAT_ALL_NOTES         (FN_NOTES+8)
 
 #define FN_HEADERFOOTER_EDIT        (FN_HEADERFOOTER+1)
 #define FN_HEADERFOOTER_DELETE      (FN_HEADERFOOTER+2)
diff --git a/sw/inc/swcommands.h b/sw/inc/swcommands.h
index 0f5cd54..cc9bc07 100644
--- a/sw/inc/swcommands.h
+++ b/sw/inc/swcommands.h
@@ -116,6 +116,7 @@
 #define CMD_FN_DELETE_COMMENT                       ".uno:DeleteComment"
 #define CMD_FN_DELETE_NOTE_AUTHOR                   ".uno:DeleteAuthor"
 #define CMD_FN_DELETE_ALL_NOTES                     ".uno:DeleteAllNotes"
+#define CMD_FN_FORMAT_ALL_NOTES                     ".uno:FormatAllNotes"
 #define CMD_FN_HIDE_NOTE                            ".uno:HideNote"
 #define CMD_FN_HIDE_NOTE_AUTHOR                     ".uno:HideAuthor"
 #define CMD_FN_HIDE_ALL_NOTES                       ".uno:HideAllNotes"
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 142d5e7..15f03ad 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -37,6 +37,12 @@ interface _Annotation
         StateMethod = GetNoteState ;
     ]
 
+    FN_FORMAT_ALL_NOTES
+    [
+        ExecMethod = NoteExec ;
+        StateMethod = GetNoteState ;
+    ]
+
     FN_HIDE_NOTE
     [
         ExecMethod = NoteExec ;
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 6855a9f..9e3189f 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -940,6 +940,11 @@ interface BaseText
         ExecMethod = ExecField ;
         StateMethod = StateField;
     ]
+    FN_FORMAT_ALL_NOTES
+    [
+        ExecMethod = ExecField ;
+        StateMethod = StateField;
+    ]
     FN_HIDE_NOTE
     [
         ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index e5dcce0..9bde88a 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -9604,6 +9604,30 @@ SfxVoidItem DeleteAllNotes FN_DELETE_ALL_NOTES
     GroupId = GID_EDIT;
 ]
 
+SfxVoidItem FormatAllNotes FN_FORMAT_ALL_NOTES
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    /* config: */
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_EDIT;
+]
+
 SfxVoidItem HideNote FN_HIDE_NOTE
 ()
 [
diff --git a/sw/source/core/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/core/uibase/docvw/AnnotationMenuButton.cxx
index f54378d..051d7ee 100644
--- a/sw/source/core/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/core/uibase/docvw/AnnotationMenuButton.cxx
@@ -75,12 +75,14 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
         pButtonPopup->EnableItem( FN_DELETE_COMMENT, false );
         pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, false );
         pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, false );
+        pButtonPopup->EnableItem( FN_FORMAT_ALL_NOTES, false );
     }
     else
     {
         pButtonPopup->EnableItem( FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() );
         pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, true );
         pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, true );
+        pButtonPopup->EnableItem( FN_FORMAT_ALL_NOTES, true );
     }
 
     if ( mrSidebarWin.IsProtected() )
diff --git a/sw/source/core/uibase/docvw/PostItMgr.cxx b/sw/source/core/uibase/docvw/PostItMgr.cxx
index e63ce8b..2bf1484 100644
--- a/sw/source/core/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/core/uibase/docvw/PostItMgr.cxx
@@ -34,8 +34,8 @@
 #include <vcl/outdev.hxx>
 #include <vcl/settings.hxx>
 
+#include <chrdlgmodes.hxx>
 #include <viewopt.hxx>
-
 #include <view.hxx>
 #include <docsh.hxx>
 #include <wrtsh.hxx>
@@ -67,11 +67,14 @@
 #include <svx/svdview.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/langitem.hxx>
+#include <editeng/kernitem.hxx>
 #include <editeng/outliner.hxx>
 
 #include <i18nlangtag/mslangid.hxx>
 #include <i18nlangtag/lang.h>
 
+#include "annotsh.hxx"
+#include "swabstdlg.hxx"
 #include "swevent.hxx"
 #include "switerator.hxx"
 
@@ -1242,6 +1245,78 @@ void SwPostItMgr::Delete()
     CalcRects();
     LayoutPostIts();
 }
+
+void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView)
+{
+    if (mvPostItFlds.empty())
+        return;
+    sw::sidebarwindows::SwSidebarWin *pOrigActiveWin = GetActiveSidebarWin();
+    sw::sidebarwindows::SwSidebarWin *pWin = pOrigActiveWin;
+    if (!pWin)
+    {
+        for (SwSidebarItem_iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end(); ++i)
+        {
+            pWin = (*i)->pPostIt;
+            if (pWin)
+                break;
+        }
+    }
+    if (!pWin)
+        return;
+    SetActiveSidebarWin(pWin);
+    OutlinerView* pOLV = pWin->GetOutlinerView();
+    SfxItemSet aEditAttr(pOLV->GetAttribs());
+    SfxItemPool* pPool(SwAnnotationShell::GetAnnotationPool(rView));
+    SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END);
+    aDlgAttr.Put(aEditAttr);
+    SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+    SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, DLG_CHAR_ANN);
+    sal_uInt16 nRet = pDlg->Execute();
+    if (RET_OK == nRet)
+    {
+        aDlgAttr.Put(*pDlg->GetOutputItemSet());
+        FormatAll(aDlgAttr);
+    }
+    delete pDlg;
+    SetActiveSidebarWin(pOrigActiveWin);
+}
+
+void SwPostItMgr::FormatAll(const SfxItemSet &rNewAttr)
+{
+    mpWrtShell->StartAllAction();
+    SwRewriter aRewriter;
+    aRewriter.AddRule(UndoArg1, SW_RES(STR_FORMAT_ALL_NOTES) );
+    mpWrtShell->StartUndo( UNDO_INSATTR, &aRewriter );
+
+    for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i)
+    {
+        if (!(*i)->pPostIt)
+            continue;
+        OutlinerView* pOLV = (*i)->pPostIt->GetOutlinerView();
+        //save old selection
+        ESelection aOrigSel(pOLV->GetSelection());
+        //select all
+        Outliner *pOutliner = pOLV->GetOutliner();
+        if (pOutliner)
+        {
+            sal_Int32 nParaCount = pOutliner->GetParagraphCount();
+            if (nParaCount > 0)
+                pOLV->SelectRange(0, nParaCount);
+        }
+        //set new char properties
+        pOLV->SetAttribs(rNewAttr);
+        //restore old selection
+        pOLV->SetSelection(aOrigSel);
+    }
+
+    mpWrtShell->EndUndo();
+    PrepareView();
+    mpWrtShell->EndAllAction();
+    mbLayout = true;
+    CalcRects();
+    LayoutPostIts();
+}
+
 void SwPostItMgr::Hide( const OUString& rAuthor )
 {
     for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i)
diff --git a/sw/source/core/uibase/docvw/SidebarWin.cxx b/sw/source/core/uibase/docvw/SidebarWin.cxx
index ac6cf3a..3539878 100644
--- a/sw/source/core/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/core/uibase/docvw/SidebarWin.cxx
@@ -1054,6 +1054,7 @@ void SwSidebarWin::ExecuteCommand(sal_uInt16 nSlot)
                 //Delete(); // do not kill the parent of our open popup menu
                 mnEventId = Application::PostUserEvent( LINK( this, SwSidebarWin, DeleteHdl), 0 );
             break;
+        case FN_FORMAT_ALL_NOTES:
         case FN_DELETE_ALL_NOTES:
         case FN_HIDE_ALL_NOTES:
             // not possible as slot as this would require that "this" is the active postit
diff --git a/sw/source/core/uibase/docvw/annotation.hrc b/sw/source/core/uibase/docvw/annotation.hrc
index 7daf555..5fe3e49 100644
--- a/sw/source/core/uibase/docvw/annotation.hrc
+++ b/sw/source/core/uibase/docvw/annotation.hrc
@@ -32,6 +32,7 @@
 #define STR_NOAUTHOR                    (RC_ANNOTATION_BEGIN +  6)
 
 #define STR_REPLY                       (RC_ANNOTATION_BEGIN +  7)
+#define STR_FORMAT_ALL_NOTES            (RC_ANNOTATION_BEGIN +  8)
 
 
 #define ANNOTATION_ACT_END   STR_REPLY
diff --git a/sw/source/core/uibase/inc/annotsh.hxx b/sw/source/core/uibase/inc/annotsh.hxx
index 40891d0..abfd7fc 100644
--- a/sw/source/core/uibase/inc/annotsh.hxx
+++ b/sw/source/core/uibase/inc/annotsh.hxx
@@ -72,6 +72,8 @@ public:
 
     virtual ::svl::IUndoManager*
                 GetUndoManager() SAL_OVERRIDE;
+
+    static SfxItemPool* GetAnnotationPool(SwView& rV);
 };
 
 #endif
diff --git a/sw/source/core/uibase/shells/annotsh.cxx b/sw/source/core/uibase/shells/annotsh.cxx
index 96faa59..f031930 100644
--- a/sw/source/core/uibase/shells/annotsh.cxx
+++ b/sw/source/core/uibase/shells/annotsh.cxx
@@ -147,11 +147,16 @@ void SwAnnotationShell::InitInterface_Impl()
 
 TYPEINIT1(SwAnnotationShell,SfxShell)
 
+SfxItemPool* SwAnnotationShell::GetAnnotationPool(SwView& rV)
+{
+    SwWrtShell &rSh = rV.GetWrtShell();
+    return rSh.GetAttrPool().GetSecondaryPool();
+}
+
 SwAnnotationShell::SwAnnotationShell( SwView& r )
-: rView(r)
+    : rView(r)
 {
-    SwWrtShell &rSh = rView.GetWrtShell();
-    SetPool(rSh.GetAttrPool().GetSecondaryPool());
+    SetPool(SwAnnotationShell::GetAnnotationPool(rView));
     SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Annotation));
 }
 
@@ -1080,9 +1085,12 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
             pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
         break;
 
-    case FN_DELETE_ALL_NOTES:
+        case FN_DELETE_ALL_NOTES:
             pPostItMgr->Delete();
             break;
+        case FN_FORMAT_ALL_NOTES:
+            pPostItMgr->ExecuteFormatAllDialog(rView);
+            break;
         case FN_DELETE_NOTE_AUTHOR:
         {
             SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, false);
@@ -1117,6 +1125,7 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
         case FN_POSTIT:
         case FN_DELETE_NOTE_AUTHOR:
         case FN_DELETE_ALL_NOTES:
+        case FN_FORMAT_ALL_NOTES:
         case FN_HIDE_NOTE:
         case FN_HIDE_NOTE_AUTHOR:
         case FN_HIDE_ALL_NOTES:
diff --git a/sw/source/core/uibase/shells/textfld.cxx b/sw/source/core/uibase/shells/textfld.cxx
index a2ba081..c71b9e4 100644
--- a/sw/source/core/uibase/shells/textfld.cxx
+++ b/sw/source/core/uibase/shells/textfld.cxx
@@ -17,9 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <chrdlgmodes.hxx>
 #include <crsskip.hxx>
 #include <hintids.hxx>
-
+#include <SidebarWin.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/outliner.hxx>
 #include <sfx2/lnkbase.hxx>
 #include <fmtfld.hxx>
 #include <vcl/msgbox.hxx>
@@ -320,6 +324,13 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                 if ( GetView().GetPostItMgr() )
                     GetView().GetPostItMgr()->Delete();
             break;
+            case FN_FORMAT_ALL_NOTES:
+            {
+                SwPostItMgr* pPostItMgr = GetView().GetPostItMgr();
+                if (pPostItMgr)
+                    pPostItMgr->ExecuteFormatAllDialog(GetView());
+            }
+            break;
             case FN_DELETE_NOTE_AUTHOR:
             {
                 SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, false);
@@ -623,6 +634,7 @@ void SwTextShell::StateField( SfxItemSet &rSet )
         case FN_DELETE_COMMENT:
         case FN_DELETE_NOTE_AUTHOR:
         case FN_DELETE_ALL_NOTES:
+        case FN_FORMAT_ALL_NOTES:
         case FN_HIDE_NOTE:
         case FN_HIDE_NOTE_AUTHOR:
         case FN_HIDE_ALL_NOTES:
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index 4510d18..1ea9f74 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -750,6 +750,12 @@
         HelpId = CMD_FN_DELETE_ALL_NOTES ;\
         Text [ en-US ] = "~Delete All Comments" ;\
     };\
+    MenuItem\
+    {\
+        Identifier = FN_FORMAT_ALL_NOTES ;\
+        HelpId = CMD_FN_FORMAT_ALL_NOTES ;\
+        Text [ en-US ] = "~Format All Comments" ;\
+    };\
     /*
     MenuItem\
     {\
diff --git a/sw/source/ui/docvw/annotation.src b/sw/source/ui/docvw/annotation.src
index 46afad9..a45c3ca 100644
--- a/sw/source/ui/docvw/annotation.src
+++ b/sw/source/ui/docvw/annotation.src
@@ -35,6 +35,11 @@ String STR_DELETE_ALL_NOTES
     Text [ en-US ] = "All Comments" ;
 };
 
+String STR_FORMAT_ALL_NOTES
+{
+    Text [ en-US ] = "All Comments" ;
+};
+
 String STR_DELETE_AUTHOR_NOTES
 {
     Text [ en-US ] = "Comments by " ;


More information about the Libreoffice-commits mailing list