52#include <unomodel.hxx>
70 const SdPage* pPage =
nullptr;
76 while (nPage < nMaxPages && !pObjFound)
81 while (aIter.
IsMore() && !pObjFound)
85 if( ( pObj->
GetName() == rObjName ) ||
101 while (nPage < nMaxMasterPages && !pObjFound)
106 while (aIter.
IsMore() && !pObjFound)
110 if( ( pObj->
GetName() == rObjName ) ||
129 sal_uInt16 nPage = 0;
133 rbIsMasterPage =
false;
144 && pPage->
GetName() == rPgName)
161 if (pPage && pPage->
GetName() == rPgName)
164 rbIsMasterPage =
true;
179 sal_uInt16 nPage = 0;
181 while (nPage < nMaxPages)
194 while (nPage < nMaxPages)
198 if (pPage && pPage->
GetName() == rPgName)
239 for (sal_uInt16 nPage = nStartPos; nPage < nPageCount; nPage++)
248 for (
size_t nObj = 0; nObj < nObjCount; ++nObj)
255 SAL_WARN_IF(!nStartPos,
"sd",
"Position of notes page must not be 0.");
257 SAL_WARN_IF(nPage <= 1,
"sd",
"Page object must not be a handout.");
259 if (nStartPos > 0 && nPage > 1)
269 if (aNewName.empty())
285 if (!
aURL.isEmpty() && (
aURL[0] == 35) && (
aURL.indexOf(aOldName, 1) == 1))
287 if (
aURL.getLength() == sal_Int32(aOldName.size() + 1))
295 const OUString sNotes(
SdResId(STR_NOTES));
296 if (
aURL.getLength() == sal_Int32(aOldName.size()) + 2 + sNotes.getLength()
297 &&
aURL.indexOf(sNotes, aOldName.size() + 2) == sal_Int32(aOldName.size() + 2))
300 aNewName +
" " + sNotes;
319 if ((pFldItem =
dynamic_cast< const SvxFieldItem *
> (pItem)) !=
nullptr)
327 if (!
aURL.isEmpty() && (
aURL[0] == 35))
329 OUString aHashSlide =
"#" +
SdResId(STR_PAGE);
331 if (
aURL.startsWith(aHashSlide))
333 OUString aURLCopy =
aURL;
334 const OUString sNotes(
SdResId(STR_NOTES));
336 aURLCopy = aURLCopy.replaceAt(0, aHashSlide.getLength(),
u"");
338 bool bNotesLink = ( aURLCopy.getLength() >= sNotes.getLength() + 3
339 && aURLCopy.endsWith(sNotes) );
341 if (bNotesLink != bNotes)
345 aURLCopy = aURLCopy.replaceAt(aURLCopy.getLength() - sNotes.getLength(), sNotes.getLength(),
u"");
347 sal_Int32 number = aURLCopy.toInt32();
348 sal_uInt16 realPageNumber = (
nPos + 1)/ 2;
350 if ( number >= realPageNumber )
353 number += nIncrement;
354 aURL =
aURL.replaceAt(aHashSlide.getLength() + 1,
aURL.getLength() - aHashSlide.getLength() - 1,
u"") +
355 OUString::number(number);
358 aURL +=
" " + sNotes;
374 sal_uInt16 nMin = std::min(nPgNum, nNewPos);
386 static_cast<SdPage*
>(pPage)->ConnectLink();
415 auto pSdPage =
static_cast<SdPage*
>(pPage.get());
469 const sal_uInt16 nDestPageNum(pPage->
GetPageNum() + 1);
470 SdPage* pNotesPage =
nullptr;
507 SdPage* pRefPage =
nullptr;
514 pHandoutPage->SetSize(pRefPage->
GetSize());
519 pHandoutPage->SetSize(aDefSize);
520 pHandoutPage->SetBorder(0, 0, 0, 0);
524 pHandoutPage->SetName(
SdResId(STR_HANDOUT) );
529 pHandoutMPage->SetSize( pHandoutPage->GetSize() );
531 pHandoutMPage->SetBorder( pHandoutPage->GetLeftBorder(),
532 pHandoutPage->GetUpperBorder(),
533 pHandoutPage->GetRightBorder(),
534 pHandoutPage->GetLowerBorder() );
536 pHandoutPage->TRG_SetMasterPage( *pHandoutMPage );
542 bool bClipboard =
false;
553 pPage->SetSize( pRefPage->
GetSize() );
559 pPage->SetSize(aDefSize);
562 if (pPrinter && pPrinter->IsValid())
564 Size aOutSize(pPrinter->GetOutputSize());
565 Point aPageOffset(pPrinter->GetPageOffset());
566 aPageOffset -= pPrinter->PixelToLogic(
Point() );
574 pPage->SetBorder(nLeft, nTop, nRight, nBottom);
583 pPage->SetBorder(1000, 1000, 1000, 1000);
591 pPage->SetBorder(0, 0, 0, 0);
604 pMPage->SetSize( pPage->GetSize() );
605 pMPage->SetBorder( pPage->GetLeftBorder(),
606 pPage->GetUpperBorder(),
607 pPage->GetRightBorder(),
608 pPage->GetLowerBorder() );
610 pPage->TRG_SetMasterPage( *pMPage );
612 pMPage->SetLayoutName( pPage->GetLayoutName() );
622 pNotesPage->SetSize( pRefPage->
GetSize() );
630 pNotesPage->SetSize(aDefSize);
637 pNotesPage->SetBorder(0, 0, 0, 0);
642 pNotesPage->SetLayoutName( pPage->GetLayoutName() );
646 pNotesMPage->SetSize( pNotesPage->GetSize() );
648 pNotesMPage->SetBorder( pNotesPage->GetLeftBorder(),
649 pNotesPage->GetUpperBorder(),
650 pNotesPage->GetRightBorder(),
651 pNotesPage->GetLowerBorder() );
653 pNotesPage->TRG_SetMasterPage( *pNotesMPage );
655 pNotesMPage->SetLayoutName( pPage->GetLayoutName() );
686 for (sal_uInt16
i = 1;
i < nPageCount;
i =
i + 2)
716 for (sal_uInt16 nPage = 0; nPage < nNoOfPages; ++nPage)
731 bool bSomethingHappened =
false;
739 std::vector<SdPage*> aPageList;
740 for (nPage = 0; nPage < nNoOfPages; nPage++)
745 aPageList.push_back(pPage);
752 if (nPage != sal_uInt16(-1))
763 nPage = sal_uInt16(-1);
768 if (nPage == sal_uInt16(-1))
770 std::vector<SdPage*>::reverse_iterator iter;
771 for (iter = aPageList.rbegin(); iter != aPageList.rend(); ++iter)
773 nPage = (*iter)->GetPageNum();
784 bSomethingHappened =
true;
791 nTargetPage = 2 * nPage + 1;
793 for (
const auto& rpPage : aPageList)
795 nPage = rpPage->GetPageNum();
796 if (nPage > nTargetPage)
800 if (nPage != nTargetPage)
810 bSomethingHappened =
true;
815 if (nPage != nTargetPage)
825 bSomethingHappened =
true;
828 nTargetPage = rpPage->GetPageNum();
835 return bSomethingHappened;
847 bool bChanged =
false;
890 if (IsTransportContainer())
894 mpDocSh->SetWaitCursor(
true );
896 bool bChanged = IsChanged();
923 SetChanged(bChanged);
926 mpDocSh->SetWaitCursor(
false );
940 WorkStartupHdl(
nullptr);
952 DBG_ASSERT(
pObject,
"sd::SdDrawDocument::GetAnimationInfo(), invalid argument!");
966 for (nUD = 0; nUD < nUDCount; nUD++)
976 if( (pRet ==
nullptr) && bCreate )
1004 for( nPage = 1; nPage < nMaxPages; nPage++ )
1013 if( nPage >= nMaxPages )
1016 SdPage* pNotesPage =
nullptr;
1020 bool bChanged =
false;
1023 while( nPage < nMaxPages )
1029 sal_uInt16 nFound = nPage + 1;
1030 while( nFound < nMaxPages )
1045 if( nMaxPages == nFound )
1051 if( nPage < nMaxPages )
1054 pNotesPage =
nullptr;
1060 sal_uInt16 nFound = nPage + 1;
1061 while( nFound < nMaxPages )
1075 if( nMaxPages == nFound )
1080 SdPage* pRefNotesPage =
nullptr;
1082 while( nFound < nMaxPages )
1089 if( nFound == nMaxPages )
1090 pRefNotesPage =
nullptr;
1096 pNewNotesPage->SetSize( pRefNotesPage->
GetSize() );
1113 while( nPage < nMaxPages )
1123 OSL_FAIL(
"master pages where in a wrong order" );
1131 const OUString& sStandardPageName,
1132 const OUString& sNotesPageName,
1137 const sal_Int32 nInsertPosition)
1139 SdPage* pPreviousStandardPage;
1140 SdPage* pPreviousNotesPage;
1148 pPreviousNotesPage = pActualPage;
1149 sal_uInt16 nNotesPageNum = pPreviousNotesPage->
GetPageNum() + 2;
1150 pPreviousStandardPage =
static_cast<SdPage*
>(
GetPage(nNotesPageNum - 3) );
1155 pPreviousStandardPage = pActualPage;
1156 sal_uInt16 nStandardPageNum = pPreviousStandardPage->
GetPageNum() + 2;
1157 pPreviousNotesPage =
static_cast<SdPage*
>(
GetPage(nStandardPageNum - 1) );
1166 pStandardPage->SetSize( pPreviousStandardPage->
GetSize() );
1167 pStandardPage->SetBorder( pPreviousStandardPage->
GetLeftBorder(),
1176 pStandardPage->SetLayoutName( pPreviousStandardPage->
GetLayoutName() );
1177 pStandardPage->SetAutoLayout(eStandardLayout,
true);
1188 pStandardPage->SetPresChange( pPreviousStandardPage->
GetPresChange() );
1189 pStandardPage->SetTime( pPreviousStandardPage->
GetTime() );
1199 pNotesPage->SetLayoutName( pPreviousNotesPage->
GetLayoutName() );
1200 pNotesPage->SetAutoLayout(eNotesLayout,
true);
1210 pStandardPage.get(),
1229 pActualPage, ePageKind,
1231 OUString(), OUString(),
1232 aVisibleLayers.
IsSet(aBckgrnd),
1233 aVisibleLayers.
IsSet(aBckgrndObj), -1);
1239 const OUString& sStandardPageName,
1240 const OUString& sNotesPageName,
1243 const sal_Int32 nInsertPosition)
1245 SdPage* pPreviousStandardPage;
1246 SdPage* pPreviousNotesPage;
1254 pPreviousNotesPage = pActualPage;
1255 sal_uInt16 nNotesPageNum = pPreviousNotesPage->
GetPageNum() + 2;
1256 pPreviousStandardPage =
static_cast<SdPage*
>(
GetPage(nNotesPageNum - 3) );
1260 pPreviousStandardPage = pActualPage;
1261 sal_uInt16 nStandardPageNum = pPreviousStandardPage->
GetPageNum() + 2;
1262 pPreviousNotesPage =
static_cast<SdPage*
>(
GetPage(nStandardPageNum - 1) );
1266 pStandardPage =
static_cast<SdPage*
>( pPreviousStandardPage->
CloneSdrPage(*this).get() );
1276 pStandardPage.get(),
1284 const OUString& sStandardPageName,
1285 const OUString& sNotesPageName,
1290 sal_Int32 nInsertPosition)
1292 SdPage* pPreviousStandardPage;
1293 SdPage* pPreviousNotesPage;
1294 sal_uInt16 nStandardPageNum;
1295 sal_uInt16 nNotesPageNum;
1296 OUString aNotesPageName(sNotesPageName);
1303 pPreviousNotesPage = pActualPage;
1304 nNotesPageNum = pPreviousNotesPage->
GetPageNum() + 2;
1305 pPreviousStandardPage =
static_cast<SdPage*
>(
GetPage(nNotesPageNum - 3) );
1306 nStandardPageNum = nNotesPageNum - 1;
1310 pPreviousStandardPage = pActualPage;
1311 nStandardPageNum = pPreviousStandardPage->
GetPageNum() + 2;
1312 pPreviousNotesPage =
static_cast<SdPage*
>(
GetPage(nStandardPageNum - 1) );
1313 nNotesPageNum = nStandardPageNum + 1;
1314 aNotesPageName = sStandardPageName;
1317 OSL_ASSERT(nNotesPageNum==nStandardPageNum+1);
1318 if (nInsertPosition < 0)
1319 nInsertPosition = nStandardPageNum;
1323 pPreviousStandardPage,
1346 SdPage const * pPreviousPage,
1348 const OUString& sPageName,
1349 sal_uInt16 nInsertionPoint,
1353 if (pPreviousPage !=
nullptr)
1365 if (pPreviousPage !=
nullptr)
1371 aVisibleLayers.
Set(aBckgrnd, bIsPageBack);
1372 aVisibleLayers.
Set(aBckgrndObj, bIsPageObj);
static const AllSettings & GetSettings()
constexpr tools::Long Y() const
constexpr tools::Long X() const
void CreateFirstPages(SdDrawDocument const *pRefDocument=nullptr)
if the document does not contain at least one handout, one slide and one notes page with at least one...
SAL_DLLPRIVATE sal_uInt16 DuplicatePage(sal_uInt16 nPageNum)
This method acts as a simplified front end for the more complex <member>DuplicatePage()</member> meth...
SAL_DLLPRIVATE void ReplacePageInCustomShows(const SdPage *pOldPage, const SdPage *pNewPage)
replacespOldPage from all custom shows with pNewPage or removes pOldPage from all custom shows if pNe...
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
bool IsPageNameUnique(std::u16string_view rPageName) const
checks, if the given name is a unique name for an existing slide
static SdAnimationInfo * GetShapeUserData(SdrObject &rObject, bool bCreate=false)
virtual SAL_DLLPRIVATE void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF) override
sal_uInt16 GetActiveSdPageCount() const
sd::UndoManager * GetUndoManager() const
SAL_DLLPRIVATE SfxItemPool & GetPool()
SAL_DLLPRIVATE sal_uLong GetLinkCount() const
LanguageType meLanguageCTL
bool CreateMissingNotesAndHandoutPages()
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
std::unique_ptr< Timer > mpWorkStartupTimer
::sd::DrawDocShell * mpDocSh
SAL_DLLPRIVATE void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF) override
void StopWorkStartupDelay()
SAL_DLLPRIVATE void SetLanguage(const LanguageType eLang, const sal_uInt16 nId)
SAL_DLLPRIVATE void UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
SAL_DLLPRIVATE sal_uInt16 GetPageByName(std::u16string_view rPgName, bool &rbIsMasterPage) const
Return the first page that has the given name.
SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage)
::std::unique_ptr< ImpMasterPageListWatcher > mpMasterPageListWatcher
SAL_DLLPRIVATE void CheckMasterPages()
this method enforces that the masterpages are in the correct order, that is at position 1 is a PageKi...
virtual SAL_DLLPRIVATE rtl::Reference< SdrPage > RemoveMasterPage(sal_uInt16 nPgNum) override
SAL_DLLPRIVATE sal_uInt16 InsertPageSet(SdPage *pCurrentPage, PageKind ePageKind, const OUString &sStandardPageName, const OUString &sNotesPageName, bool bIsPageBack, bool bIsPageObj, SdPage *pStandardPage, SdPage *pNotesPage, sal_Int32 nInsertPosition)
Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
SAL_DLLPRIVATE void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) override
static SAL_DLLPRIVATE SdAnimationInfo * GetAnimationInfo(SdrObject *pObject)
deprecated
::std::unique_ptr< ImpDrawPageListWatcher > mpDrawPageListWatcher
SAL_DLLPRIVATE void UnselectAllPages()
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
SAL_DLLPRIVATE SdrObject * GetObj(std::u16string_view rObjName) const
SAL_DLLPRIVATE void SetupNewPage(SdPage const *pPreviousPage, SdPage *pPage, const OUString &sPageName, sal_uInt16 nInsertionPoint, bool bIsPageBack, bool bIsPageObj)
Set up a newly created page and insert it into the list of pages.
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
LanguageType meLanguageCJK
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SAL_DLLPRIVATE void UpdatePageRelativeURLs(SdPage const *pPage, sal_uInt16 nPos, sal_Int32 nIncrement)
SAL_DLLPRIVATE rtl::Reference< SdrPage > RemovePage(sal_uInt16 nPgNum) override
SAL_DLLPRIVATE void DeletePage(sal_uInt16 nPgNum) override
SAL_DLLPRIVATE sal_uInt16 CreatePage(SdPage *pCurrentPage, PageKind ePageKind, const OUString &sStandardPageName, const OUString &sNotesPageName, AutoLayout eStandardLayout, AutoLayout eNotesLayout, bool bIsPageBack, bool bIsPageObj, const sal_Int32 nInsertPosition)
Create and insert a set of two new pages: a standard (draw) page and the associated notes page.
SAL_DLLPRIVATE rtl::Reference< SdPage > AllocSdPage(bool bMasterPage)
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
bool getTransitionDirection() const
sal_Int16 getTransitionSubtype() const
PageKind GetPageKind() const
sal_Int16 getTransitionType() const
virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr) override
PresChange GetPresChange() const
const sd::HeaderFooterSettings & getHeaderFooterSettings() const
double getTransitionDuration() const
void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false)
void SetSelected(bool bSel)
virtual OUString GetLayoutName() const override
void SetPageKind(PageKind ePgType)
const OUString & GetName() const
void SetName(const OUString &rName)
Set the name of the page and broadcast a model change.
sal_Int32 getTransitionFadeColor() const
AutoLayout GetAutoLayout() const
virtual void SetSize(const Size &aSize) override
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const override
void AddStyleFamily(const SdPage *pPage)
void RemoveStyleFamily(const SdPage *pPage)
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
sfx2::LinkManager * m_pLinkManager
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
sal_uInt16 GetMasterPageCount() const
rtl::Reference< SfxItemPool > m_pItemPool
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrUndoFactory & GetSdrUndoFactory() const
virtual void DeletePage(sal_uInt16 nPgNum)
css::uno::Reference< css::uno::XInterface > const & getUnoModel()
void RecalcPageNums(bool bMaster)
void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
bool IsUndoEnabled() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SdrLayerAdmin & GetLayerAdmin() const
sal_uInt16 GetPageCount() const
std::unique_ptr< SdrOutliner > m_pHitTestOutliner
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrInventor GetInventor() const
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
sal_uInt16 GetUserDataCount() const
virtual SdrInventor GetObjInventor() const
virtual const OUString & GetName() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
virtual SdrObjKind GetObjIdentifier() const
const OUString & GetPersistName() const
void TRG_SetMasterPage(SdrPage &rNew)
SdrPage & TRG_GetMasterPage() const
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet &rNew)
sal_Int32 GetLeftBorder() const
void SetInserted(bool bNew=true)
bool TRG_HasMasterPage() const
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
sal_Int32 GetLowerBorder() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const SvxFieldData * GetField() const
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
void SetURL(const OUString &rURL)
const OUString & GetURL() const
virtual SfxUndoManager * GetUndoManager() override
SfxPrinter * GetPrinter(bool bCreate)
Creates (if necessary) and returns a SfxPrinter.
const SvBaseLinks & GetLinks() const
#define DBG_ASSERT(sCon, aError)
IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl, Timer *, void)
const ::tools::Long PRINT_OFFSET
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
EmbeddedObjectRef * pObject
#define SD_ANIMATIONINFO_ID
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
OUString SdResId(TranslateId aId)
constexpr OUStringLiteral sUNO_LayerName_background_objects
constexpr OUStringLiteral sUNO_LayerName_background