2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2017-10-23 22:32:55 +02:00
|
|
|
#include <fuprlout.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/wrkwin.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/itempool.hxx>
|
2004-10-04 17:33:21 +00:00
|
|
|
#include <sot/storage.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <svx/svdundo.hxx>
|
|
|
|
|
2004-10-04 17:33:21 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
2008-04-02 08:47:35 +00:00
|
|
|
#include <sfx2/request.hxx>
|
2004-10-04 17:33:21 +00:00
|
|
|
|
2017-10-23 22:32:55 +02:00
|
|
|
#include <drawdoc.hxx>
|
|
|
|
#include <sdpage.hxx>
|
|
|
|
#include <pres.hxx>
|
|
|
|
#include <DrawViewShell.hxx>
|
|
|
|
#include <FrameView.hxx>
|
|
|
|
#include <stlpool.hxx>
|
|
|
|
#include <View.hxx>
|
|
|
|
#include <strings.hrc>
|
|
|
|
#include <glob.hxx>
|
|
|
|
#include <strmname.h>
|
|
|
|
#include <app.hrc>
|
|
|
|
#include <DrawDocShell.hxx>
|
|
|
|
#include <SlideSorterViewShell.hxx>
|
|
|
|
#include <unprlout.hxx>
|
|
|
|
#include <unchss.hxx>
|
|
|
|
#include <unmovss.hxx>
|
|
|
|
#include <sdattr.hxx>
|
|
|
|
#include <sdresid.hxx>
|
|
|
|
#include <drawview.hxx>
|
2013-04-19 15:49:58 -04:00
|
|
|
#include <editeng/outliner.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/editdata.hxx>
|
2017-10-23 22:32:55 +02:00
|
|
|
#include <sdabstdlg.hxx>
|
2015-09-18 09:09:12 +01:00
|
|
|
#include <memory>
|
2006-12-12 16:22:03 +00:00
|
|
|
|
|
|
|
namespace sd
|
|
|
|
{
|
2004-01-20 10:10:47 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-08-24 22:22:45 +04:00
|
|
|
#define DOCUMENT_TOKEN '#'
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 10:10:47 +00:00
|
|
|
FuPresentationLayout::FuPresentationLayout (
|
|
|
|
ViewShell* pViewSh,
|
|
|
|
::sd::Window* pWin,
|
|
|
|
::sd::View* pView,
|
|
|
|
SdDrawDocument* pDoc,
|
|
|
|
SfxRequest& rReq)
|
|
|
|
: FuPoor(pViewSh, pWin, pView, pDoc, rReq)
|
2005-12-14 16:02:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> FuPresentationLayout::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
|
2005-12-14 16:02:27 +00:00
|
|
|
{
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> xFunc( new FuPresentationLayout( pViewSh, pWin, pView, pDoc, rReq ) );
|
2005-12-14 16:02:27 +00:00
|
|
|
xFunc->DoExecute(rReq);
|
|
|
|
return xFunc;
|
|
|
|
}
|
|
|
|
|
2008-04-02 08:47:35 +00:00
|
|
|
void FuPresentationLayout::DoExecute( SfxRequest& rReq )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// prevent selected objects or objects which are under editing from disappearing
|
2006-12-12 16:22:03 +00:00
|
|
|
mpView->SdrEndTextEdit();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:22:03 +00:00
|
|
|
if(mpView->GetSdrPageView())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:22:03 +00:00
|
|
|
mpView->UnmarkAll();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bError = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/* if we are on a master page, the changes apply for all pages and notes-
|
|
|
|
pages who are using the relevant layout */
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bOnMaster = false;
|
2015-10-13 21:05:18 +01:00
|
|
|
if (DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-10-13 21:05:18 +01:00
|
|
|
EditMode eEditMode = pShell->GetEditMode();
|
2016-10-11 12:45:47 +02:00
|
|
|
if (eEditMode == EditMode::MasterPage)
|
2014-04-24 10:52:02 +02:00
|
|
|
bOnMaster = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-06-23 16:54:52 +01:00
|
|
|
|
|
|
|
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(mpViewShell->GetViewShellBase());
|
|
|
|
if (pSlideSorterViewShell)
|
|
|
|
{
|
2015-09-18 09:09:12 +01:00
|
|
|
std::shared_ptr<slidesorter::SlideSorterViewShell::PageSelection> xSelection(
|
2015-06-23 16:54:52 +01:00
|
|
|
pSlideSorterViewShell->GetPageSelection());
|
|
|
|
if (xSelection)
|
|
|
|
{
|
|
|
|
for (auto it = xSelection->begin(); it != xSelection->end(); ++it)
|
|
|
|
{
|
|
|
|
SdPage *pPage = *it;
|
2016-10-11 13:01:32 +02:00
|
|
|
if (pPage->IsSelected() || pPage->GetPageKind() != PageKind::Standard)
|
2015-06-23 16:54:52 +01:00
|
|
|
continue;
|
|
|
|
mpDoc->SetSelected(pPage, true);
|
|
|
|
aUnselect.push_back(pPage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<SdPage*> aSelectedPages;
|
|
|
|
std::vector<sal_uInt16> aSelectedPageNums;
|
|
|
|
// determine the active pages
|
2016-10-11 13:01:32 +02:00
|
|
|
for (sal_uInt16 nPage = 0; nPage < mpDoc->GetSdPageCount(PageKind::Standard); nPage++)
|
2015-06-23 16:54:52 +01:00
|
|
|
{
|
2016-10-11 13:01:32 +02:00
|
|
|
SdPage* pPage = mpDoc->GetSdPage(nPage, PageKind::Standard);
|
2015-06-23 16:54:52 +01:00
|
|
|
if (pPage->IsSelected())
|
|
|
|
{
|
|
|
|
aSelectedPages.push_back(pPage);
|
|
|
|
aSelectedPageNums.push_back(nPage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bMasterPage = bOnMaster;
|
|
|
|
bool bCheckMasters = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// call dialog
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bLoad = false; // appear the new master pages?
|
2013-08-24 22:22:45 +04:00
|
|
|
OUString aFile;
|
2008-04-02 08:47:35 +00:00
|
|
|
|
Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.
And in many cases the ranges are statically known, so that the checking can
happen at compile time. Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking. The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert). Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.
(At least some of the uses of the existing SfxItemSet overload taking a
const sal_uInt16* pWhichPairTable
can probably also be strengthened, but that is left for another day.)
This commit is the first in a series of two. Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap). That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.
There were three cases of necessary manual intervention:
* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.
* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
A few uses of the variadic form erroneously used nullptr instead of 0 for
termination. But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly,
some uses made the harmless error of using 0L instead of 0.
Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 09:58:13 +02:00
|
|
|
SfxItemSet aSet(mpDoc->GetPool(), svl::Items<ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END>{});
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad));
|
|
|
|
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_MASTER_PAGE, bMasterPage ) );
|
|
|
|
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_CHECK_MASTERS, bCheckMasters ) );
|
2016-09-30 13:43:07 +01:00
|
|
|
|
|
|
|
if (!aSelectedPages.empty())
|
|
|
|
{
|
|
|
|
OUString aOldLayoutName(aSelectedPages.back()->GetLayoutName());
|
|
|
|
sal_Int32 nPos = aOldLayoutName.indexOf(SD_LT_SEPARATOR);
|
|
|
|
if (nPos != -1)
|
|
|
|
aOldLayoutName = aOldLayoutName.copy(0, nPos);
|
|
|
|
aSet.Put(SfxStringItem(ATTR_PRESLAYOUT_NAME, aOldLayoutName));
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-04-02 08:47:35 +00:00
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs ();
|
|
|
|
|
|
|
|
if (pArgs)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-09-10 17:53:41 +02:00
|
|
|
if (pArgs->GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET)
|
2014-10-29 11:04:25 +02:00
|
|
|
bLoad = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_PRESLAYOUT_LOAD)).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if( pArgs->GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET )
|
2014-10-29 11:04:25 +02:00
|
|
|
bMasterPage = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if( pArgs->GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET )
|
2014-10-29 11:04:25 +02:00
|
|
|
bCheckMasters = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if (pArgs->GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET)
|
2014-10-29 11:04:25 +02:00
|
|
|
aFile = static_cast<const SfxStringItem&>(pArgs->Get(ATTR_PRESLAYOUT_NAME)).GetValue();
|
2008-04-02 08:47:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
|
2016-10-27 20:55:49 +01:00
|
|
|
ScopedVclPtr<AbstractSdPresLayoutDlg> pDlg(pFact ? pFact->CreateSdPresLayoutDlg(mpDocSh, aSet ) : nullptr);
|
2008-04-02 08:47:35 +00:00
|
|
|
|
2013-05-01 10:08:20 +01:00
|
|
|
sal_uInt16 nResult = pDlg ? pDlg->Execute() : static_cast<short>(RET_CANCEL);
|
2008-04-02 08:47:35 +00:00
|
|
|
|
|
|
|
switch (nResult)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-04-02 08:47:35 +00:00
|
|
|
case RET_OK:
|
|
|
|
{
|
|
|
|
pDlg->GetAttr(aSet);
|
2014-09-10 17:53:41 +02:00
|
|
|
if (aSet.GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET)
|
2014-10-29 11:04:25 +02:00
|
|
|
bLoad = static_cast<const SfxBoolItem&>(aSet.Get(ATTR_PRESLAYOUT_LOAD)).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if( aSet.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET )
|
2014-10-29 11:04:25 +02:00
|
|
|
bMasterPage = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if( aSet.GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET )
|
2014-10-29 11:04:25 +02:00
|
|
|
bCheckMasters = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue();
|
2014-09-10 17:53:41 +02:00
|
|
|
if (aSet.GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET)
|
2014-10-29 11:04:25 +02:00
|
|
|
aFile = static_cast<const SfxStringItem&>(aSet.Get(ATTR_PRESLAYOUT_NAME)).GetValue();
|
2008-04-02 08:47:35 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-04-02 08:47:35 +00:00
|
|
|
default:
|
2014-04-24 10:52:02 +02:00
|
|
|
bError = true;
|
2008-04-02 08:47:35 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!bError)
|
|
|
|
{
|
2014-03-17 13:38:26 +02:00
|
|
|
mpDocSh->SetWaitCursor( true );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/* Here, we only exchange masterpages, therefore the current page
|
|
|
|
remains the current page. To prevent calling PageOrderChangedHint
|
|
|
|
during insertion and extraction of the masterpages, we block. */
|
2015-09-30 12:15:36 +02:00
|
|
|
/* That isn't quite right. If the masterpageview is active and you are
|
2013-03-12 20:27:21 +01:00
|
|
|
removing a masterpage, it's possible that you are removing the
|
|
|
|
current masterpage. So you have to call ResetActualPage ! */
|
2015-09-30 16:10:07 +02:00
|
|
|
if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bCheckMasters )
|
2014-04-24 10:52:02 +02:00
|
|
|
static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (bLoad)
|
|
|
|
{
|
2013-08-24 22:22:45 +04:00
|
|
|
OUString aFileName = aFile.getToken(0, DOCUMENT_TOKEN);
|
2006-12-12 16:22:03 +00:00
|
|
|
SdDrawDocument* pTempDoc = mpDoc->OpenBookmarkDoc( aFileName );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-06-13 15:52:56 +02:00
|
|
|
// #69581: If I chose the standard-template I got no filename and so I get no
|
2000-09-18 16:07:07 +00:00
|
|
|
// SdDrawDocument-Pointer. But the method SetMasterPage is able to handle
|
|
|
|
// a NULL-pointer as a Standard-template ( look at SdDrawDocument::SetMasterPage )
|
2013-08-24 22:22:45 +04:00
|
|
|
OUString aLayoutName;
|
2001-05-18 14:11:02 +00:00
|
|
|
if( pTempDoc )
|
2013-08-24 22:22:45 +04:00
|
|
|
aLayoutName = aFile.getToken(1, DOCUMENT_TOKEN);
|
2015-06-23 16:54:52 +01:00
|
|
|
for (auto nSelectedPage : aSelectedPageNums)
|
|
|
|
mpDoc->SetMasterPage(nSelectedPage, aLayoutName, pTempDoc, bMasterPage, bCheckMasters);
|
2006-12-12 16:22:03 +00:00
|
|
|
mpDoc->CloseBookmarkDoc();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// use master page with the layout name aFile from current Doc
|
2015-06-23 16:54:52 +01:00
|
|
|
for (auto nSelectedPage : aSelectedPageNums)
|
|
|
|
mpDoc->SetMasterPage(nSelectedPage, aFile, mpDoc, bMasterPage, bCheckMasters);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// remove blocking
|
2015-09-30 16:10:07 +02:00
|
|
|
if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bCheckMasters )
|
2014-04-24 10:52:02 +02:00
|
|
|
static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(false);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// if the master page was visible, show it again
|
2017-03-06 00:24:09 +01:00
|
|
|
if (!aSelectedPages.empty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if (bOnMaster)
|
|
|
|
{
|
2015-09-30 16:10:07 +02:00
|
|
|
if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 10:10:47 +00:00
|
|
|
::sd::View* pView =
|
2006-12-12 16:22:03 +00:00
|
|
|
static_cast<DrawViewShell*>(mpViewShell)->GetView();
|
2015-06-23 16:54:52 +01:00
|
|
|
for (auto pSelectedPage : aSelectedPages)
|
|
|
|
{
|
|
|
|
sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-10-11 13:01:32 +02:00
|
|
|
if (static_cast<DrawViewShell*>(mpViewShell)->GetPageKind() == PageKind::Notes)
|
2015-06-23 16:54:52 +01:00
|
|
|
nPgNum++;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-06-23 16:54:52 +01:00
|
|
|
pView->HideSdrPage();
|
|
|
|
pView->ShowSdrPage(pView->GetModel()->GetMasterPage(nPgNum));
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// force update of TabBar
|
2014-10-11 16:01:26 +02:00
|
|
|
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_MASTERPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-06-23 16:54:52 +01:00
|
|
|
for (auto pSelectedPage : aSelectedPages)
|
|
|
|
pSelectedPage->SetAutoLayout(pSelectedPage->GetAutoLayout());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-23 16:54:52 +01:00
|
|
|
//Undo transfer to document selection
|
|
|
|
for (auto pPage : aUnselect)
|
|
|
|
mpDoc->SetSelected(pPage, false);
|
|
|
|
|
|
|
|
|
2000-10-18 13:33:02 +00:00
|
|
|
// fake a mode change to repaint the page tab bar
|
2015-09-30 16:10:07 +02:00
|
|
|
if( mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr )
|
2000-10-18 13:33:02 +00:00
|
|
|
{
|
2004-01-20 10:10:47 +00:00
|
|
|
DrawViewShell* pDrawViewSh =
|
2006-12-12 16:22:03 +00:00
|
|
|
static_cast<DrawViewShell*>(mpViewShell);
|
2000-10-18 13:33:02 +00:00
|
|
|
EditMode eMode = pDrawViewSh->GetEditMode();
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bLayer = pDrawViewSh->IsLayerModeActive();
|
2000-10-18 13:33:02 +00:00
|
|
|
pDrawViewSh->ChangeEditMode( eMode, !bLayer );
|
|
|
|
pDrawViewSh->ChangeEditMode( eMode, bLayer );
|
|
|
|
}
|
|
|
|
|
2014-03-17 13:38:26 +02:00
|
|
|
mpDocSh->SetWaitCursor( false );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 10:10:47 +00:00
|
|
|
} // end of namespace sd
|
2010-10-12 15:51:52 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|