Hi, I have submitted a patch for review:
https://gerrit.libreoffice.org/3380 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/80/3380/1 Calc: converted sort warning dialog to .ui Change-Id: I2bc44990efb62183507f46b22bfd8e09edf02eb6 --- M sc/UIConfig_scalc.mk M sc/inc/sc.hrc M sc/inc/scabstdlg.hxx M sc/source/ui/attrdlg/scdlgfact.cxx M sc/source/ui/attrdlg/scdlgfact.hxx M sc/source/ui/dbgui/sortdlg.cxx M sc/source/ui/inc/sortdlg.hrc M sc/source/ui/inc/sortdlg.hxx M sc/source/ui/src/sortdlg.src M sc/source/ui/view/cellsh2.cxx A sc/uiconfig/scalc/ui/sortwarning.ui 11 files changed, 162 insertions(+), 94 deletions(-) diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 8f800bf..12196b1 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -73,6 +73,7 @@ sc/uiconfig/scalc/ui/sortcriteriapage \ sc/uiconfig/scalc/ui/sortkey \ sc/uiconfig/scalc/ui/sortoptionspage \ + sc/uiconfig/scalc/ui/sortwarning \ sc/uiconfig/scalc/ui/textimportoptions \ sc/uiconfig/scalc/ui/textimportcsv \ )) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 4749970..3da7156 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1080,7 +1080,6 @@ #define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145) #define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146) -#define RID_SCDLG_SORT_WARNING (SC_DIALOGS_START + 147) #define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148) #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 89997d4..124843e 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -46,6 +46,7 @@ class ScDPObject; struct ScPivotFuncData; struct ScDPNumGroupInfo; +class ScSortWarningDlg; class ScTabViewShell; class ScConditionalFormat; class ScConditionalFormatList; @@ -293,6 +294,10 @@ virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const = 0; }; +class AbstractScSortWarningDlg : public VclAbstractDialog //add for ScSortWarningDlg +{ +}; + class AbstractScStringInputDlg : public VclAbstractDialog //add for ScStringInputDlg { public: @@ -345,7 +350,8 @@ const String& rStrLabel, int nId, sal_Bool bColDefault = sal_True ) = 0; - virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg + + virtual AbstractScSortWarningDlg * CreateScSortWarningDlg(Window* pParent, const String& rExtendText, const String& rCurrentText ) = 0; //add for ScSortWarningDlg virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos, int nId ) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 98b656f..ab73973 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -109,6 +109,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); +IMPL_ABSTDLG_BASE(AbstractScSortWarningDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); @@ -729,23 +730,10 @@ return 0; } - - -VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const String& rExtendText, - const String& rCurrentText, int nId ) +AbstractScSortWarningDlg* ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText ) { - Dialog * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_SORT_WARNING: - pDlg = new ScSortWarningDlg( pParent, rExtendText, rCurrentText ); - break; - default: - break; - } - if( pDlg ) - return new ScVclAbstractDialog_Impl( pDlg ); - return 0; + ScSortWarningDlg* pDlg = new ScSortWarningDlg(pParent, rExtendText, rCurrentText ); + return new AbstractScSortWarningDlg_Impl( pDlg ); } diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 3383616..cf239e8 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -47,6 +47,7 @@ class ScDPNumGroupDlg; class ScDPDateGroupDlg; class ScDPShowDetailDlg; +class ScSortWarningDlg; class ScNewScenarioDlg; class ScShowTabDlg; class ScStringInputDlg; @@ -343,6 +344,12 @@ virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const; }; +class AbstractScSortWarningDlg_Impl : public AbstractScSortWarningDlg +{ + DECL_ABSTDLG_BASE( AbstractScSortWarningDlg_Impl, ScSortWarningDlg ) +}; + + class AbstractScStringInputDlg_Impl : public AbstractScStringInputDlg //add for ScStringInputDlg { DECL_ABSTDLG_BASE( AbstractScStringInputDlg_Impl, ScStringInputDlg ) @@ -412,7 +419,7 @@ int nId, sal_Bool bColDefault = sal_True ); - virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); + virtual AbstractScSortWarningDlg * CreateScSortWarningDlg(Window* pParent, const String& rExtendText, const String& rCurrentText ); virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos, int nId ); diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx index 171a785..d096e4e 100644 --- a/sc/source/ui/dbgui/sortdlg.cxx +++ b/sc/source/ui/dbgui/sortdlg.cxx @@ -48,22 +48,19 @@ ScSortWarningDlg::ScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText ): - ModalDialog ( pParent, ScResId( RID_SCDLG_SORT_WARNING ) ), - aFtText ( this, ScResId( FT_TEXT ) ), - aFtTip ( this, ScResId( FT_TIP ) ), - aBtnExtSort ( this, ScResId( BTN_EXTSORT ) ), - aBtnCurSort ( this, ScResId( BTN_CURSORT ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ) + ModalDialog ( pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui" ) { - String sTextName = aFtText.GetText(); + get(aFtText, "sorttext" ); + get( aBtnExtSort, "extend" ); + get( aBtnCurSort, "current" ); + + String sTextName = aFtText->GetText(); sTextName.SearchAndReplaceAscii("%1", rExtendText); sTextName.SearchAndReplaceAscii("%2", rCurrentText); - aFtText.SetText( sTextName ); + aFtText->SetText( sTextName ); - aBtnExtSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) ); - aBtnCurSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) ); - - FreeResource(); + aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) ); + aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) ); } ScSortWarningDlg::~ScSortWarningDlg() @@ -72,11 +69,11 @@ IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn ) { - if ( pBtn == &aBtnExtSort ) + if ( pBtn == aBtnExtSort ) { EndDialog( BTN_EXTEND_RANGE ); } - else if( pBtn == &aBtnCurSort ) + else if( pBtn == aBtnCurSort ) { EndDialog( BTN_CURRENT_SELECTION ); } diff --git a/sc/source/ui/inc/sortdlg.hrc b/sc/source/ui/inc/sortdlg.hrc index 15e5de6..d97022f 100644 --- a/sc/source/ui/inc/sortdlg.hrc +++ b/sc/source/ui/inc/sortdlg.hrc @@ -20,7 +20,6 @@ #include "sc.hrc" // -> RID_SCDLG_SORT // -> RID_SCPAGE_SORT_FIELDS - // -> RID_SCDLG_SORT_WARNING // -> SCSTR_NONAME // -> SCSTR_UNDEFINED // -> SCSTR_FIELD @@ -32,11 +31,5 @@ #define CTRL_MANAGESORTKEY 1 #define WIN_MANAGESORTKEY 2 #define SB_SORT 3 - -#define FT_TEXT 1 -#define FT_TIP 2 -#define BTN_EXTSORT 3 -#define BTN_CURSORT 4 -#define BTN_CANCEL 5 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/sortdlg.hxx b/sc/source/ui/inc/sortdlg.hxx index d38e51c..1023e7c 100644 --- a/sc/source/ui/inc/sortdlg.hxx +++ b/sc/source/ui/inc/sortdlg.hxx @@ -56,11 +56,9 @@ ~ScSortWarningDlg(); DECL_LINK( BtnHdl, PushButton* ); private: - FixedText aFtText; - FixedText aFtTip; - PushButton aBtnExtSort; - PushButton aBtnCurSort; - CancelButton aBtnCancel; + FixedText* aFtText; + PushButton* aBtnExtSort; + PushButton* aBtnCurSort; }; #endif // SC_SORTDLG_HXX diff --git a/sc/source/ui/src/sortdlg.src b/sc/source/ui/src/sortdlg.src index 6dc6eb6..cf8e351 100644 --- a/sc/source/ui/src/sortdlg.src +++ b/sc/source/ui/src/sortdlg.src @@ -74,52 +74,4 @@ }; }; -ModalDialog RID_SCDLG_SORT_WARNING -{ - HelpID = "sc:ModalDialog:RID_SCDLG_SORT_WARNING"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 180 , 91 ) ; - Text [ en-US ] = "Sort Range" ; - Moveable = TRUE ; - Closeable = FALSE ; - FixedText FT_TEXT - { - Pos = MAP_APPFONT ( 8 , 3 ) ; - Size = MAP_APPFONT ( 170 , 33 ) ; - WordBreak = TRUE; - Text [ en-US ] = "The cells next to the current selection also contain data. Do you want to extend the sort range to %1, or sort the currently selected range, %2?"; - }; - FixedText FT_TIP - { - Pos = MAP_APPFONT ( 8 , 55 ) ; - Size = MAP_APPFONT ( 170 , 33 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "Tip: The sort range can be detected automatically. Place the cell cursor inside a list and execute sort. The whole range of neighboring non-empty cells will then be sorted."; - }; - PushButton BTN_EXTSORT - { - HelpID = "sc:PushButton:RID_SCDLG_SORT_WARNING:BTN_EXTSORT"; - Pos = MAP_APPFONT ( 6 , 39 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - Text [ en-US ] = "Extend selection"; - }; - PushButton BTN_CURSORT - { - HelpID = "sc:PushButton:RID_SCDLG_SORT_WARNING:BTN_CURSORT"; - Pos = MAP_APPFONT ( 70 , 39 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Current selection"; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 134 , 39 ) ; - Size = MAP_APPFONT ( 40 , 14 ) ; - TabStop = TRUE ; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 8f30e18..3989261 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -150,7 +150,7 @@ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - VclAbstractDialog* pWarningDlg = pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(),aExtendStr,aCurrentStr,RID_SCDLG_SORT_WARNING ); + AbstractScSortWarningDlg* pWarningDlg = pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr ); OSL_ENSURE(pWarningDlg, "Dialog create fail!"); short bResult = pWarningDlg->Execute(); if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION ) diff --git a/sc/uiconfig/scalc/ui/sortwarning.ui b/sc/uiconfig/scalc/ui/sortwarning.ui new file mode 100644 index 0000000..e743ad8 --- /dev/null +++ b/sc/uiconfig/scalc/ui/sortwarning.ui @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkWindow" id="SortWarning"> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="default_height">200</property> + <property name="type_hint">dialog</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">6</property> + <property name="right_padding">6</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel" id="sorttext"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="margin_top">6</property> + <property name="margin_bottom">6</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">The cells next to the current selection also contain data. Do you want to extend the sort range to %1, or sort the currently selected range, %2?</property> + <property name="wrap">True</property> + <property name="wrap_mode">word-char</property> + <property name="max_width_chars">72</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">center</property> + <property name="spacing">12</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="extend"> + <property name="label" translatable="yes">_Extend selection</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="current"> + <property name="label" translatable="yes">Current selection</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">6</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sorttip"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="margin_top">6</property> + <property name="margin_bottom">6</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Tip: The sort range can be detected automatically. Place the cell cursor inside a list and execute sort. The whole range of neighboring non-empty cells will then be sorted.</property> + <property name="wrap">True</property> + <property name="wrap_mode">word-char</property> + <property name="max_width_chars">72</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + </object> +</interface> -- To view, visit https://gerrit.libreoffice.org/3380 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bc44990efb62183507f46b22bfd8e09edf02eb6 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Albert Thuswaldner <albert.thuswald...@gmail.com> _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice