From b8400dbf46aeffd5991f71511ae27368d46a5c40 Mon Sep 17 00:00:00 2001 From: Abdulaziz A Alayed Date: Tue, 4 Jun 2013 12:12:33 +0200 Subject: Convert Calc Print option page to .ui. Change-Id: Ida482cb280c3ec3ae05af053861f19c13f8a1d78 --- sc/UIConfig_scalc.mk | 1 + sc/inc/helpids.h | 1 - sc/source/ui/inc/optdlg.hrc | 4 - sc/source/ui/inc/tpprint.hxx | 6 +- sc/source/ui/optdlg/tpprint.cxx | 32 ++++---- sc/source/ui/src/optdlg.src | 35 --------- sc/uiconfig/scalc/ui/optdlg.ui | 165 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 183 insertions(+), 61 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/optdlg.ui diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 94a8aeade86d..27563d357736 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -98,6 +98,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/sortwarning \ sc/uiconfig/scalc/ui/textimportoptions \ sc/uiconfig/scalc/ui/textimportcsv \ + sc/uiconfig/scalc/ui/optdlg \ )) # vim: set noet sw=4 ts=4: diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 8bbc07aa665d..9744a359d66a 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -64,7 +64,6 @@ #define HID_SCPAGE_USERLISTS "SC_HID_SCPAGE_USERLISTS" #define HID_SCPAGE_AREAS "SC_HID_SCPAGE_AREAS" #define HID_SCPAGE_COMPATIBILITY "SC_HID_SCPAGE_COMPATIBILITY" -#define HID_SCPAGE_PRINT "SC_HID_SCPAGE_PRINT" #define HID_SCPAGE_SUBT_GROUP1 "SC_HID_SCPAGE_SUBT_GROUP1" #define HID_SCPAGE_SUBT_GROUP2 "SC_HID_SCPAGE_SUBT_GROUP2" #define HID_SCPAGE_SUBT_GROUP3 "SC_HID_SCPAGE_SUBT_GROUP3" diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc index 515ddcb1e3a1..78fdf859ced7 100644 --- a/sc/source/ui/inc/optdlg.hrc +++ b/sc/source/ui/inc/optdlg.hrc @@ -56,10 +56,6 @@ #define STR_COPYERR 9 // TP_PRINT: -#define FL_PAGES 1 -#define BTN_SKIPEMPTYPAGES 2 -#define FL_SHEETS 2 -#define BTN_SELECTEDSHEETS 4 // TP_LCONTENT diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx index 0babe41a753c..2b9eac7a2b73 100644 --- a/sc/source/ui/inc/tpprint.hxx +++ b/sc/source/ui/inc/tpprint.hxx @@ -27,10 +27,8 @@ class ScTpPrintOptions : public SfxTabPage { - FixedLine aPagesFL; - CheckBox aSkipEmptyPagesCB; - FixedLine aSheetsFL; - CheckBox aSelectedSheetsCB; + CheckBox* m_pSkipEmptyPagesCB; + CheckBox* m_pSelectedSheetsCB; ScTpPrintOptions( Window* pParent, const SfxItemSet& rCoreSet ); ~ScTpPrintOptions(); diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index 9ca45c14e087..cdfc5eb6759e 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -34,14 +34,12 @@ ScTpPrintOptions::ScTpPrintOptions( Window* pParent, const SfxItemSet& rCoreAttrs ) : SfxTabPage ( pParent, - ScResId( RID_SCPAGE_PRINT ), - rCoreAttrs ), - aPagesFL ( this, ScResId( FL_PAGES ) ), - aSkipEmptyPagesCB( this, ScResId( BTN_SKIPEMPTYPAGES ) ), - aSheetsFL ( this, ScResId( FL_SHEETS ) ), - aSelectedSheetsCB( this, ScResId( BTN_SELECTEDSHEETS ) ) + "optCalcPrintPage", + "modules/scalc/ui/optdlg.ui", + rCoreAttrs ) { - FreeResource(); + get( m_pSkipEmptyPagesCB , "suppressCB" ); + get( m_pSelectedSheetsCB , "printCB" ); } ScTpPrintOptions::~ScTpPrintOptions() @@ -79,16 +77,16 @@ void ScTpPrintOptions::Reset( const SfxItemSet& rCoreSet ) if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_PRINT_SELECTEDSHEET, false , &pItem ) ) { sal_Bool bChecked = ( (const SfxBoolItem*)pItem )->GetValue(); - aSelectedSheetsCB.Check( bChecked ); + m_pSelectedSheetsCB->Check( bChecked ); } else { - aSelectedSheetsCB.Check( !aOptions.GetAllSheets() ); + m_pSelectedSheetsCB->Check( !aOptions.GetAllSheets() ); } - aSkipEmptyPagesCB.Check( aOptions.GetSkipEmpty() ); - aSkipEmptyPagesCB.SaveValue(); - aSelectedSheetsCB.SaveValue(); + m_pSkipEmptyPagesCB->Check( aOptions.GetSkipEmpty() ); + m_pSkipEmptyPagesCB->SaveValue(); + m_pSelectedSheetsCB->SaveValue(); } // ----------------------------------------------------------------------- @@ -97,18 +95,18 @@ sal_Bool ScTpPrintOptions::FillItemSet( SfxItemSet& rCoreAttrs ) { rCoreAttrs.ClearItem( SID_PRINT_SELECTEDSHEET ); - bool bSkipEmptyChanged = ( aSkipEmptyPagesCB.GetSavedValue() != aSkipEmptyPagesCB.IsChecked() ); - bool bSelectedSheetsChanged = ( aSelectedSheetsCB.GetSavedValue() != aSelectedSheetsCB.IsChecked() ); + bool bSkipEmptyChanged = ( m_pSkipEmptyPagesCB->GetSavedValue() != m_pSkipEmptyPagesCB->IsChecked() ); + bool bSelectedSheetsChanged = ( m_pSelectedSheetsCB->GetSavedValue() != m_pSelectedSheetsCB->IsChecked() ); if ( bSkipEmptyChanged || bSelectedSheetsChanged ) { ScPrintOptions aOpt; - aOpt.SetSkipEmpty( aSkipEmptyPagesCB.IsChecked() ); - aOpt.SetAllSheets( !aSelectedSheetsCB.IsChecked() ); + aOpt.SetSkipEmpty( m_pSkipEmptyPagesCB->IsChecked() ); + aOpt.SetAllSheets( !m_pSelectedSheetsCB->IsChecked() ); rCoreAttrs.Put( ScTpPrintItem( SID_SCPRINTOPTIONS, aOpt ) ); if ( bSelectedSheetsChanged ) { - rCoreAttrs.Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, aSelectedSheetsCB.IsChecked() ) ); + rCoreAttrs.Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, m_pSelectedSheetsCB->IsChecked() ) ); } return sal_True; } diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src index 5c87e4129979..d3c4fdb3e9da 100644 --- a/sc/source/ui/src/optdlg.src +++ b/sc/source/ui/src/optdlg.src @@ -755,39 +755,4 @@ TabPage RID_SCPAGE_LAYOUT }; }; -TabPage RID_SCPAGE_PRINT -{ - HelpId = HID_SCPAGE_PRINT ; - SVLook = TRUE ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - FixedLine FL_PAGES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Pages"; - }; - CheckBox BTN_SKIPEMPTYPAGES - { - HelpID = "sc:CheckBox:RID_SCPAGE_PRINT:BTN_SKIPEMPTYPAGES"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 239 , 10 ) ; - Text [ en-US ] = "~Suppress output of empty pages"; - }; - FixedLine FL_SHEETS - { - Pos = MAP_APPFONT ( 6 , 30 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Sheets"; - }; - CheckBox BTN_SELECTEDSHEETS - { - HelpID = "sc:CheckBox:RID_SCPAGE_PRINT:BTN_SELECTEDSHEETS"; - Pos = MAP_APPFONT ( 12 , 41 ) ; - Size = MAP_APPFONT ( 239 , 10 ) ; - Text [ en-US ] = "~Print only selected sheets"; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/uiconfig/scalc/ui/optdlg.ui b/sc/uiconfig/scalc/ui/optdlg.ui new file mode 100644 index 000000000000..115f589381cc --- /dev/null +++ b/sc/uiconfig/scalc/ui/optdlg.ui @@ -0,0 +1,165 @@ + + + + + 1 + 99 + 1 + 1 + 10 + + + True + False + 6 + vertical + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + vertical + 6 + + + Suppress output of empty pages + True + True + False + True + 0 + True + + + False + True + 0 + + + + + + + + + + + + + + True + False + 6 + + + + + + + + + + + + False + True + 4 + + + + + + + + + True + False + Pages + + + + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + vertical + 6 + + + Print only selected sheets + True + True + False + True + 0 + True + + + False + True + 0 + + + + + + + + + + + + + + + True + False + 0.47999998927116394 + Sheets + + + + + + + + False + True + 1 + + + + -- cgit