LibreOffice Module sd (master) 1
|
A collection of methods supporting the handling of master pages. More...
#include <DocumentHelper.hxx>
Static Public Member Functions | |
static SdPage * | CopyMasterPageToLocalDocument (SdDrawDocument &rTargetDocument, SdPage *pMasterPage) |
Return a copy of the given master page in the given document. More... | |
static SdPage * | GetSlideForMasterPage (SdPage const *pMasterPage) |
Return and, when not yet present, create a slide that uses the given master page. More... | |
static void | ProvideStyles (SdDrawDocument const &rSourceDocument, SdDrawDocument &rTargetDocument, SdPage const *pPage) |
Copy the styles used by the given page from the source document to the target document. More... | |
static void | AssignMasterPageToPageList (SdDrawDocument &rTargetDocument, SdPage *pMasterPage, const std::shared_ptr< std::vector< SdPage * > > &rPageList) |
Assign the given master page to the list of pages. More... | |
Static Private Member Functions | |
static SdPage * | AddMasterPage (SdDrawDocument &rTargetDocument, SdPage const *pMasterPage) |
static SdPage * | AddMasterPage (SdDrawDocument &rTargetDocument, SdPage const *pMasterPage, sal_uInt16 nInsertionIndex) |
static SdPage * | ProvideMasterPage (SdDrawDocument &rTargetDocument, SdPage *pMasterPage, const std::shared_ptr< std::vector< SdPage * > > &rpPageList) |
static void | AssignMasterPageToPage (SdPage const *pMasterPage, std::u16string_view rsBaseLayoutName, SdPage *pPage) |
Assign the given master page to the given page. More... | |
A collection of methods supporting the handling of master pages.
Definition at line 36 of file DocumentHelper.hxx.
|
staticprivate |
Definition at line 201 of file DocumentHelper.cxx.
References SdPage::CloneSdrPage(), DBG_UNHANDLED_EXCEPTION, SdrPage::getSdrModelFromSdrPage(), SdDrawDocument::InsertMasterPage(), SdPage::IsPrecious(), ProvideStyles(), and SAL_WARN.
Referenced by CopyMasterPageToLocalDocument(), and ProvideMasterPage().
|
staticprivate |
Definition at line 339 of file DocumentHelper.cxx.
References SdPage::CloneSdrPage(), SdPage::GetPageKind(), SdDrawDocument::GetSdPage(), SdrPage::getSdrModelFromSdrPage(), SdrPage::GetSize(), SdDrawDocument::InsertMasterPage(), SdPage::IsPrecious(), and ProvideStyles().
|
staticprivate |
Assign the given master page to the given page.
In here we have to handle three cases:
pMasterPage | In contrast to AssignMasterPageToPageList() this page is assumed to be in the target document, i.e. the same document that pPage is in. The caller will usually call AddMasterPage() to create a clone of a master page in another document to create it. |
rsBaseLayoutName | The layout name of the given master page. It is given so that it has not to be created on every call. It could be generated from the given master page, though. |
pPage | The page to which to assign the master page. It can be a slide or a master page itself. |
For points 2 and 3 where one master page A is assigned to another B we have to keep in mind that the master page that page A has already been inserted into the target document.
Definition at line 391 of file DocumentHelper.cxx.
References SdDrawDocument::GetDocSh(), SdrPageProperties::GetItemSet(), SdrPage::GetPageNum(), SdDrawDocument::GetSdPage(), SdDrawDocument::GetSdPageCount(), SdrPage::getSdrModelFromSdrPage(), SdrPage::getSdrPageProperties(), SdrPage::IsMasterPage(), SdrPageProperties::PutItem(), SdDrawDocument::RemoveUnnecessaryMasterPages(), SdDrawDocument::SetMasterPage(), Standard, SdrPage::TRG_GetMasterPage(), and SdrPage::TRG_HasMasterPage().
Referenced by AssignMasterPageToPageList().
|
static |
Assign the given master page to the list of pages.
rTargetDocument | The document that is the owner of the pages in rPageList. |
pMasterPage | This master page will usually be a member of the list of all available master pages as provided by the MasterPageContainer. |
rPageList | The pages to which to assign the master page. These pages may be slides or master pages themselves. |
Definition at line 282 of file DocumentHelper.cxx.
References AssignMasterPageToPage(), SfxUndoManager::EnterListAction(), SdDrawDocument::GetDocSh(), SdPage::GetLayoutName(), SdrPage::IsMasterPage(), SfxUndoManager::LeaveListAction(), nIndex, ProvideMasterPage(), SD_LT_SEPARATOR, and SdResId().
Referenced by sd::sidebar::MasterPagesSelector::AssignMasterPageToPageList().
|
static |
Return a copy of the given master page in the given document.
Definition at line 45 of file DocumentHelper.cxx.
References AddMasterPage(), AUTOLAYOUT_TITLE, SdrModel::GetMasterPage(), SdrModel::GetMasterPageCount(), SdDrawDocument::GetMasterSdPage(), SdDrawDocument::GetMasterSdPageCount(), SdPage::GetName(), SdrPage::GetPageNum(), SdDrawDocument::GetSdPage(), SdDrawDocument::GetSdPageCount(), SdrPage::getSdrModelFromSdrPage(), SdrModel::getUnoModel(), nIndex, SdPage::SetAutoLayout(), SdDrawDocument::SetChanged(), SdDrawDocument::SetMasterPage(), and Standard.
Referenced by sd::sidebar::MasterPageDescriptor::UpdatePageObject().
Return and, when not yet present, create a slide that uses the given master page.
Definition at line 155 of file DocumentHelper.cxx.
References SdDrawDocument::GetSdPage(), SdDrawDocument::GetSdPageCount(), SdrPage::getSdrModelFromSdrPage(), Standard, and SdrPage::TRG_GetMasterPage().
Referenced by sd::sidebar::MasterPageDescriptor::UpdatePageObject().
|
staticprivate |
Definition at line 457 of file DocumentHelper.cxx.
References AddMasterPage(), SdrModel::AddUndo(), SdrUndoFactory::CreateUndoNewPage(), SdPage::GetLayoutName(), SdrModel::GetMasterPage(), SdrModel::GetMasterPageCount(), SdrPage::GetPageNum(), SdrPage::getSdrModelFromSdrPage(), SdrModel::GetSdrUndoFactory(), SdrModel::IsUndoEnabled(), nCount, and nIndex.
Referenced by AssignMasterPageToPageList().
|
static |
Copy the styles used by the given page from the source document to the target document.
Definition at line 245 of file DocumentHelper.cxx.
References SfxUndoManager::AddUndoAction(), SdStyleSheetPool::CopyLayoutSheets(), SdDrawDocument::GetDocSh(), SdPage::GetLayoutName(), SdrModel::GetStyleSheetPool(), nIndex, and SD_LT_SEPARATOR.
Referenced by AddMasterPage().