diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-11 13:01:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-11 14:32:40 +0200 |
commit | e588aa4d347875eb4c52bd2b51c5c917f807ba6d (patch) | |
tree | 449516f28c32cc3ae6adf1a822e46fa60a949e9c /sd/source/ui/sidebar | |
parent | 4caacff9f25498c07d9b99fe0b5db82baa58a22c (diff) |
convert PageKind to scoped enum
Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r-- | sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/sidebar/DocumentHelper.cxx | 20 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainerProviders.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageObserver.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/RecentMasterPagesSelector.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 6 |
7 files changed, 29 insertions, 29 deletions
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 94f62697545e..09458acb2b3d 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -122,13 +122,13 @@ void CurrentMasterPagesSelector::LateInit() void CurrentMasterPagesSelector::Fill (ItemList& rItemList) { - sal_uInt16 nPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt16 nPageCount = mrDocument.GetMasterSdPageCount(PageKind::Standard); // Remember the names of the master pages that have been inserted to // avoid double insertion. ::std::set<OUString> aMasterPageNames; for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++) { - SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD); + SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PageKind::Standard); if (pMasterPage == nullptr) continue; @@ -168,13 +168,13 @@ void CurrentMasterPagesSelector::UpdateSelection() { // Iterate over all pages and for the selected ones put the name of // their master page into a set. - sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); + sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PageKind::Standard); ::std::set<OUString> aNames; sal_uInt16 nIndex; bool bLoop (true); for (nIndex=0; nIndex<nPageCount && bLoop; nIndex++) { - SdPage* pPage = mrDocument.GetSdPage (nIndex, PK_STANDARD); + SdPage* pPage = mrDocument.GetSdPage (nIndex, PageKind::Standard); if (pPage != nullptr && pPage->IsSelected()) { if ( ! pPage->TRG_HasMasterPage()) diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx b/sd/source/ui/sidebar/DocumentHelper.cxx index 7c626602f6c6..c853bfe8e68e 100644 --- a/sd/source/ui/sidebar/DocumentHelper.cxx +++ b/sd/source/ui/sidebar/DocumentHelper.cxx @@ -92,10 +92,10 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( // Check if a master page with the same name as that of the given // master page already exists. bool bPageExists (false); - sal_uInt16 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PK_STANDARD)); + sal_uInt16 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PageKind::Standard)); for (sal_uInt16 nMaster=0; nMaster<nMasterPageCount; nMaster++) { - SdPage* pCandidate = rTargetDocument.GetMasterSdPage (nMaster, PK_STANDARD); + SdPage* pCandidate = rTargetDocument.GetMasterSdPage (nMaster, PageKind::Standard); if (pMasterPage!=nullptr && pCandidate->GetName() == pMasterPage->GetName()) { @@ -120,8 +120,8 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( // Set a layout. SdPage* pSlide = rTargetDocument.GetSdPage( - rTargetDocument.GetSdPageCount(PK_STANDARD)-1, - PK_STANDARD); + rTargetDocument.GetSdPageCount(PageKind::Standard)-1, + PageKind::Standard); if (pSlide == nullptr) break; pSlide->SetAutoLayout(AUTOLAYOUT_TITLE, true); @@ -139,7 +139,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( // Make the connection from the new slide to the master page // (and do the same for the notes page.) rTargetDocument.SetMasterPage ( - rTargetDocument.GetSdPageCount(PK_STANDARD)-1, + rTargetDocument.GetSdPageCount(PageKind::Standard)-1, pNewMasterPage->GetName(), &rTargetDocument, false, // Connect the new master page with the new slide but @@ -165,17 +165,17 @@ SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage) // Iterate over all pages and check if it references the given master // page. - if (pDocument!=nullptr && pDocument->GetSdPageCount(PK_STANDARD) > 0) + if (pDocument!=nullptr && pDocument->GetSdPageCount(PageKind::Standard) > 0) { // In most cases a new slide has just been inserted so start with // the last page. - sal_uInt16 nPageIndex (pDocument->GetSdPageCount(PK_STANDARD)-1); + sal_uInt16 nPageIndex (pDocument->GetSdPageCount(PageKind::Standard)-1); bool bFound (false); while ( ! bFound) { pCandidate = pDocument->GetSdPage( nPageIndex, - PK_STANDARD); + PageKind::Standard); if (pCandidate != nullptr) { if (static_cast<SdPage*>(&pCandidate->TRG_GetMasterPage()) @@ -432,10 +432,10 @@ void DocumentHelper::AssignMasterPageToPage ( { // Find first slide that uses the master page. SdPage* pSlide = nullptr; - sal_uInt16 nPageCount = pDocument->GetSdPageCount(PK_STANDARD); + sal_uInt16 nPageCount = pDocument->GetSdPageCount(PageKind::Standard); for (sal_uInt16 nPage=0; nPage<nPageCount&&pSlide==nullptr; nPage++) { - SdrPage* pCandidate = pDocument->GetSdPage(nPage,PK_STANDARD); + SdrPage* pCandidate = pDocument->GetSdPage(nPage,PageKind::Standard); if (pCandidate != nullptr && pCandidate->TRG_HasMasterPage() && &(pCandidate->TRG_GetMasterPage()) == pPage) diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx index 86958f670f1d..11283ed50493 100644 --- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx @@ -130,7 +130,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume SdDrawDocument* pDocument = pDocumentShell->GetDoc(); if (pDocument != nullptr) { - pPage = pDocument->GetMasterSdPage(0, PK_STANDARD); + pPage = pDocument->GetMasterSdPage(0, PageKind::Standard); // In order to make the newly loaded master page deletable // when copied into documents it is marked as no "precious". // When it is modified then it is marked as "precious". @@ -179,7 +179,7 @@ SdPage* DefaultPageObjectProvider::operator () (SdDrawDocument* pContainerDocume if (pContainerDocument != nullptr) { sal_Int32 nIndex (0); - SdPage* pLocalSlide = pContainerDocument->GetSdPage((sal_uInt16)nIndex, PK_STANDARD); + SdPage* pLocalSlide = pContainerDocument->GetSdPage((sal_uInt16)nIndex, PageKind::Standard); if (pLocalSlide!=nullptr && pLocalSlide->TRG_HasMasterPage()) pLocalMasterPage = dynamic_cast<SdPage*>(&pLocalSlide->TRG_GetMasterPage()); } diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx index 4b2db78b4244..e2a06b42de50 100644 --- a/sd/source/ui/sidebar/MasterPageObserver.cxx +++ b/sd/source/ui/sidebar/MasterPageObserver.cxx @@ -153,10 +153,10 @@ void MasterPageObserver::Implementation::RegisterDocument ( { // Gather the names of all the master pages in the given document. MasterPageContainer::mapped_type aMasterPageSet; - sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PageKind::Standard); for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++) { - SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD); + SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PageKind::Standard); if (pMasterPage != nullptr) aMasterPageSet.insert (pMasterPage->GetName()); } @@ -236,8 +236,8 @@ void MasterPageObserver::Implementation::Notify( { SdDrawDocument& rDocument ( static_cast<SdDrawDocument&>(rBroadcaster)); - if (rDocument.GetMasterSdPageCount(PK_STANDARD) - == rDocument.GetMasterSdPageCount(PK_NOTES)) + if (rDocument.GetMasterSdPageCount(PageKind::Standard) + == rDocument.GetMasterSdPageCount(PageKind::Notes)) { AnalyzeUsedMasterPages (rDocument); } @@ -254,11 +254,11 @@ void MasterPageObserver::Implementation::AnalyzeUsedMasterPages ( SdDrawDocument& rDocument) { // Create a set of names of the master pages used by the given document. - sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PageKind::Standard); ::std::set<OUString> aCurrentMasterPages; for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++) { - SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD); + SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PageKind::Standard); if (pMasterPage != nullptr) aCurrentMasterPages.insert (pMasterPage->GetName()); OSL_TRACE("currently used master page %d is %s", diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 52b2153f221f..4adc45b7e45e 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -355,7 +355,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage) if (pMasterPage == nullptr) return; - sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); + sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PageKind::Standard); if (nPageCount == 0) return; @@ -367,7 +367,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage) new ::sd::slidesorter::SlideSorterViewShell::PageSelection()); for (sal_uInt16 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++) { - SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PK_STANDARD); + SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PageKind::Standard); if (pPage != nullptr && pPage->GetLayoutName() != sFullLayoutName) { pPageList->push_back (pPage); diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index 12d6486b609b..7387786128ed 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -95,11 +95,11 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) { // Create a set of names of the master pages used by the document. MasterPageObserver::MasterPageNameSet aCurrentNames; - sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PageKind::Standard); sal_uInt16 nIndex; for (nIndex=0; nIndex<nMasterPageCount; nIndex++) { - SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD); + SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PageKind::Standard); if (pMasterPage != nullptr) aCurrentNames.insert (pMasterPage->GetName()); } diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 2d1d3317e106..ec2361765fd9 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -474,7 +474,7 @@ void SlideBackground::populateMasterSlideDropdown() for( sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++ ) { SdPage* pMaster = static_cast<SdPage*>(pDoc->GetMasterPage(nLayout)); - if( pMaster->GetPageKind() == PK_STANDARD) + if( pMaster->GetPageKind() == PageKind::Standard) { OUString aLayoutName(pMaster->GetLayoutName()); aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR)); @@ -911,9 +911,9 @@ IMPL_LINK_NOARG(SlideBackground, AssignMasterPage, ListBox&, void) if (!pDoc) return; sal_uInt16 nSelectedPage = SDRPAGE_NOTFOUND; - for( sal_uInt16 nPage = 0; nPage < pDoc->GetSdPageCount(PK_STANDARD); nPage++ ) + for( sal_uInt16 nPage = 0; nPage < pDoc->GetSdPageCount(PageKind::Standard); nPage++ ) { - if (pDoc->GetSdPage(nPage,PK_STANDARD)->IsSelected()) + if (pDoc->GetSdPage(nPage,PageKind::Standard)->IsSelected()) { nSelectedPage = nPage; break; |