summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-11 12:45:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-11 14:32:40 +0200
commit4caacff9f25498c07d9b99fe0b5db82baa58a22c (patch)
treef828aba3333c82e5becb56706cdfeb7ce7d0461a /sd
parentd58c604eb35a84b849079d3a690d0a4f428d3121 (diff)
convert EditMode to scoped enum
Change-Id: I7c48978f3e2c173a2ec53eb6559745deeee9b93b
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/pres.hxx6
-rw-r--r--sd/source/filter/ppt/pptin.cxx6
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx2
-rw-r--r--sd/source/ui/docshell/docshel4.cxx4
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx4
-rw-r--r--sd/source/ui/func/fuinsfil.cxx2
-rw-r--r--sd/source/ui/func/fuolbull.cxx2
-rw-r--r--sd/source/ui/func/fupage.cxx2
-rw-r--r--sd/source/ui/func/fuprlout.cxx2
-rw-r--r--sd/source/ui/func/futempl.cxx2
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx2
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx2
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx8
-rw-r--r--sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx14
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx6
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx10
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx6
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
-rw-r--r--sd/source/ui/view/Outliner.cxx8
-rw-r--r--sd/source/ui/view/OutlinerIterator.cxx38
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx6
-rw-r--r--sd/source/ui/view/drawview.cxx4
-rw-r--r--sd/source/ui/view/drtxtob.cxx2
-rw-r--r--sd/source/ui/view/drviews1.cxx36
-rw-r--r--sd/source/ui/view/drviews2.cxx8
-rw-r--r--sd/source/ui/view/drviews3.cxx22
-rw-r--r--sd/source/ui/view/drviews7.cxx10
-rw-r--r--sd/source/ui/view/drviewsa.cxx10
-rw-r--r--sd/source/ui/view/drviewsb.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx4
-rw-r--r--sd/source/ui/view/frmview.cxx12
-rw-r--r--sd/source/ui/view/tabcontr.cxx2
38 files changed, 136 insertions, 138 deletions
diff --git a/sd/inc/pres.hxx b/sd/inc/pres.hxx
index 9a5edf2fe692..367e631c6ac7 100644
--- a/sd/inc/pres.hxx
+++ b/sd/inc/pres.hxx
@@ -108,10 +108,10 @@ enum PageKind
PK_HANDOUT
};
-enum EditMode
+enum class EditMode
{
- EM_PAGE,
- EM_MASTERPAGE
+ Page,
+ MasterPage
};
enum class DocumentType
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index bd7ce099cce7..f2268ebd56ac 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -1236,7 +1236,7 @@ bool ImplSdPPTImport::Import()
{
sal_uInt16 nSelectedPage = 0;
PageKind ePageKind = PK_STANDARD;
- EditMode eEditMode = EM_PAGE;
+ EditMode eEditMode = EditMode::Page;
switch ( aUserEditAtom.eLastViewType )
{
@@ -1260,11 +1260,11 @@ bool ImplSdPPTImport::Import()
case 2 : // master
{
ePageKind = PK_STANDARD;
- eEditMode = EM_MASTERPAGE;
+ eEditMode = EditMode::MasterPage;
}
break;
case 5 : // notes master
- eEditMode = EM_MASTERPAGE;
+ eEditMode = EditMode::MasterPage;
SAL_FALLTHROUGH;
case 3 : // notes
ePageKind = PK_NOTES;
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index fa323202b056..a1d14c93463c 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -674,7 +674,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
std::shared_ptr<DrawViewShell> pDrawViewShell(std::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
if (pDrawViewShell.get() != nullptr)
{
- pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EM_MASTERPAGE : EM_PAGE, false);
+ pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EditMode::MasterPage : EditMode::Page, false);
pDrawViewShell->SwitchPage((pPage->GetPageNum() - 1) >> 1);
SfxDispatcher* pDispatcher = getDispatcher( mrBase );
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index be2b4f56b9de..db6cc723ab7a 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -1092,10 +1092,10 @@ void DrawDocShell::setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage)
{
// Set the edit mode to either the normal edit mode or the
// master page mode.
- EditMode eNewEditMode = EM_PAGE;
+ EditMode eNewEditMode = EditMode::Page;
if (isMasterPage)
{
- eNewEditMode = EM_MASTERPAGE;
+ eNewEditMode = EditMode::MasterPage;
}
if (eNewEditMode != pDrawViewShell->GetEditMode())
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 7c9efb6af117..58f510f4f629 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -620,11 +620,11 @@ void FrameworkHelper::HandleModeChangeSlot (
}
// Compute requested mode
- EditMode eEMode = EM_PAGE;
+ EditMode eEMode = EditMode::Page;
if (nSlotId == SID_SLIDE_MASTER_MODE
|| nSlotId == SID_NOTES_MASTER_MODE
|| nSlotId == SID_HANDOUT_MASTER_MODE)
- eEMode = EM_MASTERPAGE;
+ eEMode = EditMode::MasterPage;
// Ensure we have the expected view shell
if (!(xView.is() && xView->getResourceId()->getResourceURL().equals(sRequestedView)))
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 23cca70afc76..00da1d6d9e1b 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -466,7 +466,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
else
{
// is it a master page?
- if (static_cast<DrawViewShell*>(mpViewShell)->GetEditMode() == EM_MASTERPAGE &&
+ if (static_cast<DrawViewShell*>(mpViewShell)->GetEditMode() == EditMode::MasterPage &&
!pPage->IsMasterPage())
{
pPage = static_cast<SdPage*>(&(pPage->TRG_GetMasterPage()));
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index b4f250d958d1..8906e7a82fb3 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -158,7 +158,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
const DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
//Init bullet level in "Customize" tab page in bullet dialog in master page view
- const bool bInMasterView = pDrawViewShell && pDrawViewShell->GetEditMode() == EM_MASTERPAGE;
+ const bool bInMasterView = pDrawViewShell && pDrawViewShell->GetEditMode() == EditMode::MasterPage;
if ( bInMasterView )
{
SdrObject* pObj = mpView->GetTextEditObject();
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index fd80f93c3b9e..2ed902540658 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -133,7 +133,7 @@ void FuPage::DoExecute( SfxRequest& )
if( mpDrawViewShell )
{
- mbMasterPage = mpDrawViewShell->GetEditMode() == EM_MASTERPAGE;
+ mbMasterPage = mpDrawViewShell->GetEditMode() == EditMode::MasterPage;
// we don't really want to format page background with SID_ATTR_PAGE[_SIZE] slots
mbDisplayBackgroundTabPage = ( mpDrawViewShell->GetPageKind() == PK_STANDARD) &&
( nSlotId != SID_ATTR_PAGE_SIZE) && ( nSlotId != SID_ATTR_PAGE );
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index b10fb9882170..edb39f5b8961 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -94,7 +94,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
if (DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell))
{
EditMode eEditMode = pShell->GetEditMode();
- if (eEditMode == EM_MASTERPAGE)
+ if (eEditMode == EditMode::MasterPage)
bOnMaster = true;
}
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 95dbd29d475d..02f8adcbf817 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -517,7 +517,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
{
SdPage* pPage = mpViewShell->GetActualPage();
- if(pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ if(pDrawViewShell->GetEditMode() == EditMode::MasterPage)
{
pPage = static_cast<SdPage*>((&(pPage->TRG_GetMasterPage())));
}
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index 71f4bd069bb7..94f62697545e 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -241,7 +241,7 @@ void CurrentMasterPagesSelector::ProcessPopupMenu (Menu& rMenu)
std::shared_ptr<DrawViewShell> pDrawViewShell (
std::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
if (pDrawViewShell
- && pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ && pDrawViewShell->GetEditMode() == EditMode::MasterPage)
{
if (rMenu.GetItemPos(SID_TP_EDIT_MASTER) != MENU_ITEM_NOTFOUND)
rMenu.EnableItem(SID_TP_EDIT_MASTER, false);
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 0db30c761f61..9169178ab18b 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -400,7 +400,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
if (pDrawViewShell != nullptr)
- if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ if (pDrawViewShell->GetEditMode() == EditMode::MasterPage)
bMasterPageMode = true;
break;
}
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index fcf4bf45e37a..2d1d3317e106 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -161,7 +161,7 @@ void SlideBackground::Initialize()
{
FrameView *pFrameView = pMainViewShell->GetFrameView();
- if ( pFrameView->GetViewShEditMode() == EM_PAGE )
+ if ( pFrameView->GetViewShEditMode() == EditMode::Page )
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
SdPage* mpPage = pDrawViewShell->getCurrentPage();
@@ -374,7 +374,7 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
EditMode eMode = pDrawViewShell->GetEditMode();
- if ( eMode == EM_MASTERPAGE)
+ if ( eMode == EditMode::MasterPage)
{
if( IsImpress() )
{
@@ -388,7 +388,7 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
mpDspMasterBackground->Disable();
mpDspMasterObjects->Disable();
}
- else // EM_PAGE
+ else // EditMode::Page
{
if( IsImpress() )
{
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 0b36058aadb4..c66987be6f8d 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -325,7 +325,7 @@ bool SlideSorterController::Command (
if (aSelectedPages.HasMoreElements())
pPage = aSelectedPages.GetNextElement()->GetPage();
- if (mrModel.GetEditMode() == EM_PAGE)
+ if (mrModel.GetEditMode() == EditMode::Page)
{
if (pPage != nullptr)
aPopupId = "pagepane";
@@ -740,7 +740,7 @@ void SlideSorterController::PrepareEditModeChange()
// Before we throw away the page descriptors we prepare for selecting
// descriptors in the other mode and for restoring the current
// selection when switching back to the current mode.
- if (mrModel.GetEditMode() == EM_PAGE)
+ if (mrModel.GetEditMode() == EditMode::Page)
{
maSelectionBeforeSwitch.clear();
@@ -784,7 +784,7 @@ void SlideSorterController::ChangeEditMode (EditMode eEditMode)
void SlideSorterController::FinishEditModeChange()
{
- if (mrModel.GetEditMode() == EM_MASTERPAGE)
+ if (mrModel.GetEditMode() == EditMode::MasterPage)
{
mpPageSelector->DeselectAllPages();
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 4dec3b3e5808..432ec42b2fd0 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -172,7 +172,7 @@ void Clipboard::HandleSlotCall (SfxRequest& rRequest)
switch (rRequest.GetSlot())
{
case SID_CUT:
- if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() != EditMode::MasterPage)
{
if(xFunc.is())
xFunc->DoCut();
@@ -183,7 +183,7 @@ void Clipboard::HandleSlotCall (SfxRequest& rRequest)
break;
case SID_COPY:
- if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() != EditMode::MasterPage)
{
if(xFunc.is())
xFunc->DoCopy();
@@ -197,7 +197,7 @@ void Clipboard::HandleSlotCall (SfxRequest& rRequest)
// Prevent redraws while inserting pages from the clipboard
// because the intermediate inconsistent state might lead to
// a crash.
- if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() != EditMode::MasterPage)
{
view::SlideSorterView::DrawLock aLock (mrSlideSorter);
SelectionObserver::Context aContext (mrSlideSorter);
@@ -847,7 +847,7 @@ Clipboard::DropType Clipboard::IsDropAccepted (DropTargetHelper&) const
if (pDragTransferable->IsPageTransferable())
{
- if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() != EditMode::MasterPage)
return DT_PAGE;
else
return DT_NONE;
diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index 4cca82bc1d00..cbaf2dab436c 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -44,7 +44,7 @@ DragAndDropContext::DragAndDropContext (SlideSorter& rSlideSorter)
mnInsertionIndex(-1)
{
// No Drag-and-Drop for master pages.
- if (rSlideSorter.GetModel().GetEditMode() != EM_PAGE)
+ if (rSlideSorter.GetModel().GetEditMode() != EditMode::Page)
return;
// For properly handling transferables created by the navigator we
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 03206dc3d715..1a78cb6d0e99 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -484,7 +484,7 @@ void SAL_CALL Listener::propertyChange (
bool bIsMasterPageMode = false;
rEvent.NewValue >>= bIsMasterPageMode;
mrController.ChangeEditMode (
- bIsMasterPageMode ? EM_MASTERPAGE : EM_PAGE);
+ bIsMasterPageMode ? EditMode::MasterPage : EditMode::Page);
}
}
@@ -547,7 +547,7 @@ void Listener::UpdateEditMode()
}
}
mrController.ChangeEditMode (
- bIsMasterPageMode ? EM_MASTERPAGE : EM_PAGE);
+ bIsMasterPageMode ? EditMode::MasterPage : EditMode::Page);
}
void Listener::HandleModelChange (const SdrPage* pPage)
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index b6135a34d43f..60fc8565dc03 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -118,7 +118,7 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
// helper functions. They are specialized for normal respectively for
// master pages.
mrSlideSorter.GetView().BegUndo (SdResId(STR_UNDO_DELETEPAGES));
- if (mrSlideSorter.GetModel().GetEditMode() == EM_PAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() == EditMode::Page)
DeleteSelectedNormalPages(aSelectedPages);
else
DeleteSelectedMasterPages(aSelectedPages);
@@ -150,7 +150,7 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
void SelectionManager::DeleteSelectedNormalPages (const ::std::vector<SdPage*>& rSelectedPages)
{
// Prepare the deletion via the UNO API.
- OSL_ASSERT(mrSlideSorter.GetModel().GetEditMode() == EM_PAGE);
+ OSL_ASSERT(mrSlideSorter.GetModel().GetEditMode() == EditMode::Page);
try
{
@@ -183,7 +183,7 @@ void SelectionManager::DeleteSelectedNormalPages (const ::std::vector<SdPage*>&
void SelectionManager::DeleteSelectedMasterPages (const ::std::vector<SdPage*>& rSelectedPages)
{
// Prepare the deletion via the UNO API.
- OSL_ASSERT(mrSlideSorter.GetModel().GetEditMode() == EM_MASTERPAGE);
+ OSL_ASSERT(mrSlideSorter.GetModel().GetEditMode() == EditMode::MasterPage);
try
{
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index e65729257426..babb24f2d074 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -541,7 +541,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
if (SfxItemState::DEFAULT == rSet.GetItemState(SID_EXPAND_PAGE))
{
bool bDisable = true;
- if (eEditMode == EM_PAGE)
+ if (eEditMode == EditMode::Page)
{
// At least one of the selected pages has to contain an outline
// presentation objects in order to enable the expand page menu
@@ -584,7 +584,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
if (SfxItemState::DEFAULT == rSet.GetItemState(SID_SUMMARY_PAGE))
{
bool bDisable = true;
- if (eEditMode == EM_PAGE)
+ if (eEditMode == EditMode::Page)
{
// At least one of the selected pages has to contain a title
// presentation objects in order to enable the summary page menu
@@ -674,14 +674,14 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
}
}
- if (eEditMode == EM_MASTERPAGE)
+ if (eEditMode == EditMode::MasterPage)
{
rSet.DisableItem(SID_ASSIGN_LAYOUT);
rSet.DisableItem(SID_INSERTPAGE);
}
// Disable some slots when in master page mode.
- if (eEditMode == EM_MASTERPAGE)
+ if (eEditMode == EditMode::MasterPage)
{
if (rSet.GetItemState(SID_INSERTPAGE) == SfxItemState::DEFAULT)
rSet.DisableItem(SID_INSERTPAGE);
@@ -743,7 +743,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
|| rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT
|| rSet.GetItemState(SID_CUT) == SfxItemState::DEFAULT)
{
- if (mrSlideSorter.GetModel().GetEditMode() == EM_MASTERPAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() == EditMode::MasterPage)
{
if (rSet.GetItemState(SID_CUT) == SfxItemState::DEFAULT)
rSet.DisableItem(SID_CUT);
@@ -940,7 +940,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUStri
::svl::IUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
- if( mrSlideSorter.GetModel().GetEditMode() == EM_PAGE )
+ if( mrSlideSorter.GetModel().GetEditMode() == EditMode::Page )
{
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
@@ -1027,7 +1027,7 @@ void SlotManager::InsertSlide (SfxRequest& rRequest)
PageSelector::BroadcastLock aBroadcastLock (mrSlideSorter);
SdPage* pNewPage = nullptr;
- if (mrSlideSorter.GetModel().GetEditMode() == EM_PAGE)
+ if (mrSlideSorter.GetModel().GetEditMode() == EditMode::Page)
{
SlideSorterViewShell* pShell = dynamic_cast<SlideSorterViewShell*>(
mrSlideSorter.GetViewShell());
diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
index 58d22cf727e9..f28cd44b4467 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
@@ -245,11 +245,11 @@ private:
bool mbPostModelChangePending;
/** This array stores the indices of the selected page descriptors at
- the time when the edit mode is switched to EM_MASTERPAGE. With this
- we can restore the selection when switching back to EM_PAGE mode.
+ the time when the edit mode is switched to EditMode::MasterPage. With this
+ we can restore the selection when switching back to EditMode::Page mode.
*/
::std::vector<SdPage*> maSelectionBeforeSwitch;
- /// The current page before the edit mode is switched to EM_MASTERPAGE.
+ /// The current page before the edit mode is switched to EditMode::MasterPage.
int mnCurrentPageBeforeSwitch;
/** The master page to select after the edit mode is changed. This
diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
index 682904fbb8d9..ebd0943b2c36 100644
--- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
+++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
@@ -103,7 +103,7 @@ SlideSorterModel::SlideSorterModel (SlideSorter& rSlideSorter)
: maMutex(),
mrSlideSorter(rSlideSorter),
mxSlides(),
- meEditMode(EM_PAGE),
+ meEditMode(EditMode::Page),
maPageDescriptors(0)
{
}
@@ -439,7 +439,7 @@ void SlideSorterModel::UpdatePageList()
{
switch (meEditMode)
{
- case EM_MASTERPAGE:
+ case EditMode::MasterPage:
{
Reference<drawing::XMasterPagesSupplier> xSupplier (
xController->getModel(), UNO_QUERY);
@@ -450,7 +450,7 @@ void SlideSorterModel::UpdatePageList()
}
break;
- case EM_PAGE:
+ case EditMode::Page:
{
Reference<drawing::XDrawPagesSupplier> xSupplier (
xController->getModel(), UNO_QUERY);
@@ -529,7 +529,7 @@ bool SlideSorterModel::NotifyPageEvent (const SdrPage* pSdrPage)
// model.
if (pPage->GetPageKind() != PK_STANDARD)
return false;
- if (pPage->IsMasterPage() != (meEditMode==EM_MASTERPAGE))
+ if (pPage->IsMasterPage() != (meEditMode==EditMode::MasterPage))
return false;
//NotifyPageEvent is called for add, remove, *and* change position so for
@@ -635,7 +635,7 @@ SdPage* SlideSorterModel::GetPage (const sal_Int32 nSdIndex) const
SdDrawDocument* pModel = const_cast<SlideSorterModel*>(this)->GetDocument();
if (pModel != nullptr)
{
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
return pModel->GetSdPage ((sal_uInt16)nSdIndex, PK_STANDARD);
else
return pModel->GetMasterSdPage ((sal_uInt16)nSdIndex, PK_STANDARD);
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index 820e77cb6b84..9ec3bbe7f0e3 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -64,15 +64,15 @@ SdUnoDrawView::~SdUnoDrawView() throw()
bool SdUnoDrawView::getMasterPageMode() const throw()
{
- return (mrDrawViewShell.GetEditMode() == EM_MASTERPAGE);
+ return (mrDrawViewShell.GetEditMode() == EditMode::MasterPage);
}
void SdUnoDrawView::setMasterPageMode (bool bMasterPageMode) throw()
{
- if ((mrDrawViewShell.GetEditMode() == EM_MASTERPAGE) != bMasterPageMode)
+ if ((mrDrawViewShell.GetEditMode() == EditMode::MasterPage) != bMasterPageMode)
{
mrDrawViewShell.ChangeEditMode (
- bMasterPageMode ? EM_MASTERPAGE : EM_PAGE,
+ bMasterPageMode ? EditMode::MasterPage : EditMode::Page,
mrDrawViewShell.IsLayerModeActive());
}
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 3033a115369e..96e5f6e93b0c 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2346,7 +2346,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
::sd::DrawViewShell*>(pViewSh);
EditMode eMode = pDrawViewSh->GetEditMode();
- if( eMode == EM_PAGE )
+ if( eMode == EditMode::Page )
{
bool bLayer = pDrawViewSh->IsLayerModeActive();
@@ -3063,7 +3063,7 @@ void SAL_CALL SdMasterPage::setName( const OUString& rName )
static_cast< ::sd::DrawViewShell*>(pViewSh);
EditMode eMode = pDrawViewSh->GetEditMode();
- if( eMode == EM_MASTERPAGE )
+ if( eMode == EditMode::MasterPage )
{
bool bLayer = pDrawViewSh->IsLayerModeActive();
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 930925c3b5f6..f7bcf14a3e44 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -162,7 +162,7 @@ Outliner::Outliner( SdDrawDocument* pDoc, OutlinerMode nMode )
mnText(0),
mpParaObj(nullptr),
meStartViewMode(PK_STANDARD),
- meStartEditMode(EM_PAGE),
+ meStartEditMode(EditMode::Page),
mnStartPageIndex((sal_uInt16)-1),
mpStartEditedObject(nullptr),
maStartSelection(),
@@ -881,14 +881,14 @@ void Outliner::DetectChange()
// Detect change of page count. Restart search at first/last page in
// that case.
- else if (aPosition.meEditMode == EM_PAGE
+ else if (aPosition.meEditMode == EditMode::Page
&& mpDrawDocument->GetSdPageCount(aPosition.mePageKind) != mnPageCount)
{
// The number of pages has changed.
mnPageCount = mpDrawDocument->GetSdPageCount(aPosition.mePageKind);
maObjectIterator = ::sd::outliner::OutlinerContainer(this).current();
}
- else if (aPosition.meEditMode == EM_MASTERPAGE
+ else if (aPosition.meEditMode == EditMode::MasterPage
&& mpDrawDocument->GetSdPageCount(aPosition.mePageKind) != mnPageCount)
{
// The number of master pages has changed.
@@ -1722,7 +1722,7 @@ sal_uInt16 Outliner::ShowModalMessageBox (Dialog& rMessageBox)
//===== Outliner::Implementation ==============================================
Outliner::Implementation::Implementation()
- : meOriginalEditMode(EM_PAGE),
+ : meOriginalEditMode(EditMode::Page),
mbOwnOutlineView(false),
mpOutlineView(nullptr)
{
diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx
index 33a615ef35cd..591ed8f17e92 100644
--- a/sd/source/ui/view/OutlinerIterator.cxx
+++ b/sd/source/ui/view/OutlinerIterator.cxx
@@ -40,7 +40,7 @@ IteratorPosition::IteratorPosition()
: mnText(0)
, mnPageIndex(-1)
, mePageKind(PK_STANDARD)
-, meEditMode(EM_PAGE)
+, meEditMode(EditMode::Page)
{
}
@@ -238,12 +238,12 @@ Iterator OutlinerContainer::CreateDocumentIterator (
if (bDirectionIsForward)
{
ePageKind = PK_STANDARD;
- eEditMode = EM_PAGE;
+ eEditMode = EditMode::Page;
}
else
{
ePageKind = PK_HANDOUT;
- eEditMode = EM_MASTERPAGE;
+ eEditMode = EditMode::MasterPage;
}
break;
@@ -251,12 +251,12 @@ Iterator OutlinerContainer::CreateDocumentIterator (
if (bDirectionIsForward)
{
ePageKind = PK_HANDOUT;
- eEditMode = EM_MASTERPAGE;
+ eEditMode = EditMode::MasterPage;
}
else
{
ePageKind = PK_STANDARD;
- eEditMode = EM_PAGE;
+ eEditMode = EditMode::Page;
}
break;
@@ -271,7 +271,7 @@ Iterator OutlinerContainer::CreateDocumentIterator (
else
{
ePageKind = PK_STANDARD;
- eEditMode = EM_PAGE;
+ eEditMode = EditMode::Page;
}
break;
}
@@ -302,10 +302,10 @@ sal_Int32 OutlinerContainer::GetPageIndex (
switch (eEditMode)
{
- case EM_PAGE:
+ case EditMode::Page:
nPageCount = pDocument->GetSdPageCount (ePageKind);
break;
- case EM_MASTERPAGE:
+ case EditMode::MasterPage:
nPageCount = pDocument->GetMasterSdPageCount(ePageKind);
break;
default:
@@ -368,7 +368,7 @@ IteratorImplBase::IteratorImplBase(SdDrawDocument* pDocument,
else
{
maPosition.mePageKind = PK_STANDARD;
- maPosition.meEditMode = EM_PAGE;
+ maPosition.meEditMode = EditMode::Page;
}
}
@@ -631,7 +631,7 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex)
maPosition.mnPageIndex = nPageIndex;
sal_Int32 nPageCount;
- if (maPosition.meEditMode == EM_PAGE)
+ if (maPosition.meEditMode == EditMode::Page)
nPageCount = mpDocument->GetSdPageCount(maPosition.mePageKind);
else
nPageCount = mpDocument->GetMasterSdPageCount(
@@ -644,7 +644,7 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex)
// side is detected here and has to be reacted to by the caller.
if (nPageIndex>=0 && nPageIndex < nPageCount)
{
- if (maPosition.meEditMode == EM_PAGE)
+ if (maPosition.meEditMode == EditMode::Page)
mpPage = mpDocument->GetSdPage (
(sal_uInt16)nPageIndex,
maPosition.mePageKind);
@@ -713,7 +713,7 @@ DocumentIteratorImpl::DocumentIteratorImpl (
: ViewIteratorImpl (nPageIndex, pDocument, rpViewShellWeak, bDirectionIsForward,
ePageKind, eEditMode)
{
- if (eEditMode == EM_PAGE)
+ if (eEditMode == EditMode::Page)
mnPageCount = pDocument->GetSdPageCount (ePageKind);
else
mnPageCount = pDocument->GetMasterSdPageCount(ePageKind);
@@ -745,9 +745,9 @@ void DocumentIteratorImpl::GotoNextText()
if (maPosition.mnPageIndex >= mnPageCount)
{
// Switch to master page.
- if (maPosition.meEditMode == EM_PAGE)
+ if (maPosition.meEditMode == EditMode::Page)
{
- maPosition.meEditMode = EM_MASTERPAGE;
+ maPosition.meEditMode = EditMode::MasterPage;
SetPage (0);
}
@@ -759,7 +759,7 @@ void DocumentIteratorImpl::GotoNextText()
bSetToOnePastLastPage = true;
else
{
- maPosition.meEditMode = EM_PAGE;
+ maPosition.meEditMode = EditMode::Page;
if (maPosition.mePageKind == PK_STANDARD)
maPosition.mePageKind = PK_NOTES;
else if (maPosition.mePageKind == PK_NOTES)
@@ -774,9 +774,9 @@ void DocumentIteratorImpl::GotoNextText()
if (maPosition.mnPageIndex < 0)
{
// Switch from master pages to draw pages.
- if (maPosition.meEditMode == EM_MASTERPAGE)
+ if (maPosition.meEditMode == EditMode::MasterPage)
{
- maPosition.meEditMode = EM_PAGE;
+ maPosition.meEditMode = EditMode::Page;
bSetToOnePastLastPage = true;
}
@@ -787,7 +787,7 @@ void DocumentIteratorImpl::GotoNextText()
SetPage (-1);
else
{
- maPosition.meEditMode = EM_MASTERPAGE;
+ maPosition.meEditMode = EditMode::MasterPage;
if (maPosition.mePageKind == PK_HANDOUT)
maPosition.mePageKind = PK_NOTES;
else if (maPosition.mePageKind == PK_NOTES)
@@ -802,7 +802,7 @@ void DocumentIteratorImpl::GotoNextText()
{
// Get new page count;
sal_Int32 nPageCount;
- if (maPosition.meEditMode == EM_PAGE)
+ if (maPosition.meEditMode == EditMode::Page)
nPageCount = mpDocument->GetSdPageCount (maPosition.mePageKind);
else
nPageCount = mpDocument->GetMasterSdPageCount(maPosition.mePageKind);
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index a0b2e4370970..d97d91ad8408 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -1057,7 +1057,7 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell)
= dynamic_cast<const DrawViewShell*>(&rMainViewShell);
if (pDrawViewShell != nullptr)
{
- if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ if (pDrawViewShell->GetEditMode() == EditMode::MasterPage)
mpToolBarManager->AddToolBar(
ToolBarManager::TBG_MASTER_MODE,
ToolBarManager::msMasterViewToolBar);
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 9c48fcc8cef3..249d86d5c4a6 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1336,11 +1336,11 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet)
case SID_DRAWINGMODE:
case SID_NORMAL_MULTI_PANE_GUI:
case SID_NOTES_MODE:
- bState = pShell->GetEditMode() == EM_PAGE;
+ bState = pShell->GetEditMode() == EditMode::Page;
break;
case SID_SLIDE_MASTER_MODE:
case SID_NOTES_MASTER_MODE:
- bState = pShell->GetEditMode() == EM_MASTERPAGE;
+ bState = pShell->GetEditMode() == EditMode::MasterPage;
break;
}
}
@@ -1386,7 +1386,7 @@ void CurrentPageSetter::operator() (bool)
// Get the current page either from the DrawPagesSupplier or the
// MasterPagesSupplier.
Any aPage;
- if (pFrameView->GetViewShEditModeOnLoad() == EM_PAGE)
+ if (pFrameView->GetViewShEditModeOnLoad() == EditMode::Page)
{
Reference<drawing::XDrawPagesSupplier> xPagesSupplier (
mrBase.GetController()->getModel(), UNO_QUERY_THROW);
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index f3da2e75ce24..e800f6957705 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -134,7 +134,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
bool bOk = false;
// is there a masterpage edit?
- if ( mpDrawViewShell && mpDrawViewShell->GetEditMode() == EM_MASTERPAGE )
+ if ( mpDrawViewShell && mpDrawViewShell->GetEditMode() == EditMode::MasterPage )
{
SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
SdPage& rPage = *mpDrawViewShell->getCurrentPage();
@@ -430,7 +430,7 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt
bool bResult = true;
// is there a masterpage edit?
- if (mpDrawViewShell && mpDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ if (mpDrawViewShell && mpDrawViewShell->GetEditMode() == EditMode::MasterPage)
{
if (IsPresObjSelected(false))
{
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 0a0de09320b3..ef1926241799 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -256,7 +256,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
//fdo#78151 it doesn't make sense to promote or demote outline levels in master view.
const DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
- const bool bInMasterView = pDrawViewShell && pDrawViewShell->GetEditMode() == EM_MASTERPAGE;
+ const bool bInMasterView = pDrawViewShell && pDrawViewShell->GetEditMode() == EditMode::MasterPage;
if (!bInMasterView)
{
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index dfe0bdf3db0c..9d46be077b86 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -330,7 +330,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
sal_uInt16 nActualPageNum = 0;
- GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EM_MASTERPAGE);
+ GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EditMode::MasterPage);
GetViewShellBase().GetDrawController().FireChangeLayerMode (bIsLayerModeActive);
if ( mpDrawView->IsTextEdit() )
@@ -346,7 +346,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
if (mePageKind == PK_HANDOUT)
{
// at handouts only allow MasterPage
- eEMode = EM_MASTERPAGE;
+ eEMode = EditMode::MasterPage;
}
GetViewShellBase().GetDrawController().BroadcastContextChange();
@@ -363,9 +363,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
// Determine whether to show the master view toolbar. The master
// page mode has to be active and the shell must not be a handout
// view.
- bool bShowMasterViewToolbar (meEditMode == EM_MASTERPAGE
+ bool bShowMasterViewToolbar (meEditMode == EditMode::MasterPage
&& GetShellType() != ViewShell::ST_HANDOUT);
- bool bShowPresentationToolbar (meEditMode != EM_MASTERPAGE
+ bool bShowPresentationToolbar (meEditMode != EditMode::MasterPage
&& GetShellType() != ViewShell::ST_HANDOUT
&& GetShellType() != ViewShell::ST_DRAW);
@@ -385,7 +385,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
if (comphelper::LibreOfficeKit::isActive())
aFillColor = COL_TRANSPARENT;
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
/******************************************************************
* PAGEMODE
@@ -484,7 +484,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
maTabControl->Show();
// Set the tab control only for draw pages. For master page
// this has been done already above.
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
maTabControl->SetCurPageId (nActualPageNum + 1);
}
@@ -629,7 +629,7 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void )
/// inherited from sd::ViewShell
SdPage* DrawViewShell::getCurrentPage() const
{
- const sal_Int32 nPageCount = (meEditMode == EM_PAGE)?
+ const sal_Int32 nPageCount = (meEditMode == EditMode::Page)?
GetDoc()->GetSdPageCount(mePageKind):
GetDoc()->GetMasterSdPageCount(mePageKind);
@@ -638,11 +638,11 @@ SdPage* DrawViewShell::getCurrentPage() const
if( (nPageCount < 0) || (nCurrentPage>=nPageCount) )
nCurrentPage = 0; // play safe here
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
return GetDoc()->GetSdPage((sal_uInt16)nCurrentPage, mePageKind);
}
- else // EM_MASTERPAGE
+ else // EditMode::MasterPage
{
return GetDoc()->GetMasterSdPage((sal_uInt16)nCurrentPage, mePageKind);
}
@@ -658,13 +658,13 @@ void DrawViewShell::ResetActualPage()
return;
sal_uInt16 nCurrentPage = maTabControl->GetCurPageId() - 1;
- sal_uInt16 nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
+ sal_uInt16 nPageCount = (meEditMode == EditMode::Page)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
if (nPageCount > 0)
nCurrentPage = std::min((sal_uInt16)(nPageCount - 1), nCurrentPage);
else
nCurrentPage = 0;
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
// Update for TabControl
@@ -684,7 +684,7 @@ void DrawViewShell::ResetActualPage()
maTabControl->SetCurPageId(nCurrentPage + 1);
}
- else // EM_MASTERPAGE
+ else // EditMode::MasterPage
{
SdPage* pActualPage = GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
maTabControl->Clear();
@@ -808,7 +808,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
// Make sure that the given page index points to an existing page. Move
// the index into the valid range if necessary.
- sal_uInt16 nPageCount = (meEditMode == EM_PAGE)
+ sal_uInt16 nPageCount = (meEditMode == EditMode::Page)
? GetDoc()->GetSdPageCount(mePageKind)
: GetDoc()->GetMasterSdPageCount(mePageKind);
if (nSelectedPage >= nPageCount)
@@ -825,7 +825,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
SdPage* pNewPage = nullptr;
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
{
if( GetDoc()->GetMasterSdPageCount(mePageKind) > nSelectedPage )
pNewPage = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
@@ -874,7 +874,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
mpActualPage = nullptr;
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
mpActualPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
}
@@ -943,7 +943,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
VisAreaChanged(Rectangle(Point(), Size(1, 1)));
}
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
/**********************************************************************
* PAGEMODE
@@ -1175,7 +1175,7 @@ void DrawViewShell::ResetActualLayer()
if ( aName != aBackgroundLayer )
{
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
{
// don't show page layer onto the masterpage
if (aName != aLayoutLayer &&
@@ -1225,7 +1225,7 @@ void DrawViewShell::ResetActualLayer()
}
else
{
- nActiveLayer = ( meEditMode == EM_MASTERPAGE ) ? 2 : 0;
+ nActiveLayer = ( meEditMode == EditMode::MasterPage ) ? 2 : 0;
}
mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayer + 1) );
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index db8d511c6ca3..60cd53336786 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -377,7 +377,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_MODIFYPAGE:
{
if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ||
- (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) )
+ (mePageKind==PK_HANDOUT && meEditMode==EditMode::MasterPage) )
{
if ( mpDrawView->IsTextEdit() )
{
@@ -398,7 +398,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ASSIGN_LAYOUT:
{
- if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
+ if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EditMode::MasterPage))
{
if ( mpDrawView->IsTextEdit() )
mpDrawView->SdrEndTextEdit();
@@ -421,7 +421,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
sal_uInt16 nPageId = maTabControl->GetCurPageId();
- SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
+ SdPage* pCurrentPage = ( GetEditMode() == EditMode::Page )
? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
: GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
@@ -3091,7 +3091,7 @@ SdPage* DrawViewShell::CreateOrDuplicatePage (
const sal_Int32 nInsertPosition)
{
SdPage* pNewPage = nullptr;
- if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE)
+ if (ePageKind == PK_STANDARD && meEditMode != EditMode::MasterPage)
{
if ( mpDrawView->IsTextEdit() )
{
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index b7f41789b848..b42489f3af40 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -159,7 +159,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
rReq.Ignore ();
break;
}
- else if (meEditMode != EM_MASTERPAGE)
+ else if (meEditMode != EditMode::MasterPage)
{
if (! CHECK_RANGE (0, nWhatPage, GetDoc()->GetSdPageCount((PageKind)nWhatKind)))
{
@@ -255,7 +255,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
// turn on default layer of page
mpDrawView->SetActiveLayer(SD_RESSTR(STR_LAYER_LAYOUT));
- ChangeEditMode(EM_PAGE, mbIsLayerModeActive);
+ ChangeEditMode(EditMode::Page, mbIsLayerModeActive);
Invalidate();
rReq.Done ();
@@ -265,25 +265,23 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_LAYERMODE: // BASIC
{
- const SfxItemSet *pArgs = rReq.GetArgs ();
+ const SfxItemSet *pArgs = rReq.GetArgs();
- if ( pArgs && pArgs->Count () == 2)
+ if (pArgs && pArgs->Count() == 2)
{
- const SfxBoolItem* pWhatLayerMode = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE);
const SfxUInt32Item* pWhatLayer = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYER);
-
- sal_Int32 nWhatLayer = (sal_Int32)pWhatLayer->GetValue ();
- if (CHECK_RANGE (EM_PAGE, nWhatLayer, EM_MASTERPAGE))
+ EditMode nWhatLayer = (EditMode)pWhatLayer->GetValue();
+ if (nWhatLayer == EditMode::Page || nWhatLayer == EditMode::MasterPage)
{
- mbIsLayerModeActive = pWhatLayerMode->GetValue ();
- meEditMode = (EditMode) nWhatLayer;
+ mbIsLayerModeActive = rReq.GetArg<SfxBoolItem>(ID_VAL_ISACTIVE)->GetValue();
+ meEditMode = nWhatLayer;
}
}
ChangeEditMode(meEditMode, !mbIsLayerModeActive);
Invalidate();
- rReq.Done ();
+ rReq.Done();
break;
}
@@ -312,7 +310,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_MASTER_LAYOUTS:
{
SdPage* pPage = GetActualPage();
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
// Use the master page of the current page.
pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage());
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index be17178b3b43..c9ef3b687479 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -692,7 +692,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem(SID_ANIMATION_OBJECTS);
rSet.DisableItem(SID_ANIMATION_EFFECTS);
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
rSet.DisableItem(SID_MODIFYPAGE);
rSet.DisableItem(SID_SELECT_BACKGROUND);
@@ -721,7 +721,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
else
{
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
{
rSet.DisableItem(SID_INSERTPAGE);
rSet.DisableItem(SID_DUPLICATE_PAGE);
@@ -741,7 +741,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_RENAMELAYER );
}
- if (meEditMode == EM_PAGE)
+ if (meEditMode == EditMode::Page)
{
/**********************************************************************
* page mode
@@ -795,7 +795,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
|| SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_MASTER_PAGE ) )
{
if (maTabControl->GetPageCount() == 1 ||
- meEditMode == EM_MASTERPAGE ||
+ meEditMode == EditMode::MasterPage ||
mePageKind == PK_NOTES ||
mePageKind == PK_HANDOUT ||
(GetShellType()!=ST_DRAW&&IsLayerModeActive()))
@@ -1545,7 +1545,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
SfxItemSet aMergedAttr(GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0);
SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
- MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EM_MASTERPAGE, aMergedAttr);
+ MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EditMode::MasterPage, aMergedAttr);
if (drawing::FillStyle_BITMAP == static_cast<const XFillStyleItem&>(aMergedAttr.Get(XATTR_FILLSTYLE)).GetValue())
{
bDisableSaveBackground = false;
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 3ce557923a26..ab80ea2adbbb 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -226,7 +226,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
// to set it in order to resync frame view and this view.
mpFrameView->SetPageKind(eInitialPageKind);
mePageKind = eInitialPageKind;
- meEditMode = EM_PAGE;
+ meEditMode = EditMode::Page;
DocumentType eDocType = GetDoc()->GetDocumentType(); // RTTI does not work here
switch (mePageKind)
{
@@ -265,13 +265,13 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
/* In order to set the correct EditMode of the FrameView, we select another
one (small trick). */
- if (mpFrameView->GetViewShEditMode(/*mePageKind*/) == EM_PAGE)
+ if (mpFrameView->GetViewShEditMode(/*mePageKind*/) == EditMode::Page)
{
- meEditMode = EM_MASTERPAGE;
+ meEditMode = EditMode::MasterPage;
}
else
{
- meEditMode = EM_PAGE;
+ meEditMode = EditMode::Page;
}
// Use configuration of FrameView
@@ -775,7 +775,7 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet )
eViewType = svx::sidebar::SelectionAnalyzer::ViewType::Notes;
break;
case PK_STANDARD:
- if (meEditMode == EM_MASTERPAGE)
+ if (meEditMode == EditMode::MasterPage)
eViewType = svx::sidebar::SelectionAnalyzer::ViewType::Master;
else
eViewType = svx::sidebar::SelectionAnalyzer::ViewType::Standard;
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index 0c4c7f05d05a..75406a095927 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -74,7 +74,7 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName )
SdPage* pPageToRename = nullptr;
PageKind ePageKind = GetPageKind();
- if( GetEditMode() == EM_PAGE )
+ if( GetEditMode() == EditMode::Page )
{
pPageToRename = GetDoc()->GetSdPage( nPageId - 1, ePageKind );
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 6204e6edc4c0..5199a7188286 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1002,7 +1002,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
// turn on default layer of MasterPage
mpDrawView->SetActiveLayer( SD_RESSTR(STR_LAYER_BCKGRNDOBJ) );
- ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive);
+ ChangeEditMode(EditMode::MasterPage, mbIsLayerModeActive);
if(HasCurrentFunction(SID_BEZIER_EDIT))
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
@@ -1026,7 +1026,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
// crash. This seems to be some bug in the edit mode switching
// and page switching methods.
SwitchPage (0);
- ChangeEditMode(EM_PAGE, IsLayerModeActive());
+ ChangeEditMode(EditMode::Page, IsLayerModeActive());
Broadcast (
ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 52cfe4f277f7..7d9a63962a95 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -210,11 +210,11 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
mePageKindOnLoad = PK_STANDARD;
mnSelectedPage = 0;
mnSelectedPageOnLoad = 0;
- meEditMode = EM_PAGE;
- // meStandardEditMode = EM_PAGE;
- // meNotesEditMode = EM_PAGE;
- // meHandoutEditMode = EM_MASTERPAGE;
- SetViewShEditModeOnLoad(EM_PAGE);
+ meEditMode = EditMode::Page;
+ // meStandardEditMode = EditMode::Page;
+ // meNotesEditMode = EditMode::Page;
+ // meHandoutEditMode = EditMode::MasterPage;
+ SetViewShEditModeOnLoad(EditMode::Page);
mbLayerMode = false;
SetEliminatePolyPoints(false);
mbDoubleClickTextEdit = false;
@@ -877,7 +877,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr
}
}
- SetViewShEditModeOnLoad(EM_PAGE);
+ SetViewShEditModeOnLoad(EditMode::Page);
const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom );
const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom );
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 34627e7faf92..308143eccd7a 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -182,7 +182,7 @@ sal_Int8 TabControl::AcceptDrop( const AcceptDropEvent& rEvt )
if( bInternalMove )
{
- if( rEvt.mbLeaving || ( pDrViewSh->GetEditMode() == EM_MASTERPAGE ) )
+ if( rEvt.mbLeaving || ( pDrViewSh->GetEditMode() == EditMode::MasterPage ) )
HideDropPos();
else
{