diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-02-21 17:17:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-23 14:28:42 +0000 |
commit | 8655095a4910ca795dfd182e6796d9375727a694 (patch) | |
tree | 3472e1c3cea9539fc2785c8db99a421a10e93694 /sw | |
parent | 3c5c43cf2aa354a98f28a466647f4d463cdfdc85 (diff) |
try and beat this weird SvxAcceptChgCtr into something sanish
a) convert to .ui
b) The accept/reject changes dialogs now have a "close" button and the
accept/reject etc buttons are relocated into the main dialog button area rather
than as direct children of the view page. They now get disabled on switching to
the non-view page.
c) Merges the sc redline changes dialog, the sw redline changes dialog and the
sw autocorrect changes dialog
Change-Id: If0ba376c3f2d36709aeeed995fa9901741434c40
Diffstat (limited to 'sw')
-rw-r--r-- | sw/UI_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 2 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/inc/misc.hrc | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/redlndlg.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/inc/swmodalredlineacceptdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.cxx | 45 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.hrc | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.src | 33 | ||||
-rw-r--r-- | sw/source/ui/misc/swmodalredlineacceptdlg.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 2 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/acceptrejectchanges.ui | 75 |
14 files changed, 15 insertions, 191 deletions
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index 9bdc71f8e2a9..d410de64faeb 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -10,7 +10,6 @@ $(eval $(call gb_UI_UI,modules/swriter)) $(eval $(call gb_UI_add_uifiles,modules/swriter,\ - sw/uiconfig/swriter/ui/acceptrejectchanges \ sw/uiconfig/swriter/ui/autoformattable \ sw/uiconfig/swriter/ui/autotext \ sw/uiconfig/swriter/ui/bibliographyentry \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 26dd338dce82..2f608eab459b 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -138,7 +138,6 @@ #define HID_FILEDLG_SRCVIEW "SW_HID_FILEDLG_SRCVIEW" #define HID_FILEDLG_WIZDOKU "SW_HID_FILEDLG_WIZDOKU" -#define HID_REDLINE_AUTOFMT_ACCEPT "SW_HID_REDLINE_AUTOFMT_ACCEPT" #define HID_MULTI_TOX_DLG "SW_HID_MULTI_TOX_DLG" #define HID_ASCII_FILTER "SW_HID_ASCII_FILTER" #define HID_GLBLTREE_EDIT_LINK "SW_HID_GLBLTREE_EDIT_LINK" @@ -175,7 +174,6 @@ #define HID_OPTSHDWCRSR "SW_HID_OPTSHDWCRSR" #define HID_NUMPARA "SW_HID_NUMPARA" #define HID_REDLINE_OPT "SW_HID_REDLINE_OPT" -#define HID_REDLINE_ACCEPT "SW_HID_REDLINE_ACCEPT" #define HID_EDIT_FLD_DB "SW_HID_EDIT_FLD_DB" #define HID_EDIT_FLD_DOKINF "SW_HID_EDIT_FLD_DOKINF" #define HID_EDIT_FLD_VAR "SW_HID_EDIT_FLD_VAR" diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index ac42c4b04410..0551921b0710 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -397,7 +397,7 @@ public: virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg( Window* pParent, //add for SwRenameXNamedDlg ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ) = 0; - virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ) = 0; //add for SwModalRedlineAcceptDlg + virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent) = 0; virtual VclAbstractDialog* CreateSwVclDialog( int nResId, Window* pParent, sal_Bool& rWithPrev ) = 0; //add for SwMergeTblDlg virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId, diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index da55531de7c6..62e75620bbd9 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1035,21 +1035,10 @@ AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDl return 0; } -AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ) +AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg(Window *pParent) { - SwModalRedlineAcceptDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_MOD_REDLINE_ACCEPT : - pDlg = new SwModalRedlineAcceptDlg( pParent ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); - return 0; + SwModalRedlineAcceptDlg* pDlg = new SwModalRedlineAcceptDlg( pParent ); + return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); } VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index e5dbd9063024..836afb6d0e18 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -488,7 +488,7 @@ public: virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg( Window* pParent, //add for SwRenameXNamedDlg ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ); - virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ); //add for SwModalRedlineAcceptDlg + virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent); //add for SwModalRedlineAcceptDlg virtual VclAbstractDialog* CreateSwVclDialog( int nResId, Window* pParent, sal_Bool& rWithPrev ); //add for SwMergeTblDlg diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc index 09448403f8a3..95efecca9f58 100644 --- a/sw/source/ui/inc/misc.hrc +++ b/sw/source/ui/inc/misc.hrc @@ -26,11 +26,8 @@ #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25) -#define DLG_REDLINE_ACCEPT (RC_MISC_BEGIN + 29) #define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31) -#define DLG_MOD_REDLINE_ACCEPT (RC_MISC_BEGIN + 32) - #define MSG_DOUBLE_SHORTNAME (RC_MISC_BEGIN + 30) #define MSG_QUERY_DELETE (RC_MISC_BEGIN + 31) diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx index e11c94811e33..f7e14079a13f 100644 --- a/sw/source/ui/inc/redlndlg.hxx +++ b/sw/source/ui/inc/redlndlg.hxx @@ -83,7 +83,6 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg String sFmtCollSet; String sFilterAction; String sAutoFormat; - Size aBorderSz; SvxTPView* pTPView; SvxRedlinTable* pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox Link aOldSelectHdl; @@ -131,7 +130,6 @@ public: void FillInfo(String &rExtraData) const; virtual void Activate(); - virtual void Resize(); }; class SwModelessRedlineAcceptDlg : public SfxModelessDialog @@ -139,8 +137,6 @@ class SwModelessRedlineAcceptDlg : public SfxModelessDialog SwRedlineAcceptDlg* pImplDlg; SwChildWinWrapper* pChildWin; - virtual void Resize(); - public: SwModelessRedlineAcceptDlg(SfxBindings*, SwChildWinWrapper*, Window *pParent); ~SwModelessRedlineAcceptDlg(); diff --git a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx index d076f64a5ede..a0f90f8f8843 100644 --- a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx +++ b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx @@ -27,8 +27,6 @@ class SwModalRedlineAcceptDlg : public SfxModalDialog { SwRedlineAcceptDlg* pImplDlg; - virtual void Resize(); - public: SwModalRedlineAcceptDlg(Window *pParent); ~SwModalRedlineAcceptDlg(); diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index 8156657aac89..0706fbc8f632 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -84,15 +84,13 @@ sal_Bool SwRedlineAcceptChild::ReInitDlg(SwDocShell *pDocSh) return bRet; } -SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings, - SwChildWinWrapper* pChild, - Window *_pParent) : - SfxModelessDialog(_pBindings, pChild, _pParent, SW_RES(DLG_REDLINE_ACCEPT)), - pChildWin (pChild) +SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( + SfxBindings* _pBindings, SwChildWinWrapper* pChild, Window *_pParent) + : SfxModelessDialog(_pBindings, pChild, _pParent, + "AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui") + , pChildWin (pChild) { pImplDlg = new SwRedlineAcceptDlg(this); - - FreeResource(); } void SwModelessRedlineAcceptDlg::Activate() @@ -139,12 +137,6 @@ void SwModelessRedlineAcceptDlg::FillInfo(SfxChildWinInfo& rInfo) const pImplDlg->FillInfo(rInfo.aExtraString); } -void SwModelessRedlineAcceptDlg::Resize() -{ - pImplDlg->Resize(); - SfxModelessDialog::Resize(); -} - SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg() { delete pImplDlg; @@ -152,7 +144,7 @@ SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg() SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) : pParentDlg (pParent), - aTabPagesCTRL (pParent, SW_RES(CTRL_TABPAGES)), + aTabPagesCTRL (pParent->get_content_area()), aPopup (SW_RES(MN_REDLINE_POPUP)), sInserted (SW_RES(STR_REDLINE_INSERTED)), sDeleted (SW_RES(STR_REDLINE_DELETED)), @@ -206,19 +198,6 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) : pTable->SetTabs(aStaticTabs); - // set minimum size - Size aMinSz(aTabPagesCTRL.GetMinSizePixel()); - Point aPos(aTabPagesCTRL.GetPosPixel()); - - aMinSz.Width() += (aPos.X() * 2 - 1); - aMinSz.Height() += (aPos.Y() * 2 - 1); - pParentDlg->SetMinOutputSizePixel(aMinSz); - - if (pParentDlg->GetOutputSizePixel().Width() < aMinSz.Width()) - pParentDlg->SetOutputSizePixel(Size(aMinSz.Width(), pParentDlg->GetOutputSizePixel().Height())); - if (pParentDlg->GetOutputSizePixel().Height() < aMinSz.Height()) - pParentDlg->SetOutputSizePixel(Size(pParentDlg->GetOutputSizePixel().Width(), aMinSz.Height())); - pTable->SortByCol(nSortMode, bSortDir); aOldSelectHdl = pTable->GetSelectHdl(); @@ -362,18 +341,6 @@ const String &SwRedlineAcceptDlg::GetActionText(const SwRedline& rRedln, sal_uIn return aEmptyStr; } -void SwRedlineAcceptDlg::Resize() -{ - Size aSz(pParentDlg->GetOutputSizePixel()); - - Point aPos(aTabPagesCTRL.GetPosPixel()); - - aSz.Width() -= (aPos.X() * 2 - 1); - aSz.Height() -= (aPos.Y() * 2 - 1); - - aTabPagesCTRL.SetOutputSizePixel(aSz); -} - /*-------------------------------------------------------------------- Description: newly initialise after activation --------------------------------------------------------------------*/ diff --git a/sw/source/ui/misc/redlndlg.hrc b/sw/source/ui/misc/redlndlg.hrc index dd8fa7fd52a2..b83b5b35ab94 100644 --- a/sw/source/ui/misc/redlndlg.hrc +++ b/sw/source/ui/misc/redlndlg.hrc @@ -15,7 +15,6 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define CTRL_TABPAGES 1 #define MN_EDIT_COMMENT 1 #define MN_SUB_SORT 2 @@ -24,6 +23,3 @@ #define MN_SORT_DATE 5 #define MN_SORT_COMMENT 6 #define MN_SORT_POSITION 7 - -#define XBORDER 3 -#define YBORDER 3 diff --git a/sw/source/ui/misc/redlndlg.src b/sw/source/ui/misc/redlndlg.src index 268bdf5187e0..5b79c1b90503 100644 --- a/sw/source/ui/misc/redlndlg.src +++ b/sw/source/ui/misc/redlndlg.src @@ -21,39 +21,6 @@ #include "misc.hrc" #include "helpid.h" -#define WIDTH 297 -#define HEIGHT 169 - -#define REDLNDLG \ - OutputSize = TRUE ; \ - SVLook = TRUE ; \ - Size = MAP_APPFONT ( WIDTH , HEIGHT ) ; \ - Moveable = TRUE ; \ - Closeable = TRUE ; \ - Sizeable = TRUE ; \ - Hide = TRUE ; \ - Control CTRL_TABPAGES\ - {\ - Pos = MAP_APPFONT ( XBORDER , YBORDER ) ; \ - Size = MAP_APPFONT ( WIDTH - XBORDER * 2 , HEIGHT - YBORDER * 2 ) ; \ - HelpID = HID_REDLINE_CTRL ; \ - TabStop = TRUE ; \ - }; - -ModelessDialog DLG_REDLINE_ACCEPT -{ - HelpID = HID_REDLINE_ACCEPT ; - Text [ en-US ] = "Accept or Reject Changes" ; - REDLNDLG -}; - -ModalDialog DLG_MOD_REDLINE_ACCEPT -{ - HelpID = HID_REDLINE_AUTOFMT_ACCEPT ; - REDLNDLG - Text [ en-US ] = "Accept or Reject AutoCorrect Changes"; -}; - Menu MN_REDLINE_POPUP { ItemList = diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx index 528380e49344..45ac31c15c75 100644 --- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx +++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx @@ -34,7 +34,6 @@ #include <helpid.h> #include <cmdid.h> #include <misc.hrc> -#include <redlndlg.hrc> #include <shells.hrc> #include <vector> @@ -43,15 +42,14 @@ #include <unomid.h> -SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) : - SfxModalDialog(pParent, SW_RES(DLG_MOD_REDLINE_ACCEPT)) +SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) + : SfxModalDialog(pParent, + "AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui") { pImplDlg = new SwRedlineAcceptDlg(this, sal_True); pImplDlg->Initialize(GetExtraData()); pImplDlg->Activate(); // for data's initialisation - - FreeResource(); } SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg() @@ -66,12 +64,6 @@ void SwModalRedlineAcceptDlg::Activate() { } -void SwModalRedlineAcceptDlg::Resize() -{ - pImplDlg->Resize(); - SfxModalDialog::Resize(); -} - void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept ) { SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage(); diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 7e168d16dcc1..830d5101697a 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -603,7 +603,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - AbstractSwModalRedlineAcceptDlg* pDlg = pFact->CreateSwModalRedlineAcceptDlg( &GetView().GetEditWin(), DLG_MOD_REDLINE_ACCEPT ); + AbstractSwModalRedlineAcceptDlg* pDlg = pFact->CreateSwModalRedlineAcceptDlg(&GetView().GetEditWin()); OSL_ENSURE(pDlg, "Dialogdiet fail!"); switch (lcl_AskRedlineMode(&GetView().GetEditWin())) diff --git a/sw/uiconfig/swriter/ui/acceptrejectchanges.ui b/sw/uiconfig/swriter/ui/acceptrejectchanges.ui deleted file mode 100644 index 2ebcf117269f..000000000000 --- a/sw/uiconfig/swriter/ui/acceptrejectchanges.ui +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <!-- interface-requires gtk+ 3.0 --> - <object class="GtkDialog" id="AcceptRejectChangesDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> - <property name="title" translatable="yes">Accept or Reject Changes</property> - <property name="type_hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkNotebook" id="notebook1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <child> - <placeholder/> - </child> - <child type="tab"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">List</property> - </object> - <packing> - <property name="tab_fill">False</property> - </packing> - </child> - <child> - <placeholder/> - </child> - <child type="tab"> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Filter</property> - </object> - <packing> - <property name="position">1</property> - <property name="tab_fill">False</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - </object> -</interface> |