2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-27 16:10:40 +00: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
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
#include "DrawDocShell.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
|
|
|
#include <sfx2/docfac.hxx>
|
2004-10-04 17:30:40 +00:00
|
|
|
#include <sfx2/objface.hxx>
|
2014-08-08 15:11:05 +02:00
|
|
|
#include <sfx2/request.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svxids.hrc>
|
2009-12-10 23:06:35 +01:00
|
|
|
#include <svl/srchitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/srchdlg.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/flstitem.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/eitem.hxx>
|
|
|
|
#include <svl/intitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <sfx2/printer.hxx>
|
2001-01-08 14:38:52 +00:00
|
|
|
#include <sfx2/docfile.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/drawitem.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/whiter.hxx>
|
|
|
|
#include <svl/itempool.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svtools/ctrltool.hxx>
|
2013-01-02 22:07:41 +01:00
|
|
|
#include <vcl/graphicfilter.hxx>
|
2013-04-19 18:08:13 -04:00
|
|
|
#include <comphelper/classids.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/cjkoptions.hxx>
|
|
|
|
#include <svl/visitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-01-28 13:55:28 +00:00
|
|
|
#include <svx/svdoutl.hxx>
|
|
|
|
|
2003-09-19 07:16:52 +00:00
|
|
|
#include <sfx2/fcontnr.hxx>
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "app.hrc"
|
2013-04-19 15:49:58 -04:00
|
|
|
#include "sdmod.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "strmname.h"
|
|
|
|
#include "stlpool.hxx"
|
|
|
|
#include "strings.hrc"
|
2004-01-20 09:53:47 +00:00
|
|
|
#include "View.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawdoc.hxx"
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
#include "glob.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
|
|
|
#include "fupoor.hxx"
|
|
|
|
#include "fusearch.hxx"
|
2004-01-20 09:53:47 +00:00
|
|
|
#include "ViewShell.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdresid.hxx"
|
2004-11-26 19:06:25 +00:00
|
|
|
#include "slideshow.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawview.hxx"
|
2004-01-20 09:53:47 +00:00
|
|
|
#include "FrameView.hxx"
|
2003-04-04 18:18:04 +00:00
|
|
|
#include "unomodel.hxx"
|
2006-01-10 13:29:30 +00:00
|
|
|
#include "undo/undomanager.hxx"
|
|
|
|
#include "undo/undofactory.hxx"
|
2008-01-28 13:55:28 +00:00
|
|
|
#include "OutlineView.hxx"
|
|
|
|
#include "ViewShellBase.hxx"
|
2016-05-10 19:16:47 +02:00
|
|
|
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
|
2004-01-20 09:53:47 +00:00
|
|
|
|
|
|
|
using namespace sd;
|
|
|
|
#define DrawDocShell
|
|
|
|
#include "sdslots.hxx"
|
|
|
|
|
2014-11-25 10:12:55 +00:00
|
|
|
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell);
|
2014-04-18 17:25:30 +02:00
|
|
|
|
|
|
|
void DrawDocShell::InitInterface_Impl()
|
2004-01-20 09:53:47 +00:00
|
|
|
{
|
2014-04-18 16:01:27 +02:00
|
|
|
GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
|
2004-01-20 09:53:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
2013-03-10 16:46:07 +01:00
|
|
|
/**
|
|
|
|
* slotmaps and definitions of SFX
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
SFX_IMPL_OBJECTFACTORY(
|
|
|
|
DrawDocShell,
|
2004-10-04 17:30:40 +00:00
|
|
|
SvGlobalName(SO3_SIMPRESS_CLASSID),
|
2015-04-10 09:47:28 +02:00
|
|
|
SfxObjectShellFlags::STD_NORMAL,
|
2004-10-04 17:30:40 +00:00
|
|
|
"simpress" )
|
2004-01-20 09:53:47 +00:00
|
|
|
|
2008-07-02 10:50:18 +00:00
|
|
|
void DrawDocShell::Construct( bool bClipboard )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
mbInDestruction = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
SetSlotFilter(); // setzt Filter zurueck
|
2003-04-04 18:18:04 +00:00
|
|
|
|
2015-11-10 10:23:02 +01:00
|
|
|
mbOwnDocument = mpDoc == nullptr;
|
2006-12-12 16:12:36 +00:00
|
|
|
if( mbOwnDocument )
|
|
|
|
mpDoc = new SdDrawDocument(meDocType, this);
|
2006-08-22 13:00:08 +00:00
|
|
|
|
|
|
|
// The document has been created so we can call UpdateRefDevice() to set
|
|
|
|
// the document's ref device.
|
|
|
|
UpdateRefDevice();
|
|
|
|
|
2010-01-12 23:32:12 +01:00
|
|
|
SetBaseModel( new SdXImpressDocument( this, bClipboard ) );
|
2006-12-12 16:12:36 +00:00
|
|
|
SetPool( &mpDoc->GetItemPool() );
|
|
|
|
mpUndoManager = new sd::UndoManager;
|
|
|
|
mpDoc->SetSdrUndoManager( mpUndoManager );
|
|
|
|
mpDoc->SetSdrUndoFactory( new sd::UndoFactory );
|
2003-04-04 18:18:04 +00:00
|
|
|
UpdateTablePointers();
|
2016-05-04 11:31:33 +02:00
|
|
|
SetStyleFamily(SfxStyleFamily::Pseudo);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bDataObject,
|
2010-01-06 21:34:53 +01:00
|
|
|
DocumentType eDocumentType) :
|
2015-04-09 15:24:21 +02:00
|
|
|
SfxObjectShell( eMode == SfxObjectCreateMode::INTERNAL ? SfxObjectCreateMode::EMBEDDED : eMode),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpDoc(nullptr),
|
|
|
|
mpUndoManager(nullptr),
|
|
|
|
mpPrinter(nullptr),
|
|
|
|
mpViewShell(nullptr),
|
|
|
|
mpFontList(nullptr),
|
2006-12-12 16:12:36 +00:00
|
|
|
meDocType(eDocumentType),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpFilterSIDs(nullptr),
|
2006-12-12 16:12:36 +00:00
|
|
|
mbSdDataObj(bDataObject),
|
2014-04-24 10:52:02 +02:00
|
|
|
mbOwnPrinter(false),
|
|
|
|
mbNewDocument( true )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-04-09 15:24:21 +02:00
|
|
|
Construct( eMode == SfxObjectCreateMode::INTERNAL );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-04-09 16:35:22 +02:00
|
|
|
DrawDocShell::DrawDocShell( SfxModelFlags nModelCreationFlags, bool bDataObject, DocumentType eDocumentType ) :
|
2010-01-06 21:34:53 +01:00
|
|
|
SfxObjectShell( nModelCreationFlags ),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpDoc(nullptr),
|
|
|
|
mpUndoManager(nullptr),
|
|
|
|
mpPrinter(nullptr),
|
|
|
|
mpViewShell(nullptr),
|
|
|
|
mpFontList(nullptr),
|
2010-01-06 21:34:53 +01:00
|
|
|
meDocType(eDocumentType),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpFilterSIDs(nullptr),
|
2010-01-06 21:34:53 +01:00
|
|
|
mbSdDataObj(bDataObject),
|
2014-04-24 10:52:02 +02:00
|
|
|
mbOwnPrinter(false),
|
|
|
|
mbNewDocument( true )
|
2010-01-06 21:34:53 +01:00
|
|
|
{
|
2014-01-28 20:00:21 +01:00
|
|
|
Construct( false );
|
2010-01-06 21:34:53 +01:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bDataObject,
|
2000-09-18 16:07:07 +00:00
|
|
|
DocumentType eDocumentType) :
|
2015-04-09 15:24:21 +02:00
|
|
|
SfxObjectShell(eMode == SfxObjectCreateMode::INTERNAL ? SfxObjectCreateMode::EMBEDDED : eMode),
|
2006-12-12 16:12:36 +00:00
|
|
|
mpDoc(pDoc),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpUndoManager(nullptr),
|
|
|
|
mpPrinter(nullptr),
|
|
|
|
mpViewShell(nullptr),
|
|
|
|
mpFontList(nullptr),
|
2006-12-12 16:12:36 +00:00
|
|
|
meDocType(eDocumentType),
|
2015-11-10 10:23:02 +01:00
|
|
|
mpFilterSIDs(nullptr),
|
2006-12-12 16:12:36 +00:00
|
|
|
mbSdDataObj(bDataObject),
|
2014-04-24 10:52:02 +02:00
|
|
|
mbOwnPrinter(false),
|
|
|
|
mbNewDocument( true )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-04-09 15:24:21 +02:00
|
|
|
Construct( eMode == SfxObjectCreateMode::INTERNAL );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
DrawDocShell::~DrawDocShell()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-08-18 16:26:03 +00:00
|
|
|
// Tell all listeners that the doc shell is about to be
|
|
|
|
// destroyed. This has been introduced for the PreviewRenderer to
|
|
|
|
// free its view (that uses the item poll of the doc shell) but
|
2013-02-22 11:12:12 +01:00
|
|
|
// may be useful in other places as well.
|
2016-12-08 10:26:01 +02:00
|
|
|
Broadcast(SfxHint(SfxHintId::Dying));
|
2004-08-18 16:26:03 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
mbInDestruction = true;
|
2005-12-14 15:54:19 +00:00
|
|
|
|
2015-11-10 10:23:02 +01:00
|
|
|
SetDocShellFunction(nullptr);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:12:36 +00:00
|
|
|
delete mpFontList;
|
2006-01-10 13:29:30 +00:00
|
|
|
|
2006-12-12 16:12:36 +00:00
|
|
|
if( mpDoc )
|
2015-11-10 10:23:02 +01:00
|
|
|
mpDoc->SetSdrUndoManager( nullptr );
|
2006-12-12 16:12:36 +00:00
|
|
|
delete mpUndoManager;
|
2006-01-10 13:29:30 +00:00
|
|
|
|
2006-12-12 16:12:36 +00:00
|
|
|
if (mbOwnPrinter)
|
2015-03-18 20:52:22 +00:00
|
|
|
mpPrinter.disposeAndClear();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:12:36 +00:00
|
|
|
if( mbOwnDocument )
|
|
|
|
delete mpDoc;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-10 16:46:07 +01:00
|
|
|
// that the navigator get informed about the disappearance of the document
|
2014-01-28 20:00:21 +01:00
|
|
|
SfxBoolItem aItem(SID_NAVIGATOR_INIT, true);
|
2006-12-12 16:12:36 +00:00
|
|
|
SfxViewFrame* pFrame = mpViewShell ? mpViewShell->GetFrame() : GetFrame();
|
2000-09-21 15:12:50 +00:00
|
|
|
|
|
|
|
if( !pFrame )
|
|
|
|
pFrame = SfxViewFrame::GetFirst( this );
|
|
|
|
|
|
|
|
if( pFrame )
|
2016-03-30 17:55:05 +02:00
|
|
|
{
|
|
|
|
pFrame->GetDispatcher()->ExecuteList(
|
|
|
|
SID_NAVIGATOR_INIT, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
|
|
|
|
{ &aItem });
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
void DrawDocShell::GetState(SfxItemSet &rSet)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
SfxWhichIter aIter( rSet );
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
while ( nWhich )
|
|
|
|
{
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
|
2000-09-18 16:07:07 +00:00
|
|
|
? GetPool().GetSlotId(nWhich)
|
|
|
|
: nWhich;
|
|
|
|
|
|
|
|
switch ( nSlotId )
|
|
|
|
{
|
2016-02-21 16:33:30 +02:00
|
|
|
case SID_ATTR_CHAR_FONTLIST:
|
|
|
|
rSet.Put( SvxFontListItem( mpFontList, nSlotId ) );
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_SEARCH_ITEM:
|
|
|
|
{
|
|
|
|
rSet.Put( *SD_MOD()->GetSearchItem() );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CLOSEDOC:
|
2014-05-09 10:06:43 +01:00
|
|
|
GetSlotState(SID_CLOSEDOC, SfxObjectShell::GetInterface(), &rSet);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SEARCH_OPTIONS:
|
|
|
|
{
|
2015-04-16 13:44:05 +02:00
|
|
|
SearchOptionFlags nOpt = SearchOptionFlags::SEARCH |
|
|
|
|
SearchOptionFlags::WHOLE_WORDS |
|
|
|
|
SearchOptionFlags::BACKWARDS |
|
|
|
|
SearchOptionFlags::REG_EXP |
|
|
|
|
SearchOptionFlags::EXACT |
|
|
|
|
SearchOptionFlags::SIMILARITY |
|
|
|
|
SearchOptionFlags::SELECTION;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (!IsReadOnly())
|
|
|
|
{
|
2015-04-16 13:44:05 +02:00
|
|
|
nOpt |= SearchOptionFlags::REPLACE;
|
|
|
|
nOpt |= SearchOptionFlags::REPLACE_ALL;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-04-16 13:44:05 +02:00
|
|
|
rSet.Put(SfxUInt16Item(nWhich, static_cast<sal_uInt16>(nOpt)));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-03-28 10:55:47 +00:00
|
|
|
case SID_VERSION:
|
|
|
|
{
|
|
|
|
GetSlotState( SID_VERSION, SfxObjectShell::GetInterface(), &rSet );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-09-17 12:24:31 +00:00
|
|
|
case SID_CHINESE_CONVERSION:
|
2004-04-27 15:02:33 +00:00
|
|
|
case SID_HANGUL_HANJA_CONVERSION:
|
|
|
|
{
|
2005-11-10 14:47:32 +00:00
|
|
|
rSet.Put(SfxVisibilityItem(nWhich, SvtCJKOptions().IsAnyEnabled()));
|
2004-04-27 15:02:33 +00:00
|
|
|
}
|
|
|
|
break;
|
2014-04-23 18:33:22 +05:30
|
|
|
case SID_LANGUAGE_STATUS:
|
|
|
|
{
|
|
|
|
// Keeping this enabled for the time being
|
|
|
|
rSet.Put(SfxVisibilityItem(nWhich, true));
|
|
|
|
}
|
|
|
|
break;
|
2004-04-27 15:02:33 +00:00
|
|
|
|
2016-05-10 19:16:47 +02:00
|
|
|
case SID_NOTEBOOKBAR:
|
|
|
|
{
|
2016-10-03 09:16:04 +02:00
|
|
|
if (mpViewShell)
|
|
|
|
{
|
|
|
|
bool bVisible = sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(),
|
|
|
|
"modules/simpress/ui/");
|
|
|
|
rSet.Put( SfxBoolItem( SID_NOTEBOOKBAR, bVisible ) );
|
|
|
|
}
|
2016-05-10 19:16:47 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
|
2006-05-02 14:06:09 +00:00
|
|
|
SfxViewFrame* pFrame = SfxViewFrame::Current();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pFrame)
|
|
|
|
{
|
2014-09-10 17:53:41 +02:00
|
|
|
if (rSet.GetItemState(SID_RELOAD) != SfxItemState::UNKNOWN)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pFrame->GetSlotState(SID_RELOAD,
|
|
|
|
pFrame->GetInterface(), &rSet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-17 13:38:26 +02:00
|
|
|
void DrawDocShell::InPlaceActivate( bool bActive )
|
2002-07-30 13:24:29 +00:00
|
|
|
{
|
2011-06-08 15:43:44 -04:30
|
|
|
SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(this, false);
|
|
|
|
std::vector<FrameView*> &rViews = mpDoc->GetFrameViewList();
|
|
|
|
|
2002-07-30 13:24:29 +00:00
|
|
|
if( !bActive )
|
|
|
|
{
|
2011-06-08 15:43:44 -04:30
|
|
|
std::vector<FrameView*>::iterator pIter;
|
|
|
|
for ( pIter = rViews.begin(); pIter != rViews.end(); ++pIter )
|
|
|
|
delete *pIter;
|
2002-07-30 13:24:29 +00:00
|
|
|
|
2011-06-08 15:43:44 -04:30
|
|
|
rViews.clear();
|
2002-07-30 13:24:29 +00:00
|
|
|
|
2011-06-08 15:43:44 -04:30
|
|
|
while (pSfxViewFrame)
|
|
|
|
{
|
2013-03-10 16:46:07 +01:00
|
|
|
// determine the number of FrameViews
|
2014-09-18 15:10:54 +02:00
|
|
|
SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell();
|
2015-09-30 16:10:07 +02:00
|
|
|
ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh);
|
2002-07-30 13:24:29 +00:00
|
|
|
|
2011-06-08 15:43:44 -04:30
|
|
|
if ( pViewSh && pViewSh->GetFrameView() )
|
2002-07-30 13:24:29 +00:00
|
|
|
{
|
2011-06-08 15:43:44 -04:30
|
|
|
pViewSh->WriteFrameViewData();
|
|
|
|
rViews.push_back( new FrameView( mpDoc, pViewSh->GetFrameView() ) );
|
2002-07-30 13:24:29 +00:00
|
|
|
}
|
2011-06-08 15:43:44 -04:30
|
|
|
|
|
|
|
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
|
2002-07-30 13:24:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 17:30:40 +00:00
|
|
|
SfxObjectShell::InPlaceActivate( bActive );
|
2002-07-30 13:24:29 +00:00
|
|
|
|
|
|
|
if( bActive )
|
|
|
|
{
|
2011-06-08 15:43:44 -04:30
|
|
|
for( sal_uInt32 i = 0; pSfxViewFrame && (i < rViews.size()); i++ )
|
2002-07-30 13:24:29 +00:00
|
|
|
{
|
2013-03-10 16:46:07 +01:00
|
|
|
// determine the number of FrameViews
|
2014-09-18 15:10:54 +02:00
|
|
|
SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell();
|
2015-09-30 16:10:07 +02:00
|
|
|
ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh);
|
2002-07-30 13:24:29 +00:00
|
|
|
|
2011-06-08 15:43:44 -04:30
|
|
|
if ( pViewSh )
|
2002-07-30 13:24:29 +00:00
|
|
|
{
|
2011-06-08 15:43:44 -04:30
|
|
|
pViewSh->ReadFrameViewData( rViews[ i ] );
|
2002-07-30 13:24:29 +00:00
|
|
|
}
|
2011-06-08 15:43:44 -04:30
|
|
|
|
|
|
|
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
|
2002-07-30 13:24:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-18 11:23:57 +02:00
|
|
|
void DrawDocShell::Activate( bool bMDI)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if (bMDI)
|
|
|
|
{
|
|
|
|
ApplySlotFilter();
|
2006-12-12 16:12:36 +00:00
|
|
|
mpDoc->StartOnlineSpelling();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-18 11:23:57 +02:00
|
|
|
void DrawDocShell::Deactivate( bool )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-10-20 14:54:59 +02:00
|
|
|
::svl::IUndoManager* DrawDocShell::GetUndoManager()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:12:36 +00:00
|
|
|
return mpUndoManager;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
void DrawDocShell::UpdateTablePointers()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-09-23 14:05:07 +01:00
|
|
|
PutItem( SvxColorListItem( mpDoc->GetColorList(), SID_COLOR_TABLE ) );
|
2007-05-10 14:28:28 +00:00
|
|
|
PutItem( SvxGradientListItem( mpDoc->GetGradientList(), SID_GRADIENT_LIST ) );
|
|
|
|
PutItem( SvxHatchListItem( mpDoc->GetHatchList(), SID_HATCH_LIST ) );
|
|
|
|
PutItem( SvxBitmapListItem( mpDoc->GetBitmapList(), SID_BITMAP_LIST ) );
|
2016-06-07 16:58:20 +05:30
|
|
|
PutItem( SvxPatternListItem( mpDoc->GetPatternList(), SID_PATTERN_LIST ) );
|
2007-05-10 14:28:28 +00:00
|
|
|
PutItem( SvxDashListItem( mpDoc->GetDashList(), SID_DASH_LIST ) );
|
|
|
|
PutItem( SvxLineEndListItem( mpDoc->GetLineEndList(), SID_LINEEND_LIST ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-05-04 13:59:00 +00:00
|
|
|
UpdateFontList();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
void DrawDocShell::CancelSearching()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 15:54:19 +00:00
|
|
|
if( dynamic_cast<FuSearch*>( mxDocShellFunction.get() ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-11-10 10:23:02 +01:00
|
|
|
SetDocShellFunction(nullptr);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-10 16:46:07 +01:00
|
|
|
/**
|
|
|
|
* apply configured slot filters
|
|
|
|
*/
|
2004-01-20 09:53:47 +00:00
|
|
|
void DrawDocShell::ApplySlotFilter() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2002-06-07 07:28:46 +00:00
|
|
|
SfxViewShell* pTestViewShell = SfxViewShell::GetFirst();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-06-07 07:28:46 +00:00
|
|
|
while( pTestViewShell )
|
|
|
|
{
|
2004-01-20 09:53:47 +00:00
|
|
|
if( pTestViewShell->GetObjectShell()
|
2015-03-26 15:30:40 +01:00
|
|
|
== this
|
2004-01-20 09:53:47 +00:00
|
|
|
&& pTestViewShell->GetViewFrame()
|
|
|
|
&& pTestViewShell->GetViewFrame()->GetDispatcher() )
|
2002-06-07 07:28:46 +00:00
|
|
|
{
|
|
|
|
SfxDispatcher* pDispatcher = pTestViewShell->GetViewFrame()->GetDispatcher();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:12:36 +00:00
|
|
|
if( mpFilterSIDs )
|
2015-04-09 12:40:57 +02:00
|
|
|
pDispatcher->SetSlotFilter( mbFilterEnable ? SfxSlotFilterState::ENABLED : SfxSlotFilterState::DISABLED, mnFilterCount, mpFilterSIDs );
|
2002-06-07 07:28:46 +00:00
|
|
|
else
|
|
|
|
pDispatcher->SetSlotFilter();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-06-07 07:28:46 +00:00
|
|
|
if( pDispatcher->GetBindings() )
|
2014-03-12 11:14:12 +02:00
|
|
|
pDispatcher->GetBindings()->InvalidateAll( true );
|
2002-06-07 07:28:46 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-06-07 07:28:46 +00:00
|
|
|
pTestViewShell = SfxViewShell::GetNext( *pTestViewShell );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 13:38:26 +02:00
|
|
|
void DrawDocShell::SetModified( bool bSet /* = true */ )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 17:30:40 +00:00
|
|
|
SfxObjectShell::SetModified( bSet );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2011-02-07 22:11:09 +01:00
|
|
|
// change model state, too
|
|
|
|
// only set the changed state if modification is enabled
|
2007-06-26 14:53:42 +00:00
|
|
|
if( IsEnableSetModified() )
|
|
|
|
{
|
|
|
|
if ( mpDoc )
|
|
|
|
mpDoc->NbcSetChanged( bSet );
|
2002-07-19 11:04:58 +00:00
|
|
|
|
2016-12-08 10:26:01 +02:00
|
|
|
Broadcast( SfxHint( SfxHintId::DocChanged ) );
|
2007-06-26 14:53:42 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-03-10 16:46:07 +01:00
|
|
|
/**
|
|
|
|
* Callback for ExecuteSpellPopup()
|
|
|
|
*/
|
2011-02-07 22:11:09 +01:00
|
|
|
// ExecuteSpellPopup now handled by DrawDocShell. This is necessary
|
2001-09-27 09:32:01 +00:00
|
|
|
// to get hands on the outliner and the text object.
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK(DrawDocShell, OnlineSpellCallback, SpellCallbackInfo&, rInfo, void)
|
2001-09-27 09:32:01 +00:00
|
|
|
{
|
2015-11-10 10:23:02 +01:00
|
|
|
SdrObject* pObj = nullptr;
|
|
|
|
SdrOutliner* pOutl = nullptr;
|
2001-09-27 09:32:01 +00:00
|
|
|
|
|
|
|
if(GetViewShell())
|
|
|
|
{
|
|
|
|
pOutl = GetViewShell()->GetView()->GetTextEditOutliner();
|
|
|
|
pObj = GetViewShell()->GetView()->GetTextEditObject();
|
|
|
|
}
|
|
|
|
|
2015-09-22 12:26:29 +02:00
|
|
|
mpDoc->ImpOnlineSpellCallback(&rInfo, pObj, pOutl);
|
2001-09-27 09:32:01 +00:00
|
|
|
}
|
2008-01-28 13:55:28 +00:00
|
|
|
|
|
|
|
void DrawDocShell::ClearUndoBuffer()
|
|
|
|
{
|
|
|
|
// clear possible undo buffers of outliners
|
2009-11-30 12:56:04 +01:00
|
|
|
SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(this, false);
|
2008-01-28 13:55:28 +00:00
|
|
|
while(pSfxViewFrame)
|
|
|
|
{
|
|
|
|
ViewShellBase* pViewShellBase = dynamic_cast< ViewShellBase* >( pSfxViewFrame->GetViewShell() );
|
|
|
|
if( pViewShellBase )
|
|
|
|
{
|
2015-09-18 09:09:12 +01:00
|
|
|
std::shared_ptr<ViewShell> pViewSh( pViewShellBase->GetMainViewShell() );
|
2008-01-28 13:55:28 +00:00
|
|
|
if( pViewSh.get() )
|
|
|
|
{
|
|
|
|
::sd::View* pView = pViewSh->GetView();
|
|
|
|
if( pView )
|
|
|
|
{
|
|
|
|
pView->SdrEndTextEdit();
|
|
|
|
sd::OutlineView* pOutlView = dynamic_cast< sd::OutlineView* >( pView );
|
|
|
|
if( pOutlView )
|
|
|
|
{
|
2014-06-18 12:14:29 +02:00
|
|
|
pOutlView->GetOutliner().GetUndoManager().Clear();
|
2008-01-28 13:55:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-11-30 12:56:04 +01:00
|
|
|
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
|
2008-01-28 13:55:28 +00:00
|
|
|
}
|
|
|
|
|
2010-10-20 14:54:59 +02:00
|
|
|
::svl::IUndoManager* pUndoManager = GetUndoManager();
|
2008-01-28 13:55:28 +00:00
|
|
|
if(pUndoManager && pUndoManager->GetUndoActionCount())
|
|
|
|
pUndoManager->Clear();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 09:53:47 +00:00
|
|
|
} // end of namespace sd
|
2010-10-12 15:51:52 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|