void FuPresentationLayout::DoExecute( SfxRequest& rReq )
{ // prevent selected objects or objects which are under editing from disappearing
mpView->SdrEndTextEdit();
/* if we are on a master page, the changes apply for all pages and notes-
pages who are using the relevant layout */ bool bOnMaster = false; if (DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(&mrViewShell))
{
EditMode eEditMode = pShell->GetEditMode(); if (eEditMode == EditMode::MasterPage)
bOnMaster = true;
}
std::vector<SdPage*> aUnselect; if (!bOnMaster)
{ //We later rely on IsSelected, so transfer the selection here //into the document
slidesorter::SlideSorterViewShell* pSlideSorterViewShell
= slidesorter::SlideSorterViewShell::GetSlideSorter(mrViewShell.GetViewShellBase()); if (pSlideSorterViewShell)
{
std::shared_ptr<slidesorter::SlideSorterViewShell::PageSelection> xSelection(
pSlideSorterViewShell->GetPageSelection()); if (xSelection)
{ for (SdPage *pPage : *xSelection)
{ if (pPage->IsSelected() || pPage->GetPageKind() != PageKind::Standard) continue;
mrDoc.SetSelected(pPage, true);
aUnselect.push_back(pPage);
}
}
}
}
std::vector<SdPage*> aSelectedPages;
std::vector<sal_uInt16> aSelectedPageNums; // determine the active pages for (sal_uInt16 nPage = 0; nPage < mrDoc.GetSdPageCount(PageKind::Standard); nPage++)
{
SdPage* pPage = mrDoc.GetSdPage(nPage, PageKind::Standard); if (pPage->IsSelected())
{
aSelectedPages.push_back(pPage);
aSelectedPageNums.push_back(nPage);
}
}
/* Here, we only exchange masterpages, therefore the current page remainsthecurrentpage.TopreventcallingPageOrderChangedHint
during insertion and extraction of the masterpages, we block. */ /* That isn't quite right. If the masterpageview is active and you are removingamasterpage,it'spossiblethatyouareremovingthe
current masterpage. So you have to call ResetActualPage ! */ if( dynamic_cast< const DrawViewShell *>( &mrViewShell ) != nullptr && !bCheckMasters ) static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(true);
// #69581: If I chose the standard-template I got no filename and so I get no // SdDrawDocument-Pointer. But the method SetMasterPage is able to handle // a NULL-pointer as a Standard-template ( look at SdDrawDocument::SetMasterPage )
OUString aLayoutName; if( pTempDoc )
aLayoutName = aFile.getToken(0, DOCUMENT_TOKEN, nIdx); for (auto nSelectedPage : aSelectedPageNums)
mrDoc.SetMasterPage(nSelectedPage, aLayoutName, pTempDoc, bMasterPage, bCheckMasters);
mrDoc.CloseBookmarkDoc();
} else
{ // use master page with the layout name aFile from current Doc for (auto nSelectedPage : aSelectedPageNums)
mrDoc.SetMasterPage(nSelectedPage, aFile, &mrDoc, bMasterPage, bCheckMasters);
}
// if the master page was visible, show it again if (!aSelectedPages.empty())
{ if (bOnMaster)
{ if( auto pDrawViewShell = dynamic_cast<DrawViewShell *>( &mrViewShell ))
{
::sd::View* pView = pDrawViewShell->GetView(); for (auto pSelectedPage : aSelectedPages)
{
sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum();
if (static_cast<DrawViewShell*>(&mrViewShell)->GetPageKind() == PageKind::Notes)
nPgNum++;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.