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/unoidl | |
parent | 4caacff9f25498c07d9b99fe0b5db82baa58a22c (diff) |
convert PageKind to scoped enum
Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/SdUnoDrawView.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 88 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 62 |
3 files changed, 78 insertions, 78 deletions
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx index 9ec3bbe7f0e3..8d5fad88f62e 100644 --- a/sd/source/ui/unoidl/SdUnoDrawView.cxx +++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx @@ -550,9 +550,9 @@ Any SdUnoDrawView::getDrawViewMode() const Any aRet; switch( mrDrawViewShell.GetPageKind() ) { - case PK_NOTES: aRet <<= DrawViewMode_NOTES; break; - case PK_HANDOUT: aRet <<= DrawViewMode_HANDOUT; break; - case PK_STANDARD: aRet <<= DrawViewMode_DRAW; break; + case PageKind::Notes: aRet <<= DrawViewMode_NOTES; break; + case PageKind::Handout: aRet <<= DrawViewMode_HANDOUT; break; + case PageKind::Standard: aRet <<= DrawViewMode_DRAW; break; } return aRet; } diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 601cec71bfec..ca52ce5fe0ce 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -455,7 +455,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) throw (css::uno::RuntimeException, std::exception) { - sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PageKind::Standard ); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRND), false); sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), false); @@ -474,7 +474,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) else { // here we determine the page after which we should insert - SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( (sal_uInt16)(nPageCount - 1), nPage ), PK_STANDARD ); + SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( (sal_uInt16)(nPageCount - 1), nPage ), PageKind::Standard ); SetOfByte aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers(); bool bIsPageBack = aVisibleLayers.IsSet( aBckgrnd ); bool bIsPageObj = aVisibleLayers.IsSet( aBckgrndObj ); @@ -542,7 +542,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) pPreviousNotesPage->GetLwrBorder() ); pNotesPage->SetOrientation( pPreviousNotesPage->GetOrientation() ); pNotesPage->SetName(aNotesPageName); - pNotesPage->SetPageKind(PK_NOTES); + pNotesPage->SetPageKind(PageKind::Notes); // insert page after current page mpDoc->InsertPage(pNotesPage, nNotesPageNum); @@ -804,7 +804,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::getHandoutMast if( mpDoc ) { initializeDocument(); - SdPage* pPage = mpDoc->GetMasterSdPage( 0, PK_HANDOUT ); + SdPage* pPage = mpDoc->GetMasterSdPage( 0, PageKind::Handout ); if( pPage ) xPage.set( pPage->getUnoPage(), uno::UNO_QUERY ); } @@ -1482,7 +1482,7 @@ sal_Int32 SAL_CALL SdXImpressDocument::getRendererCount( const uno::Any& rSelect rSelection >>= xModel; if( xModel == mpDocShell->GetModel() ) - nRet = mpDoc->GetSdPageCount( PK_STANDARD ); + nRet = mpDoc->GetSdPageCount( PageKind::Standard ); else { uno::Reference< drawing::XShapes > xShapes; @@ -1517,7 +1517,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SdXImpressDocument::getRenderer( awt::Size aPageSize; if ( bExportNotesPages ) { - Size aNotesPageSize = mpDoc->GetSdPage( 0, PK_NOTES )->GetSize(); + Size aNotesPageSize = mpDoc->GetSdPage( 0, PageKind::Notes )->GetSize(); aPageSize = awt::Size( aNotesPageSize.Width(), aNotesPageSize.Height() ); } else @@ -1652,7 +1652,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh uno::Reference< beans::XPropertySet > xShapePropSet( xShape, uno::UNO_QUERY ); if( xShapePropSet.is() ) { - Size aPageSize( rDoc.GetSdPage( 0, PK_STANDARD )->GetSize() ); + Size aPageSize( rDoc.GetSdPage( 0, PageKind::Standard )->GetSize() ); Point aPoint( 0, 0 ); Rectangle aPageRect( aPoint, aPageSize ); @@ -1668,7 +1668,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh { case presentation::ClickAction_LASTPAGE : { - sal_Int32 nCount = rDoc.GetSdPageCount( PK_STANDARD ); + sal_Int32 nCount = rDoc.GetSdPageCount( PageKind::Standard ); sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nCount - 1, vcl::PDFWriter::FitRectangle ); sal_Int32 nLinkId = rPDFExtOutDevData.CreateLink( aLinkRect ); rPDFExtOutDevData.SetLinkDest( nLinkId, nDestId ); @@ -1694,7 +1694,7 @@ void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xSh case presentation::ClickAction_NEXTPAGE : { sal_Int32 nDestPage = rPDFExtOutDevData.GetCurrentPageNumber() + 1; - sal_Int32 nLastPage = rDoc.GetSdPageCount( PK_STANDARD ) - 1; + sal_Int32 nLastPage = rDoc.GetSdPageCount( PageKind::Standard ) - 1; if ( nDestPage > nLastPage ) nDestPage = nLastPage; sal_Int32 nDestId = rPDFExtOutDevData.CreateDest( aPageRect, nDestPage, vcl::PDFWriter::FitRectangle ); @@ -1862,7 +1862,7 @@ namespace sal_Int16 nRet = 0; for (sal_Int16 i = 0; i < nPageNumber-1; ++i) { - if (!(pDoc->GetSdPage(i, PK_STANDARD))->IsExcluded()) + if (!(pDoc->GetSdPage(i, PageKind::Standard))->IsExcluded()) ++nRet; } return nRet; @@ -1882,7 +1882,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r { uno::Reference< awt::XDevice > xRenderDevice; const sal_Int32 nPageNumber = nRenderer + 1; - PageKind ePageKind = PK_STANDARD; + PageKind ePageKind = PageKind::Standard; bool bExportNotesPages = false; for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) @@ -1893,7 +1893,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r { rxOptions[ nProperty].Value >>= bExportNotesPages; if ( bExportNotesPages ) - ePageKind = PK_NOTES; + ePageKind = PageKind::Notes; } } @@ -1906,7 +1906,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r { vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast<vcl::PDFExtOutDevData* >( pOut->GetExtOutDevData() ); - if ( !( (mpDoc->GetSdPage((sal_Int16) nPageNumber-1, PK_STANDARD))->IsExcluded() ) || + if ( !( (mpDoc->GetSdPage((sal_Int16) nPageNumber-1, PageKind::Standard))->IsExcluded() ) || (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides()) ) { ::sd::ClientView* pView = new ::sd::ClientView( mpDocShell, pOut ); @@ -2125,7 +2125,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r } } - Size aPageSize( mpDoc->GetSdPage( 0, PK_STANDARD )->GetSize() ); + Size aPageSize( mpDoc->GetSdPage( 0, PageKind::Standard )->GetSize() ); Point aPoint( 0, 0 ); Rectangle aPageRect( aPoint, aPageSize ); @@ -2150,7 +2150,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r rBookmarks.clear(); //---> #i56629, #i40318 //get the page name, will be used as outline element in PDF bookmark pane - OUString aPageName = mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1 , PK_STANDARD )->GetName(); + OUString aPageName = mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1 , PageKind::Standard )->GetName(); if( !aPageName.isEmpty() ) { // Destination PageNum @@ -2298,7 +2298,7 @@ int SdXImpressDocument::getParts() { // TODO: master pages? // Read: drviews1.cxx - return mpDoc->GetSdPageCount(PK_STANDARD); + return mpDoc->GetSdPageCount(PageKind::Standard); } int SdXImpressDocument::getPart() @@ -2312,7 +2312,7 @@ int SdXImpressDocument::getPart() OUString SdXImpressDocument::getPartName( int nPart ) { - SdPage* pPage = mpDoc->GetSdPage( nPart, PK_STANDARD ); + SdPage* pPage = mpDoc->GetSdPage( nPart, PageKind::Standard ); if (!pPage) { SAL_WARN("sd", "DrawViewShell not available!"); @@ -2324,7 +2324,7 @@ OUString SdXImpressDocument::getPartName( int nPart ) OUString SdXImpressDocument::getPartHash( int nPart ) { - SdPage* pPage = mpDoc->GetSdPage( nPart, PK_STANDARD ); + SdPage* pPage = mpDoc->GetSdPage( nPart, PageKind::Standard ); if (!pPage) { SAL_WARN("sd", "DrawViewShell not available!"); @@ -2340,13 +2340,13 @@ void SdXImpressDocument::setPartMode( int nPartMode ) if (!pViewSh) return; - PageKind aPageKind( PK_STANDARD ); + PageKind aPageKind( PageKind::Standard ); switch ( nPartMode ) { case LOK_PARTMODE_SLIDES: break; case LOK_PARTMODE_NOTES: - aPageKind = PK_NOTES; + aPageKind = PageKind::Notes; break; } pViewSh->SetPageKind( aPageKind ); @@ -2748,7 +2748,7 @@ sal_Int32 SAL_CALL SdDrawPagesAccess::getCount() if( nullptr == mpModel ) throw lang::DisposedException(); - return mpModel->mpDoc->GetSdPageCount( PK_STANDARD ); + return mpModel->mpDoc->GetSdPageCount( PageKind::Standard ); } uno::Any SAL_CALL SdDrawPagesAccess::getByIndex( sal_Int32 Index ) @@ -2761,10 +2761,10 @@ uno::Any SAL_CALL SdDrawPagesAccess::getByIndex( sal_Int32 Index ) uno::Any aAny; - if( (Index < 0) || (Index >= mpModel->mpDoc->GetSdPageCount( PK_STANDARD ) ) ) + if( (Index < 0) || (Index >= mpModel->mpDoc->GetSdPageCount( PageKind::Standard ) ) ) throw lang::IndexOutOfBoundsException(); - SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)Index, PK_STANDARD ); + SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)Index, PageKind::Standard ); if( pPage ) { uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); @@ -2784,11 +2784,11 @@ uno::Any SAL_CALL SdDrawPagesAccess::getByName( const OUString& aName ) throw(co if( !aName.isEmpty() ) { - const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD ); + const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PageKind::Standard ); sal_uInt16 nPage; for( nPage = 0; nPage < nCount; nPage++ ) { - SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD ); + SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PageKind::Standard ); if(nullptr == pPage) continue; @@ -2812,14 +2812,14 @@ uno::Sequence< OUString > SAL_CALL SdDrawPagesAccess::getElementNames() throw(un if( nullptr == mpModel ) throw lang::DisposedException(); - const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD ); + const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PageKind::Standard ); uno::Sequence< OUString > aNames( nCount ); OUString* pNames = aNames.getArray(); sal_uInt16 nPage; for( nPage = 0; nPage < nCount; nPage++ ) { - SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD ); + SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PageKind::Standard ); *pNames++ = SdDrawPage::getPageApiName( pPage ); } @@ -2833,11 +2833,11 @@ sal_Bool SAL_CALL SdDrawPagesAccess::hasByName( const OUString& aName ) throw(un if( nullptr == mpModel ) throw lang::DisposedException(); - const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD ); + const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PageKind::Standard ); sal_uInt16 nPage; for( nPage = 0; nPage < nCount; nPage++ ) { - SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD ); + SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PageKind::Standard ); if(nullptr == pPage) continue; @@ -2903,7 +2903,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag SdDrawDocument& rDoc = *mpModel->mpDoc; - sal_uInt16 nPageCount = rDoc.GetSdPageCount( PK_STANDARD ); + sal_uInt16 nPageCount = rDoc.GetSdPageCount( PageKind::Standard ); if( nPageCount > 1 ) { // get pPage from xPage and determine the Id (nPos ) afterwards @@ -2911,7 +2911,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag if( pSvxPage ) { SdPage* pPage = static_cast<SdPage*>(pSvxPage->GetSdrPage()); - if(pPage && ( pPage->GetPageKind() == PK_STANDARD ) ) + if(pPage && ( pPage->GetPageKind() == PageKind::Standard ) ) { sal_uInt16 nPage = pPage->GetPageNum(); @@ -3018,7 +3018,7 @@ sal_Int32 SAL_CALL SdMasterPagesAccess::getCount() if( nullptr == mpModel->mpDoc ) throw lang::DisposedException(); - return mpModel->mpDoc->GetMasterSdPageCount(PK_STANDARD); + return mpModel->mpDoc->GetMasterSdPageCount(PageKind::Standard); } /** @@ -3035,10 +3035,10 @@ uno::Any SAL_CALL SdMasterPagesAccess::getByIndex( sal_Int32 Index ) uno::Any aAny; - if( (Index < 0) || (Index >= mpModel->mpDoc->GetMasterSdPageCount( PK_STANDARD ) ) ) + if( (Index < 0) || (Index >= mpModel->mpDoc->GetMasterSdPageCount( PageKind::Standard ) ) ) throw lang::IndexOutOfBoundsException(); - SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( (sal_uInt16)Index, PK_STANDARD ); + SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( (sal_uInt16)Index, PageKind::Standard ); if( pPage ) { uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY ); @@ -3116,8 +3116,8 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn static_cast<SdStyleSheetPool*>(pDoc->GetStyleSheetPool())->CreateLayoutStyleSheets( aPrefix ); // get the first page for initial size and border settings - SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_STANDARD ); - SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_NOTES); + SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PageKind::Standard ); + SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PageKind::Notes); // create and insert new draw masterpage SdPage* pMPage = mpModel->mpDoc->AllocSdPage(true); @@ -3139,7 +3139,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn // create and insert new notes masterpage SdPage* pMNotesPage = mpModel->mpDoc->AllocSdPage(true); pMNotesPage->SetSize( pRefNotesPage->GetSize() ); - pMNotesPage->SetPageKind(PK_NOTES); + pMNotesPage->SetPageKind(PageKind::Notes); pMNotesPage->SetBorder( pRefNotesPage->GetLftBorder(), pRefNotesPage->GetUppBorder(), pRefNotesPage->GetRgtBorder(), @@ -3180,7 +3180,7 @@ void SAL_CALL SdMasterPagesAccess::remove( const uno::Reference< drawing::XDrawP return; //Todo: this should be excepted // only standard pages can be removed directly - if( pPage->GetPageKind() == PK_STANDARD ) + if( pPage->GetPageKind() == PageKind::Standard ) { sal_uInt16 nPage = pPage->GetPageNum(); @@ -3299,8 +3299,8 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames() if( pDoc->GetDocumentType() == DocumentType::Draw ) { - const sal_uInt16 nMaxPages = pDoc->GetSdPageCount( PK_STANDARD ); - const sal_uInt16 nMaxMasterPages = pDoc->GetMasterSdPageCount( PK_STANDARD ); + const sal_uInt16 nMaxPages = pDoc->GetSdPageCount( PageKind::Standard ); + const sal_uInt16 nMaxMasterPages = pDoc->GetMasterSdPageCount( PageKind::Standard ); uno::Sequence< OUString > aSeq( nMaxPages + nMaxMasterPages ); OUString* pStr = aSeq.getArray(); @@ -3308,11 +3308,11 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames() sal_uInt16 nPage; // standard pages for( nPage = 0; nPage < nMaxPages; nPage++ ) - *pStr++ = pDoc->GetSdPage( nPage, PK_STANDARD )->GetName(); + *pStr++ = pDoc->GetSdPage( nPage, PageKind::Standard )->GetName(); // master pages for( nPage = 0; nPage < nMaxMasterPages; nPage++ ) - *pStr++ = pDoc->GetMasterSdPage( nPage, PK_STANDARD )->GetName(); + *pStr++ = pDoc->GetMasterSdPage( nPage, PageKind::Standard )->GetName(); return aSeq; } else @@ -3382,7 +3382,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw(std::exc for( nPage = 0; nPage < nMaxPages; nPage++ ) { pPage = static_cast<SdPage*>(pDoc->GetPage( nPage )); - if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) ) + if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PageKind::Standard)) ) return pPage; } @@ -3390,7 +3390,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw(std::exc for( nPage = 0; nPage < nMaxMasterPages; nPage++ ) { pPage = static_cast<SdPage*>(pDoc->GetMasterPage( nPage )); - if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) ) + if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PageKind::Standard)) ) return pPage; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 96e5f6e93b0c..11c16dfac953 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -179,7 +179,7 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind eP static const SfxItemPropertyMapEntry aDrawPageNotesHandoutPropertyMap_Impl[] = { - // this must be the first two entries so they can be excluded for PK_STANDARD + // this must be the first two entries so they can be excluded for PageKind::Standard { OUString(UNO_NAME_PAGE_BACKGROUND), WID_PAGE_BACK, cppu::UnoType<beans::XPropertySet>::get(), beans::PropertyAttribute::MAYBEVOID,0}, DRAW_PAGE_NOTES_PROPERTIES }; @@ -218,13 +218,13 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind eP GRAPHIC_PAGE_PROPERTIES }; - bool bWithoutBackground = ePageKind != PK_STANDARD && ePageKind != PK_HANDOUT; + bool bWithoutBackground = ePageKind != PageKind::Standard && ePageKind != PageKind::Handout; const SvxItemPropertySet* pRet = nullptr; if( bImpress ) { - if( ePageKind == PK_STANDARD ) + if( ePageKind == PageKind::Standard ) { - //PK_STANDARD always has a background property + //PageKind::Standard always has a background property static SvxItemPropertySet aDrawPagePropertySet_Impl( aDrawPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() ); pRet = &aDrawPagePropertySet_Impl; } @@ -306,7 +306,7 @@ const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind ) }; const SvxItemPropertySet* pRet = nullptr; - if( ePageKind == PK_HANDOUT ) + if( ePageKind == PageKind::Handout ) { static SvxItemPropertySet aHandoutMasterPagePropertySet_Impl( aHandoutMasterPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() ); pRet = &aHandoutMasterPagePropertySet_Impl; @@ -475,7 +475,7 @@ SdrObject * SdGenericDrawPage::CreateSdrObject_( const Reference< drawing::XShap } else if( aType == "PageShape" ) { - if( GetPage()->GetPageKind() == PK_NOTES && GetPage()->IsMasterPage() ) + if( GetPage()->GetPageKind() == PageKind::Notes && GetPage()->IsMasterPage() ) eObjKind = PRESOBJ_TITLE; else eObjKind = PRESOBJ_PAGE; @@ -584,9 +584,9 @@ Any SAL_CALL SdGenericDrawPage::queryInterface( const uno::Type & rType ) } else if (IsImpressDocument() && rType == cppu::UnoType<XAnimationNodeSupplier>::get()) { - const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PK_STANDARD; + const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard; - if( ePageKind == PK_STANDARD ) + if( ePageKind == PageKind::Standard ) return makeAny( Reference< XAnimationNodeSupplier >( this ) ); } else @@ -946,7 +946,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName } case WID_PAGE_NUMBER: - if( (GetPage()->GetPageKind() == PK_HANDOUT) && !GetPage()->IsMasterPage() ) + if( (GetPage()->GetPageKind() == PageKind::Handout) && !GetPage()->IsMasterPage() ) { if( !(aValue >>= mnTempPageNumber) ) throw lang::IllegalArgumentException(); @@ -1121,11 +1121,11 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) if ( pDocShell ) { sal_uInt16 nPgNum = 0; - sal_uInt16 nPageCount = pDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt16 nPageCount = pDoc->GetSdPageCount( PageKind::Standard ); sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 ); while( nPgNum < nPageCount ) { - pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber ); + pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PageKind::Standard ), nPgNum == nPageNumber ); nPgNum++; } std::shared_ptr<GDIMetaFile> xMetaFile = pDocShell->GetPreviewMetaFile(); @@ -1162,11 +1162,11 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) if ( pDocShell ) { sal_uInt16 nPgNum = 0; - sal_uInt16 nPageCount = pDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt16 nPageCount = pDoc->GetSdPageCount( PageKind::Standard ); sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 ); while( nPgNum < nPageCount ) { - pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber ); + pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PageKind::Standard ), nPgNum == nPageNumber ); nPgNum++; } std::shared_ptr<GDIMetaFile> xMetaFile = pDocShell->GetPreviewMetaFile(); @@ -1417,7 +1417,7 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co { case OBJ_TITLETEXT: pShape = new SvxShapeText( pObj ); - if( GetPage()->GetPageKind() == PK_NOTES && GetPage()->IsMasterPage() ) + if( GetPage()->GetPageKind() == PageKind::Notes && GetPage()->IsMasterPage() ) { // fake a empty PageShape if it's a title shape on the master page pShape->SetShapeType("com.sun.star.presentation.PageShape"); @@ -2084,7 +2084,7 @@ Any SAL_CALL SdDrawPage::queryInterface( const uno::Type & rType ) && rType == cppu::UnoType<presentation::XPresentationPage>::get() ) { SdPage * p = dynamic_cast<SdPage *>(SvxDrawPage::mpPage); - if( p == nullptr || p->GetPageKind() != PK_HANDOUT ) + if( p == nullptr || p->GetPageKind() != PageKind::Handout ) { return makeAny( Reference< presentation::XPresentationPage >( this ) ); } @@ -2114,8 +2114,8 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes() throw(uno::RuntimeExceptio if( maTypeSequence.getLength() == 0 ) { - const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PK_STANDARD; - bool bPresPage = IsImpressDocument() && ePageKind != PK_HANDOUT; + const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard; + bool bPresPage = IsImpressDocument() && ePageKind != PageKind::Handout; // Collect the types of this class. ::std::vector<uno::Type> aTypes; @@ -2133,7 +2133,7 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes() throw(uno::RuntimeExceptio aTypes.push_back(cppu::UnoType<beans::XMultiPropertySet>::get()); if( bPresPage ) aTypes.push_back(cppu::UnoType<presentation::XPresentationPage>::get()); - if( bPresPage && ePageKind == PK_STANDARD ) + if( bPresPage && ePageKind == PageKind::Standard ) aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get()); // Get types of base class. @@ -2291,7 +2291,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName ) OUString aName( rName ); - if(GetPage() && GetPage()->GetPageKind() != PK_NOTES) + if(GetPage() && GetPage()->GetPageKind() != PageKind::Notes) { // check if this is the default 'page1234' name if(aName.startsWith( sEmptyPageName )) @@ -2330,9 +2330,9 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName ) GetPage()->SetName( aName ); sal_uInt16 nNotesPageNum = (GetPage()->GetPageNum()-1)>>1; - if( GetModel()->GetDoc()->GetSdPageCount( PK_NOTES ) > nNotesPageNum ) + if( GetModel()->GetDoc()->GetSdPageCount( PageKind::Notes ) > nNotesPageNum ) { - SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( nNotesPageNum, PK_NOTES ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( nNotesPageNum, PageKind::Notes ); if( pNotesPage ) pNotesPage->SetName(aName); } @@ -2418,7 +2418,7 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >& static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetLayoutName( pSdPage->GetLayoutName() ); // set notes master also - SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); pNotesPage->TRG_ClearMasterPage(); sal_uInt16 nNum = (SvxFmDrawPage::mpPage->TRG_GetMasterPage()).GetPageNum() + 1; @@ -2441,7 +2441,7 @@ Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getNotesPage() if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() && SvxFmDrawPage::mpPage->GetPageNum() ) { - SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); if( pNotesPage ) { Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY ); @@ -2703,7 +2703,7 @@ Any SdGenericDrawPage::getNavigationOrder() // class SdMasterPage SdMasterPage::SdMasterPage( SdXImpressDocument* pModel, SdPage* pPage ) throw() -: SdGenericDrawPage( pModel, pPage, ImplGetMasterPagePropertySet( pPage ? pPage->GetPageKind() : PK_STANDARD ) ) +: SdGenericDrawPage( pModel, pPage, ImplGetMasterPagePropertySet( pPage ? pPage->GetPageKind() : PageKind::Standard ) ) { } @@ -2729,7 +2729,7 @@ Any SAL_CALL SdMasterPage::queryInterface( const uno::Type & rType ) aAny <<= Reference< container::XNamed >(this); else if( rType == cppu::UnoType<presentation::XPresentationPage>::get() && ( IsImpressDocument() && - GetPage() && GetPage()->GetPageKind() != PK_HANDOUT) ) + GetPage() && GetPage()->GetPageKind() != PageKind::Handout) ) aAny <<= Reference< presentation::XPresentationPage >( this ); else return SdGenericDrawPage::queryInterface( rType ); @@ -2758,8 +2758,8 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes() throw(uno::RuntimeExcept if( maTypeSequence.getLength() == 0 ) { - const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PK_STANDARD; - bool bPresPage = IsImpressDocument() && SvxFmDrawPage::mpPage && ePageKind != PK_HANDOUT; + const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard; + bool bPresPage = IsImpressDocument() && SvxFmDrawPage::mpPage && ePageKind != PageKind::Handout; // Collect the types of this class. ::std::vector<uno::Type> aTypes; @@ -2776,7 +2776,7 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes() throw(uno::RuntimeExcept aTypes.push_back(cppu::UnoType<beans::XMultiPropertySet>::get()); if( bPresPage ) aTypes.push_back(cppu::UnoType<presentation::XPresentationPage>::get()); - if( bPresPage && ePageKind == PK_STANDARD ) + if( bPresPage && ePageKind == PageKind::Standard ) aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get()); // Get types of base class. @@ -2817,7 +2817,7 @@ Sequence< OUString > SAL_CALL SdMasterPage::getSupportedServiceNames() throw(uno Sequence< OUString > aSeq( SdGenericDrawPage::getSupportedServiceNames() ); comphelper::ServiceInfoHelper::addToSequence( aSeq, {"com.sun.star.drawing.MasterPage"} ); - if( SvxFmDrawPage::mpPage && static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetPageKind() == PK_HANDOUT ) + if( SvxFmDrawPage::mpPage && static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetPageKind() == PageKind::Handout ) comphelper::ServiceInfoHelper::addToSequence( aSeq, {"com.sun.star.presentation.HandoutMasterPage"} ); return aSeq; @@ -3040,7 +3040,7 @@ void SAL_CALL SdMasterPage::setName( const OUString& rName ) throwIfDisposed(); - if(SvxFmDrawPage::mpPage && GetPage()->GetPageKind() != PK_NOTES) + if(SvxFmDrawPage::mpPage && GetPage()->GetPageKind() != PageKind::Notes) { SdDrawDocument* pDoc = GetModel()->GetDoc(); bool bOutDummy; @@ -3102,7 +3102,7 @@ Reference< drawing::XDrawPage > SAL_CALL SdMasterPage::getNotesPage() if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() ) { - SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES ); + SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PageKind::Notes ); if( pNotesPage ) { Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY ); |