diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-10 08:06:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-10 08:08:45 +0200 |
commit | 3b536279ed8131373a2c123873e07f45c36a8684 (patch) | |
tree | cf2d0845e63dd049c2a8d6d2a72af60ea6a88972 /sw/source/uibase | |
parent | 6e12729f715f142140d220dc7d3b28a4a0657016 (diff) |
convert SwXPrintSettingsType to scoped enum
and drop read-only PRINT_SETTINGS_WEB enumerator
Change-Id: I5260b92bca2d86082bbec37569e31be9525a300e
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/inc/unomod.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 16 |
3 files changed, 9 insertions, 16 deletions
diff --git a/sw/source/uibase/inc/unomod.hxx b/sw/source/uibase/inc/unomod.hxx index ad83a01700c2..c3ef5a5de79e 100644 --- a/sw/source/uibase/inc/unomod.hxx +++ b/sw/source/uibase/inc/unomod.hxx @@ -64,11 +64,10 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; }; -enum SwXPrintSettingsType +enum class SwXPrintSettingsType { - PRINT_SETTINGS_MODULE, - PRINT_SETTINGS_WEB, - PRINT_SETTINGS_DOCUMENT + Module, + Document }; class SwXPrintSettings : public comphelper::ChainableHelperNoState diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 8505a31d45cb..f207b3a205b8 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -242,7 +242,7 @@ SwXDocumentSettings::SwXDocumentSettings ( SwXTextDocument * pModel ) , mpDoc ( nullptr ) , mpPrinter( nullptr ) { - registerSlave ( new SwXPrintSettings ( PRINT_SETTINGS_DOCUMENT, mpModel->GetDocShell()->GetDoc() ) ); + registerSlave ( new SwXPrintSettings ( SwXPrintSettingsType::Document, mpModel->GetDocShell()->GetDoc() ) ); } SwXDocumentSettings::~SwXDocumentSettings() diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 46321258981e..3d9af0634b78 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -220,7 +220,7 @@ Reference< XPropertySet > SwXModule::getPrintSettings() if(!mxPrintSettings.is()) { OSL_FAIL("Web or Text?"); - mxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) ); + mxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( SwXPrintSettingsType::Module ) ); } return mxPrintSettings; } @@ -259,13 +259,10 @@ void SwXPrintSettings::_preSetValues () { switch (meType) { - case PRINT_SETTINGS_MODULE: + case SwXPrintSettingsType::Module: mpPrtOpt = SW_MOD()->GetPrtOptions( false ); break; - case PRINT_SETTINGS_WEB: - mpPrtOpt = SW_MOD()->GetPrtOptions( true ); - break; - case PRINT_SETTINGS_DOCUMENT: + case SwXPrintSettingsType::Document: { if (!mpDoc) throw IllegalArgumentException (); @@ -411,13 +408,10 @@ void SwXPrintSettings::_preGetValues() { switch (meType) { - case PRINT_SETTINGS_MODULE: + case SwXPrintSettingsType::Module: mpPrtOpt = SW_MOD()->GetPrtOptions( false ); break; - case PRINT_SETTINGS_WEB: - mpPrtOpt = SW_MOD()->GetPrtOptions( true ); - break; - case PRINT_SETTINGS_DOCUMENT: + case SwXPrintSettingsType::Document: { if (!mpDoc) throw IllegalArgumentException (); |