diff options
46 files changed, 304 insertions, 313 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index d40782f48920..0233edbbd7b2 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -120,7 +120,7 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const & m_eDrawMode( CHARTDRAW_SELECT ), mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this]() { return this->GetContextName(); }, - this, vcl::EnumContext::Context_Cell)) + this, vcl::EnumContext::Context::Cell)) { m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) ); } diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx index e0f19b002368..f96265c27278 100644 --- a/include/vcl/EnumContext.hxx +++ b/include/vcl/EnumContext.hxx @@ -61,53 +61,53 @@ public: LAST = Application::NONE }; - enum Context + enum class Context { - Context_3DObject, - Context_Annotation, - Context_Auditing, - Context_Axis, - Context_Cell, - Context_Chart, - Context_ChartElements, - Context_Draw, - Context_DrawLine, - Context_DrawPage, - Context_DrawText, - Context_EditCell, - Context_ErrorBar, - Context_Form, - Context_Frame, - Context_Graphic, - Context_Grid, - Context_HandoutPage, - Context_MasterPage, - Context_Media, - Context_MultiObject, - Context_NotesPage, - Context_OLE, - Context_OutlineText, - Context_Pivot, - Context_Series, - Context_SlidesorterPage, - Context_Table, - Context_Text, - Context_TextObject, - Context_Trendline, + ThreeDObject, + Annotation, + Auditing, + Axis, + Cell, + Chart, + ChartElements, + Draw, + DrawLine, + DrawPage, + DrawText, + EditCell, + ErrorBar, + Form, + Frame, + Graphic, + Grid, + HandoutPage, + MasterPage, + Media, + MultiObject, + NotesPage, + OLE, + OutlineText, + Pivot, + Series, + SlidesorterPage, + Table, + Text, + TextObject, + Trendline, // Default context of an application. Do we need this? - Context_Default, + Default, // Used only by deck or panel descriptors. Matches any context. - Context_Any, + Any, // Special context name that is only used when a deck would // otherwise be empty. - Context_Empty, + Empty, - Context_Unknown, + Unknown, - LastContextEnum = Context_Unknown + LAST = Unknown }; EnumContext(); diff --git a/include/vcl/IContext.hxx b/include/vcl/IContext.hxx index 446a845bbbfa..841c9d69e828 100644 --- a/include/vcl/IContext.hxx +++ b/include/vcl/IContext.hxx @@ -21,7 +21,7 @@ class VCL_DLLPUBLIC IContext protected: IContext() { - maContext.push_back( vcl::EnumContext::Context::Context_Any ); + maContext.push_back( vcl::EnumContext::Context::Any ); } public: diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 5f7e494e44d8..26563ac42c64 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -62,7 +62,7 @@ ScChartShell::ScChartShell(ScViewData* pData) : { SetHelpId( HID_SCSHELL_CHARTSH ); SetName( "ChartObject" ); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Chart)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Chart)); } ScChartShell::~ScChartShell() diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 9ae7fb2f8ece..5ec9cb43cf0c 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -58,7 +58,7 @@ ScDrawShell::ScDrawShell( ScViewData* pData ) : mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this] () { return this->GetSidebarContextName(); }, GetFrame()->GetFrame().GetController(), - vcl::EnumContext::Context_Cell)) + vcl::EnumContext::Context::Cell)) { SetPool( &pViewData->GetScDrawView()->GetModel()->GetItemPool() ); ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager(); diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx index cbfc149ba7a1..f96bc0f7bbf8 100644 --- a/sc/source/ui/drawfunc/drformsh.cxx +++ b/sc/source/ui/drawfunc/drformsh.cxx @@ -57,7 +57,7 @@ ScDrawFormShell::ScDrawFormShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_DRAWFORMSH); SetName("DrawForm"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Form)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Form)); } ScDrawFormShell::~ScDrawFormShell() diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index a8c8b34718e3..04668a68f92a 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -128,7 +128,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) : SetHelpId( HID_SCSHELL_DRTXTOB ); SetName("DrawText"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_DrawText)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::DrawText)); } ScDrawTextObjectBar::~ScDrawTextObjectBar() diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index d1875e7b4a49..59b4393a58ad 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -59,7 +59,7 @@ ScGraphicShell::ScGraphicShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_GRAPHIC); SetName("GraphicObject"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Graphic)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Graphic)); } ScGraphicShell::~ScGraphicShell() diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx index 546afd9aaff8..e68571c03abf 100644 --- a/sc/source/ui/drawfunc/mediash.cxx +++ b/sc/source/ui/drawfunc/mediash.cxx @@ -50,7 +50,7 @@ ScMediaShell::ScMediaShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_MEDIA); SetName( OUString( ScResId( SCSTR_MEDIASHELL ) ) ); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Media)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Media)); } ScMediaShell::~ScMediaShell() diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx index a108cdce45e9..da80a4976589 100644 --- a/sc/source/ui/drawfunc/oleobjsh.cxx +++ b/sc/source/ui/drawfunc/oleobjsh.cxx @@ -57,7 +57,7 @@ ScOleObjectShell::ScOleObjectShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_OLEOBEJCTSH); SetName("OleObject"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OLE)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::OLE)); } ScOleObjectShell::~ScOleObjectShell() diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx index bc94dd09b286..216d33c2a582 100644 --- a/sc/source/ui/view/auditsh.cxx +++ b/sc/source/ui/view/auditsh.cxx @@ -56,7 +56,7 @@ ScAuditingShell::ScAuditingShell(ScViewData* pData) : } SetHelpId( HID_SCSHELL_AUDIT ); SetName("Auditing"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Auditing)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Auditing)); } ScAuditingShell::~ScAuditingShell() diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 50628caadfcc..98254a257732 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -82,7 +82,7 @@ ScCellShell::ScCellShell(ScViewData* pData, VclPtr<vcl::Window> frameWin) : { SetHelpId(HID_SCSHELL_CELLSH); SetName("Cell"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Cell)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Cell)); } ScCellShell::~ScCellShell() diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 1e1aae092de0..bb005969f793 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -99,7 +99,7 @@ ScEditShell::ScEditShell(EditView* pView, ScViewData* pData) : SetPool( pEditView->GetEditEngine()->GetEmptyItemSet().GetPool() ); SetUndoManager( &pEditView->GetEditEngine()->GetUndoManager() ); SetName("EditCell"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_EditCell)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::EditCell)); } ScEditShell::~ScEditShell() diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index b86a21876bd6..e99b0a658205 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -65,7 +65,7 @@ ScPivotShell::ScPivotShell( ScTabViewShell* pViewSh ) : } SetHelpId( HID_SCSHELL_PIVOTSH ); SetName("Pivot"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Pivot)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Pivot)); } ScPivotShell::~ScPivotShell() diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 7401b0b3a1c3..de54fd3ff512 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -218,7 +218,7 @@ void ScTabViewShell::Activate(bool bMDI) ContextChangeEventMultiplexer::NotifyContextChange( GetController(), - vcl::EnumContext::Context_Default); + vcl::EnumContext::Context::Default); } void ScTabViewShell::Deactivate(bool bMDI) diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 6673ee838ec3..78c204f9ee35 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -392,13 +392,13 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener, if(!mbTitle) { vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application::Draw, - vcl::EnumContext::Context_DrawPage); + vcl::EnumContext::Context::DrawPage); vcl::EnumContext aDrawMasterContext(vcl::EnumContext::Application::Draw, - vcl::EnumContext::Context_MasterPage); + vcl::EnumContext::Context::MasterPage); vcl::EnumContext aImpressOtherContext(vcl::EnumContext::Application::Impress, - vcl::EnumContext::Context_DrawPage); + vcl::EnumContext::Context::DrawPage); vcl::EnumContext aImpressMasterContext(vcl::EnumContext::Application::Impress, - vcl::EnumContext::Context_MasterPage); + vcl::EnumContext::Context::MasterPage); if(maContext == aDrawOtherContext || maContext == aDrawMasterContext) { mpMasterLabel->SetText(SD_RESSTR(STR_MASTERPAGE_NAME)); diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 681385ac93fe..6190a6007168 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -464,7 +464,7 @@ void SlideSorterViewShell::Activate (bool bIsMDIActivate) ArrangeGUIElements(); // Determine and broadcast the context that belongs to the main view shell. - EnumContext::Context eContext = EnumContext::Context_Unknown; + EnumContext::Context eContext = EnumContext::Context::Unknown; std::shared_ptr<ViewShell> pMainViewShell (GetViewShellBase().GetMainViewShell()); ViewShell::ShellType eMainViewShellType ( pMainViewShell @@ -476,7 +476,7 @@ void SlideSorterViewShell::Activate (bool bIsMDIActivate) case ViewShell::ST_SLIDE_SORTER: case ViewShell::ST_NOTES: case ViewShell::ST_DRAW: - eContext = EnumContext::Context_DrawPage; + eContext = EnumContext::Context::DrawPage; if( nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index 1ded42c755c9..e6c516512086 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -93,7 +93,7 @@ TableObjectBar::TableObjectBar( ViewShell* pSdViewShell, ::sd::View* pSdView ) SetRepeatTarget( mpView ); SetHelpId( SD_IF_SDDRAWTABLEOBJECTBAR ); SetName( SD_RESSTR( RID_DRAW_TABLE_TOOLBOX ) ); - SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Table)); + SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Table)); } TableObjectBar::~TableObjectBar() diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index a34d55b15092..446cad75ba2f 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -510,37 +510,37 @@ void DrawController::BroadcastContextChange() const if ( ! pViewShell) return; - EnumContext::Context eContext (EnumContext::Context_Unknown); + EnumContext::Context eContext (EnumContext::Context::Unknown); switch (pViewShell->GetShellType()) { case ViewShell::ST_IMPRESS: case ViewShell::ST_DRAW: if (mbMasterPageMode) - eContext = EnumContext::Context_MasterPage; + eContext = EnumContext::Context::MasterPage; else - eContext = EnumContext::Context_DrawPage; + eContext = EnumContext::Context::DrawPage; break; case ViewShell::ST_NOTES: - eContext = EnumContext::Context_NotesPage; + eContext = EnumContext::Context::NotesPage; break; case ViewShell::ST_HANDOUT: - eContext = EnumContext::Context_HandoutPage; + eContext = EnumContext::Context::HandoutPage; break; case ViewShell::ST_OUTLINE: - eContext = EnumContext::Context_OutlineText; + eContext = EnumContext::Context::OutlineText; break; case ViewShell::ST_SLIDE_SORTER: - eContext = EnumContext::Context_SlidesorterPage; + eContext = EnumContext::Context::SlidesorterPage; break; case ViewShell::ST_PRESENTATION: case ViewShell::ST_NONE: default: - eContext = EnumContext::Context_Empty; + eContext = EnumContext::Context::Empty; break; } diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 17b136025af7..5257e60796b3 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -109,7 +109,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas , mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this] () { return this->GetSidebarContextName(); }, uno::Reference<frame::XController>(&rViewShellBase.GetDrawController()), - vcl::EnumContext::Context_Default)) + vcl::EnumContext::Context::Default)) { if (pFrameViewArgument != nullptr) mpFrameView = pFrameViewArgument; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index b6200179769e..6ffd4d6384df 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -203,7 +203,7 @@ OutlineViewShell::OutlineViewShell ( Construct(GetDocSh()); - SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OutlineText)); + SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::OutlineText)); m_StrOldPageName.clear(); diff --git a/sfx2/source/notebookbar/ContextVBox.cxx b/sfx2/source/notebookbar/ContextVBox.cxx index 64de1cab2a48..8723cc458c2e 100644 --- a/sfx2/source/notebookbar/ContextVBox.cxx +++ b/sfx2/source/notebookbar/ContextVBox.cxx @@ -50,7 +50,7 @@ public: { VclContainer* pChild = static_cast<VclContainer*>( GetChild( nChild ) ); - if ( pChild->HasContext( eContext ) || pChild->HasContext( vcl::EnumContext::Context::Context_Any ) ) + if ( pChild->HasContext( eContext ) || pChild->HasContext( vcl::EnumContext::Context::Any ) ) { Size aSize( pChild->GetOptimalSize() ); aSize.Height() += 6; diff --git a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx index 0a1bbe044bba..bdbf62defb36 100644 --- a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx +++ b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx @@ -58,7 +58,7 @@ void ContextChangeBroadcaster::Deactivate (const css::uno::Reference<css::frame: BroadcastContextChange( rxFrame, GetModuleName(rxFrame), - vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Default)); + vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Default)); } } diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 2095acf6db15..9e0f0003ecf1 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -517,7 +517,7 @@ void ResourceManager::ReadContextList ( // Setup the actual context enum. const vcl::EnumContext::Context eContext (vcl::EnumContext::GetContextEnum(sContextName)); - if (eContext == vcl::EnumContext::Context_Unknown) + if (eContext == vcl::EnumContext::Context::Unknown) { SAL_WARN("sfx.sidebar", "context name " << sContextName << " not recognized"); continue; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index f048a7a5b0f8..840d7531e1c5 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -689,14 +689,14 @@ void SidebarController::SwitchToDeck ( if (aPanelContextDescriptors.empty()) { // There are no panels to be displayed in the current context. - if (vcl::EnumContext::GetContextEnum(rContext.msContext) != vcl::EnumContext::Context_Empty) + if (vcl::EnumContext::GetContextEnum(rContext.msContext) != vcl::EnumContext::Context::Empty) { // Switch to the "empty" context and try again. SwitchToDeck( rDeckDescriptor, Context( rContext.msApplication, - vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Empty))); + vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Empty))); return; } else diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index d77c903ad0ea..7ee232f22528 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -32,12 +32,12 @@ namespace svx { namespace sidebar { EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMarkList& rMarkList) { - EnumContext::Context eContext = EnumContext::Context_Unknown; + EnumContext::Context eContext = EnumContext::Context::Unknown; switch (rMarkList.GetMarkCount()) { case 0: - // Empty selection. Return Context_Unknown to let the caller + // Empty selection. Return Context::Unknown to let the caller // substitute it with the default context. break; @@ -46,7 +46,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && static_cast<SdrTextObj*>(pObj)->IsInEditMode() ) { - eContext = EnumContext::Context_DrawText; + eContext = EnumContext::Context::DrawText; } else { @@ -55,7 +55,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark if (nInv == SdrInventor::Default) eContext = GetContextForObjectId_SC(nObjId); else if (nInv == SdrInventor::FmForm) - eContext = EnumContext::Context_Form; + eContext = EnumContext::Context::Form; } break; } @@ -69,18 +69,18 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark { const sal_uInt16 nObjId (GetObjectTypeFromMark(rMarkList)); if (nObjId == 0) - eContext = EnumContext::Context_MultiObject; + eContext = EnumContext::Context::MultiObject; else eContext = GetContextForObjectId_SC(nObjId); break; } case SdrInventor::FmForm: - eContext = EnumContext::Context_Form; + eContext = EnumContext::Context::Form; break; case SdrInventor::Unknown: - eContext = EnumContext::Context_MultiObject; + eContext = EnumContext::Context::MultiObject; break; default: break; @@ -96,7 +96,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( const SdrMarkList& rMarkList, const ViewType eViewType) { - EnumContext::Context eContext = EnumContext::Context_Unknown; + EnumContext::Context eContext = EnumContext::Context::Unknown; // Note that some cases are handled by the caller. They rely on // sd specific data. @@ -106,19 +106,19 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( switch(eViewType) { case ViewType::Standard: - eContext = EnumContext::Context_DrawPage; + eContext = EnumContext::Context::DrawPage; break; case ViewType::Master: - eContext = EnumContext::Context_MasterPage; + eContext = EnumContext::Context::MasterPage; break; case ViewType::Handout: - eContext = EnumContext::Context_HandoutPage; + eContext = EnumContext::Context::HandoutPage; break; case ViewType::Notes: - eContext = EnumContext::Context_NotesPage; + eContext = EnumContext::Context::NotesPage; break; case ViewType::Outline: - eContext = EnumContext::Context_OutlineText; + eContext = EnumContext::Context::OutlineText; break; } break; @@ -133,10 +133,10 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( // Let a table object take precedence over text // edit mode. The panels for text editing are // present for table context as well, anyway. - eContext = EnumContext::Context_Table; + eContext = EnumContext::Context::Table; } else - eContext = EnumContext::Context_DrawText; + eContext = EnumContext::Context::DrawText; } else { @@ -154,11 +154,11 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( } else if (nInv == SdrInventor::E3d) { - eContext = EnumContext::Context_3DObject; + eContext = EnumContext::Context::ThreeDObject; } else if (nInv == SdrInventor::FmForm) { - eContext = EnumContext::Context_Form; + eContext = EnumContext::Context::Form; } } break; @@ -172,22 +172,22 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( { const sal_uInt16 nObjId = GetObjectTypeFromMark(rMarkList); if (nObjId == 0) - eContext = EnumContext::Context_MultiObject; + eContext = EnumContext::Context::MultiObject; else eContext = GetContextForObjectId_SD(nObjId, eViewType); break; } case SdrInventor::E3d: - eContext = EnumContext::Context_3DObject; + eContext = EnumContext::Context::ThreeDObject; break; case SdrInventor::FmForm: - eContext = EnumContext::Context_Form; + eContext = EnumContext::Context::Form; break; case SdrInventor::Unknown: - eContext = EnumContext::Context_MultiObject; + eContext = EnumContext::Context::MultiObject; break; default: break; @@ -220,27 +220,27 @@ EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SC (const sal_uInt case OBJ_CCUT: case OBJ_CUSTOMSHAPE: case OBJ_GRUP: - return EnumContext::Context_Draw; + return EnumContext::Context::Draw; case OBJ_PLIN: case OBJ_PATHLINE: case OBJ_FREELINE: case OBJ_LINE: case OBJ_EDGE: - return EnumContext::Context_DrawLine; + return EnumContext::Context::DrawLine; case OBJ_GRAF: - return EnumContext::Context_Graphic; + return EnumContext::Context::Graphic; case OBJ_OLE2: - return EnumContext::Context_OLE; + return EnumContext::Context::OLE; case OBJ_MEDIA: - return EnumContext::Context_Media; + return EnumContext::Context::Media; break; default: - return EnumContext::Context_Unknown; + return EnumContext::Context::Unknown; } } @@ -263,48 +263,48 @@ EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SD ( case OBJ_CCUT: case OBJ_CUSTOMSHAPE: case OBJ_GRUP: - return EnumContext::Context_Draw; + return EnumContext::Context::Draw; case OBJ_EDGE: case OBJ_PATHLINE: case OBJ_FREELINE: case OBJ_PLIN: case OBJ_LINE: - return EnumContext::Context_DrawLine; + return EnumContext::Context::DrawLine; case OBJ_TITLETEXT: case OBJ_OUTLINETEXT: case OBJ_TEXT: case OBJ_TEXTEXT: - return EnumContext::Context_TextObject; + return EnumContext::Context::TextObject; case OBJ_GRAF: - return EnumContext::Context_Graphic; + return EnumContext::Context::Graphic; case OBJ_OLE2: - return EnumContext::Context_OLE; + return EnumContext::Context::OLE; case OBJ_MEDIA: - return EnumContext::Context_Media; + return EnumContext::Context::Media; case OBJ_TABLE: - return EnumContext::Context_Table; + return EnumContext::Context::Table; case OBJ_PAGE: switch (eViewType) { case ViewType::Handout: - return EnumContext::Context_HandoutPage; + return EnumContext::Context::HandoutPage; case ViewType::Notes: - return EnumContext::Context_NotesPage; + return EnumContext::Context::NotesPage; case ViewType::Outline: - return EnumContext::Context_OutlineText; + return EnumContext::Context::OutlineText; default: - return EnumContext::Context_Unknown; + return EnumContext::Context::Unknown; } default: - return EnumContext::Context_Unknown; + return EnumContext::Context::Unknown; } } diff --git a/svx/source/sidebar/SelectionChangeHandler.cxx b/svx/source/sidebar/SelectionChangeHandler.cxx index 76430afbd6b0..e00a015d34b2 100644 --- a/svx/source/sidebar/SelectionChangeHandler.cxx +++ b/svx/source/sidebar/SelectionChangeHandler.cxx @@ -57,7 +57,7 @@ void SAL_CALL SelectionChangeHandler::selectionChanged (const lang::EventObject& vcl::EnumContext::GetContextEnum(maSelectionChangeCallback())); ContextChangeEventMultiplexer::NotifyContextChange( mxController, - eContext==vcl::EnumContext::Context_Unknown + eContext==vcl::EnumContext::Context::Unknown ? meDefaultContext : eContext); } diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index e3f26039ff7d..85bb09bf8083 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 3ee1dd4e50a3..73099ed8509b 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 13e96ce3404c..3ece38aa122a 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -82,52 +82,52 @@ 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: @@ -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 e822d2224709..9ebea6a25c98 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 89b9a00efe04..5861e13e6487 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::ThreeDObject): + 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 95bd906321ff..cad648cbf3d6 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/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index ae7f5c63fa89..4489deb9aab8 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -156,7 +156,7 @@ SwAnnotationShell::SwAnnotationShell( SwView& r ) : rView(r) { SetPool(SwAnnotationShell::GetAnnotationPool(rView)); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Annotation)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Annotation)); } SwAnnotationShell::~SwAnnotationShell() diff --git a/sw/source/uibase/shells/beziersh.cxx b/sw/source/uibase/shells/beziersh.cxx index 088197253f0b..80a451929924 100644 --- a/sw/source/uibase/shells/beziersh.cxx +++ b/sw/source/uibase/shells/beziersh.cxx @@ -63,7 +63,7 @@ SwBezierShell::SwBezierShell(SwView &_rView): SdrView* pSdrView = pSh->GetDrawView(); pSdrView->SetEliminatePolyPointLimitAngle(1500L); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Draw)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Draw)); } void SwBezierShell::Execute(SfxRequest &rReq) diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index fc424d73bbbc..95af0166fc97 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -538,7 +538,7 @@ SwDrawShell::SwDrawShell(SwView &_rView) : SetHelpId(SW_DRAWSHELL); SetName("Draw"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Draw)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Draw)); } // Edit SfxRequests for FontWork diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx index 8d4c678ca8c3..8b21b6338a83 100644 --- a/sw/source/uibase/shells/drformsh.cxx +++ b/sw/source/uibase/shells/drformsh.cxx @@ -250,7 +250,7 @@ SwDrawFormShell::SwDrawFormShell(SwView &_rView) : SetHelpId(SW_DRAWFORMSHELL); GetShell().NoEdit(); SetName("DrawForm"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Form)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Form)); } SwDrawFormShell::~SwDrawFormShell() diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index b2520f5980f1..4cadee411d4e 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -134,7 +134,7 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) : rSh.NoEdit(); SetName("ObjectText"); SetHelpId(SW_DRWTXTSHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_DrawText)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::DrawText)); } SwDrawTextShell::~SwDrawTextShell() diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 66fd5a567e31..4631e6cd6b6b 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -966,7 +966,7 @@ SwFrameShell::SwFrameShell(SwView &_rView) : // #96392# Use this to announce it is the frame shell who creates the selection. SwTransferable::CreateSelection( _rView.GetWrtShell(), this ); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Frame)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Frame)); } SwFrameShell::~SwFrameShell() diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 7f2eea848106..73064dff0787 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -945,7 +945,7 @@ SwGrfShell::SwGrfShell(SwView &_rView) : { SetName("Graphic"); SetHelpId(SW_GRFSHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Graphic)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Graphic)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx index 51f18658990e..b389c0cb972a 100644 --- a/sw/source/uibase/shells/mediash.cxx +++ b/sw/source/uibase/shells/mediash.cxx @@ -192,7 +192,7 @@ SwMediaShell::SwMediaShell(SwView &_rView) : { SetName("Media Playback"); SetHelpId(SW_MEDIASHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Media)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Media)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/olesh.cxx b/sw/source/uibase/shells/olesh.cxx index ae67572a2775..328df3c62feb 100644 --- a/sw/source/uibase/shells/olesh.cxx +++ b/sw/source/uibase/shells/olesh.cxx @@ -52,7 +52,7 @@ SwOleShell::SwOleShell(SwView &_rView) : { SetName("Object"); SetHelpId(SW_OLESHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OLE)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::OLE)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index b2286fa09538..8c63736cf151 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1406,7 +1406,7 @@ SwTableShell::SwTableShell(SwView &_rView) : { SetName("Table"); SetHelpId(SW_TABSHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Table)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Table)); } void SwTableShell::GetFrameBorderState(SfxItemSet &rSet) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index ca6dc13eaf39..d12e0c68fcec 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -834,7 +834,7 @@ SwTextShell::SwTextShell(SwView &_rView) : { SetName("Text"); SetHelpId(SW_TEXTSHELL); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Text)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Text)); } SwTextShell::~SwTextShell() diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 0dc66120df89..ee31141867f6 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2209,7 +2209,7 @@ sal_uInt16 NotebookbarTabControl::m_nHeaderHeight = 0; NotebookbarTabControl::NotebookbarTabControl(vcl::Window* pParent) : TabControl(pParent, WB_STDTABCONTROL) , bLastContextWasSupported(true) - , eLastContext(vcl::EnumContext::Context::Context_Any) + , eLastContext(vcl::EnumContext::Context::Any) { LanguageTag aLocale( Application::GetSettings().GetUILanguageTag()); ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "vcl", aLocale ); @@ -2232,18 +2232,18 @@ void NotebookbarTabControl::SetContext( vcl::EnumContext::Context eContext ) { TabPage* pPage = static_cast<TabPage*>(GetChild(nChild)); - if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Context_Any)) + if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Any)) EnablePage(nChild + 2); else EnablePage(nChild + 2, false); if (!bHandled && bLastContextWasSupported - && pPage->HasContext(vcl::EnumContext::Context::Context_Default)) + && pPage->HasContext(vcl::EnumContext::Context::Default)) { SetCurPageId(nChild + 2); } - if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Context_Any) + if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Any) { SetCurPageId(nChild + 2); bHandled = true; @@ -2367,7 +2367,7 @@ bool NotebookbarTabControl::ImplPlaceTabs( long nWidth ) mbSmallInvalidate = false; // don't show empty space when tab is hidden, move next tabs to the left - if ( it->mpTabPage && !it->mpTabPage->HasContext(vcl::EnumContext::Context_Any) ) + if ( it->mpTabPage && !it->mpTabPage->HasContext(vcl::EnumContext::Context::Any) ) { aNewRect.setX(aNewRect.getX() - nHiddenWidth); nHiddenWidth += aNewRect.getWidth(); diff --git a/vcl/source/window/EnumContext.cxx b/vcl/source/window/EnumContext.cxx index 98ebf3297c45..f2e46f1cf1ba 100644 --- a/vcl/source/window/EnumContext.cxx +++ b/vcl/source/window/EnumContext.cxx @@ -35,7 +35,7 @@ static o3tl::enumarray<EnumContext::Application, rtl::OUString> maApplicationVec typedef ::std::map<rtl::OUString,EnumContext::Context> ContextMap; static ContextMap maContextMap; -static ::std::vector<rtl::OUString> maContextVector; +static o3tl::enumarray<EnumContext::Context, rtl::OUString> maContextVector; } @@ -44,7 +44,7 @@ const sal_Int32 EnumContext::OptimalMatch = 0; // Neither application nor conte EnumContext::EnumContext() : meApplication(Application::NONE), - meContext(Context_Unknown) + meContext(Context::Unknown) { } @@ -150,9 +150,6 @@ const ::rtl::OUString& EnumContext::GetApplicationName (const Application eAppli void EnumContext::AddEntry (const ::rtl::OUString& rsName, const Context eContext) { maContextMap[rsName] = eContext; - OSL_ASSERT(eContext<=LastContextEnum); - if (maContextVector.size() <= size_t(eContext)) - maContextVector.resize(eContext+1); maContextVector[eContext] = rsName; } @@ -160,41 +157,40 @@ void EnumContext::ProvideContextContainers() { if (maContextMap.empty()) { - maContextVector.resize(static_cast<size_t>(LastContextEnum)+1); - AddEntry("any", Context_Any); - AddEntry("default", Context_Default); - AddEntry("empty", Context_Empty); - AddEntry("3DObject", Context_3DObject); - AddEntry("Annotation", Context_Annotation); - AddEntry("Auditing", Context_Auditing); - AddEntry("Axis", Context_Axis); - AddEntry("Cell", Context_Cell); - AddEntry("Chart", Context_Chart); - AddEntry("ChartElements", Context_ChartElements); - AddEntry("Draw", Context_Draw); - AddEntry("DrawLine", Context_DrawLine); - AddEntry("DrawPage", Context_DrawPage); - AddEntry("DrawText", Context_DrawText); - AddEntry("EditCell", Context_EditCell); - AddEntry("ErrorBar", Context_ErrorBar); - AddEntry("Form", Context_Form); - AddEntry("Frame", Context_Frame); - AddEntry("Graphic", Context_Graphic); - AddEntry("Grid", Context_Grid); - AddEntry("HandoutPage", Context_HandoutPage); - AddEntry("MasterPage", Context_MasterPage); - AddEntry("Media", Context_Media); - AddEntry("MultiObject", Context_MultiObject); - AddEntry("NotesPage", Context_NotesPage); - AddEntry("OLE", Context_OLE); - AddEntry("OutlineText", Context_OutlineText); - AddEntry("Pivot", Context_Pivot); - AddEntry("Series", Context_Series); - AddEntry("SlidesorterPage", Context_SlidesorterPage); - AddEntry("Table", Context_Table); - AddEntry("Text", Context_Text); - AddEntry("TextObject", Context_TextObject); - AddEntry("Trendline", Context_Trendline); + AddEntry("any", Context::Any); + AddEntry("default", Context::Default); + AddEntry("empty", Context::Empty); + AddEntry("3DObject", Context::ThreeDObject); + AddEntry("Annotation", Context::Annotation); + AddEntry("Auditing", Context::Auditing); + AddEntry("Axis", Context::Axis); + AddEntry("Cell", Context::Cell); + AddEntry("Chart", Context::Chart); + AddEntry("ChartElements", Context::ChartElements); + AddEntry("Draw", Context::Draw); + AddEntry("DrawLine", Context::DrawLine); + AddEntry("DrawPage", Context::DrawPage); + AddEntry("DrawText", Context::DrawText); + AddEntry("EditCell", Context::EditCell); + AddEntry("ErrorBar", Context::ErrorBar); + AddEntry("Form", Context::Form); + AddEntry("Frame", Context::Frame); + AddEntry("Graphic", Context::Graphic); + AddEntry("Grid", Context::Grid); + AddEntry("HandoutPage", Context::HandoutPage); + AddEntry("MasterPage", Context::MasterPage); + AddEntry("Media", Context::Media); + AddEntry("MultiObject", Context::MultiObject); + AddEntry("NotesPage", Context::NotesPage); + AddEntry("OLE", Context::OLE); + AddEntry("OutlineText", Context::OutlineText); + AddEntry("Pivot", Context::Pivot); + AddEntry("Series", Context::Series); + AddEntry("SlidesorterPage", Context::SlidesorterPage); + AddEntry("Table", Context::Table); + AddEntry("Text", Context::Text); + AddEntry("TextObject", Context::TextObject); + AddEntry("Trendline", Context::Trendline); } } @@ -206,18 +202,13 @@ EnumContext::Context EnumContext::GetContextEnum (const ::rtl::OUString& rsConte if (iContext != maContextMap.end()) return iContext->second; else - return EnumContext::Context_Unknown; + return EnumContext::Context::Unknown; } const ::rtl::OUString& EnumContext::GetContextName (const Context eContext) { ProvideContextContainers(); - - const sal_Int32 nIndex (eContext); - if (nIndex<0 || nIndex>= LastContextEnum) - return maContextVector[Context_Unknown]; - else - return maContextVector[nIndex]; + return maContextVector[eContext]; } } // end of namespace vcl |