diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-20 13:05:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-23 12:33:44 +0200 |
commit | c0af8057188c0e95831f9e6d1ef96a424da6f9b2 (patch) | |
tree | 6509c67d0cfcc42e3b107004167f2efcccda43cd /sc | |
parent | 27e26fc4286f66ab1bf4c807d86b8f3254c5c68b (diff) |
weld SfxPrintOptionsDialog
and SwMMResultPrintDialog
Change-Id: Icded6a26a3a151293bea0c9173334cf634283e89
Reviewed-on: https://gerrit.libreoffice.org/53299
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/prevwsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tpprint.hxx | 10 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpprint.cxx | 54 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 4 |
6 files changed, 31 insertions, 45 deletions
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 179e6b1de882..bfeb685faa99 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -105,7 +105,7 @@ public: virtual SfxPrinter* GetPrinter( bool bCreate = false ) override; virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override; virtual bool HasPrintOptionsPage() const override; - virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( TabPageParent pParent, const SfxItemSet &rOptions ) override; + virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions) override; void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 17bc4ecf1b76..126811185faf 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -318,7 +318,7 @@ public: SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override; virtual bool HasPrintOptionsPage() const override; - virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( TabPageParent pParent, const SfxItemSet &rOptions ) override; + virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions) override; void ConnectObject( const SdrOle2Obj* pObj ); void ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx index fb201a5b852c..9ddae6ec4dae 100644 --- a/sc/source/ui/inc/tpprint.hxx +++ b/sc/source/ui/inc/tpprint.hxx @@ -21,19 +21,17 @@ #define INCLUDED_SC_SOURCE_UI_INC_TPPRINT_HXX #include <sfx2/tabdlg.hxx> -#include <vcl/fixed.hxx> class ScTpPrintOptions : public SfxTabPage { friend class VclPtr<ScTpPrintOptions>; - VclPtr<CheckBox> m_pSkipEmptyPagesCB; - VclPtr<CheckBox> m_pSelectedSheetsCB; - VclPtr<CheckBox> m_pForceBreaksCB; + std::unique_ptr<weld::CheckButton> m_xSkipEmptyPagesCB; + std::unique_ptr<weld::CheckButton> m_xSelectedSheetsCB; + std::unique_ptr<weld::CheckButton> m_xForceBreaksCB; - ScTpPrintOptions( vcl::Window* pParent, const SfxItemSet& rCoreSet ); + ScTpPrintOptions(TabPageParent pPage, const SfxItemSet& rCoreSet); public: virtual ~ScTpPrintOptions() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rCoreSet ); virtual bool FillItemSet( SfxItemSet* rCoreSet ) override; virtual void Reset( const SfxItemSet* rCoreSet ) override; diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index 9c8dcbc77300..f38a2f5cc7b7 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -26,34 +26,22 @@ #include <scmod.hxx> #include <sc.hrc> -ScTpPrintOptions::ScTpPrintOptions( vcl::Window* pParent, +ScTpPrintOptions::ScTpPrintOptions( TabPageParent pPage, const SfxItemSet& rCoreAttrs ) - : SfxTabPage ( pParent, - "optCalcPrintPage", - "modules/scalc/ui/optdlg.ui", - &rCoreAttrs ) + : SfxTabPage(pPage, "modules/scalc/ui/optdlg.ui", "optCalcPrintPage", &rCoreAttrs ) + , m_xSkipEmptyPagesCB(m_xBuilder->weld_check_button("suppressCB")) + , m_xSelectedSheetsCB(m_xBuilder->weld_check_button("printCB")) + , m_xForceBreaksCB(m_xBuilder->weld_check_button("forceBreaksCB")) { - get( m_pSkipEmptyPagesCB , "suppressCB" ); - get( m_pSelectedSheetsCB , "printCB" ); - get( m_pForceBreaksCB, "forceBreaksCB" ); } ScTpPrintOptions::~ScTpPrintOptions() { - disposeOnce(); } -void ScTpPrintOptions::dispose() +VclPtr<SfxTabPage> ScTpPrintOptions::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - m_pSkipEmptyPagesCB.clear(); - m_pSelectedSheetsCB.clear(); - m_pForceBreaksCB.clear(); - SfxTabPage::dispose(); -} - -VclPtr<SfxTabPage> ScTpPrintOptions::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) -{ - return VclPtr<ScTpPrintOptions>::Create( pParent.pParent, *rAttrSet ); + return VclPtr<ScTpPrintOptions>::Create(pParent, *rAttrSet); } DeactivateRC ScTpPrintOptions::DeactivatePage( SfxItemSet* pSetP ) @@ -80,38 +68,38 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet ) if ( SfxItemState::SET == rCoreSet->GetItemState( SID_PRINT_SELECTEDSHEET, false , &pItem ) ) { bool bChecked = static_cast<const SfxBoolItem*>(pItem)->GetValue(); - m_pSelectedSheetsCB->Check( bChecked ); + m_xSelectedSheetsCB->set_active( bChecked ); } else { - m_pSelectedSheetsCB->Check( !aOptions.GetAllSheets() ); + m_xSelectedSheetsCB->set_active( !aOptions.GetAllSheets() ); } - m_pSkipEmptyPagesCB->Check( aOptions.GetSkipEmpty() ); - m_pSkipEmptyPagesCB->SaveValue(); - m_pSelectedSheetsCB->SaveValue(); - m_pForceBreaksCB->Check( aOptions.GetForceBreaks() ); - m_pForceBreaksCB->SaveValue(); + m_xSkipEmptyPagesCB->set_active( aOptions.GetSkipEmpty() ); + m_xSkipEmptyPagesCB->save_state(); + m_xSelectedSheetsCB->save_state(); + m_xForceBreaksCB->set_active( aOptions.GetForceBreaks() ); + m_xForceBreaksCB->save_state(); } bool ScTpPrintOptions::FillItemSet( SfxItemSet* rCoreAttrs ) { rCoreAttrs->ClearItem( SID_PRINT_SELECTEDSHEET ); - bool bSkipEmptyChanged = m_pSkipEmptyPagesCB->IsValueChangedFromSaved(); - bool bSelectedSheetsChanged = m_pSelectedSheetsCB->IsValueChangedFromSaved(); - bool bForceBreaksChanged = m_pForceBreaksCB->IsValueChangedFromSaved(); + bool bSkipEmptyChanged = m_xSkipEmptyPagesCB->get_state_changed_from_saved(); + bool bSelectedSheetsChanged = m_xSelectedSheetsCB->get_state_changed_from_saved(); + bool bForceBreaksChanged = m_xForceBreaksCB->get_state_changed_from_saved(); if ( bSkipEmptyChanged || bSelectedSheetsChanged || bForceBreaksChanged ) { ScPrintOptions aOpt; - aOpt.SetSkipEmpty( m_pSkipEmptyPagesCB->IsChecked() ); - aOpt.SetAllSheets( !m_pSelectedSheetsCB->IsChecked() ); - aOpt.SetForceBreaks( m_pForceBreaksCB->IsChecked() ); + aOpt.SetSkipEmpty( m_xSkipEmptyPagesCB->get_active() ); + aOpt.SetAllSheets( !m_xSelectedSheetsCB->get_active() ); + aOpt.SetForceBreaks( m_xForceBreaksCB->get_active() ); rCoreAttrs->Put( ScTpPrintItem( aOpt ) ); if ( bSelectedSheetsChanged ) { - rCoreAttrs->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, m_pSelectedSheetsCB->IsChecked() ) ); + rCoreAttrs->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, m_xSelectedSheetsCB->get_active() ) ); } return true; } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index ac3f87758d0a..3d8360d52747 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -516,13 +516,13 @@ bool ScPreviewShell::HasPrintOptionsPage() const return true; } -VclPtr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage( TabPageParent pParent, const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT); if ( ScTpPrintOptionsCreate ) - return ScTpPrintOptionsCreate( pParent, &rOptions ); + return ScTpPrintOptionsCreate(pPage, &rOptions); return VclPtr<SfxTabPage>(); } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index f5d0815f1570..401cca9ebd95 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1049,13 +1049,13 @@ bool ScTabViewShell::HasPrintOptionsPage() const return true; } -VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage( TabPageParent pParent, const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT); if ( ScTpPrintOptionsCreate ) - return ScTpPrintOptionsCreate( pParent, &rOptions ); + return ScTpPrintOptionsCreate(pPage, &rOptions); return VclPtr<SfxTabPage>(); } |