[Libreoffice-commits] core.git: 2 commits - sc/source svx/uiconfig sw/AllLangResTarget_sw.mk sw/inc sw/source

Caolán McNamara caolanm at redhat.com
Tue Feb 21 20:27:52 UTC 2017


 sc/source/ui/miscdlgs/acredlin.cxx           |    6 
 svx/uiconfig/ui/acceptrejectchangesdialog.ui |   79 ++++++-
 sw/AllLangResTarget_sw.mk                    |    1 
 sw/inc/helpid.h                              |    9 
 sw/source/uibase/inc/misc.hrc                |    1 
 sw/source/uibase/inc/redlndlg.hxx            |    2 
 sw/source/uibase/misc/redlndlg.cxx           |  283 ++++++++++++---------------
 sw/source/uibase/misc/redlndlg.hrc           |   28 --
 sw/source/uibase/misc/redlndlg.src           |   85 --------
 9 files changed, 207 insertions(+), 287 deletions(-)

New commits:
commit 4bd8c84c4af617ddfeaa48e9c773ccc73bebade2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 17:14:26 2017 +0000

    reformat this a tad
    
    Change-Id: I278abd2f3410cb0212b48a605001fe7145c82cfa

diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 2d96ad8..5765393 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -146,25 +146,24 @@ void SwModelessRedlineAcceptDlg::dispose()
 }
 
 SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer *pBuilder,
-                                       vcl::Window *pContentArea, bool bAutoFormat) :
-    m_pParentDlg      (pParent),
-    m_aTabPagesCTRL   (VclPtr<SvxAcceptChgCtr>::Create(pContentArea, pBuilder)),
-    m_xPopup(pBuilder->get_menu("writermenu")),
-    m_sInserted       (SW_RES(STR_REDLINE_INSERTED)),
-    m_sDeleted        (SW_RES(STR_REDLINE_DELETED)),
-    m_sFormated       (SW_RES(STR_REDLINE_FORMATED)),
-    m_sTableChgd      (SW_RES(STR_REDLINE_TABLECHG)),
-    m_sFormatCollSet     (SW_RES(STR_REDLINE_FMTCOLLSET)),
-    m_sAutoFormat     (SW_RES(STR_REDLINE_AUTOFMT)),
-    m_bOnlyFormatedRedlines( false ),
-    m_bRedlnAutoFormat   (bAutoFormat),
-    m_bInhibitActivate( false ),
-    m_aInserted       (BitmapEx(SW_RES(BMP_REDLINE_INSERTED))),
-    m_aDeleted        (BitmapEx(SW_RES(BMP_REDLINE_DELETED))),
-    m_aFormated       (BitmapEx(SW_RES(BMP_REDLINE_FORMATED))),
-    m_aTableChgd      (BitmapEx(SW_RES(BMP_REDLINE_TABLECHG))),
-    m_aFormatCollSet  (BitmapEx(SW_RES(BMP_REDLINE_FMTCOLLSET)))
-
+                                       vcl::Window *pContentArea, bool bAutoFormat)
+    : m_pParentDlg(pParent)
+    , m_aTabPagesCTRL(VclPtr<SvxAcceptChgCtr>::Create(pContentArea, pBuilder))
+    , m_xPopup(pBuilder->get_menu("writermenu"))
+    , m_sInserted(SW_RES(STR_REDLINE_INSERTED))
+    , m_sDeleted(SW_RES(STR_REDLINE_DELETED))
+    , m_sFormated(SW_RES(STR_REDLINE_FORMATED))
+    , m_sTableChgd(SW_RES(STR_REDLINE_TABLECHG))
+    , m_sFormatCollSet(SW_RES(STR_REDLINE_FMTCOLLSET))
+    , m_sAutoFormat(SW_RES(STR_REDLINE_AUTOFMT))
+    , m_bOnlyFormatedRedlines(false)
+    , m_bRedlnAutoFormat(bAutoFormat)
+    , m_bInhibitActivate(false)
+    , m_aInserted(BitmapEx(SW_RES(BMP_REDLINE_INSERTED)))
+    , m_aDeleted(BitmapEx(SW_RES(BMP_REDLINE_DELETED)))
+    , m_aFormated(BitmapEx(SW_RES(BMP_REDLINE_FORMATED)))
+    , m_aTableChgd(BitmapEx(SW_RES(BMP_REDLINE_TABLECHG)))
+    , m_aFormatCollSet(BitmapEx(SW_RES(BMP_REDLINE_FMTCOLLSET)))
 {
     m_aTabPagesCTRL->SetHelpId(HID_REDLINE_CTRL);
     m_pTPView = m_aTabPagesCTRL->GetViewPage();
commit e834354ff3dbf38b1d3834f6980fffaed7b4074c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 16:25:41 2017 +0000

    convert writer changes menu to .ui
    
    Change-Id: I30a957f91c3faca5e16a70efce08579ac3368bdf

diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index cf18e2b..ac5d9b5 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1679,15 +1679,15 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void)
             m_xPopup->Deactivate();
         }
 
-        const sal_uInt16 nSubSortId = m_xPopup->GetItemId("sort");
+        const sal_uInt16 nSubSortId = m_xPopup->GetItemId("calcsort");
         PopupMenu *pSubMenu = m_xPopup->GetPopupMenu(nSubSortId);
-        const sal_uInt16 nActionId = pSubMenu->GetItemId("action");
+        const sal_uInt16 nActionId = pSubMenu->GetItemId("calcaction");
 
         sal_uInt16 nSortedCol = pTheView->GetSortedCol();
         if (nSortedCol != 0xFFFF)
             pSubMenu->CheckItem(nActionId + nSortedCol);
 
-        const sal_uInt16 nEditId = m_xPopup->GetItemId("edit");
+        const sal_uInt16 nEditId = m_xPopup->GetItemId("calcedit");
 
         m_xPopup->EnableItem(nEditId, false);
 
diff --git a/svx/uiconfig/ui/acceptrejectchangesdialog.ui b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
index af4ddf2..38d6d01 100644
--- a/svx/uiconfig/ui/acceptrejectchangesdialog.ui
+++ b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
@@ -128,14 +128,14 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="GtkMenuItem" id="edit">
+      <object class="GtkMenuItem" id="calcedit">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Edit Comment...</property>
       </object>
     </child>
     <child>
-      <object class="GtkMenuItem" id="sort">
+      <object class="GtkMenuItem" id="calcsort">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Sorting</property>
@@ -145,7 +145,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
-              <object class="GtkRadioMenuItem" id="action">
+              <object class="GtkRadioMenuItem" id="calcaction">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Action</property>
@@ -153,7 +153,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioMenuItem" id="position">
+              <object class="GtkRadioMenuItem" id="calcposition">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Position</property>
@@ -161,7 +161,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioMenuItem" id="author">
+              <object class="GtkRadioMenuItem" id="calcauthor">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Author</property>
@@ -169,7 +169,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioMenuItem" id="date">
+              <object class="GtkRadioMenuItem" id="calcdate">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Date</property>
@@ -177,7 +177,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkRadioMenuItem" id="desc">
+              <object class="GtkRadioMenuItem" id="calcdesc">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Description</property>
@@ -189,4 +189,69 @@
       </object>
     </child>
   </object>
+  <object class="GtkMenu" id="writermenu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="writeredit">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Edit Comment...</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="writersort">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Sort By</property>
+        <property name="use_underline">True</property>
+        <child type="submenu">
+          <object class="GtkMenu">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkRadioMenuItem" id="writeraction">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Action</property>
+                <property name="use_underline">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkRadioMenuItem" id="writerauthor">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Author</property>
+                <property name="use_underline">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkRadioMenuItem" id="writerdate">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Date</property>
+                <property name="use_underline">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkRadioMenuItem" id="writerdesc">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Comment</property>
+                <property name="use_underline">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkRadioMenuItem" id="writerposition">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Document Position</property>
+                <property name="use_underline">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
 </interface>
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 536821e..925c5ab 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -66,7 +66,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/uibase/dialog/regionsw.src \
     sw/source/uibase/docvw/docvw.src \
     sw/source/uibase/lingu/olmenu.src \
-    sw/source/uibase/misc/redlndlg.src \
     sw/source/uibase/ribbar/inputwin.src \
     sw/source/uibase/ribbar/workctrl.src \
     sw/source/uibase/uiview/view.src \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 3319a90..2a780a4 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -58,13 +58,6 @@
 #define HID_GLBLTREE_UPD_IDX                                    "SW_HID_GLBLTREE_UPD_IDX"
 #define HID_GLBLTREE_UPD_LINK                                   "SW_HID_GLBLTREE_UPD_LINK"
 #define HID_GLBLTREEUPD_ALL                                     "SW_HID_GLBLTREEUPD_ALL"
-#define HID_SORT_ACTION                                         "SW_HID_SORT_ACTION"
-#define HID_SORT_AUTHOR                                         "SW_HID_SORT_AUTHOR"
-#define HID_SORT_DATE                                           "SW_HID_SORT_DATE"
-#define HID_SORT_COMMENT                                        "SW_HID_SORT_COMMENT"
-#define HID_SW_SORT_POSITION                                    "SW_HID_SW_SORT_POSITION"
-#define HID_EDIT_COMMENT                                        "SW_HID_EDIT_COMMENT"
-
 
 #define HID_GLBLTREE_EDIT_LINK                                  "SW_HID_GLBLTREE_EDIT_LINK"
 
@@ -73,8 +66,6 @@
 
 #define HID_REDLINE_CTRL                                        "SW_HID_REDLINE_CTRL"
 
-
-
 // sw::sidebar::PagePropertyPanel
 #define HID_SWPAGE_LEFT_MARGIN              "HID_SWPAGE_LEFT_MARGIN"
 #define HID_SWPAGE_RIGHT_MARGIN             "HID_SWPAGE_RIGHT_MARGIN"
diff --git a/sw/source/uibase/inc/misc.hrc b/sw/source/uibase/inc/misc.hrc
index f7a0db9..2c29900 100644
--- a/sw/source/uibase/inc/misc.hrc
+++ b/sw/source/uibase/inc/misc.hrc
@@ -39,7 +39,6 @@
 #define STR_CHANGE_END              (RC_MISC_BEGIN + 45)
 #define STR_SAVE_GLOSSARY           (RC_MISC_BEGIN + 46)
 
-#define MN_REDLINE_POPUP            (RC_MISC_BEGIN + 61)
 #define STR_MY_AUTOTEXT             (RC_MISC_BEGIN + 64)
 
 #define STR_COMMENTS_LABEL          (RC_MISC_BEGIN + 65)
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index 328ac45..fd5d594 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -66,7 +66,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final
     SwRedlineDataChildArr   m_RedlineChildren;
     SwRedlineDataParentSortArr m_aUsedSeqNo;
     VclPtr<SvxAcceptChgCtr>    m_aTabPagesCTRL;
-    ScopedVclPtrInstance<PopupMenu> m_aPopup;
+    VclPtr<PopupMenu>       m_xPopup;
     Timer                   m_aDeselectTimer;
     Timer                   m_aSelectTimer;
     OUString                m_sInserted;
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 746ccd9..2d96ad8 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -36,7 +36,6 @@
 #include <helpid.h>
 #include <cmdid.h>
 #include <misc.hrc>
-#include <redlndlg.hrc>
 #include <shells.hrc>
 
 // -> #111827#
@@ -150,7 +149,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
                                        vcl::Window *pContentArea, bool bAutoFormat) :
     m_pParentDlg      (pParent),
     m_aTabPagesCTRL   (VclPtr<SvxAcceptChgCtr>::Create(pContentArea, pBuilder)),
-    m_aPopup          (SW_RES(MN_REDLINE_POPUP)),
+    m_xPopup(pBuilder->get_menu("writermenu")),
     m_sInserted       (SW_RES(STR_REDLINE_INSERTED)),
     m_sDeleted        (SW_RES(STR_REDLINE_DELETED)),
     m_sFormated       (SW_RES(STR_REDLINE_FORMATED)),
@@ -1012,166 +1011,147 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl, SvSimpleTable*, void)
 {
     const CommandEvent aCEvt(m_pTable->GetCommandEvent());
 
-    switch ( aCEvt.GetCommand() )
-    {
-        case CommandEventId::ContextMenu:
-        {
-            SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
-            SvTreeListEntry* pEntry = m_pTable->FirstSelected();
-            const SwRangeRedline *pRed = nullptr;
-
-            if (pEntry)
-            {
-                SvTreeListEntry* pTopEntry = pEntry;
+    if (aCEvt.GetCommand() != CommandEventId::ContextMenu)
+        return;
 
-                if (m_pTable->GetParent(pEntry))
-                    pTopEntry = m_pTable->GetParent(pEntry);
+    SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
+    SvTreeListEntry* pEntry = m_pTable->FirstSelected();
+    const SwRangeRedline *pRed = nullptr;
 
-                sal_uInt16 nPos = GetRedlinePos(*pTopEntry);
+    if (pEntry)
+    {
+        SvTreeListEntry* pTopEntry = pEntry;
 
-                // disable commenting for protected areas
-                if (nPos != USHRT_MAX && (pRed = pSh->GotoRedline(nPos, true)) != nullptr)
-                {
-                    if( pSh->IsCursorPtAtEnd() )
-                        pSh->SwapPam();
-                    pSh->SetInSelect();
-                }
-            }
+        if (m_pTable->GetParent(pEntry))
+            pTopEntry = m_pTable->GetParent(pEntry);
 
-            m_aPopup->EnableItem( MN_EDIT_COMMENT, pEntry && pRed &&
-                                            !m_pTable->GetParent(pEntry) &&
-                                            !m_pTable->NextSelected(pEntry)
-//JP 27.9.2001: make no sense if we handle readonly sections
-//                                          && pRed->HasReadonlySel()
-                                            );
+        sal_uInt16 nPos = GetRedlinePos(*pTopEntry);
 
-            m_aPopup->EnableItem( MN_SUB_SORT, m_pTable->First() != nullptr );
-            sal_uInt16 nColumn = m_pTable->GetSortedCol();
-            if (nColumn == 0xffff)
-                nColumn = 4;
+        // disable commenting for protected areas
+        if (nPos != USHRT_MAX && (pRed = pSh->GotoRedline(nPos, true)) != nullptr)
+        {
+            if( pSh->IsCursorPtAtEnd() )
+                pSh->SwapPam();
+            pSh->SetInSelect();
+        }
+    }
 
-            PopupMenu *pSubMenu = m_aPopup->GetPopupMenu(MN_SUB_SORT);
-            if (pSubMenu)
-            {
-                for (sal_uInt16 i = MN_SORT_ACTION; i < MN_SORT_ACTION + 5; i++)
-                    pSubMenu->CheckItem(i, false);
+    const sal_uInt16 nEditId = m_xPopup->GetItemId("writeredit");
 
-                pSubMenu->CheckItem(nColumn + MN_SORT_ACTION);
-            }
+    m_xPopup->EnableItem(nEditId, pEntry && pRed &&
+                                  !m_pTable->GetParent(pEntry) &&
+                                  !m_pTable->NextSelected(pEntry));
 
-            sal_uInt16 nRet = m_aPopup->Execute(m_pTable, aCEvt.GetMousePosPixel());
+    sal_uInt16 nColumn = m_pTable->GetSortedCol();
+    if (nColumn == 0xffff)
+        nColumn = 4;
 
-            switch( nRet )
-            {
-                case MN_EDIT_COMMENT:
-                {
-                    if (pEntry)
-                    {
-                        if (m_pTable->GetParent(pEntry))
-                            pEntry = m_pTable->GetParent(pEntry);
+    const sal_uInt16 nSubSortId = m_xPopup->GetItemId("writersort");
+    m_xPopup->EnableItem(nSubSortId, m_pTable->First() != nullptr);
+    PopupMenu *pSubMenu = m_xPopup->GetPopupMenu(nSubSortId);
+    const sal_uInt16 nActionId = pSubMenu->GetItemId("writeraction");
+    for (sal_uInt16 i = nActionId; i < nActionId + 5; ++i)
+        pSubMenu->CheckItem(i, false);
+    pSubMenu->CheckItem(nActionId + nColumn);
 
-                        sal_uInt16 nPos = GetRedlinePos(*pEntry);
+    sal_uInt16 nRet = m_xPopup->Execute(m_pTable, aCEvt.GetMousePosPixel());
 
-                        if (nPos == USHRT_MAX)
-                            break;
+    if (nRet == nEditId)
+    {
+        if (pEntry)
+        {
+            if (m_pTable->GetParent(pEntry))
+                pEntry = m_pTable->GetParent(pEntry);
 
-                        const SwRangeRedline &rRedline = pSh->GetRedline(nPos);
+            sal_uInt16 nPos = GetRedlinePos(*pEntry);
 
-                        /* enable again once we have redline comments in the margin
-                        sComment = rRedline.GetComment();
-                        if ( !sComment.Len() )
-                            GetActiveView()->GetDocShell()->Broadcast(SwRedlineHint(&rRedline,SWREDLINE_INSERTED));
-                        const_cast<SwRangeRedline&>(rRedline).Broadcast(SwRedlineHint(&rRedline,SWREDLINE_FOCUS));
-                        */
+            if (nPos == USHRT_MAX)
+                return;
 
-                        OUString sComment = convertLineEnd(rRedline.GetComment(), GetSystemLineEnd());
-                        SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                        OSL_ENSURE(pFact, "Dialog creation failed!");
-                        ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc();
-                        OSL_ENSURE(fnGetRange, "Dialog creation failed! GetRanges()");
-                        SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() );
+            const SwRangeRedline &rRedline = pSh->GetRedline(nPos);
 
-                        aSet.Put(SvxPostItTextItem(sComment, SID_ATTR_POSTIT_TEXT));
-                        aSet.Put(SvxPostItAuthorItem(rRedline.GetAuthorString(), SID_ATTR_POSTIT_AUTHOR));
+            /* enable again once we have redline comments in the margin
+            sComment = rRedline.GetComment();
+            if ( !sComment.Len() )
+                GetActiveView()->GetDocShell()->Broadcast(SwRedlineHint(&rRedline,SWREDLINE_INSERTED));
+            const_cast<SwRangeRedline&>(rRedline).Broadcast(SwRedlineHint(&rRedline,SWREDLINE_FOCUS));
+            */
 
-                        aSet.Put(SvxPostItDateItem( GetAppLangDateTimeString(
-                                    rRedline.GetRedlineData().GetTimeStamp() ),
-                                    SID_ATTR_POSTIT_DATE ));
+            OUString sComment = convertLineEnd(rRedline.GetComment(), GetSystemLineEnd());
+            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+            OSL_ENSURE(pFact, "Dialog creation failed!");
+            ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc();
+            OSL_ENSURE(fnGetRange, "Dialog creation failed! GetRanges()");
+            SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() );
 
-                        ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact->CreateSvxPostItDialog( m_pParentDlg, aSet ));
-                        OSL_ENSURE(pDlg, "Dialog creation failed!");
+            aSet.Put(SvxPostItTextItem(sComment, SID_ATTR_POSTIT_TEXT));
+            aSet.Put(SvxPostItAuthorItem(rRedline.GetAuthorString(), SID_ATTR_POSTIT_AUTHOR));
 
-                        pDlg->HideAuthor();
+            aSet.Put(SvxPostItDateItem( GetAppLangDateTimeString(
+                        rRedline.GetRedlineData().GetTimeStamp() ),
+                        SID_ATTR_POSTIT_DATE ));
 
-                        sal_uInt16 nResId = 0;
-                        switch( rRedline.GetType() )
-                        {
-                        case nsRedlineType_t::REDLINE_INSERT:
-                            nResId = STR_REDLINE_INSERTED;
-                            break;
-                        case nsRedlineType_t::REDLINE_DELETE:
-                            nResId = STR_REDLINE_DELETED;
-                            break;
-                        case nsRedlineType_t::REDLINE_FORMAT:
-                        case nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT:
-                            nResId = STR_REDLINE_FORMATED;
-                            break;
-                        case nsRedlineType_t::REDLINE_TABLE:
-                            nResId = STR_REDLINE_TABLECHG;
-                            break;
-                        default:;//prevent warning
-                        }
-                        OUString sTitle(SW_RES(STR_REDLINE_COMMENT));
-                        if( nResId )
-                            sTitle += SW_RESSTR( nResId );
-                        pDlg->SetText(sTitle);
+            ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact->CreateSvxPostItDialog( m_pParentDlg, aSet ));
+            OSL_ENSURE(pDlg, "Dialog creation failed!");
 
-                        SwViewShell::SetCareWin(pDlg->GetWindow());
+            pDlg->HideAuthor();
 
-                        if ( pDlg->Execute() == RET_OK )
-                        {
-                            const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
-                            OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
+            sal_uInt16 nResId = 0;
+            switch( rRedline.GetType() )
+            {
+                case nsRedlineType_t::REDLINE_INSERT:
+                    nResId = STR_REDLINE_INSERTED;
+                    break;
+                case nsRedlineType_t::REDLINE_DELETE:
+                    nResId = STR_REDLINE_DELETED;
+                    break;
+                case nsRedlineType_t::REDLINE_FORMAT:
+                case nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT:
+                    nResId = STR_REDLINE_FORMATED;
+                    break;
+                case nsRedlineType_t::REDLINE_TABLE:
+                    nResId = STR_REDLINE_TABLECHG;
+                    break;
+                default:;//prevent warning
+            }
+            OUString sTitle(SW_RES(STR_REDLINE_COMMENT));
+            if( nResId )
+                sTitle += SW_RESSTR( nResId );
+            pDlg->SetText(sTitle);
 
-                            // insert / change comment
-                            pSh->SetRedlineComment(sMsg);
-                            m_pTable->SetEntryText(sMsg.replace('\n', ' '), pEntry, 3);
-                        }
+            SwViewShell::SetCareWin(pDlg->GetWindow());
 
-                        pDlg.disposeAndClear();
-                        SwViewShell::SetCareWin(nullptr);
-                    }
+            if ( pDlg->Execute() == RET_OK )
+            {
+                const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+                OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
 
-                }
-                break;
+                // insert / change comment
+                pSh->SetRedlineComment(sMsg);
+                m_pTable->SetEntryText(sMsg.replace('\n', ' '), pEntry, 3);
+            }
 
-            case MN_SORT_ACTION:
-            case MN_SORT_AUTHOR:
-            case MN_SORT_DATE:
-            case MN_SORT_COMMENT:
-            case MN_SORT_POSITION:
-                {
-                    bSortDir = true;
-                    if (nRet - MN_SORT_ACTION == 4 && m_pTable->GetSortedCol() == 0xffff)
-                        break;  // we already have it
+            pDlg.disposeAndClear();
+            SwViewShell::SetCareWin(nullptr);
+        }
+    }
+    else if (nRet)
+    {
+        bSortDir = true;
+        if (nRet - nActionId == 4 && m_pTable->GetSortedCol() == 0xffff)
+            return;  // we already have it
 
-                    nSortMode = nRet - MN_SORT_ACTION;
-                    if (nSortMode == 4)
-                        nSortMode = 0xffff; // unsorted / sorted by position
+        nSortMode = nRet - nActionId;
+        if (nSortMode == 4)
+            nSortMode = 0xffff; // unsorted / sorted by position
 
-                    if (m_pTable->GetSortedCol() == nSortMode)
-                        bSortDir = !m_pTable->GetSortDirection();
+        if (m_pTable->GetSortedCol() == nSortMode)
+            bSortDir = !m_pTable->GetSortDirection();
 
-                    SwWait aWait( *::GetActiveView()->GetDocShell(), false );
-                    m_pTable->SortByCol(nSortMode, bSortDir);
-                    if (nSortMode == 0xffff)
-                        Init();             // newly fill everything
-                }
-                break;
-            }
-        }
-        break;
-        default: break;
+        SwWait aWait( *::GetActiveView()->GetDocShell(), false );
+        m_pTable->SortByCol(nSortMode, bSortDir);
+        if (nSortMode == 0xffff)
+            Init();             // newly fill everything
     }
 }
 
diff --git a/sw/source/uibase/misc/redlndlg.hrc b/sw/source/uibase/misc/redlndlg.hrc
deleted file mode 100644
index e3d0464..0000000
--- a/sw/source/uibase/misc/redlndlg.hrc
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define MN_EDIT_COMMENT     1
-#define MN_SUB_SORT         2
-#define MN_SORT_ACTION      3
-#define MN_SORT_AUTHOR      4
-#define MN_SORT_DATE        5
-#define MN_SORT_COMMENT     6
-#define MN_SORT_POSITION    7
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/misc/redlndlg.src b/sw/source/uibase/misc/redlndlg.src
deleted file mode 100644
index e3b9aad..0000000
--- a/sw/source/uibase/misc/redlndlg.src
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-/* StarView resource file */
-
-#include "redlndlg.hrc"
-#include "misc.hrc"
-#include "helpid.h"
-
-Menu MN_REDLINE_POPUP
-{
-    ItemList =
-    {
-        MenuItem
-        {
-            Identifier = MN_EDIT_COMMENT ;
-            HelpID = HID_EDIT_COMMENT ;
-            Text [ en-US ] = "Edit Comment..." ;
-        };
-        MenuItem
-        {
-            Identifier = MN_SUB_SORT ;
-            RadioCheck = TRUE ;
-            SubMenu = Menu
-            {
-                ItemList =
-                {
-                    MenuItem
-                    {
-                        Identifier = MN_SORT_ACTION ;
-                        HelpID = HID_SORT_ACTION ;
-                        RadioCheck = TRUE ;
-                        Text [ en-US ] = "Action" ;
-                    };
-                    MenuItem
-                    {
-                        Identifier = MN_SORT_AUTHOR ;
-                        HelpID = HID_SORT_AUTHOR ;
-                        RadioCheck = TRUE ;
-                        Text [ en-US ] = "Author" ;
-                    };
-                    MenuItem
-                    {
-                        Identifier = MN_SORT_DATE ;
-                        HelpID = HID_SORT_DATE ;
-                        RadioCheck = TRUE ;
-                        Text [ en-US ] = "Date" ;
-                    };
-                    MenuItem
-                    {
-                        Identifier = MN_SORT_COMMENT ;
-                        HelpID = HID_SORT_COMMENT ;
-                        RadioCheck = TRUE ;
-                        Text [ en-US ] = "Comment" ;
-                    };
-                    MenuItem
-                    {
-                        Identifier = MN_SORT_POSITION ;
-                        HelpID = HID_SW_SORT_POSITION ;
-                        RadioCheck = TRUE ;
-                        Text [ en-US ] = "Document position" ;
-                    };
-                };
-            };
-            Text [ en-US ] = "Sort By" ;
-        };
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list