[Libreoffice-commits] core.git: 3 commits - sd/inc sd/qa sd/source sd/xml
Noel Grandin
noel.grandin at collabora.co.uk
Tue Oct 11 12:36:40 UTC 2016
sd/inc/pres.hxx | 21 +-
sd/qa/unit/dialogs-test.cxx | 12 -
sd/qa/unit/misc-tests.cxx | 8
sd/qa/unit/tiledrendering/tiledrendering.cxx | 4
sd/qa/unit/uimpress.cxx | 2
sd/source/core/EffectMigration.cxx | 10 -
sd/source/core/PageListWatcher.cxx | 24 +-
sd/source/core/drawdoc.cxx | 20 +-
sd/source/core/drawdoc2.cxx | 100 +++++-----
sd/source/core/drawdoc3.cxx | 78 +++----
sd/source/core/pglink.cxx | 2
sd/source/core/sdpage.cxx | 71 +++----
sd/source/core/sdpage2.cxx | 14 -
sd/source/core/stlpool.cxx | 4
sd/source/core/stlsheet.cxx | 4
sd/source/filter/cgm/sdcgmfilter.cxx | 2
sd/source/filter/grf/sdgrffilter.cxx | 10 -
sd/source/filter/html/HtmlOptionsDialog.cxx | 6
sd/source/filter/html/htmlex.cxx | 16 -
sd/source/filter/html/pubdlg.cxx | 2
sd/source/filter/ppt/pptin.cxx | 56 ++---
sd/source/filter/sdfilter.cxx | 2
sd/source/filter/xml/sdxmlwrp.cxx | 4
sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 6
sd/source/ui/animations/CustomAnimationPane.cxx | 4
sd/source/ui/animations/SlideTransitionPane.cxx | 8
sd/source/ui/annotations/annotationmanager.cxx | 24 +-
sd/source/ui/app/sdmod.cxx | 6
sd/source/ui/app/sdmod1.cxx | 14 -
sd/source/ui/app/sdmod2.cxx | 20 +-
sd/source/ui/app/sdxfer.cxx | 10 -
sd/source/ui/app/tmplctrl.cxx | 6
sd/source/ui/dlg/PhotoAlbumDialog.cxx | 4
sd/source/ui/dlg/animobjs.cxx | 10 -
sd/source/ui/dlg/custsdlg.cxx | 6
sd/source/ui/dlg/docprev.cxx | 2
sd/source/ui/dlg/headerfooterdlg.cxx | 42 ++--
sd/source/ui/dlg/masterlayoutdlg.cxx | 10 -
sd/source/ui/dlg/sdpreslt.cxx | 4
sd/source/ui/dlg/sdtreelb.cxx | 14 -
sd/source/ui/docshell/docshel2.cxx | 12 -
sd/source/ui/docshell/docshel4.cxx | 24 +-
sd/source/ui/framework/factories/BasicViewFactory.cxx | 6
sd/source/ui/framework/tools/FrameworkHelper.cxx | 4
sd/source/ui/func/fuconstr.cxx | 4
sd/source/ui/func/fuexpand.cxx | 8
sd/source/ui/func/fuinsert.cxx | 2
sd/source/ui/func/fuinsfil.cxx | 12 -
sd/source/ui/func/fuolbull.cxx | 2
sd/source/ui/func/fupage.cxx | 8
sd/source/ui/func/fuprlout.cxx | 10 -
sd/source/ui/func/fusldlg.cxx | 8
sd/source/ui/func/fusumry.cxx | 10 -
sd/source/ui/func/futempl.cxx | 6
sd/source/ui/func/futext.cxx | 4
sd/source/ui/inc/DrawDocShell.hxx | 6
sd/source/ui/inc/DrawViewShell.hxx | 2
sd/source/ui/inc/GraphicDocShell.hxx | 4
sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx | 10 -
sd/source/ui/sidebar/DocumentHelper.cxx | 20 +-
sd/source/ui/sidebar/LayoutMenu.cxx | 2
sd/source/ui/sidebar/MasterPageContainerProviders.cxx | 4
sd/source/ui/sidebar/MasterPageObserver.cxx | 12 -
sd/source/ui/sidebar/MasterPagesSelector.cxx | 4
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx | 4
sd/source/ui/sidebar/SlideBackground.cxx | 12 -
sd/source/ui/slideshow/slideshow.cxx | 10 -
sd/source/ui/slideshow/slideshowimpl.cxx | 24 +-
sd/source/ui/slideshow/slideshowviewimpl.cxx | 2
sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 6
sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 12 -
sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx | 2
sd/source/ui/slidesorter/controller/SlsListener.cxx | 10 -
sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx | 6
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 26 +-
sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx | 6
sd/source/ui/slidesorter/model/SlideSorterModel.cxx | 18 -
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 16 -
sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx | 2
sd/source/ui/table/tablefunction.cxx | 2
sd/source/ui/unoidl/SdUnoDrawView.cxx | 12 -
sd/source/ui/unoidl/UnoDocumentSettings.cxx | 2
sd/source/ui/unoidl/unodoc.cxx | 4
sd/source/ui/unoidl/unomodel.cxx | 96 ++++-----
sd/source/ui/unoidl/unopage.cxx | 66 +++---
sd/source/ui/view/DocumentRenderer.cxx | 34 +--
sd/source/ui/view/Outliner.cxx | 18 -
sd/source/ui/view/OutlinerIterator.cxx | 72 +++----
sd/source/ui/view/ToolBarManager.cxx | 2
sd/source/ui/view/ViewClipboard.cxx | 10 -
sd/source/ui/view/ViewShellBase.cxx | 20 +-
sd/source/ui/view/ViewShellImplementation.cxx | 10 -
sd/source/ui/view/drawview.cxx | 6
sd/source/ui/view/drtxtob.cxx | 2
sd/source/ui/view/drtxtob1.cxx | 2
sd/source/ui/view/drviews1.cxx | 58 ++---
sd/source/ui/view/drviews2.cxx | 16 -
sd/source/ui/view/drviews3.cxx | 40 +---
sd/source/ui/view/drviews5.cxx | 16 -
sd/source/ui/view/drviews7.cxx | 40 ++--
sd/source/ui/view/drviewsa.cxx | 40 ++--
sd/source/ui/view/drviewsb.cxx | 6
sd/source/ui/view/drviewse.cxx | 4
sd/source/ui/view/frmview.cxx | 30 +--
sd/source/ui/view/grviewsh.cxx | 2
sd/source/ui/view/outlnvsh.cxx | 26 +-
sd/source/ui/view/outlview.cxx | 32 +--
sd/source/ui/view/presvish.cxx | 2
sd/source/ui/view/sdview.cxx | 6
sd/source/ui/view/sdview2.cxx | 4
sd/source/ui/view/sdview3.cxx | 22 +-
sd/source/ui/view/tabcontr.cxx | 4
sd/source/ui/view/unmodpg.cxx | 4
sd/source/ui/view/viewoverlaymanager.cxx | 2
sd/source/ui/view/viewshe2.cxx | 12 -
sd/source/ui/view/viewshe3.cxx | 12 -
sd/xml/objectlist.xml | 32 +--
117 files changed, 885 insertions(+), 885 deletions(-)
New commits:
commit e588aa4d347875eb4c52bd2b51c5c917f807ba6d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Oct 11 13:01:32 2016 +0200
convert PageKind to scoped enum
Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
diff --git a/sd/inc/pres.hxx b/sd/inc/pres.hxx
index 367e631..ab816d5 100644
--- a/sd/inc/pres.hxx
+++ b/sd/inc/pres.hxx
@@ -101,11 +101,12 @@ enum AutoLayout
AUTOLAYOUT_END
};
-enum PageKind
+enum class PageKind
{
- PK_STANDARD,
- PK_NOTES,
- PK_HANDOUT
+ Standard,
+ Notes,
+ Handout,
+ LAST = Handout
};
enum class EditMode
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 9c6789a..b74ec922 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -188,7 +188,7 @@ const SfxItemSet& SdDialogsTest::getSfxItemSetFromSdrObject()
{
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
- SdPage* pSdPage = pDrawDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
CPPUNIT_ASSERT(pSdPage);
SdrObject* pSdrObj = pSdPage->GetObj(0);
CPPUNIT_ASSERT(pSdrObj);
@@ -401,7 +401,7 @@ VclAbstractDialog* SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreateMorphDlg(vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) override;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
- SdPage* pSdPage = pDrawDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
CPPUNIT_ASSERT(pSdPage);
SdrObject* pSdrObj = pSdPage->GetObj(0);
// using one SdrObject is okay, none crashes
@@ -566,7 +566,7 @@ VclAbstractDialog* SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreateMasterLayoutDialog(vcl::Window* pParent, SdDrawDocument* pDoc, SdPage*) override;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
- SdPage* pSdPage = pDrawDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
CPPUNIT_ASSERT(pSdPage);
pRetval = getSdAbstractDialogFactory()->CreateMasterLayoutDialog(
Application::GetDefDialogParent(),
@@ -585,7 +585,7 @@ VclAbstractDialog* SdDialogsTest::createDialogByID(sal_uInt32 nID)
// cases
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
- SdPage* pSdPage = pDrawDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
CPPUNIT_ASSERT(pSdPage);
pRetval = getSdAbstractDialogFactory()->CreateHeaderFooterDialog(
getViewShell(),
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index c25abc6..b926c0d 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -112,11 +112,11 @@ void SdMiscTest::testTdf96206()
auto pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase());
auto& rSSController = pSSVS->GetSlideSorter().GetController();
- const sal_uInt16 nMasterPageCnt1 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::PK_STANDARD);
+ const sal_uInt16 nMasterPageCnt1 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), nMasterPageCnt1);
rSSController.GetClipboard().DoCopy();
rSSController.GetClipboard().DoPaste();
- const sal_uInt16 nMasterPageCnt2 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::PK_STANDARD);
+ const sal_uInt16 nMasterPageCnt2 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
CPPUNIT_ASSERT_EQUAL(nMasterPageCnt1, nMasterPageCnt2);
xDocSh->DoClose();
@@ -130,7 +130,7 @@ void SdMiscTest::testTdf96708()
auto& rSSController = pSSVS->GetSlideSorter().GetController();
auto& rPageSelector = rSSController.GetPageSelector();
- const sal_uInt16 nMasterPageCnt1 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::PK_STANDARD);
+ const sal_uInt16 nMasterPageCnt1 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), nMasterPageCnt1);
rPageSelector.SelectAllPages();
rSSController.GetClipboard().DoCopy();
@@ -140,7 +140,7 @@ void SdMiscTest::testTdf96708()
Scheduler::ProcessTaskScheduling(true);
rSSController.GetClipboard().DoPaste();
- const sal_uInt16 nMasterPageCnt2 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::PK_STANDARD);
+ const sal_uInt16 nMasterPageCnt2 = xDocSh->GetDoc()->GetMasterSdPageCount(PageKind::Standard);
CPPUNIT_ASSERT_EQUAL(nMasterPageCnt1, nMasterPageCnt2);
xDocSh->DoClose();
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 14dfb2a..c156615 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -645,7 +645,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
};
// the document has 1 slide
- CPPUNIT_ASSERT(pDoc->GetSdPageCount(PK_STANDARD) == 1);
+ CPPUNIT_ASSERT(pDoc->GetSdPageCount(PageKind::Standard) == 1);
uno::Sequence<beans::PropertyValue> aArgs;
@@ -716,7 +716,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
}
// the document has 1 slide
- CPPUNIT_ASSERT(pDoc->GetSdPageCount(PK_STANDARD) == 1);
+ CPPUNIT_ASSERT(pDoc->GetSdPageCount(PageKind::Standard) == 1);
comphelper::LibreOfficeKit::setActive(false);
}
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index febad37..67f2c80 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -1431,9 +1431,9 @@ void EffectMigration::DocumentLoaded(SdDrawDocument & rDoc)
{
if (DocumentType::Draw == rDoc.GetDocumentType())
return; // no animations in Draw
- for (sal_uInt16 n = 0; n < rDoc.GetSdPageCount(PK_STANDARD); ++n)
+ for (sal_uInt16 n = 0; n < rDoc.GetSdPageCount(PageKind::Standard); ++n)
{
- SdPage *const pPage = rDoc.GetSdPage(n, PK_STANDARD);
+ SdPage *const pPage = rDoc.GetSdPage(n, PageKind::Standard);
if (pPage->hasAnimationNode())
{
// this will force the equivalent of the MainSequence::onTimerHdl
@@ -1442,9 +1442,9 @@ void EffectMigration::DocumentLoaded(SdDrawDocument & rDoc)
pPage->getMainSequence()->getRootNode();
}
}
- for (sal_uInt16 n = 0; n < rDoc.GetMasterSdPageCount(PK_STANDARD); ++n)
+ for (sal_uInt16 n = 0; n < rDoc.GetMasterSdPageCount(PageKind::Standard); ++n)
{
- SdPage *const pPage = rDoc.GetMasterSdPage(n, PK_STANDARD);
+ SdPage *const pPage = rDoc.GetMasterSdPage(n, PageKind::Standard);
if (pPage->hasAnimationNode())
{
pPage->getMainSequence()->getRootNode();
diff --git a/sd/source/core/PageListWatcher.cxx b/sd/source/core/PageListWatcher.cxx
index cb05d4b..d5e5dad 100644
--- a/sd/source/core/PageListWatcher.cxx
+++ b/sd/source/core/PageListWatcher.cxx
@@ -40,17 +40,17 @@ void ImpPageListWatcher::ImpRecreateSortedPageListOnDemand()
switch(pCandidate->GetPageKind())
{
- case PK_STANDARD:
+ case PageKind::Standard:
{
maPageVectorStandard.push_back(pCandidate);
break;
}
- case PK_NOTES:
+ case PageKind::Notes:
{
maPageVectorNotes.push_back(pCandidate);
break;
}
- case PK_HANDOUT:
+ case PageKind::Handout:
{
DBG_ASSERT(!mpHandoutPage, "ImpPageListWatcher::ImpRecreateSortedPageListOnDemand: Two Handout pages in PageList of Model (!)");
mpHandoutPage = pCandidate;
@@ -85,29 +85,29 @@ SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum)
switch(ePgKind)
{
- case PK_STANDARD:
+ case PageKind::Standard:
{
if( nPgNum < (sal_uInt32)maPageVectorStandard.size() )
pRetval = maPageVectorStandard[nPgNum];
else
{
SAL_WARN( "sd.core",
- "ImpPageListWatcher::GetSdPage(PK_STANDARD): page number " << nPgNum << " >= " << maPageVectorStandard.size() );
+ "ImpPageListWatcher::GetSdPage(PageKind::Standard): page number " << nPgNum << " >= " << maPageVectorStandard.size() );
}
break;
}
- case PK_NOTES:
+ case PageKind::Notes:
{
if( nPgNum < (sal_uInt32)maPageVectorNotes.size() )
pRetval = maPageVectorNotes[nPgNum];
else
{
SAL_WARN( "sd.core",
- "ImpPageListWatcher::GetSdPage(PK_NOTES): page number " << nPgNum << " >= " << maPageVectorNotes.size() );
+ "ImpPageListWatcher::GetSdPage(PageKind::Notes): page number " << nPgNum << " >= " << maPageVectorNotes.size() );
}
break;
}
- case PK_HANDOUT:
+ case PageKind::Handout:
{
// #11420# for models used to transfer drawing shapes via clipboard it's ok to not have a handout page
DBG_ASSERT(nPgNum == 0L, "ImpPageListWatcher::GetSdPage: access to non existing handout page (!)");
@@ -136,17 +136,17 @@ sal_uInt32 ImpPageListWatcher::GetSdPageCount(PageKind ePgKind)
switch(ePgKind)
{
- case PK_STANDARD:
+ case PageKind::Standard:
{
nRetval = maPageVectorStandard.size();
break;
}
- case PK_NOTES:
+ case PageKind::Notes:
{
nRetval = maPageVectorNotes.size();
break;
}
- case PK_HANDOUT:
+ case PageKind::Handout:
{
if(mpHandoutPage)
{
@@ -170,7 +170,7 @@ sal_uInt32 ImpPageListWatcher::GetVisibleSdPageCount()
for(sal_uInt32 a(0L); a < nPageCount; a++)
{
SdPage* pCandidate = ImpGetPage(a);
- if ((pCandidate->GetPageKind() == PK_STANDARD)&&(!pCandidate->IsExcluded())) nVisiblePageCount++;
+ if ((pCandidate->GetPageKind() == PageKind::Standard)&&(!pCandidate->IsExcluded())) nVisiblePageCount++;
}
return nVisiblePageCount;
}
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 7011846..a0a2d0a 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -496,10 +496,10 @@ SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const
pNewStylePool->CopyCellSheets(*pOldStylePool);
pNewStylePool->CopyTableStyles(*pOldStylePool);
- for (sal_uInt16 i = 0; i < GetMasterSdPageCount(PK_STANDARD); i++)
+ for (sal_uInt16 i = 0; i < GetMasterSdPageCount(PageKind::Standard); i++)
{
// Move with all of the master page's layouts
- OUString aOldLayoutName(const_cast<SdDrawDocument*>(this)->GetMasterSdPage(i, PK_STANDARD)->GetLayoutName());
+ OUString aOldLayoutName(const_cast<SdDrawDocument*>(this)->GetMasterSdPage(i, PageKind::Standard)->GetLayoutName());
aOldLayoutName = aOldLayoutName.copy( 0, aOldLayoutName.indexOf( SD_LT_SEPARATOR ) );
SdStyleSheetVector aCreatedSheets;
pNewStylePool->CopyLayoutSheets(aOldLayoutName, *pOldStylePool, aCreatedSheets );
@@ -588,7 +588,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
CheckMasterPages();
- if ( GetMasterSdPageCount(PK_STANDARD) > 1 )
+ if ( GetMasterSdPageCount(PageKind::Standard) > 1 )
RemoveUnnecessaryMasterPages( nullptr, true, false );
for ( sal_uInt16 i = 0; i < GetPageCount(); i++ )
@@ -670,10 +670,10 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
// create missing layout style sheets for broken documents
// that where created with the 5.2
- nPageCount = GetMasterSdPageCount( PK_STANDARD );
+ nPageCount = GetMasterSdPageCount( PageKind::Standard );
for (nPage = 0; nPage < nPageCount; nPage++)
{
- SdPage* pPage = GetMasterSdPage(nPage, PK_STANDARD);
+ SdPage* pPage = GetMasterSdPage(nPage, PageKind::Standard);
pSPool->CreateLayoutStyleSheets( pPage->GetName(), true );
}
@@ -696,11 +696,11 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
mbNewOrLoadCompleted = true;
// Update all linked pages
- sal_uInt16 nMaxSdPages = GetSdPageCount(PK_STANDARD);
+ sal_uInt16 nMaxSdPages = GetSdPageCount(PageKind::Standard);
for (sal_uInt16 nSdPage=0; nSdPage < nMaxSdPages; nSdPage++)
{
- SdPage* pPage = GetSdPage(nSdPage, PK_STANDARD);
+ SdPage* pPage = GetSdPage(nSdPage, PageKind::Standard);
if (pPage && !pPage->GetFileName().isEmpty() && pPage->GetBookmarkName().getLength())
{
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 112a9e8..5c50194 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -156,7 +156,7 @@ sal_uInt16 SdDrawDocument::GetPageByName(const OUString& rPgName, bool& rbIsMast
GetPage(nPage)));
if (pPage != nullptr
- && pPage->GetPageKind() != PK_HANDOUT
+ && pPage->GetPageKind() != PageKind::Handout
&& pPage->GetName() == rPgName)
{
nPageNum = nPage;
@@ -224,7 +224,7 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
// If this is a notes page, find its page object and correct the page
// number
- if (pPage && pPage->GetPageKind() == PK_NOTES)
+ if (pPage && pPage->GetPageKind() == PageKind::Notes)
{
const size_t nObjCount = pPage->GetObjCount();
for (size_t nObj = 0; nObj < nObjCount; ++nObj)
@@ -293,7 +293,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, const OUSt
void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement)
{
- bool bNotes = (pPage->GetPageKind() == PK_NOTES);
+ bool bNotes = (pPage->GetPageKind() == PageKind::Notes);
SfxItemPool& rPool(GetPool());
sal_uInt32 nCount = rPool.GetItemCount2(EE_FEATURE_FIELD);
@@ -377,7 +377,7 @@ void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
if (!bLast)
UpdatePageRelativeURLs(static_cast<SdPage*>( pPage ), nPos, 1);
- if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
+ if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PageKind::Standard)
{
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
@@ -410,7 +410,7 @@ SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
if (!bLast)
UpdatePageRelativeURLs(static_cast<SdPage*>(pPage), nPgNum, -1);
- if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
+ if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PageKind::Standard)
{
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
@@ -428,7 +428,7 @@ SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
void SdDrawDocument::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos )
{
FmFormModel::InsertMasterPage( pPage, nPos );
- if( pPage->IsMasterPage() && (static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD) )
+ if( pPage->IsMasterPage() && (static_cast<SdPage*>(pPage)->GetPageKind() == PageKind::Standard) )
{
// new master page created, add its style family
SdStyleSheetPool* pStylePool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
@@ -440,7 +440,7 @@ void SdDrawDocument::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos )
SdrPage* SdDrawDocument::RemoveMasterPage(sal_uInt16 nPgNum)
{
SdPage* pPage = static_cast<SdPage*>(GetMasterPage(nPgNum ));
- if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) )
+ if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PageKind::Standard) )
{
// master page removed, remove its style family
SdStyleSheetPool* pStylePool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
@@ -456,7 +456,7 @@ void SdDrawDocument::SetSelected(SdPage* pPage, bool bSelect)
{
PageKind ePageKind = pPage->GetPageKind();
- if (ePageKind == PK_STANDARD)
+ if (ePageKind == PageKind::Standard)
{
pPage->SetSelected(bSelect);
@@ -468,17 +468,17 @@ void SdDrawDocument::SetSelected(SdPage* pPage, bool bSelect)
pNotesPage = static_cast<SdPage*>(GetPage(nDestPageNum));
}
- if (pNotesPage && pNotesPage->GetPageKind() == PK_NOTES)
+ if (pNotesPage && pNotesPage->GetPageKind() == PageKind::Notes)
{
pNotesPage->SetSelected(bSelect);
}
}
- else if (ePageKind == PK_NOTES)
+ else if (ePageKind == PageKind::Notes)
{
pPage->SetSelected(bSelect);
SdPage* pStandardPage = static_cast<SdPage*>( GetPage( pPage->GetPageNum() - 1 ) );
- if (pStandardPage && pStandardPage->GetPageKind() == PK_STANDARD)
+ if (pStandardPage && pStandardPage->GetPageKind() == PageKind::Standard)
pStandardPage->SetSelected(bSelect);
}
}
@@ -500,7 +500,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
SdPage* pRefPage = nullptr;
if( pRefDocument )
- pRefPage = pRefDocument->GetSdPage( 0, PK_HANDOUT );
+ pRefPage = pRefDocument->GetSdPage( 0, PageKind::Handout );
if( pRefPage )
{
@@ -513,14 +513,14 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
pHandoutPage->SetBorder(0, 0, 0, 0);
}
- pHandoutPage->SetPageKind(PK_HANDOUT);
+ pHandoutPage->SetPageKind(PageKind::Handout);
pHandoutPage->SetName( SD_RESSTR(STR_HANDOUT) );
InsertPage(pHandoutPage, 0);
// Insert master page and register this with the handout page
SdPage* pHandoutMPage = AllocSdPage(true);
pHandoutMPage->SetSize( pHandoutPage->GetSize() );
- pHandoutMPage->SetPageKind(PK_HANDOUT);
+ pHandoutMPage->SetPageKind(PageKind::Handout);
pHandoutMPage->SetBorder( pHandoutPage->GetLftBorder(),
pHandoutPage->GetUppBorder(),
pHandoutPage->GetRgtBorder(),
@@ -535,7 +535,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
bool bClipboard = false;
if( pRefDocument )
- pRefPage = pRefDocument->GetSdPage( 0, PK_STANDARD );
+ pRefPage = pRefDocument->GetSdPage( 0, PageKind::Standard );
if (nPageCount == 0)
{
@@ -608,7 +608,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
SdPage* pNotesPage = AllocSdPage(false);
if( pRefDocument )
- pRefPage = pRefDocument->GetSdPage( 0, PK_NOTES );
+ pRefPage = pRefDocument->GetSdPage( 0, PageKind::Notes );
if( pRefPage )
{
@@ -629,7 +629,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
pNotesPage->SetBorder(0, 0, 0, 0);
}
- pNotesPage->SetPageKind(PK_NOTES);
+ pNotesPage->SetPageKind(PageKind::Notes);
InsertPage(pNotesPage, 2);
if( bClipboard )
pNotesPage->SetLayoutName( pPage->GetLayoutName() );
@@ -637,7 +637,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
// Insert master page, then register this with the notes page
SdPage* pNotesMPage = AllocSdPage(true);
pNotesMPage->SetSize( pNotesPage->GetSize() );
- pNotesMPage->SetPageKind(PK_NOTES);
+ pNotesMPage->SetPageKind(PageKind::Notes);
pNotesMPage->SetBorder( pNotesPage->GetLftBorder(),
pNotesPage->GetUppBorder(),
pNotesPage->GetRgtBorder(),
@@ -671,10 +671,10 @@ bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
{
// Set PageKind
SdPage* pHandoutMPage = static_cast<SdPage*>( GetMasterPage(0) );
- pHandoutMPage->SetPageKind(PK_HANDOUT);
+ pHandoutMPage->SetPageKind(PageKind::Handout);
SdPage* pHandoutPage = static_cast<SdPage*>( GetPage(0) );
- pHandoutPage->SetPageKind(PK_HANDOUT);
+ pHandoutPage->SetPageKind(PageKind::Handout);
pHandoutPage->TRG_SetMasterPage( *pHandoutMPage );
for (sal_uInt16 i = 1; i < nPageCount; i = i + 2)
@@ -689,7 +689,7 @@ bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
}
SdPage* pNotesPage = static_cast<SdPage*>( GetPage(i+1) );
- pNotesPage->SetPageKind(PK_NOTES);
+ pNotesPage->SetPageKind(PageKind::Notes);
// Set notes master page
sal_uInt16 nMasterPageAfterPagesMasterPage = (pPage->TRG_GetMasterPage()).GetPageNum() + 1;
@@ -706,10 +706,10 @@ bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
void SdDrawDocument::UnselectAllPages()
{
- sal_uInt16 nNoOfPages = GetSdPageCount(PK_STANDARD);
+ sal_uInt16 nNoOfPages = GetSdPageCount(PageKind::Standard);
for (sal_uInt16 nPage = 0; nPage < nNoOfPages; ++nPage)
{
- SdPage* pPage = GetSdPage(nPage, PK_STANDARD);
+ SdPage* pPage = GetSdPage(nPage, PageKind::Standard);
pPage->SetSelected(false);
}
}
@@ -721,7 +721,7 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
{
SdPage* pPage = nullptr;
sal_uInt16 nPage;
- sal_uInt16 nNoOfPages = GetSdPageCount(PK_STANDARD);
+ sal_uInt16 nNoOfPages = GetSdPageCount(PageKind::Standard);
bool bSomethingHappened = false;
const bool bUndo = IsUndoEnabled();
@@ -733,7 +733,7 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
std::vector<SdPage*> aPageList;
for (nPage = 0; nPage < nNoOfPages; nPage++)
{
- pPage = GetSdPage(nPage, PK_STANDARD);
+ pPage = GetSdPage(nPage, PageKind::Standard);
if (pPage->IsSelected()) {
aPageList.push_back(pPage);
@@ -745,11 +745,11 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
if (nPage != (sal_uInt16)-1)
{
- pPage = GetSdPage(nPage, PK_STANDARD);
+ pPage = GetSdPage(nPage, PageKind::Standard);
while (nPage > 0 && pPage->IsSelected())
{
nPage--;
- pPage = GetSdPage(nPage, PK_STANDARD);
+ pPage = GetSdPage(nPage, PageKind::Standard);
}
if (pPage->IsSelected())
@@ -783,7 +783,7 @@ bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
else
{
nTargetPage = nPage;
- nTargetPage = 2 * nTargetPage + 1; // PK_STANDARD --> absolute
+ nTargetPage = 2 * nTargetPage + 1; // PageKind::Standard --> absolute
std::vector<SdPage*>::iterator iter;
for (iter = aPageList.begin(); iter != aPageList.end(); ++iter)
@@ -893,7 +893,7 @@ IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl, Timer *, void)
bool bChanged = IsChanged(); // remember this
// Initialize Autolayouts
- SdPage* pHandoutMPage = GetMasterSdPage(0, PK_HANDOUT);
+ SdPage* pHandoutMPage = GetMasterSdPage(0, PageKind::Handout);
if (pHandoutMPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
@@ -901,7 +901,7 @@ IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl, Timer *, void)
pHandoutMPage->SetAutoLayout(AUTOLAYOUT_HANDOUT6, true, true);
}
- SdPage* pPage = GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = GetSdPage(0, PageKind::Standard);
if (pPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
@@ -909,7 +909,7 @@ IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl, Timer *, void)
pPage->SetAutoLayout(AUTOLAYOUT_NONE, true, true);
}
- SdPage* pNotesPage = GetSdPage(0, PK_NOTES);
+ SdPage* pNotesPage = GetSdPage(0, PageKind::Notes);
if (pNotesPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
@@ -1075,8 +1075,8 @@ ImageMap* SdDrawDocument::GetImageMapForObject(SdrObject* pObj)
}
/** this method enforces that the masterpages are in the correct order,
- that is at position 1 is a PK_STANDARD masterpage followed by a
- PK_NOTES masterpage and so on. #
+ that is at position 1 is a PageKind::Standard masterpage followed by a
+ PageKind::Notes masterpage and so on. #
*/
void SdDrawDocument::CheckMasterPages()
{
@@ -1097,8 +1097,8 @@ void SdDrawDocument::CheckMasterPages()
{
pPage = static_cast<SdPage*> (GetMasterPage( nPage ));
// if an odd page is not a standard page or an even page is not a notes page
- if( ((1 == (nPage & 1)) && (pPage->GetPageKind() != PK_STANDARD) ) ||
- ((0 == (nPage & 1)) && (pPage->GetPageKind() != PK_NOTES) ) )
+ if( ((1 == (nPage & 1)) && (pPage->GetPageKind() != PageKind::Standard) ) ||
+ ((0 == (nPage & 1)) && (pPage->GetPageKind() != PageKind::Notes) ) )
break; // then we have a fatal error
}
@@ -1114,14 +1114,14 @@ void SdDrawDocument::CheckMasterPages()
while( nPage < nMaxPages )
{
pPage = static_cast<SdPage*> (GetMasterPage( nPage ));
- if( pPage->GetPageKind() != PK_STANDARD )
+ if( pPage->GetPageKind() != PageKind::Standard )
{
bChanged = true;
sal_uInt16 nFound = nPage + 1;
while( nFound < nMaxPages )
{
pPage = static_cast<SdPage*>(GetMasterPage( nFound ));
- if( PK_STANDARD == pPage->GetPageKind() )
+ if( PageKind::Standard == pPage->GetPageKind() )
{
MoveMasterPage( nFound, nPage );
pPage->SetInserted();
@@ -1144,7 +1144,7 @@ void SdDrawDocument::CheckMasterPages()
else
pNotesPage = nullptr;
- if( (nullptr == pNotesPage) || (pNotesPage->GetPageKind() != PK_NOTES) || ( pPage->GetLayoutName() != pNotesPage->GetLayoutName() ) )
+ if( (nullptr == pNotesPage) || (pNotesPage->GetPageKind() != PageKind::Notes) || ( pPage->GetLayoutName() != pNotesPage->GetLayoutName() ) )
{
bChanged = true;
@@ -1152,7 +1152,7 @@ void SdDrawDocument::CheckMasterPages()
while( nFound < nMaxPages )
{
pNotesPage = static_cast<SdPage*>(GetMasterPage( nFound ));
- if( (PK_NOTES == pNotesPage->GetPageKind()) && ( pPage->GetLayoutName() == pNotesPage->GetLayoutName() ) )
+ if( (PageKind::Notes == pNotesPage->GetPageKind()) && ( pPage->GetLayoutName() == pNotesPage->GetLayoutName() ) )
{
MoveMasterPage( nFound, nPage );
pNotesPage->SetInserted();
@@ -1173,7 +1173,7 @@ void SdDrawDocument::CheckMasterPages()
while( nFound < nMaxPages )
{
pRefNotesPage = static_cast<SdPage*>(GetMasterPage( nFound ));
- if( PK_NOTES == pRefNotesPage->GetPageKind() )
+ if( PageKind::Notes == pRefNotesPage->GetPageKind() )
break;
nFound++;
}
@@ -1181,7 +1181,7 @@ void SdDrawDocument::CheckMasterPages()
pRefNotesPage = nullptr;
SdPage* pNewNotesPage = AllocSdPage(true);
- pNewNotesPage->SetPageKind(PK_NOTES);
+ pNewNotesPage->SetPageKind(PageKind::Notes);
if( pRefNotesPage )
{
pNewNotesPage->SetSize( pRefNotesPage->GetSize() );
@@ -1200,7 +1200,7 @@ void SdDrawDocument::CheckMasterPages()
nPage++;
}
- // now remove all remaining and unused non PK_STANDARD slides
+ // now remove all remaining and unused non PageKind::Standard slides
while( nPage < nMaxPages )
{
bChanged = true;
@@ -1235,7 +1235,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
// From the given page determine the standard page and notes page of which
// to take the layout and the position where to insert the new pages.
- if (ePageKind == PK_NOTES)
+ if (ePageKind == PageKind::Notes)
{
pPreviousNotesPage = pActualPage;
sal_uInt16 nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
@@ -1282,7 +1282,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
// Create new notes page and set it up
pNotesPage = AllocSdPage(false);
- pNotesPage->SetPageKind(PK_NOTES);
+ pNotesPage->SetPageKind(PageKind::Notes);
// Use master page of current page
pNotesPage->TRG_SetMasterPage(pPreviousNotesPage->TRG_GetMasterPage());
@@ -1306,7 +1306,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
sal_uInt16 SdDrawDocument::DuplicatePage (sal_uInt16 nPageNum)
{
- PageKind ePageKind = PK_STANDARD;
+ PageKind ePageKind = PageKind::Standard;
// Get current page
SdPage* pActualPage = GetSdPage(nPageNum, ePageKind);
@@ -1341,7 +1341,7 @@ sal_uInt16 SdDrawDocument::DuplicatePage (
// From the given page determine the standard page and the notes page
// of which to make copies.
- if (ePageKind == PK_NOTES)
+ if (ePageKind == PageKind::Notes)
{
pPreviousNotesPage = pActualPage;
sal_uInt16 nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
@@ -1390,7 +1390,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
// Gather some information about the standard page and the notes page
// that are to be inserted. This makes sure that there is always one
// standard page followed by one notes page.
- if (ePageKind == PK_NOTES)
+ if (ePageKind == PageKind::Notes)
{
pPreviousNotesPage = pActualPage;
nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
@@ -1420,7 +1420,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
bIsPageObj);
// Set up and insert the notes page
- pNotesPage->SetPageKind(PK_NOTES);
+ pNotesPage->SetPageKind(PageKind::Notes);
SetupNewPage (
pPreviousNotesPage,
pNotesPage,
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index c70a4cf0..1cc5280 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -161,7 +161,7 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo
if( rBookmarkList.empty() )
{
// simply take master page of nPos'th page in source document
- pBMMPage = static_cast<SdPage*>(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PK_STANDARD)->TRG_GetMasterPage()));
+ pBMMPage = static_cast<SdPage*>(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PageKind::Standard)->TRG_GetMasterPage()));
}
else
{
@@ -181,10 +181,10 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo
}
// enforce that bookmarked page is a standard page and not already a master page
- if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
+ if (pBMPage && pBMPage->GetPageKind()==PageKind::Standard && !pBMPage->IsMasterPage())
{
const sal_uInt16 nBMSdPage = (nBMPage - 1) / 2;
- pBMMPage = static_cast<SdPage*> (&(pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD)->TRG_GetMasterPage()));
+ pBMMPage = static_cast<SdPage*> (&(pBookmarkDoc->GetSdPage(nBMSdPage, PageKind::Standard)->TRG_GetMasterPage()));
}
}
@@ -408,8 +408,8 @@ bool SdDrawDocument::InsertBookmarkAsPage(
return false;
}
- const sal_uInt16 nSdPageCount = GetSdPageCount(PK_STANDARD);
- const sal_uInt32 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD);
+ const sal_uInt16 nSdPageCount = GetSdPageCount(PageKind::Standard);
+ const sal_uInt32 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PageKind::Standard);
const sal_uInt16 nMPageCount = GetMasterPageCount();
if (nSdPageCount==0 || nBMSdPageCount==0 || nMPageCount==0)
@@ -421,7 +421,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
// page so that inserted pages can be properly scaled even when inserted
// before the first page.
// Note that the pointers are used later on as general page pointers.
- SdPage* pRefPage = GetSdPage(0, PK_STANDARD);
+ SdPage* pRefPage = GetSdPage(0, PageKind::Standard);
Size aSize(pRefPage->GetSize());
sal_Int32 nLeft = pRefPage->GetLftBorder();
sal_Int32 nRight = pRefPage->GetRgtBorder();
@@ -429,7 +429,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
sal_Int32 nLower = pRefPage->GetLwrBorder();
Orientation eOrient = pRefPage->GetOrientation();
- SdPage* pNPage = GetSdPage(0, PK_NOTES);
+ SdPage* pNPage = GetSdPage(0, PageKind::Notes);
Size aNSize(pNPage->GetSize());
sal_Int32 nNLeft = pNPage->GetLftBorder();
sal_Int32 nNRight = pNPage->GetRgtBorder();
@@ -438,7 +438,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
Orientation eNOrient = pNPage->GetOrientation();
// Adapt page size and margins to those of the later pages?
- pRefPage = GetSdPage(nSdPageCount - 1, PK_STANDARD);
+ pRefPage = GetSdPage(nSdPageCount - 1, PageKind::Standard);
if( bNoDialogs )
{
@@ -458,7 +458,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
}
else
{
- SdPage* pBMPage = pBookmarkDoc->GetSdPage(0,PK_STANDARD);
+ SdPage* pBMPage = pBookmarkDoc->GetSdPage(0,PageKind::Standard);
if (pBMPage->GetSize() != pRefPage->GetSize() ||
pBMPage->GetLftBorder() != pRefPage->GetLftBorder() ||
@@ -561,7 +561,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
{
- SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
+ SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PageKind::Standard);
OUString sName(pBMPage->GetName());
bool bIsMasterPage;
@@ -650,7 +650,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
pBMPage = aBookmarkedPages[nPos];
sal_uInt16 nBMPage = pBMPage!=nullptr ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND;
- if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
+ if (pBMPage && pBMPage->GetPageKind()==PageKind::Standard && !pBMPage->IsMasterPage())
{
// It has to be a default page
bool bMustRename = false;
@@ -813,7 +813,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
if (nInsertPos > 0)
{
sal_uInt16 nSdPageStart = (nInsertPos - 1) / 2;
- sal_uInt16 nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount +
+ sal_uInt16 nSdPageEnd = GetSdPageCount(PageKind::Standard) - nSdPageCount +
nSdPageStart - 1;
const bool bRemoveEmptyPresObj =
(pBookmarkDoc->GetDocumentType() == DocumentType::Impress) &&
@@ -831,7 +831,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
for (sal_uInt16 nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++)
{
- pRefPage = GetSdPage(nSdPage, PK_STANDARD);
+ pRefPage = GetSdPage(nSdPage, PageKind::Standard);
if (pExchangeList && pExchangeIter != pExchangeList->end())
{
@@ -840,7 +840,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
pRefPage->SetName(aExchangeName);
Broadcast(SdrHint(SdrHintKind::PageOrderChange, pRefPage));
- SdPage* pNewNotesPage = GetSdPage(nSdPage, PK_NOTES);
+ SdPage* pNewNotesPage = GetSdPage(nSdPage, PageKind::Notes);
pNewNotesPage->SetName(aExchangeName);
Broadcast(SdrHint(SdrHintKind::PageOrderChange, pNewNotesPage));
@@ -869,7 +869,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
if( bRemoveEmptyPresObj )
pRefPage->RemoveEmptyPresentationObjects();
- pRefPage = GetSdPage(nSdPage, PK_NOTES);
+ pRefPage = GetSdPage(nSdPage, PageKind::Notes);
// update layout and referred master page
pRefPage->SetPresentationLayout(aLayout);
@@ -897,7 +897,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
for (sal_uInt16 nPage = nMPageCount; nPage < nNewMPageCount; nPage++)
{
pRefPage = static_cast<SdPage*>( GetMasterPage(nPage) );
- if (pRefPage->GetPageKind() == PK_STANDARD)
+ if (pRefPage->GetPageKind() == PageKind::Standard)
{
if (bScaleObjects)
{
@@ -1059,7 +1059,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
pView->EndListening(*this);
// Look for the page into which the objects are supposed to be inserted
- SdrPage* pPage = GetSdPage(0, PK_STANDARD);
+ SdrPage* pPage = GetSdPage(0, PageKind::Standard);
if (mpDocSh)
{
@@ -1203,7 +1203,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
}
// Check all master pages
- sal_uInt16 nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD );
+ sal_uInt16 nSdMasterPageCount = GetMasterSdPageCount( PageKind::Standard );
for (sal_Int32 nMPage = nSdMasterPageCount - 1; nMPage >= 0; nMPage--)
{
SdPage* pMaster = pMasterPage;
@@ -1211,8 +1211,8 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
if (!pMaster)
{
- pMaster = GetMasterSdPage( (sal_uInt16) nMPage, PK_STANDARD );
- pNotesMaster = GetMasterSdPage( (sal_uInt16) nMPage, PK_NOTES );
+ pMaster = GetMasterSdPage( (sal_uInt16) nMPage, PageKind::Standard );
+ pNotesMaster = GetMasterSdPage( (sal_uInt16) nMPage, PageKind::Notes );
}
else
{
@@ -1226,9 +1226,9 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
}
}
- DBG_ASSERT( pMaster->GetPageKind() == PK_STANDARD, "wrong page kind" );
+ DBG_ASSERT( pMaster->GetPageKind() == PageKind::Standard, "wrong page kind" );
- if ( pMaster->GetPageKind() == PK_STANDARD &&
+ if ( pMaster->GetPageKind() == PageKind::Standard &&
GetMasterPageUserCount( pMaster ) == 0 &&
pNotesMaster )
{
@@ -1240,9 +1240,9 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
{
// remove only duplicate pages
bDeleteMaster = false;
- for (sal_uInt16 i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++)
+ for (sal_uInt16 i = 0; i < GetMasterSdPageCount( PageKind::Standard ); i++)
{
- SdPage* pMPg = GetMasterSdPage( i, PK_STANDARD );
+ SdPage* pMPg = GetMasterSdPage( i, PageKind::Standard );
if( pMPg != pMaster &&
pMPg->GetLayoutName() == aLayoutName )
{
@@ -1264,7 +1264,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
if( (pShownPage == pMaster) || (pShownPage == pNotesMaster) )
{
pView->HideSdrPage();
- pView->ShowSdrPage( GetSdPage( 0, PK_STANDARD ) );
+ pView->ShowSdrPage( GetSdPage( 0, PageKind::Standard ) );
}
}
}
@@ -1421,7 +1421,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), OUString(), 0, nViewShellId);
}
- SdPage* pSelectedPage = GetSdPage(nSdPageNum, PK_STANDARD);
+ SdPage* pSelectedPage = GetSdPage(nSdPageNum, PageKind::Standard);
SdPage* pNotes = static_cast<SdPage*>( GetPage(pSelectedPage->GetPageNum()+1) );
SdPage& rOldMaster = static_cast<SdPage&>(pSelectedPage->TRG_GetMasterPage());
SdPage& rOldNotesMaster = static_cast<SdPage&>(pNotes->TRG_GetMasterPage());
@@ -1442,8 +1442,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (rLayoutName.isEmpty())
{
// No LayoutName: take first MasterPage
- pMaster = pSourceDoc->GetMasterSdPage(0, PK_STANDARD);
- pNotesMaster = pSourceDoc->GetMasterSdPage(0, PK_NOTES);
+ pMaster = pSourceDoc->GetMasterSdPage(0, PageKind::Standard);
+ pNotesMaster = pSourceDoc->GetMasterSdPage(0, PageKind::Notes);
}
else
{
@@ -1457,9 +1457,9 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pMP->GetLayoutName() == aSearchFor)
{
- if (pMP->GetPageKind() == PK_STANDARD)
+ if (pMP->GetPageKind() == PageKind::Standard)
pMaster = pMP;
- if (pMP->GetPageKind() == PK_NOTES)
+ if (pMP->GetPageKind() == PageKind::Notes)
pNotesMaster = pMP;
}
if (pMaster && pNotesMaster)
@@ -1472,8 +1472,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if( (pMaster == nullptr) || (pNotesMaster == nullptr) )
{
// so take the first MasterPage
- pMaster = pSourceDoc->GetMasterSdPage(0, PK_STANDARD);
- pNotesMaster = pSourceDoc->GetMasterSdPage(0, PK_NOTES);
+ pMaster = pSourceDoc->GetMasterSdPage(0, PageKind::Standard);
+ pNotesMaster = pSourceDoc->GetMasterSdPage(0, PageKind::Notes);
}
}
@@ -1834,7 +1834,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
pMaster->SetAutoLayout(AUTOLAYOUT_NONE, true, true);
pNotesMaster = AllocSdPage(true);
- pNotesMaster->SetPageKind(PK_NOTES);
+ pNotesMaster->SetPageKind(PageKind::Notes);
pNotesMaster->SetSize(pNotes->GetSize());
pNotesMaster->SetBorder(pNotes->GetLftBorder(),
pNotes->GetUppBorder(),
@@ -1876,7 +1876,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
AutoLayout eOldAutoLayout = (*pIter)->GetAutoLayout();
AutoLayout eNewAutoLayout =
- (*pIter)->GetPageKind() == PK_STANDARD ? AUTOLAYOUT_NONE : AUTOLAYOUT_NOTES;
+ (*pIter)->GetPageKind() == PageKind::Standard ? AUTOLAYOUT_NONE : AUTOLAYOUT_NOTES;
if( bUndo )
{
@@ -1926,7 +1926,7 @@ void SdDrawDocument::Merge(SdrModel& rSourceModel,
for( sal_uInt16 nMaster = nMasterPageCount; nMaster < GetMasterPageCount(); nMaster++ )
{
SdPage* pPage = static_cast< SdPage* >( GetMasterPage( nMaster ) );
- if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) )
+ if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PageKind::Standard) )
{
// new master page created, add its style family
SdStyleSheetPool* pStylePool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx
index 83587d3..4e4c373 100644
--- a/sd/source/core/pglink.cxx
+++ b/sd/source/core/pglink.cxx
@@ -84,7 +84,7 @@ SdPageLink::~SdPageLink()
if (aBookmarkName.isEmpty())
{
// no page name specified: we assume it is the first page
- aBookmarkName = pBookmarkDoc->GetSdPage(0, PK_STANDARD)->GetName();
+ aBookmarkName = pBookmarkDoc->GetSdPage(0, PageKind::Standard)->GetName();
pPage->SetBookmarkName(aBookmarkName);
}
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index fa77599..2f61675 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/xml/dom/XNamedNodeMap.hpp>
#include <rtl/ustring.hxx>
#include <basegfx/tools/tools.hxx>
+#include <o3tl/enumarray.hxx>
#include "Outliner.hxx"
#include "app.hrc"
@@ -93,7 +94,7 @@ using ::com::sun::star::uno::Reference;
SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
: FmFormPage(rNewDoc, bMasterPage)
, SdrObjUserCall()
-, mePageKind(PK_STANDARD)
+, mePageKind(PageKind::Standard)
, meAutoLayout(AUTOLAYOUT_NONE)
, mbSelected(false)
, mePresChange(PRESCHANGE_MANUAL)
@@ -357,7 +358,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec
case PRESOBJ_HANDOUT:
{
// Save the first standard page at SdrPageObj
- // #i105146# We want no content to be displayed for PK_HANDOUT,
+ // #i105146# We want no content to be displayed for PageKind::Handout,
// so just never set a page as content
pSdrObj = new SdrPageObj(nullptr);
}
@@ -437,11 +438,11 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec
// check if we need another vertical adjustment than the default
SdrTextVertAdjust eV = SDRTEXTVERTADJUST_TOP;
- if( (eObjKind == PRESOBJ_FOOTER) && (mePageKind != PK_STANDARD) )
+ if( (eObjKind == PRESOBJ_FOOTER) && (mePageKind != PageKind::Standard) )
{
eV = SDRTEXTVERTADJUST_BOTTOM;
}
- else if( (eObjKind == PRESOBJ_SLIDENUMBER) && (mePageKind != PK_STANDARD) )
+ else if( (eObjKind == PRESOBJ_SLIDENUMBER) && (mePageKind != PageKind::Standard) )
{
eV = SDRTEXTVERTADJUST_BOTTOM;
}
@@ -479,11 +480,11 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec
SvxAdjust eH = SVX_ADJUST_LEFT;
- if( (eObjKind == PRESOBJ_DATETIME) && (mePageKind != PK_STANDARD ) )
+ if( (eObjKind == PRESOBJ_DATETIME) && (mePageKind != PageKind::Standard ) )
{
eH = SVX_ADJUST_RIGHT;
}
- else if( (eObjKind == PRESOBJ_FOOTER) && (mePageKind == PK_STANDARD ) )
+ else if( (eObjKind == PRESOBJ_FOOTER) && (mePageKind == PageKind::Standard ) )
{
eH = SVX_ADJUST_CENTER;
}
@@ -509,7 +510,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec
// Subscribe object at the style sheet
// Set style only when one was found (as in 5.2)
- if( mePageKind != PK_HANDOUT )
+ if( mePageKind != PageKind::Handout )
{
SfxStyleSheet* pSheetForPresObj = GetStyleSheetForPresObj(eObjKind);
if(pSheetForPresObj)
@@ -772,14 +773,14 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
/**************************************************************************
* create background, title- and layout area
**************************************************************************/
- if( mePageKind == PK_STANDARD )
+ if( mePageKind == PageKind::Standard )
{
pMasterPage->EnsureMasterPageDefaultBackground();
}
if (GetModel() && static_cast<SdDrawDocument*>(GetModel())->GetDocumentType() == DocumentType::Impress)
{
- if( mePageKind == PK_HANDOUT && bInit )
+ if( mePageKind == PageKind::Handout && bInit )
{
// handout template
@@ -808,7 +809,7 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
while( iter != aAreas.end() )
{
SdrPageObj* pPageObj = static_cast<SdrPageObj*>(pMasterPage->CreatePresObj(PRESOBJ_HANDOUT, false, (*iter++), true) );
- // #i105146# We want no content to be displayed for PK_HANDOUT,
+ // #i105146# We want no content to be displayed for PageKind::Handout,
// so just never set a page as content
pPageObj->SetReferencedPage(nullptr);
@@ -817,22 +818,22 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
}
}
- if( mePageKind != PK_HANDOUT )
+ if( mePageKind != PageKind::Handout )
{
SdrObject* pMasterTitle = pMasterPage->GetPresObj( PRESOBJ_TITLE );
if( pMasterTitle == nullptr )
pMasterPage->CreateDefaultPresObj(PRESOBJ_TITLE);
- SdrObject* pMasterOutline = pMasterPage->GetPresObj( mePageKind==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
+ SdrObject* pMasterOutline = pMasterPage->GetPresObj( mePageKind==PageKind::Notes ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
if( pMasterOutline == nullptr )
- pMasterPage->CreateDefaultPresObj( mePageKind == PK_STANDARD ? PRESOBJ_OUTLINE : PRESOBJ_NOTES );
+ pMasterPage->CreateDefaultPresObj( mePageKind == PageKind::Standard ? PRESOBJ_OUTLINE : PRESOBJ_NOTES );
}
// create header&footer objects
if( bCreate )
{
- if( mePageKind != PK_STANDARD )
+ if( mePageKind != PageKind::Standard )
{
SdrObject* pHeader = pMasterPage->GetPresObj( PRESOBJ_HEADER );
if( pHeader == nullptr )
@@ -856,8 +857,8 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
namespace {
-const char* const PageKindVector[] = {
- "PK_STANDARD", "PK_NOTES", "PK_HANDOUT"
+static const o3tl::enumarray<PageKind, char const *> PageKindVector = {
+ "PageKind::Standard", "PageKind::Notes", "PageKind::Handout"
};
const char* const PresObjKindVector[] = {
@@ -957,7 +958,7 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind)
const char* sObjKind = PresObjKindVector[eObjKind];
const char* sPageKind = PageKindVector[mePageKind];
// create footer objects for standard master page
- if( mePageKind == PK_STANDARD )
+ if( mePageKind == PageKind::Standard )
{
const long nLftBorder = GetLftBorder();
const long nUppBorder = GetUppBorder();
@@ -1048,7 +1049,7 @@ Rectangle SdPage::GetTitleRect() const
{
Rectangle aTitleRect;
- if (mePageKind != PK_HANDOUT)
+ if (mePageKind != PageKind::Handout)
{
double propvalue[] = {0,0,0,0};
@@ -1061,7 +1062,7 @@ Rectangle SdPage::GetTitleRect() const
aTitleSize.Height() -= GetUppBorder() + GetLwrBorder();
const char* sPageKind = PageKindVector[mePageKind];
- if (mePageKind == PK_STANDARD)
+ if (mePageKind == PageKind::Standard)
{
getPresObjProp( *this , "PRESOBJ_TITLE" ,sPageKind, propvalue);
aTitlePos.X() += long( aTitleSize.Width() * propvalue[2] );
@@ -1069,7 +1070,7 @@ Rectangle SdPage::GetTitleRect() const
aTitleSize.Width() = long( aTitleSize.Width() * propvalue[1] );
aTitleSize.Height() = long( aTitleSize.Height() * propvalue[0] );
}
- else if (mePageKind == PK_NOTES)
+ else if (mePageKind == PageKind::Notes)
{
Point aPos = aTitlePos;
getPresObjProp( *this, "PRESOBJ_TITLE" ,sPageKind, propvalue);
@@ -1134,7 +1135,7 @@ Rectangle SdPage::GetLayoutRect() const
{
Rectangle aLayoutRect;
- if (mePageKind != PK_HANDOUT)
+ if (mePageKind != PageKind::Handout)
{
double propvalue[] = {0,0,0,0};
@@ -1144,7 +1145,7 @@ Rectangle SdPage::GetLayoutRect() const
aLayoutSize.Height() -= GetUppBorder() + GetLwrBorder();
const char* sPageKind = PageKindVector[mePageKind];
- if (mePageKind == PK_STANDARD)
+ if (mePageKind == PageKind::Standard)
{
getPresObjProp( *this ,"PRESOBJ_OUTLINE", sPageKind, propvalue);
aLayoutPos.X() += long( aLayoutSize.Width() * propvalue[2] );
@@ -1154,7 +1155,7 @@ Rectangle SdPage::GetLayoutRect() const
aLayoutRect.SetPos(aLayoutPos);
aLayoutRect.SetSize(aLayoutSize);
}
- else if (mePageKind == PK_NOTES)
+ else if (mePageKind == PageKind::Notes)
{
getPresObjProp( *this, "PRESOBJ_NOTES", sPageKind, propvalue);
aLayoutPos.X() += long( aLayoutSize.Width() * propvalue[2] );
@@ -1310,12 +1311,12 @@ static void CalcAutoLayoutRectangles( SdPage& rPage,Rectangle* rRectangle ,const
Rectangle aTitleRect;
Rectangle aLayoutRect;
- if( rPage.GetPageKind() != PK_HANDOUT )
+ if( rPage.GetPageKind() != PageKind::Handout )
{
SdPage& rMasterPage = static_cast<SdPage&>(rPage.TRG_GetMasterPage());
SdrObject* pMasterTitle = rMasterPage.GetPresObj( PRESOBJ_TITLE );
SdrObject* pMasterSubTitle = rMasterPage.GetPresObj( PRESOBJ_TEXT );
- SdrObject* pMasterOutline = rMasterPage.GetPresObj( rPage.GetPageKind()==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
+ SdrObject* pMasterOutline = rMasterPage.GetPresObj( rPage.GetPageKind()==PageKind::Notes ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
if( pMasterTitle )
aTitleRect = pMasterTitle->GetLogicRect();
@@ -2538,7 +2539,7 @@ const OUString& SdPage::GetName() const
OUString aCreatedPageName( maCreatedPageName );
if (GetRealName().isEmpty())
{
- if ((mePageKind == PK_STANDARD || mePageKind == PK_NOTES) && !mbMaster)
+ if ((mePageKind == PageKind::Standard || mePageKind == PageKind::Notes) && !mbMaster)
{
// default name for handout pages
sal_uInt16 nNum = (GetPageNum() + 1) / 2;
@@ -2570,12 +2571,12 @@ const OUString& SdPage::GetName() const
aCreatedPageName = GetRealName();
}
- if (mePageKind == PK_NOTES)
+ if (mePageKind == PageKind::Notes)
{
aCreatedPageName += " ";
aCreatedPageName += SD_RESSTR(STR_NOTES);
}
- else if (mePageKind == PK_HANDOUT && mbMaster)
+ else if (mePageKind == PageKind::Handout && mbMaster)
{
aCreatedPageName += " (";
aCreatedPageName += SD_RESSTR(STR_HANDOUT);
@@ -2610,7 +2611,7 @@ OUString SdPage::GetPresObjText(PresObjKind eObjKind) const
{
if (mbMaster)
{
- if (mePageKind != PK_NOTES)
+ if (mePageKind != PageKind::Notes)
{
aString = SD_RESSTR( STR_PRESOBJ_MPTITLE );
}
@@ -2715,7 +2716,7 @@ void SdPage::SetName (const OUString& rName)
const HeaderFooterSettings& SdPage::getHeaderFooterSettings() const
{
- if( mePageKind == PK_HANDOUT && !mbMaster )
+ if( mePageKind == PageKind::Handout && !mbMaster )
{
return static_cast<SdPage&>(TRG_GetMasterPage()).maHeaderFooterSettings;
}
@@ -2727,7 +2728,7 @@ const HeaderFooterSettings& SdPage::getHeaderFooterSettings() const
void SdPage::setHeaderFooterSettings( const sd::HeaderFooterSettings& rNewSettings )
{
- if( mePageKind == PK_HANDOUT && !mbMaster )
+ if( mePageKind == PageKind::Handout && !mbMaster )
{
static_cast<SdPage&>(TRG_GetMasterPage()).maHeaderFooterSettings = rNewSettings;
}
@@ -2826,7 +2827,7 @@ bool SdPage::checkVisibility(
{
const bool bSubContentProcessing(rDisplayInfo.GetSubContentActive());
- if( bSubContentProcessing || ( pCheckPage->GetPageKind() == PK_HANDOUT && bIsPrinting ) )
+ if( bSubContentProcessing || ( pCheckPage->GetPageKind() == PageKind::Handout && bIsPrinting ) )
{
// use the page that is currently processed
const SdPage* pVisualizedSdPage = dynamic_cast< const SdPage* >(pVisualizedPage);
@@ -2924,7 +2925,7 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj )
void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< Rectangle >& rAreas )
{
- SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PK_HANDOUT );
+ SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PageKind::Handout );
if( eLayout == AUTOLAYOUT_NONE )
{
@@ -3035,7 +3036,7 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
aPartArea.Width() = ((aArea.Width() - ((nColCnt-1) * nGapW) ) / nColCnt);
aPartArea.Height() = ((aArea.Height() - ((nRowCnt-1) * nGapH) ) / nRowCnt);
- SdrPage* pFirstPage = rModel.GetMasterSdPage(0, PK_STANDARD);
+ SdrPage* pFirstPage = rModel.GetMasterSdPage(0, PageKind::Standard);
if ( pFirstPage )
{
// scale actual size into handout rect
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index bbb6598..d58daf7 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -318,7 +318,7 @@ void SdPage::ConnectLink()
sfx2::LinkManager* pLinkManager = pModel!=nullptr ? pModel->GetLinkManager() : nullptr;
if (pLinkManager && !mpPageLink && !maFileName.isEmpty() && !maBookmarkName.isEmpty() &&
- mePageKind==PK_STANDARD && !IsMasterPage() &&
+ mePageKind==PageKind::Standard && !IsMasterPage() &&
static_cast<SdDrawDocument*>(pModel)->IsNewOrLoadCompleted())
{
/**********************************************************************
@@ -636,14 +636,14 @@ void SdPage::dumpAsXml(xmlTextWriterPtr pWriter) const
const char* pPageKind = nullptr;
switch (mePageKind)
{
- case PK_STANDARD:
- pPageKind = "PK_STANDARD";
+ case PageKind::Standard:
+ pPageKind = "PageKind::Standard";
break;
- case PK_NOTES:
- pPageKind = "PK_NOTES";
+ case PageKind::Notes:
+ pPageKind = "PageKind::Notes";
break;
- case PK_HANDOUT:
- pPageKind = "PK_HANDOUT";
+ case PageKind::Handout:
+ pPageKind = "PageKind::Handout";
break;
}
if (pPageKind)
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index fe1cc07..f8d5a3a 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -121,9 +121,9 @@ SdStyleSheetPool::SdStyleSheetPool(SfxItemPool const& _rPool, SdDrawDocument* pD
msTableFamilyName = xNamed->getName();
// create presentation families, one for each master page
- const sal_uInt16 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD);
+ const sal_uInt16 nCount = mpDoc->GetMasterSdPageCount(PageKind::Standard);
for( sal_uInt16 nPage = 0; nPage < nCount; ++nPage )
- AddStyleFamily( mpDoc->GetMasterSdPage(nPage,PK_STANDARD) );
+ AddStyleFamily( mpDoc->GetMasterSdPage(nPage,PageKind::Standard) );
}
}
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 9e34cbd..41ee42b 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -388,11 +388,11 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const
}
if (aRealStyle.isEmpty())
{
- SdPage* pPage = pDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = pDoc->GetSdPage(0, PageKind::Standard);
if (pPage)
{
- aRealStyle = pDoc->GetSdPage(0, PK_STANDARD)->GetLayoutName();
+ aRealStyle = pDoc->GetSdPage(0, PageKind::Standard)->GetLayoutName();
}
else
{
diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx
index e07a245..8384aa6 100644
--- a/sd/source/filter/cgm/sdcgmfilter.cxx
+++ b/sd/source/filter/cgm/sdcgmfilter.cxx
@@ -91,7 +91,7 @@ bool SdCGMFilter::Import()
if( ( nRetValue &~0xff000000 ) != 0xffffff ) // maybe the backgroundcolor is already white
{ // so we must not set a master page
mrDocument.StopWorkStartupDelay();
- SdPage* pSdPage = mrDocument.GetMasterSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = mrDocument.GetMasterSdPage(0, PageKind::Standard);
if(pSdPage)
{
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index f0137e8..5741ded 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -190,7 +190,7 @@ bool SdGRFFilter::Import()
if( mrDocument.GetPageCount() == 0 )
mrDocument.CreateFirstPages();
- SdPage* pPage = mrDocument.GetSdPage( 0, PK_STANDARD );
+ SdPage* pPage = mrDocument.GetSdPage( 0, PageKind::Standard );
Point aPos;
Size aPagSize( pPage->GetSize() );
Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
@@ -241,17 +241,17 @@ bool SdGRFFilter::Export()
SdPage* pPage = nullptr;
sd::DrawViewShell* pDrawViewShell = dynamic_cast<::sd::DrawViewShell* >(mrDocShell.GetViewShell() );
- PageKind ePageKind = PK_STANDARD;
+ PageKind ePageKind = PageKind::Standard;
if( pDrawViewShell )
{
ePageKind = pDrawViewShell->GetPageKind();
- if( PK_HANDOUT == ePageKind )
- pPage = mrDocument.GetSdPage( 0, PK_HANDOUT );
+ if( PageKind::Handout == ePageKind )
+ pPage = mrDocument.GetSdPage( 0, PageKind::Handout );
else
pPage = pDrawViewShell->GetActualPage();
}
else
- pPage = mrDocument.GetSdPage( 0, PK_STANDARD );
+ pPage = mrDocument.GetSdPage( 0, PageKind::Standard );
if ( pPage )
{
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 7e215af..e7120f4 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -596,7 +596,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams
}
// calculate image sizes
- SdPage* pPage = mpDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = mpDoc->GetSdPage(0, PageKind::Standard);
Size aTmpSize( pPage->GetSize() );
double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
@@ -610,15 +610,15 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams
maExportPath = aINetURLObj.GetPartBeforeLastName(); // with trailing '/'
maIndex = aINetURLObj.GetLastName();
- mnSdPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
+ mnSdPageCount = mpDoc->GetSdPageCount( PageKind::Standard );
for( sal_uInt16 nPage = 0; nPage < mnSdPageCount; nPage++ )
{
- pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
+ pPage = mpDoc->GetSdPage( nPage, PageKind::Standard );
if( mbHiddenSlides || !pPage->IsExcluded() )
{
maPages.push_back( pPage );
- maNotesPages.push_back( mpDoc->GetSdPage( nPage, PK_NOTES ) );
+ maNotesPages.push_back( mpDoc->GetSdPage( nPage, PageKind::Notes ) );
}
}
mnSdPageCount = maPages.size();
@@ -803,7 +803,7 @@ void HtmlExport::ExportHtml()
void HtmlExport::SetDocColors( SdPage* pPage )
{
if( pPage == nullptr )
- pPage = mpDoc->GetSdPage(0, PK_STANDARD);
+ pPage = mpDoc->GetSdPage(0, PageKind::Standard);
svtools::ColorConfig aConfig;
maVLinkColor = Color(aConfig.GetColorValue(svtools::LINKSVISITED).nColor);
@@ -2208,7 +2208,7 @@ OUString const & HtmlExport::getDocumentTitle()
{
// if there is a non-empty title object, use their first passage
// as page title
- SdPage* pSdPage = mpDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pSdPage = mpDoc->GetSdPage(0, PageKind::Standard);
SdrObject* pTitleObj = pSdPage->GetPresObj(PRESOBJ_TITLE);
if (pTitleObj && !pTitleObj->IsEmptyPresObj())
{
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index f2268eb..d6a7d6d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -584,10 +584,10 @@ bool ImplSdPPTImport::Import()
bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bNotesMaster;
bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bStarDrawFiller;
- PageKind ePgKind = ( bNotesMaster ) ? PK_NOTES : PK_STANDARD;
+ PageKind ePgKind = ( bNotesMaster ) ? PageKind::Notes : PageKind::Standard;
bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bHandoutMaster;
if ( bHandout )
- ePgKind = PK_HANDOUT;
+ ePgKind = PageKind::Handout;
pPage->SetPageKind( ePgKind );
pSdrModel->InsertMasterPage( static_cast<SdrPage*>(pPage) );
@@ -630,7 +630,7 @@ bool ImplSdPPTImport::Import()
OUString aLayoutName( SD_RESSTR( STR_LAYOUT_DEFAULT_NAME ) );
if ( nMasterNum > 2 )
{
- if ( ePgKind == PK_STANDARD )
+ if ( ePgKind == PageKind::Standard )
{ // standard page: create new presentation layout
aLayoutName = SD_RESSTR( STR_LAYOUT_DEFAULT_TITLE_NAME );
aLayoutName += OUString::number( (sal_Int32)( ( nMasterNum + 1 ) / 2 - 1 ) );
@@ -645,7 +645,7 @@ bool ImplSdPPTImport::Import()
pPage->SetLayoutName( aLayoutName );
// set stylesheets
- if ( pPage->GetPageKind() == PK_STANDARD )
+ if ( pPage->GetPageKind() == PageKind::Standard )
{
TSS_Type nTitleInstance = TSS_Type::PageTitle;
TSS_Type nOutlinerInstance = TSS_Type::Body;
@@ -708,7 +708,7 @@ bool ImplSdPPTImport::Import()
aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, TSS_Type::Unknown );
}
}
- else if ( ePgKind == PK_NOTES )
+ else if ( ePgKind == PageKind::Notes )
{
pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_NOTES );
if ( pSheet )
@@ -869,7 +869,7 @@ bool ImplSdPPTImport::Import()
pObj = pMPage->GetObj( 0 );
if ( pObj && pObj->GetObjIdentifier() == OBJ_RECT )
{
- if ( pMPage->GetPageKind() == PK_STANDARD )
+ if ( pMPage->GetPageKind() == PageKind::Standard )
{
// transform data from imported background object to new form
// and delete the object. It was used as container to transport
@@ -909,7 +909,7 @@ bool ImplSdPPTImport::Import()
sal_uInt16 nPageNum = nAktPageNum;
SdPage* pHandoutPage = static_cast<SdPage*>(MakeBlancPage( false ));
- pHandoutPage->SetPageKind( PK_HANDOUT );
+ pHandoutPage->SetPageKind( PageKind::Handout );
pSdrModel->InsertPage( pHandoutPage );
sal_uInt16 nPageAnz = GetPageCount();
@@ -930,11 +930,11 @@ bool ImplSdPPTImport::Import()
pMasterPersist = &(*pPageList)[ nMasterNum ];
pPage->SetLayoutName(static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetLayoutName());
}
- pPage->SetPageKind( PK_STANDARD );
+ pPage->SetPageKind( PageKind::Standard );
pSdrModel->InsertPage( pPage ); // SJ: #i29625# because of form controls, the
ImportPage( pPage, pMasterPersist ); // page must be inserted before importing
SetHeaderFooterPageSettings( pPage, pMasterPersist );
- // CWS preseng01: pPage->SetPageKind( PK_STANDARD );
+ // CWS preseng01: pPage->SetPageKind( PageKind::Standard );
DffRecordHeader aPageHd;
if ( SeekToAktPage( &aPageHd ) )
@@ -1015,7 +1015,7 @@ bool ImplSdPPTImport::Import()
pMasterPersist2 = &(*pPageList)[ nNotesMasterNum ];
pNotesPage->SetLayoutName( static_cast<SdPage&>(pNotesPage->TRG_GetMasterPage()).GetLayoutName() );
}
- pNotesPage->SetPageKind( PK_NOTES );
+ pNotesPage->SetPageKind( PageKind::Notes );
pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
pSdrModel->InsertPage( pNotesPage ); // SJ: #i29625# because of form controls, the
ImportPage( pNotesPage, pMasterPersist2 ); // page must be inserted before importing
@@ -1024,7 +1024,7 @@ bool ImplSdPPTImport::Import()
}
else
{
- pNotesPage->SetPageKind( PK_NOTES );
+ pNotesPage->SetPageKind( PageKind::Notes );
pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
pSdrModel->InsertPage( pNotesPage );
@@ -1050,7 +1050,7 @@ bool ImplSdPPTImport::Import()
for ( nMaster = 1; nMaster < nMasterCount; nMaster++ )
{
SdPage* pMaster = static_cast<SdPage*>( pSdrModel->GetMasterPage( nMaster ) );
- if ( pMaster->GetPageKind() == PK_STANDARD )
+ if ( pMaster->GetPageKind() == PageKind::Standard )
{
SetPageNum( nMaster, PPT_MASTERPAGE );
if ( !pFoundMaster )
@@ -1080,12 +1080,12 @@ bool ImplSdPPTImport::Import()
bOk = mpDoc->CreateMissingNotesAndHandoutPages();
if ( bOk )
{
- for ( i = 0; i < mpDoc->GetSdPageCount( PK_STANDARD ); i++ )
+ for ( i = 0; i < mpDoc->GetSdPageCount( PageKind::Standard ); i++ )
{
// set AutoLayout
SetPageNum( i );
- SdPage* pPage = mpDoc->GetSdPage( i, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( i, PageKind::Standard );
AutoLayout eAutoLayout = AUTOLAYOUT_NONE;
const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
if ( pSlideLayout )
@@ -1203,14 +1203,14 @@ bool ImplSdPPTImport::Import()
}
// handout master page: auto layout
- SdPage* pHandoutMPage = mpDoc->GetMasterSdPage( 0, PK_HANDOUT );
+ SdPage* pHandoutMPage = mpDoc->GetMasterSdPage( 0, PageKind::Handout );
pHandoutMPage->SetAutoLayout( AUTOLAYOUT_HANDOUT6, true, true );
}
sal_uInt32 nSlideCount = GetPageCount();
for ( i = 0; ( i < nSlideCount) && ( i < maSlideNameList.size() ); i++ )
{
- SdPage* pPage = mpDoc->GetSdPage( i, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( i, PageKind::Standard );
OUString &aName = maSlideNameList[ i ];
if ( pPage )
{
@@ -1235,7 +1235,7 @@ bool ImplSdPPTImport::Import()
if ( pFrameView )
{
sal_uInt16 nSelectedPage = 0;
- PageKind ePageKind = PK_STANDARD;
+ PageKind ePageKind = PageKind::Standard;
EditMode eEditMode = EditMode::Page;
switch ( aUserEditAtom.eLastViewType )
@@ -1259,7 +1259,7 @@ bool ImplSdPPTImport::Import()
SAL_FALLTHROUGH;
case 2 : // master
{
- ePageKind = PK_STANDARD;
+ ePageKind = PageKind::Standard;
eEditMode = EditMode::MasterPage;
}
break;
@@ -1267,10 +1267,10 @@ bool ImplSdPPTImport::Import()
eEditMode = EditMode::MasterPage;
SAL_FALLTHROUGH;
case 3 : // notes
- ePageKind = PK_NOTES;
+ ePageKind = PageKind::Notes;
break;
case 4 : // handout
- ePageKind = PK_HANDOUT;
+ ePageKind = PageKind::Handout;
break;
default :
case 1 : // normal
@@ -1315,7 +1315,7 @@ bool ImplSdPPTImport::Import()
sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
{
- SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( nPage, PageKind::Standard );
if ( pPage )
{
pSdCustomShow->PagesVector().push_back( pPage );
@@ -1393,7 +1393,7 @@ bool ImplSdPPTImport::Import()
if ( nStartSlide && ( nStartSlide <= GetPageCount() ) )
{
- SdPage* pPage = mpDoc->GetSdPage( nStartSlide - 1, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( nStartSlide - 1, PageKind::Standard );
if ( pPage )
rPresSettings.maPresPage = pPage->GetName();
}
@@ -1509,8 +1509,8 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
{
sal_uLong nFilePosMerk = rStCtrl.Tell();
- // set PageKind at page (up to now only PK_STANDARD or PK_NOTES)
- if ( pPage->GetPageKind() == PK_STANDARD )
+ // set PageKind at page (up to now only PageKind::Standard or PageKind::Notes)
+ if ( pPage->GetPageKind() == PageKind::Standard )
{
PptSlidePersistList* pPersistList = GetPageList( eAktPageKind );
PptSlidePersistEntry* pActualSlidePersist = ( pPersistList && ( nAktPageNum < pPersistList->size() ) )
@@ -2316,7 +2316,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
if ( !aPresentationText.isEmpty() )
pPage->SetObjText( pText, pOutl, ePresKind, aPresentationText );
- if ( pPage->GetPageKind() != PK_NOTES && pPage->GetPageKind() != PK_HANDOUT)
+ if ( pPage->GetPageKind() != PageKind::Notes && pPage->GetPageKind() != PageKind::Handout)
{
SfxStyleSheet* pSheet2( pPage->GetStyleSheetForPresObj( ePresKind ) );
if ( pSheet2 )
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 343a924..ec1ad2a 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -402,9 +402,9 @@ sal_Int32 ReadThroughComponent(
//numbering level matches that of the outline level it previews
void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc)
{
- for (sal_uInt16 i = 0; i < pDoc->GetMasterSdPageCount(PK_STANDARD); ++i)
+ for (sal_uInt16 i = 0; i < pDoc->GetMasterSdPageCount(PageKind::Standard); ++i)
{
- SdPage *pMasterPage = pDoc->GetMasterSdPage(i, PK_STANDARD);
+ SdPage *pMasterPage = pDoc->GetMasterSdPage(i, PageKind::Standard);
SdrObject* pMasterOutline = pMasterPage->GetPresObj(PRESOBJ_OUTLINE);
if (!pMasterOutline)
continue;
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 716dd5f..d629c38 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -791,7 +791,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
::sd::PresentationViewShell* pPresViewSh = static_cast< ::sd::PresentationViewShell*>(mpViewShell);
SdPage* pCurrPge = pPresViewSh->getCurrentPage();
SdDrawDocument* pDoc = pPresViewSh->GetDoc();
- SdPage* pNotesPge = pDoc->GetSdPage((pCurrPge->GetPageNum()-1)>>1, PK_NOTES);
+ SdPage* pNotesPge = pDoc->GetSdPage((pCurrPge->GetPageNum()-1)>>1, PageKind::Notes);
if (pNotesPge)
{
SdrObject* pNotesObj = pNotesPge->GetPresObj(PRESOBJ_NOTES);
@@ -837,7 +837,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
sValue += OUString::number((sal_Int16)((sal_uInt16)((pCurrPge->GetPageNum()-1)>>1) + 1)) ;
sName = ";total-pages:";
sValue += sName;
- sValue += OUString::number(pDoc->GetSdPageCount(PK_STANDARD)) ;
+ sValue += OUString::number(pDoc->GetSdPageCount(PageKind::Standard)) ;
sValue += ";";
}
}
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 8ee6ae0..bc04d6b 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -1031,11 +1031,11 @@ IMPL_LINK_NOARG(SlideTransitionPane, ApplyToAllButtonClicked, Button*, void)
::sd::slidesorter::SharedPageSelection pPages (
new ::sd::slidesorter::SlideSorterViewShell::PageSelection());
- sal_uInt16 nPageCount = mpDrawDoc->GetSdPageCount( PK_STANDARD );
+ sal_uInt16 nPageCount = mpDrawDoc->GetSdPageCount( PageKind::Standard );
pPages->reserve( nPageCount );
for( sal_uInt16 i=0; i<nPageCount; ++i )
{
- SdPage * pPage = mpDrawDoc->GetSdPage( i, PK_STANDARD );
+ SdPage * pPage = mpDrawDoc->GetSdPage( i, PageKind::Standard );
if( pPage )
pPages->push_back( pPage );
}
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index a1d14c9..b2e6c9a 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -560,7 +560,7 @@ void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet)
SdPage* pCurrentPage = GetCurrentPage();
const bool bReadOnly = mrBase.GetDocShell()->IsReadOnly();
- const bool bWrongPageKind = (pCurrentPage == nullptr) || (pCurrentPage->GetPageKind() != PK_STANDARD);
+ const bool bWrongPageKind = (pCurrentPage == nullptr) || (pCurrentPage->GetPageKind() != PageKind::Standard);
const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
@@ -1102,10 +1102,10 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
{
if( bForeward )
{
- if( nPageNum >= mpDoc->GetSdPageCount(PK_STANDARD)-1 )
+ if( nPageNum >= mpDoc->GetSdPageCount(PageKind::Standard)-1 )
{
// we reached end of draw pages, start with master pages (skip handout master for draw)
- return mpDoc->GetMasterSdPage( (mpDoc->GetDocumentType() == DocumentType::Impress) ? 0 : 1, PK_STANDARD );
+ return mpDoc->GetMasterSdPage( (mpDoc->GetDocumentType() == DocumentType::Impress) ? 0 : 1, PageKind::Standard );
}
nPageNum++;
}
@@ -1116,13 +1116,13 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
nPageNum--;
}
- return mpDoc->GetSdPage(nPageNum, PK_STANDARD);
+ return mpDoc->GetSdPage(nPageNum, PageKind::Standard);
}
else
{
if( bForeward )
{
- if( nPageNum >= mpDoc->GetMasterSdPageCount(PK_STANDARD)-1 )
+ if( nPageNum >= mpDoc->GetMasterSdPageCount(PageKind::Standard)-1 )
{
return nullptr; // we reached the end, there is nothing more to see here
}
@@ -1133,24 +1133,24 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
if( nPageNum == (mpDoc->GetDocumentType() == DocumentType::Impress ? 0 : 1) )
{
// we reached beginning of master pages, start with end if pages
- return mpDoc->GetSdPage( mpDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD );
+ return mpDoc->GetSdPage( mpDoc->GetSdPageCount(PageKind::Standard)-1, PageKind::Standard );
}
nPageNum--;
}
- return mpDoc->GetMasterSdPage(nPageNum,PK_STANDARD);
+ return mpDoc->GetMasterSdPage(nPageNum,PageKind::Standard);
}
}
SdPage* AnnotationManagerImpl::GetFirstPage()
{
// return first drawing page
- return mpDoc->GetSdPage(0, PK_STANDARD );
+ return mpDoc->GetSdPage(0, PageKind::Standard );
}
SdPage* AnnotationManagerImpl::GetLastPage()
{
- return mpDoc->GetMasterSdPage( mpDoc->GetMasterSdPageCount(PK_STANDARD) - 1, PK_STANDARD );
+ return mpDoc->GetMasterSdPage( mpDoc->GetMasterSdPageCount(PageKind::Standard) - 1, PageKind::Standard );
}
SdPage* AnnotationManagerImpl::GetCurrentPage()
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 3d0dbb8..1dcaae8 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -638,10 +638,10 @@ void OutlineToImpressFinalizer::operator() (bool)
// Call UpdatePreview once for every slide to resync the
// document with the outliner of the OutlineViewShell.
- sal_uInt16 nPageCount (mrDocument.GetSdPageCount(PK_STANDARD));
+ sal_uInt16 nPageCount (mrDocument.GetSdPageCount(PageKind::Standard));
for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++)
{
- SdPage* pPage = mrDocument.GetSdPage(nIndex, PK_STANDARD);
+ SdPage* pPage = mrDocument.GetSdPage(nIndex, PageKind::Standard);
// Make the page the actual page so that the
// following UpdatePreview() call accesses the
// correct paragraphs.
@@ -649,7 +649,7 @@ void OutlineToImpressFinalizer::operator() (bool)
pOutlineShell->UpdatePreview(pPage, true);
}
// Select the first slide.
- SdPage* pPage = mrDocument.GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = mrDocument.GetSdPage(0, PageKind::Standard);
pView->SetActualPage(pPage);
pOutlineShell->UpdatePreview(pPage, true);
}
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index ff7a727..ebdbcd5 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -104,7 +104,7 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
nPgNum++;
}
- pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PK_STANDARD );
+ pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PageKind::Standard );
}
else
{
@@ -232,7 +232,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
{
int nPgNum;
- if( (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
+ if( (pPage->GetPageKind() == PageKind::Handout) && pViewSh )
{
nPgNum = pViewSh->GetPrintedHandoutPageNum();
}
@@ -300,7 +300,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
if( !bMasterView )
{
- if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
+ if( pPage && (pPage->GetPageKind() == PageKind::Handout) && pViewSh )
{
nPageCount = pViewSh->GetPrintedHandoutPageCount();
}
@@ -499,7 +499,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
sal_Int32 nY;
if( pDocSh )
{
- SdrPage* pPage = static_cast<SdrPage*>(pDoc->GetSdPage(0, PK_STANDARD));
+ SdrPage* pPage = static_cast<SdrPage*>(pDoc->GetSdPage(0, PageKind::Standard));
Size aSize(pPage->GetSize());
nW = aSize.Width();
nH = aSize.Height();
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index f84bf48..40a423a 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -261,7 +261,7 @@ void SdTransferable::CreateData()
{
mbOwnView = true;
- SdPage* pPage = mpSdDrawDocument->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = mpSdDrawDocument->GetSdPage(0, PageKind::Standard);
if( 1 == pPage->GetObjCount() )
CreateObjectReplacement( pPage->GetObj( 0 ) );
@@ -302,7 +302,7 @@ void SdTransferable::CreateData()
SdrModel* pOldModel = mpSdView->GetModel();
SdStyleSheetPool* pOldStylePool = static_cast<SdStyleSheetPool*>( pOldModel->GetStyleSheetPool() );
SdStyleSheetPool* pNewStylePool = static_cast<SdStyleSheetPool*>( mpSdDrawDocumentIntern->GetStyleSheetPool() );
- SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD );
+ SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PageKind::Standard );
OUString aOldLayoutName( pOldPage->GetLayoutName() );
pPage->SetSize( pOldPage->GetSize() );
@@ -322,7 +322,7 @@ void SdTransferable::CreateData()
mpSdDrawDocumentIntern && mpSdViewIntern &&
mpSdDrawDocumentIntern->GetPageCount() )
{
- SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD );
+ SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PageKind::Standard );
if( 1 == mpSdDrawDocumentIntern->GetPageCount() )
{
@@ -723,7 +723,7 @@ void SdTransferable::SetPageBookmarks( const std::vector<OUString> &rPageBookmar
if( mpSdViewIntern )
{
- SdPage* pPage = mpSdDrawDocument->GetSdPage( 0, PK_STANDARD );
+ SdPage* pPage = mpSdDrawDocument->GetSdPage( 0, PageKind::Standard );
if( pPage )
{
diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx
index c44eb1b..ea5db97 100644
--- a/sd/source/ui/app/tmplctrl.cxx
+++ b/sd/source/ui/app/tmplctrl.cxx
@@ -106,12 +106,12 @@ void SdTemplateControl::Command( const CommandEvent& rCEvt )
ScopedVclPtrInstance<SdTemplatePopup_Impl> aPop;
{
- const sal_uInt16 nMasterCount = pDoc->GetMasterSdPageCount(PK_STANDARD);
+ const sal_uInt16 nMasterCount = pDoc->GetMasterSdPageCount(PageKind::Standard);
sal_uInt16 nCount = 0;
for( sal_uInt16 nPage = 0; nPage < nMasterCount; ++nPage )
{
- SdPage* pMaster = pDoc->GetMasterSdPage(nPage, PK_STANDARD);
+ SdPage* pMaster = pDoc->GetMasterSdPage(nPage, PageKind::Standard);
if( pMaster )
aPop->InsertItem( ++nCount, pMaster->GetName() );
}
@@ -120,7 +120,7 @@ void SdTemplateControl::Command( const CommandEvent& rCEvt )
sal_uInt16 nCurrId = aPop->GetCurId()-1;
if( nCurrId < nMasterCount )
{
- SdPage* pMaster = pDoc->GetMasterSdPage(nCurrId, PK_STANDARD);
+ SdPage* pMaster = pDoc->GetMasterSdPage(nCurrId, PageKind::Standard);
SfxStringItem aStyle( ATTR_PRESLAYOUT_NAME, pMaster->GetName() );
pViewFrame->GetDispatcher()->ExecuteList(
SID_PRESENTATION_LAYOUT, SfxCallMode::SLOT, { &aStyle });
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index ee87843..5456683 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -684,7 +684,7 @@ Reference< drawing::XDrawPage > SdPhotoAlbumDialog::appendNewSlide(AutoLayout aL
Reference< drawing::XDrawPage > xSlide; // Create the slide
Reference< container::XIndexAccess > xIndexAccess( xDrawPages, uno::UNO_QUERY );
xSlide = xDrawPages->insertNewByIndex( xIndexAccess->getCount() );
- SdPage* pSlide = pDoc->GetSdPage( pDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD);
+ SdPage* pSlide = pDoc->GetSdPage( pDoc->GetSdPageCount(PageKind::Standard)-1, PageKind::Standard);
pSlide->SetAutoLayout(aLayout, true); // Set the layout here
return xSlide;
}
@@ -759,7 +759,7 @@ void SdPhotoAlbumDialog::createCaption(const awt::Size& aPageSize )
CapSize.Height() = aPageSize.Height/6;
CapPos.X() = 0;
CapPos.Y() = aPageSize.Height - CapSize.Height();
- SdPage* pSlide = pDoc->GetSdPage( pDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD );
+ SdPage* pSlide = pDoc->GetSdPage( pDoc->GetSdPageCount(PageKind::Standard)-1, PageKind::Standard );
// try to get existing PresObj
const Rectangle rRect(CapPos,CapSize);
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 57e3416..b023d0a 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -414,7 +414,7 @@ IMPL_LINK( AnimationWindow, ClickGetObjectHdl, Button*, pBtn, void )
IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, Button*, pBtn, void )
{
- SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = pMyDoc->GetSdPage(0, PageKind::Standard);
SdrObject* pObject;
// tdf#95298 check m_nCurrentFrame for EMPTY_FRAMELIST to avoid out-of-bound array access
@@ -525,7 +525,7 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
{
BitmapEx aBmp(*m_FrameList[m_nCurrentFrame].first);
- SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = pMyDoc->GetSdPage(0, PageKind::Standard);
SdrObject *const pObject = pPage->GetObj(m_nCurrentFrame);
if( pObject )
{
@@ -708,7 +708,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
// clone object(s) and insert the clone(s) into the list
const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
const size_t nMarkCount = rMarkList.GetMarkCount();
- SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = pMyDoc->GetSdPage(0, PageKind::Standard);
const size_t nCloneCount = pPage->GetObjCount();
if (nMarkCount > 0)
@@ -1013,7 +1013,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
// calculate offset for the specified direction
Size aOffset;
SdrObject * pClone = nullptr;
- SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD);
+ SdPage* pPage = pMyDoc->GetSdPage(0, PageKind::Standard);
for (size_t i = 0; i < nCount; ++i)
{
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 3e3c5d5..1fce442 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -314,10 +314,10 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow,
// fill Listbox with page names of Docs
for( long nPage = 0L;
- nPage < rDoc.GetSdPageCount( PK_STANDARD );
+ nPage < rDoc.GetSdPageCount( PageKind::Standard );
nPage++ )
{
- SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) nPage, PK_STANDARD );
+ SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) nPage, PageKind::Standard );
OUString aStr( pPage->GetName() );
m_pLbPages->InsertEntry( aStr );
}
@@ -419,7 +419,7 @@ void SdDefineCustomShowDlg::ClickButtonHdl2(void* p)
m_pLbCustomPages->Select( pEntry );
SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) m_pLbPages->
- GetSelectEntryPos( i ), PK_STANDARD );
+ GetSelectEntryPos( i ), PageKind::Standard );
pEntry->SetUserData( pPage );
if( nPosCP != TREELIST_APPEND )
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index 3158d48..32297a4 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -201,7 +201,7 @@ void SdDocPreviewWin::updateViewSettings()
if(pDoc)
{
- SdPage * pPage = pDoc->GetSdPage( mnShowPage, PK_STANDARD );
+ SdPage * pPage = pDoc->GetSdPage( mnShowPage, PageKind::Standard );
if( pPage )
{
SdrOutliner& rOutl = pDoc->GetDrawOutliner();
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index f369a61..14c1966 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -175,12 +175,12 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
SdPage* pSlide;
SdPage* pNotes;
- if( pCurrentPage->GetPageKind() == PK_STANDARD )
+ if( pCurrentPage->GetPageKind() == PageKind::Standard )
{
pSlide = pCurrentPage;
pNotes = static_cast<SdPage*>(pDoc->GetPage( pCurrentPage->GetPageNum() + 1 ));
}
- else if( pCurrentPage->GetPageKind() == PK_NOTES )
+ else if( pCurrentPage->GetPageKind() == PageKind::Notes )
{
pNotes = pCurrentPage;
pSlide = static_cast<SdPage*>(pDoc->GetPage( pCurrentPage->GetPageNum() -1 ));
@@ -189,8 +189,8 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
else
{
// handout
- pSlide = pDoc->GetSdPage( 0, PK_STANDARD );
- pNotes = pDoc->GetSdPage( 0, PK_NOTES );
+ pSlide = pDoc->GetSdPage( 0, PageKind::Standard );
+ pNotes = pDoc->GetSdPage( 0, PageKind::Notes );
mpCurrentPage = nullptr;
}
@@ -228,7 +228,7 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
maSlideSettings = pSlide->getHeaderFooterSettings();
- const HeaderFooterSettings& rTitleSettings = mpDoc->GetSdPage(0, PK_STANDARD)->getHeaderFooterSettings();
+ const HeaderFooterSettings& rTitleSettings = mpDoc->GetSdPage(0, PageKind::Standard)->getHeaderFooterSettings();
bool bNotOnTitle = !rTitleSettings.mbFooterVisible && !rTitleSettings.mbSlideNumberVisible && !rTitleSettings.mbDateTimeVisible;
mpSlideTabPage->init( maSlideSettings, bNotOnTitle );
@@ -324,19 +324,19 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides )
// apply to all slides
if( bToAll )
{
- int nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
+ int nPageCount = mpDoc->GetSdPageCount( PageKind::Standard );
int nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PageKind::Standard );
change( pUndoGroup, pPage, aNewSettings );
}
}
else
{
// apply only to the current slide
- DBG_ASSERT( mpCurrentPage && mpCurrentPage->GetPageKind() == PK_STANDARD, "no current page to apply to!" );
- if( mpCurrentPage && (mpCurrentPage->GetPageKind() == PK_STANDARD) )
+ DBG_ASSERT( mpCurrentPage && mpCurrentPage->GetPageKind() == PageKind::Standard, "no current page to apply to!" );
+ if( mpCurrentPage && (mpCurrentPage->GetPageKind() == PageKind::Standard) )
{
change( pUndoGroup, mpCurrentPage, aNewSettings );
}
@@ -347,13 +347,13 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides )
if( bNewNotOnTitle )
{
// just hide them, plain simple UI feature
- HeaderFooterSettings aTempSettings = mpDoc->GetSdPage( 0, PK_STANDARD )->getHeaderFooterSettings();
+ HeaderFooterSettings aTempSettings = mpDoc->GetSdPage( 0, PageKind::Standard )->getHeaderFooterSettings();
aTempSettings.mbFooterVisible = false;
aTempSettings.mbSlideNumberVisible = false;
aTempSettings.mbDateTimeVisible = false;
- change( pUndoGroup, mpDoc->GetSdPage( 0, PK_STANDARD ), aTempSettings );
+ change( pUndoGroup, mpDoc->GetSdPage( 0, PageKind::Standard ), aTempSettings );
}
// now notes settings
@@ -365,17 +365,17 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides )
if( !bForceSlides || !(aNewSettings == maNotesHandoutSettings) )
{
// first set to all notes pages
- int nPageCount = mpDoc->GetSdPageCount( PK_NOTES );
+ int nPageCount = mpDoc->GetSdPageCount( PageKind::Notes );
int nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_NOTES );
+ SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PageKind::Notes );
change( pUndoGroup, pPage, aNewSettings );
}
// and last but not least to the handout page
- change( pUndoGroup, mpDoc->GetMasterSdPage( 0, PK_HANDOUT ), aNewSettings );
+ change( pUndoGroup, mpDoc->GetMasterSdPage( 0, PageKind::Handout ), aNewSettings );
}
// give the undo group to the undo manager
@@ -416,7 +416,7 @@ HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument*
get(mpCTPreview, "preview");
mpCTPreview->init( pActualPage ?
(pActualPage->IsMasterPage() ? pActualPage : static_cast<SdPage*>(&(pActualPage->TRG_GetMasterPage()))) :
- (pDoc->GetMasterSdPage( 0, bHandoutMode ? PK_NOTES : PK_STANDARD )) );
+ (pDoc->GetMasterSdPage( 0, bHandoutMode ? PageKind::Notes : PageKind::Standard )) );
if( mbHandoutMode )
{
@@ -591,26 +591,26 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
// if set, set it on all notes master pages
if( bSet )
{
- sal_uInt16 nPageCount = mpDoc->GetMasterSdPageCount( PK_NOTES );
+ sal_uInt16 nPageCount = mpDoc->GetMasterSdPageCount( PageKind::Notes );
sal_uInt16 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PK_NOTES ) );
+ GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PageKind::Notes ) );
}
}
// #i119985# and set it, or just get it from the notes master page
- GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( 0, PK_NOTES ) );
+ GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( 0, PageKind::Notes ) );
}
else
{
// get the language from the first master page
// or set it to all master pages
- sal_uInt16 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PK_NOTES ) : 1;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list