Kaydet (Commit) e588aa4d authored tarafından Noel Grandin's avatar Noel Grandin

convert PageKind to scoped enum

Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
üst 4caacff9
......@@ -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
......
......@@ -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(),
......
......@@ -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();
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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;
}
......
......@@ -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())
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -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);
}
......
This diff is collapsed.
......@@ -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)
......
......@@ -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) );
}
}
......
......@@ -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
{
......
......@@ -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)
{
......
......@@ -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 )
{
......
......@@ -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())
{
......
This diff is collapsed.
......@@ -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;
......
......@@ -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 += ";";
}
}
......
......@@ -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 );
}
......
......@@ -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()
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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 )
{
......
......@@ -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 });
......
......@@ -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() );