diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-20 14:59:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-21 07:10:54 +0000 |
commit | 5ec1b04b9bfe949316c67b1282f7f8fa066c3b60 (patch) | |
tree | 77e1940145bf44e6dc60aeefb2df853d88f2f0c0 | |
parent | 72002992a3c5213882fa4d60c7cd8fab10f0b009 (diff) |
convert EnumContext::Application to scoped enum
Change-Id: Ia289a7b63bf8797085315218785e2a2a4c45d232
Reviewed-on: https://gerrit.libreoffice.org/32230
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | framework/source/uielement/notebookbarmenucontroller.cxx | 12 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmodemenucontroller.cxx | 16 | ||||
-rw-r--r-- | include/vcl/EnumContext.hxx | 34 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 32 | ||||
-rw-r--r-- | svx/source/sidebar/ContextChangeEventMultiplexer.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanel.cxx | 6 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 22 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 118 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaSpacingWindow.cxx | 48 | ||||
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 52 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextPropertyPanel.cxx | 30 | ||||
-rw-r--r-- | vcl/source/window/EnumContext.cxx | 79 |
15 files changed, 246 insertions, 253 deletions
diff --git a/framework/source/uielement/notebookbarmenucontroller.cxx b/framework/source/uielement/notebookbarmenucontroller.cxx index 833fdafff983..f1e85696af9b 100644 --- a/framework/source/uielement/notebookbarmenucontroller.cxx +++ b/framework/source/uielement/notebookbarmenucontroller.cxx @@ -90,13 +90,13 @@ void NotebookbarMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > OUStringBuffer aPath("org.openoffice.Office.UI.Notebookbar/Applications/"); switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: aPath.append("Writer"); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: aPath.append("Calc"); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: aPath.append("Impress"); break; default: @@ -250,15 +250,15 @@ void SAL_CALL NotebookbarMenuController::itemActivated( const css::awt::MenuEven OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/"); switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: aPath.append("Writer"); aActive = officecfg::Office::UI::Notebookbar::ActiveWriter::get( m_xContext ); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: aPath.append("Calc"); aActive = officecfg::Office::UI::Notebookbar::ActiveCalc::get( m_xContext ); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: aPath.append("Impress"); aActive = officecfg::Office::UI::Notebookbar::ActiveImpress::get( m_xContext ); break; diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx index ffd0440431e4..c7eba87087a1 100644 --- a/framework/source/uielement/toolbarmodemenucontroller.cxx +++ b/framework/source/uielement/toolbarmodemenucontroller.cxx @@ -91,16 +91,16 @@ void ToolbarModeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/"); switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: aPath.append("Writer"); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: aPath.append("Calc"); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: aPath.append("Impress"); break; - case vcl::EnumContext::Application::Application_Draw: + case vcl::EnumContext::Application::Draw: aPath.append("Draw"); break; default: @@ -253,16 +253,16 @@ void SAL_CALL ToolbarModeMenuController::itemActivated( const css::awt::MenuEven OUStringBuffer aPath("org.openoffice.Office.UI.ToolbarMode/Applications/"); switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: aPath.append("Writer"); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: aPath.append("Calc"); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: aPath.append("Impress"); break; - case vcl::EnumContext::Application::Application_Draw: + case vcl::EnumContext::Application::Draw: aPath.append("Draw"); break; default: diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx index cb48266d168c..e0f19b002368 100644 --- a/include/vcl/EnumContext.hxx +++ b/include/vcl/EnumContext.hxx @@ -31,35 +31,35 @@ namespace vcl { class VCL_DLLPUBLIC EnumContext { public: - enum Application + enum class Application { - Application_Writer, - Application_WriterGlobal, - Application_WriterWeb, - Application_WriterXML, - Application_WriterForm, - Application_WriterReport, - Application_Calc, - Application_Chart, - Application_Draw, - Application_Impress, + Writer, + WriterGlobal, + WriterWeb, + WriterXML, + WriterForm, + WriterReport, + Calc, + Chart, + Draw, + Impress, // For your convenience to avoid duplicate code in the common // case that Draw and Impress use identical context configurations. - Application_DrawImpress, + DrawImpress, // Also for your convenience for the different variants of Writer documents. - Application_WriterVariants, + WriterVariants, // Used only by deck or panel descriptors. Matches any // application. - Application_Any, + Any, // Use this only in special circumstances. One might be the // wish to disable a deck or panel during debugging. - Application_None, + NONE, - LastApplicationEnum = Application_None + LAST = Application::NONE }; enum Context { @@ -123,7 +123,7 @@ public: made are: Draw or Impress -> DrawImpress Writer or WriterWeb -> WriterAndWeb - Use the Application_DrawImpress or Application_WriterAndWeb values in the CombinedEnumContext macro. + Use the Application::DrawImpress or Application::WriterAndWeb values in the CombinedEnumContext macro. */ sal_Int32 GetCombinedContext_DI() const; diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 1946be932b8c..6673ee838ec3 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -111,7 +111,7 @@ SlideBackground::SlideBackground( mbEditModeChangePending(false), mxFrame(rxFrame), maContext(), - maApplication(vcl::EnumContext::Application_None), + maApplication(vcl::EnumContext::Application::NONE), mbTitle(false), mpBindings(pBindings) { @@ -138,7 +138,7 @@ SlideBackground::~SlideBackground() bool SlideBackground::IsImpress() { - return ( maApplication == vcl::EnumContext::Application_Impress ); + return ( maApplication == vcl::EnumContext::Application::Impress ); } void SlideBackground::Initialize() @@ -391,18 +391,18 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener, { if(!mbTitle) { - vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application_Draw, + vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context_DrawPage); - vcl::EnumContext aDrawMasterContext(vcl::EnumContext::Application_Draw, + vcl::EnumContext aDrawMasterContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context_MasterPage); - vcl::EnumContext aImpressOtherContext(vcl::EnumContext::Application_Impress, + vcl::EnumContext aImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context_DrawPage); - vcl::EnumContext aImpressMasterContext(vcl::EnumContext::Application_Impress, + vcl::EnumContext aImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context_MasterPage); if(maContext == aDrawOtherContext || maContext == aDrawMasterContext) { mpMasterLabel->SetText(SD_RESSTR(STR_MASTERPAGE_NAME)); - maApplication = vcl::EnumContext::Application_Draw; + maApplication = vcl::EnumContext::Application::Draw; mpCloseMaster->Hide(); mpEditMaster->Hide(); if( maContext == aDrawMasterContext) @@ -413,7 +413,7 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener, else if ( maContext == aImpressOtherContext || maContext == aImpressMasterContext ) { mpMasterLabel->SetText(SD_RESSTR(STR_MASTERSLIDE_NAME)); - maApplication = vcl::EnumContext::Application_Impress; + maApplication = vcl::EnumContext::Application::Impress; mpCloseMaster->Hide(); mpEditMaster->Show(); if( maContext == aImpressMasterContext ) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index fc81adb9ee3b..62679201870a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -156,16 +156,16 @@ namespace { switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: return OUString( "Writer" ); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: return OUString( "Calc" ); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: return OUString( "Impress" ); break; - case vcl::EnumContext::Application::Application_Draw: + case vcl::EnumContext::Application::Draw: return OUString( "Draw" ); break; default: @@ -719,7 +719,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // Get information about current frame and module Reference<XFrame> xCurrentFrame; - vcl::EnumContext::Application eCurrentApp = vcl::EnumContext::Application::Application_None; + vcl::EnumContext::Application eCurrentApp = vcl::EnumContext::Application::NONE; OUString aCurrentMode; SfxViewFrame* pViewFrame = SfxViewFrame::Current(); diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index c34b66629d29..b404a3724ba2 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -58,13 +58,13 @@ static OUString lcl_getAppName( vcl::EnumContext::Application eApp ) { switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: return OUString( "Writer" ); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: return OUString( "Calc" ); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: return OUString( "Impress" ); break; default: @@ -79,13 +79,13 @@ static void lcl_setNotebookbarFileName( vcl::EnumContext::Application eApp, cons comphelper::ConfigurationChanges::create( ::comphelper::getProcessComponentContext() ) ); switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: officecfg::Office::UI::Notebookbar::ActiveWriter::set( sFileName, aBatch ); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: officecfg::Office::UI::Notebookbar::ActiveCalc::set( sFileName, aBatch ); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: officecfg::Office::UI::Notebookbar::ActiveImpress::set( sFileName, aBatch ); break; default: @@ -98,13 +98,13 @@ static OUString lcl_getNotebookbarFileName( vcl::EnumContext::Application eApp ) { switch ( eApp ) { - case vcl::EnumContext::Application::Application_Writer: + case vcl::EnumContext::Application::Writer: return officecfg::Office::UI::Notebookbar::ActiveWriter::get(); break; - case vcl::EnumContext::Application::Application_Calc: + case vcl::EnumContext::Application::Calc: return officecfg::Office::UI::Notebookbar::ActiveCalc::get(); break; - case vcl::EnumContext::Application::Application_Impress: + case vcl::EnumContext::Application::Impress: return officecfg::Office::UI::Notebookbar::ActiveImpress::get(); break; default: @@ -170,7 +170,7 @@ void SfxNotebookBar::CloseMethod(SystemWindow* pSysWindow) bool SfxNotebookBar::IsActive() { - vcl::EnumContext::Application eApp = vcl::EnumContext::Application::Application_Any; + vcl::EnumContext::Application eApp = vcl::EnumContext::Application::Any; if (SfxViewFrame::Current()) { @@ -354,7 +354,7 @@ void SfxNotebookBar::ShowMenubar(bool bShow) m_bLock = true; Reference<frame::XFrame> xFrame; - vcl::EnumContext::Application eCurrentApp = vcl::EnumContext::Application::Application_None; + vcl::EnumContext::Application eCurrentApp = vcl::EnumContext::Application::NONE; uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xContext ); diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 97742b73b5fc..2095acf6db15 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -469,39 +469,39 @@ void ResourceManager::ReadContextList ( std::vector<vcl::EnumContext::Application> aApplications; vcl::EnumContext::Application eApplication (vcl::EnumContext::GetApplicationEnum(sApplicationName)); - if (eApplication == vcl::EnumContext::Application_None - && !sApplicationName.equals(vcl::EnumContext::GetApplicationName(vcl::EnumContext::Application_None))) + if (eApplication == vcl::EnumContext::Application::NONE + && !sApplicationName.equals(vcl::EnumContext::GetApplicationName(vcl::EnumContext::Application::NONE))) { // Handle some special names: abbreviations that make // context descriptions more readable. if (sApplicationName == "Writer") - aApplications.push_back(vcl::EnumContext::Application_Writer); + aApplications.push_back(vcl::EnumContext::Application::Writer); else if (sApplicationName == "Calc") - aApplications.push_back(vcl::EnumContext::Application_Calc); + aApplications.push_back(vcl::EnumContext::Application::Calc); else if (sApplicationName == "Draw") - aApplications.push_back(vcl::EnumContext::Application_Draw); + aApplications.push_back(vcl::EnumContext::Application::Draw); else if (sApplicationName == "Impress") - aApplications.push_back(vcl::EnumContext::Application_Impress); + aApplications.push_back(vcl::EnumContext::Application::Impress); else if (sApplicationName == "Chart") - aApplications.push_back(vcl::EnumContext::Application_Chart); + aApplications.push_back(vcl::EnumContext::Application::Chart); else if (sApplicationName == "DrawImpress") { // A special case among the special names: it is // common to use the same context descriptions for // both Draw and Impress. This special case helps to // avoid duplication in the .xcu file. - aApplications.push_back(vcl::EnumContext::Application_Draw); - aApplications.push_back(vcl::EnumContext::Application_Impress); + aApplications.push_back(vcl::EnumContext::Application::Draw); + aApplications.push_back(vcl::EnumContext::Application::Impress); } else if (sApplicationName == "WriterVariants") { // Another special case for all Writer variants. - aApplications.push_back(vcl::EnumContext::Application_Writer); - aApplications.push_back(vcl::EnumContext::Application_WriterGlobal); - aApplications.push_back(vcl::EnumContext::Application_WriterWeb); - aApplications.push_back(vcl::EnumContext::Application_WriterXML); - aApplications.push_back(vcl::EnumContext::Application_WriterForm); - aApplications.push_back(vcl::EnumContext::Application_WriterReport); + aApplications.push_back(vcl::EnumContext::Application::Writer); + aApplications.push_back(vcl::EnumContext::Application::WriterGlobal); + aApplications.push_back(vcl::EnumContext::Application::WriterWeb); + aApplications.push_back(vcl::EnumContext::Application::WriterXML); + aApplications.push_back(vcl::EnumContext::Application::WriterForm); + aApplications.push_back(vcl::EnumContext::Application::WriterReport); } else { @@ -541,7 +541,7 @@ void ResourceManager::ReadContextList ( std::vector<vcl::EnumContext::Application>::const_iterator iApplication; for (iApplication = aApplications.begin(); iApplication != aApplications.end(); ++iApplication) { - if (*iApplication != vcl::EnumContext::Application_None) + if (*iApplication != vcl::EnumContext::Application::NONE) { rContextList.AddContextDescription( Context( diff --git a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx index f8dbc13110f2..43a15143e53e 100644 --- a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx +++ b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx @@ -76,7 +76,7 @@ void ContextChangeEventMultiplexer::NotifyContextChange ( // Ignore it. } return vcl::EnumContext::GetApplicationName( - vcl::EnumContext::Application_None); + vcl::EnumContext::Application::NONE); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index 45396bc00a21..e3f26039ff7d 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.cxx +++ b/svx/source/sidebar/line/LinePropertyPanel.cxx @@ -188,9 +188,9 @@ void LinePropertyPanel::HandleContextChange( switch(maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_Calc, Context_DrawLine): - case CombinedEnumContext(Application_DrawImpress, Context_DrawLine): - case CombinedEnumContext(Application_WriterVariants, Context_Draw): + case CombinedEnumContext(Application::Calc, Context_DrawLine): + case CombinedEnumContext(Application::DrawImpress, Context_DrawLine): + case CombinedEnumContext(Application::WriterVariants, Context_Draw): // TODO : Implement DrawLine context in Writer bShowArrows = true; break; diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index 46ca5b89fcd8..3ee1dd4e50a3 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -213,14 +213,14 @@ void ParaLineSpacingControl::Initialize() { switch (currentContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_DrawImpress, Context_Table): - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): - case CombinedEnumContext(Application_Calc, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::DrawImpress, Context_Table): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::Calc, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): { mpLineDist->RemoveEntry(LLINESPACE_FIX); } @@ -230,9 +230,9 @@ void ParaLineSpacingControl::Initialize() { switch (currentContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): { mpLineDist->InsertEntry(OUString("Fixed"), LLINESPACE_FIX); } diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 65a203fc36a9..13e96ce3404c 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -82,59 +82,59 @@ void ParaPropertyPanel::HandleContextChange ( maContext = rContext; switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_Calc, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::Calc, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): mpTBxVertAlign->Show(); mpTBxBackColor->Hide(); mpTBxNumBullet->Hide(); ReSize(false); break; - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Table): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Table): mpTBxVertAlign->Show(); mpTBxBackColor->Hide(); mpTBxNumBullet->Show(); ReSize(true); break; - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): mpTBxVertAlign->Hide(); mpTBxBackColor->Show(); mpTBxNumBullet->Show(); ReSize(true); break; - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Table): mpTBxVertAlign->Show(); mpTBxBackColor->Show(); mpTBxNumBullet->Show(); ReSize(true); break; - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): mpTBxVertAlign->Hide(); mpTBxBackColor->Hide(); mpTBxNumBullet->Hide(); ReSize(false); break; - case CombinedEnumContext(Application_Calc, Context_EditCell): - case CombinedEnumContext(Application_Calc, Context_Cell): - case CombinedEnumContext(Application_Calc, Context_Pivot): - case CombinedEnumContext(Application_DrawImpress, Context_Text): - case CombinedEnumContext(Application_DrawImpress, Context_OutlineText): + case CombinedEnumContext(Application::Calc, Context_EditCell): + case CombinedEnumContext(Application::Calc, Context_Cell): + case CombinedEnumContext(Application::Calc, Context_Pivot): + case CombinedEnumContext(Application::DrawImpress, Context_Text): + case CombinedEnumContext(Application::DrawImpress, Context_OutlineText): break; default: break; } - mpTBxOutline->Show( maContext.GetApplication_DI() == vcl::EnumContext::Application_DrawImpress ); + mpTBxOutline->Show( maContext.GetApplication_DI() == vcl::EnumContext::Application::DrawImpress ); } void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent) @@ -199,9 +199,9 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v { switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): { SfxBoolItem aMargin( SID_INC_INDENT, true ); GetBindings()->GetDispatcher()->ExecuteList( @@ -228,9 +228,9 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v { switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): { SfxBoolItem aMargin( SID_DEC_INDENT, true ); GetBindings()->GetDispatcher()->ExecuteList( @@ -327,23 +327,23 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): - case CombinedEnumContext(Application_Calc, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): - case CombinedEnumContext(Application_DrawImpress, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::Calc, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_Table): { mpLeftIndent->SetMin( DEFAULT_VALUE ); mpRightIndent->SetMin( DEFAULT_VALUE ); mpFLineIndent->SetMin( DEFAULT_VALUE ); } break; - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): { mpLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); mpRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); @@ -371,9 +371,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM ); nVal = (long)mpLeftIndent->Normalize( (long)nVal ); - if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) - && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) - && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table)) + if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Text) + && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Default) + && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Table)) { mpFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM ); } @@ -383,22 +383,22 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Table): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): { mpLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM ); mpRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM ); mpFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM ); } break; - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_Table): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_Table): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): { mpLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM ); mpRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM ); @@ -419,9 +419,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat const sal_uInt16 nIdDecrIndent = mpTbxIndent_IncDec->GetItemId(UNO_DECREMENTINDENT); mpTbxIndent_IncDec->EnableItem(nIdHangingIndent); - if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) - && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) - && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) + if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Text) + && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Default) + && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Table) ) { mpTbxIndent_IncDec->EnableItem(nIdIncrIndent); mpTbxIndent_IncDec->EnableItem(nIdDecrIndent); @@ -432,9 +432,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat mpLeftIndent-> Disable(); mpRightIndent->Disable(); mpFLineIndent->Disable(); - if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && - maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && - maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) + if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Text) && + maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Default) && + maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Table) ) mpTbxIndent_IncDec->Disable(); else mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, false); @@ -444,9 +444,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat mpLeftIndent->SetEmptyFieldValue(); mpRightIndent->SetEmptyFieldValue(); mpFLineIndent->SetEmptyFieldValue(); - if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && - maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && - maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) + if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Text) && + maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Default) && + maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Table) ) mpTbxIndent_IncDec->Disable(); else mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, false); @@ -492,9 +492,9 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { - if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Text) - || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Default) - || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Table) ) + if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context_Text) + || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context_Default) + || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context_Table) ) && ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) ) { // Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx index 41a7e45bab1c..e822d2224709 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx +++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx @@ -147,23 +147,23 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat switch(m_aContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): - case CombinedEnumContext(Application_Calc, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): - case CombinedEnumContext(Application_DrawImpress, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::Calc, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_Table): { m_pBeforeSpacing->SetMin(DEFAULT_VALUE); m_pAfterSpacing->SetMin(DEFAULT_VALUE); m_pFLSpacing->SetMin(DEFAULT_VALUE); } break; - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): { m_pBeforeSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM); m_pAfterSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM); @@ -185,9 +185,9 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat aTxtLeft = (long)m_pBeforeSpacing->Normalize(aTxtLeft); - if(m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) - && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) - && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table)) + if(m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Text) + && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Default) + && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context_Table)) { m_pFLSpacing->SetMin(aTxtLeft*(-1), FUNIT_100TH_MM); } @@ -196,22 +196,22 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat switch(m_aContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Default): - case CombinedEnumContext(Application_WriterVariants, Context_Table): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Default): + case CombinedEnumContext(Application::WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): { m_pBeforeSpacing->SetMax(MAX_SW - aTxtRight, FUNIT_100TH_MM); m_pAfterSpacing->SetMax(MAX_SW - aTxtLeft, FUNIT_100TH_MM); m_pFLSpacing->SetMax(MAX_SW - aTxtLeft - aTxtRight, FUNIT_100TH_MM); } break; - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_Table): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_Table): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): { m_pBeforeSpacing->SetMax(MAX_SC_SD - aTxtRight, FUNIT_100TH_MM); m_pAfterSpacing->SetMax(MAX_SC_SD - aTxtLeft, FUNIT_100TH_MM); diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 09703ceffadd..89b9a00efe04 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -264,37 +264,37 @@ void PosSizePropertyPanel::HandleContextChange( switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterVariants, Context_Draw): + case CombinedEnumContext(Application::WriterVariants, Context_Draw): bShowAngle = true; bShowFlip = true; break; - case CombinedEnumContext(Application_WriterVariants, Context_Graphic): + case CombinedEnumContext(Application::WriterVariants, Context_Graphic): bShowFlip = true; break; - case CombinedEnumContext(Application_Calc, Context_Draw): - case CombinedEnumContext(Application_Calc, Context_DrawLine): - case CombinedEnumContext(Application_Calc, Context_Graphic): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_DrawLine): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::Calc, Context_Draw): + case CombinedEnumContext(Application::Calc, Context_DrawLine): + case CombinedEnumContext(Application::Calc, Context_Graphic): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_DrawLine): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): bShowPosition = true; bShowAngle = true; bShowFlip = true; break; - case CombinedEnumContext(Application_Calc, Context_Chart): - case CombinedEnumContext(Application_Calc, Context_Form): - case CombinedEnumContext(Application_Calc, Context_Media): - case CombinedEnumContext(Application_Calc, Context_OLE): - case CombinedEnumContext(Application_Calc, Context_MultiObject): - case CombinedEnumContext(Application_DrawImpress, Context_Media): - case CombinedEnumContext(Application_DrawImpress, Context_Form): - case CombinedEnumContext(Application_DrawImpress, Context_OLE): - case CombinedEnumContext(Application_DrawImpress, Context_3DObject): - case CombinedEnumContext(Application_DrawImpress, Context_MultiObject): + case CombinedEnumContext(Application::Calc, Context_Chart): + case CombinedEnumContext(Application::Calc, Context_Form): + case CombinedEnumContext(Application::Calc, Context_Media): + case CombinedEnumContext(Application::Calc, Context_OLE): + case CombinedEnumContext(Application::Calc, Context_MultiObject): + case CombinedEnumContext(Application::DrawImpress, Context_Media): + case CombinedEnumContext(Application::DrawImpress, Context_Form): + case CombinedEnumContext(Application::DrawImpress, Context_OLE): + case CombinedEnumContext(Application::DrawImpress, Context_3DObject): + case CombinedEnumContext(Application::DrawImpress, Context_MultiObject): bShowPosition = true; break; } @@ -763,8 +763,8 @@ void PosSizePropertyPanel::NotifyItemUpdate( const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); - if(((nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_Draw) - || nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject) + if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context_Draw) + || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context_TextObject) ) && OBJ_EDGE == eKind) || OBJ_CAPTION == eKind) { @@ -787,8 +787,8 @@ void PosSizePropertyPanel::NotifyItemUpdate( const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj(); const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); - if(((nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_Draw) - || nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject) + if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context_Draw) + || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context_TextObject) ) && OBJ_EDGE == eKind) || OBJ_CAPTION == eKind) { @@ -810,7 +810,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( } } - if(nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject)) + if(nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context_TextObject)) { mpFlipTbx->Disable(); mpFtFlip->Disable(); @@ -855,8 +855,8 @@ void PosSizePropertyPanel::executeSize() SfxAllEnumItem aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, (sal_uInt16)RectPoint::LT); const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI()); - if( nCombinedContext == CombinedEnumContext(Application_WriterVariants, Context_Graphic) - || nCombinedContext == CombinedEnumContext(Application_WriterVariants, Context_OLE) + if( nCombinedContext == CombinedEnumContext(Application::WriterVariants, Context_Graphic) + || nCombinedContext == CombinedEnumContext(Application::WriterVariants, Context_OLE) ) { GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM, diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 6014b1fa067a..95bd906321ff 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -103,31 +103,31 @@ void TextPropertyPanel::HandleContextChange ( switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_Calc, Context_Cell): - case CombinedEnumContext(Application_Calc, Context_Pivot): + case CombinedEnumContext(Application::Calc, Context_Cell): + case CombinedEnumContext(Application::Calc, Context_Pivot): // bNeedTextSpacing = false; break; - case CombinedEnumContext(Application_Calc, Context_EditCell): + case CombinedEnumContext(Application::Calc, Context_EditCell): bNeedTextSpacing = true; break; - case CombinedEnumContext(Application_Calc, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_DrawText): - case CombinedEnumContext(Application_WriterVariants, Context_Annotation): - case CombinedEnumContext(Application_DrawImpress, Context_DrawText): - case CombinedEnumContext(Application_DrawImpress, Context_Text): - case CombinedEnumContext(Application_DrawImpress, Context_Table): - case CombinedEnumContext(Application_DrawImpress, Context_OutlineText): - case CombinedEnumContext(Application_DrawImpress, Context_Draw): - case CombinedEnumContext(Application_DrawImpress, Context_TextObject): - case CombinedEnumContext(Application_DrawImpress, Context_Graphic): + case CombinedEnumContext(Application::Calc, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_DrawText): + case CombinedEnumContext(Application::WriterVariants, Context_Annotation): + case CombinedEnumContext(Application::DrawImpress, Context_DrawText): + case CombinedEnumContext(Application::DrawImpress, Context_Text): + case CombinedEnumContext(Application::DrawImpress, Context_Table): + case CombinedEnumContext(Application::DrawImpress, Context_OutlineText): + case CombinedEnumContext(Application::DrawImpress, Context_Draw): + case CombinedEnumContext(Application::DrawImpress, Context_TextObject): + case CombinedEnumContext(Application::DrawImpress, Context_Graphic): bNeedTextSpacing = true; bDrawText = true; break; - case CombinedEnumContext(Application_WriterVariants, Context_Text): - case CombinedEnumContext(Application_WriterVariants, Context_Table): + case CombinedEnumContext(Application::WriterVariants, Context_Text): + case CombinedEnumContext(Application::WriterVariants, Context_Table): bNeedTextSpacing = true; bWriterText = true; break; diff --git a/vcl/source/window/EnumContext.cxx b/vcl/source/window/EnumContext.cxx index 80d35b625a13..98ebf3297c45 100644 --- a/vcl/source/window/EnumContext.cxx +++ b/vcl/source/window/EnumContext.cxx @@ -19,6 +19,7 @@ #include <vcl/EnumContext.hxx> #include <osl/diagnose.h> +#include <o3tl/enumarray.hxx> #include <map> @@ -29,7 +30,7 @@ namespace { typedef ::std::map<rtl::OUString,EnumContext::Application> ApplicationMap; static ApplicationMap maApplicationMap; -static ::std::vector<rtl::OUString> maApplicationVector; +static o3tl::enumarray<EnumContext::Application, rtl::OUString> maApplicationVector; typedef ::std::map<rtl::OUString,EnumContext::Context> ContextMap; @@ -42,7 +43,7 @@ const sal_Int32 EnumContext::NoMatch = 4; const sal_Int32 EnumContext::OptimalMatch = 0; // Neither application nor context name is "any". EnumContext::EnumContext() - : meApplication(Application_None), + : meApplication(Application::NONE), meContext(Context_Unknown) { } @@ -72,17 +73,17 @@ EnumContext::Application EnumContext::GetApplication_DI() const { switch (meApplication) { - case Application_Draw: - case Application_Impress: - return Application_DrawImpress; - - case Application_Writer: - case Application_WriterGlobal: - case Application_WriterWeb: - case Application_WriterXML: - case Application_WriterForm: - case Application_WriterReport: - return Application_WriterVariants; + case Application::Draw: + case Application::Impress: + return Application::DrawImpress; + + case Application::Writer: + case Application::WriterGlobal: + case Application::WriterWeb: + case Application::WriterXML: + case Application::WriterForm: + case Application::WriterReport: + return Application::WriterVariants; default: return meApplication; @@ -104,9 +105,7 @@ bool EnumContext::operator!= (const EnumContext& rOther) void EnumContext::AddEntry (const ::rtl::OUString& rsName, const Application eApplication) { maApplicationMap[rsName] = eApplication; - OSL_ASSERT(eApplication<=LastApplicationEnum); - if (maApplicationVector.size() <= size_t(eApplication)) - maApplicationVector.resize(eApplication+1); + OSL_ASSERT(eApplication<=Application::LAST); maApplicationVector[eApplication]=rsName; } @@ -114,20 +113,19 @@ void EnumContext::ProvideApplicationContainers() { if (maApplicationMap.empty()) { - maApplicationVector.resize(static_cast<size_t>(EnumContext::LastApplicationEnum)+1); - AddEntry("com.sun.star.text.TextDocument", EnumContext::Application_Writer); - AddEntry("com.sun.star.text.GlobalDocument", EnumContext::Application_WriterGlobal); - AddEntry("com.sun.star.text.WebDocument", EnumContext::Application_WriterWeb); - AddEntry("com.sun.star.xforms.XMLFormDocument", EnumContext::Application_WriterXML); - AddEntry("com.sun.star.sdb.FormDesign", EnumContext::Application_WriterForm); - AddEntry("com.sun.star.sdb.TextReportDesign", EnumContext::Application_WriterReport); - AddEntry("com.sun.star.sheet.SpreadsheetDocument", EnumContext::Application_Calc); - AddEntry("com.sun.star.chart2.ChartDocument", EnumContext::Application_Chart); - AddEntry("com.sun.star.drawing.DrawingDocument", EnumContext::Application_Draw); - AddEntry("com.sun.star.presentation.PresentationDocument", EnumContext::Application_Impress); - - AddEntry("any", EnumContext::Application_Any); - AddEntry("none", EnumContext::Application_None); + AddEntry("com.sun.star.text.TextDocument", EnumContext::Application::Writer); + AddEntry("com.sun.star.text.GlobalDocument", EnumContext::Application::WriterGlobal); + AddEntry("com.sun.star.text.WebDocument", EnumContext::Application::WriterWeb); + AddEntry("com.sun.star.xforms.XMLFormDocument", EnumContext::Application::WriterXML); + AddEntry("com.sun.star.sdb.FormDesign", EnumContext::Application::WriterForm); + AddEntry("com.sun.star.sdb.TextReportDesign", EnumContext::Application::WriterReport); + AddEntry("com.sun.star.sheet.SpreadsheetDocument", EnumContext::Application::Calc); + AddEntry("com.sun.star.chart2.ChartDocument", EnumContext::Application::Chart); + AddEntry("com.sun.star.drawing.DrawingDocument", EnumContext::Application::Draw); + AddEntry("com.sun.star.presentation.PresentationDocument", EnumContext::Application::Impress); + + AddEntry("any", EnumContext::Application::Any); + AddEntry("none", EnumContext::Application::NONE); } } @@ -140,27 +138,22 @@ EnumContext::Application EnumContext::GetApplicationEnum (const ::rtl::OUString& if (iApplication != maApplicationMap.end()) return iApplication->second; else - return EnumContext::Application_None; + return EnumContext::Application::NONE; } const ::rtl::OUString& EnumContext::GetApplicationName (const Application eApplication) { ProvideApplicationContainers(); - - const sal_Int32 nIndex (eApplication); - if (nIndex<0 || nIndex>= LastApplicationEnum) - return maApplicationVector[Application_None]; - else - return maApplicationVector[nIndex]; + return maApplicationVector[eApplication]; } -void EnumContext::AddEntry (const ::rtl::OUString& rsName, const Context eApplication) +void EnumContext::AddEntry (const ::rtl::OUString& rsName, const Context eContext) { - maContextMap[rsName] = eApplication; - OSL_ASSERT(eApplication<=LastContextEnum); - if (maContextVector.size() <= size_t(eApplication)) - maContextVector.resize(eApplication+1); - maContextVector[eApplication] = rsName; + maContextMap[rsName] = eContext; + OSL_ASSERT(eContext<=LastContextEnum); + if (maContextVector.size() <= size_t(eContext)) + maContextVector.resize(eContext+1); + maContextVector[eContext] = rsName; } void EnumContext::ProvideContextContainers() |