2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* $RCSfile: viewshel.cxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2006-11-01 17:05:37 +00:00
|
|
|
* $Revision: 1.60 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2006-11-01 17:05:37 +00:00
|
|
|
* last change: $Author: vg $ $Date: 2006-11-01 18:05:37 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:20:19 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 18:45:30 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
#include "ViewShell.hxx"
|
2004-07-13 14:03:16 +00:00
|
|
|
#include "ViewShellImplementation.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2004-10-04 17:48:54 +00:00
|
|
|
#ifndef _COM_SUN_STAR_EMBED_EMBEDSTATE_HPP_
|
|
|
|
#include <com/sun/star/embed/EmbedStates.hpp>
|
|
|
|
#endif
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
#ifndef SD_VIEW_SHELL_BASE_HXX
|
2004-01-20 12:38:38 +00:00
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
#endif
|
2006-03-21 16:49:01 +00:00
|
|
|
#include "ShellFactory.hxx"
|
2004-07-13 14:03:16 +00:00
|
|
|
#include "DrawController.hxx"
|
|
|
|
#include "LayerTabBar.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2004-10-04 17:48:54 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SFX_BINDINGS_HXX //autogen
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXDISPATCH_HXX //autogen
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SCRBAR_HXX //autogen
|
|
|
|
#include <vcl/scrbar.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXENUMITEM_HXX //autogen
|
|
|
|
#include <svtools/eitem.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVX_RULER_HXX //autogen
|
|
|
|
#include <svx/ruler.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVXIDS_HXX
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#endif
|
|
|
|
#ifndef _B3D_BASE3D_HXX
|
|
|
|
#include "goodies/base3d.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _SVX_FMSHELL_HXX
|
|
|
|
#include <svx/fmshell.hxx>
|
|
|
|
#endif
|
2003-06-04 10:06:02 +00:00
|
|
|
#ifndef SD_WINDOW_UPDATER_HXX
|
|
|
|
#include "WindowUpdater.hxx"
|
|
|
|
#endif
|
2004-07-13 14:03:16 +00:00
|
|
|
#ifndef SD_GRAPHIC_VIEW_SHELL_HXX
|
|
|
|
#include "GraphicViewShell.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _SFX_CHILDWIN_HXX
|
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
#endif
|
2003-12-01 09:10:43 +00:00
|
|
|
#ifndef _SD_SDXFER_HXX
|
|
|
|
#include <sdxfer.hxx>
|
|
|
|
#endif
|
2004-01-20 12:38:38 +00:00
|
|
|
#ifndef SD_GRAPHIC_VIEW_SHELL_HXX
|
|
|
|
#include "GraphicViewShell.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _SFX_CHILDWIN_HXX
|
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "helpids.h"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
2006-01-10 13:39:43 +00:00
|
|
|
#ifndef SD_OUTLINE_VIEW_HXX
|
|
|
|
#include "OutlineView.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_CLIENT_HXX
|
|
|
|
#include "Client.hxx"
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdresid.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
#include "DrawDocShell.hxx"
|
2004-11-26 19:36:02 +00:00
|
|
|
#ifndef _SD_SLIDESHOW_HXX
|
|
|
|
#include "slideshow.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawdoc.hxx"
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
#include "zoomlist.hxx"
|
2004-01-20 12:38:38 +00:00
|
|
|
#ifndef SD_FRAME_VIEW_HXX
|
|
|
|
#include "FrameView.hxx"
|
|
|
|
#endif
|
2002-03-08 14:28:48 +00:00
|
|
|
#include "optsitem.hxx"
|
2004-07-13 14:03:16 +00:00
|
|
|
#include "BezierObjectBar.hxx"
|
|
|
|
#include "TextObjectBar.hxx"
|
|
|
|
#include "GraphicObjectBar.hxx"
|
2004-08-12 08:20:24 +00:00
|
|
|
#include "MediaObjectBar.hxx"
|
2004-07-13 14:03:16 +00:00
|
|
|
#include "ViewShellManager.hxx"
|
2006-03-21 16:49:01 +00:00
|
|
|
#include "FormShellManager.hxx"
|
2004-07-13 14:03:16 +00:00
|
|
|
#include <svx/fmshell.hxx>
|
|
|
|
#include "ViewTabBar.hxx"
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
#include <svx/extrusionbar.hxx>
|
2004-10-12 12:14:18 +00:00
|
|
|
#include <svx/fontworkbar.hxx>
|
2006-01-10 13:39:43 +00:00
|
|
|
#include <svx/svdoutl.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-01-16 10:19:41 +00:00
|
|
|
// #96090#
|
|
|
|
#ifndef _SFXSLSTITM_HXX
|
|
|
|
#include <svtools/slstitm.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXREQUEST_HXX
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#endif
|
2004-09-17 12:50:32 +00:00
|
|
|
#include "SpellDialogChildWindow.hxx"
|
2002-01-16 10:19:41 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
#include "Window.hxx"
|
|
|
|
#include "fupoor.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
|
|
|
|
#define SO2_DECL_SVINPLACEOBJECT_DEFINED
|
|
|
|
SO2_DECL_REF(SvInPlaceObject)
|
|
|
|
#endif
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
namespace {
|
2006-03-21 16:49:01 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
class ViewShellObjectBarFactory
|
2006-03-21 16:49:01 +00:00
|
|
|
: public ::sd::ShellFactory<SfxShell>
|
2004-07-13 14:03:16 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ViewShellObjectBarFactory (::sd::ViewShell& rViewShell);
|
|
|
|
virtual ~ViewShellObjectBarFactory (void);
|
|
|
|
virtual SfxShell* CreateShell (
|
|
|
|
::sd::ShellId nId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
::sd::FrameView* pFrameView);
|
|
|
|
virtual void ReleaseShell (SfxShell* pShell);
|
|
|
|
private:
|
|
|
|
::sd::ViewShell& mrViewShell;
|
|
|
|
/** This cache holds the already created object bars.
|
|
|
|
*/
|
2004-12-09 15:13:30 +00:00
|
|
|
typedef ::std::map< ::sd::ShellId,SfxShell*> ShellCache;
|
2004-07-13 14:03:16 +00:00
|
|
|
ShellCache maShellCache;
|
|
|
|
};
|
2006-03-21 16:49:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // end of anonymous namespace
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
static const int DELTA_ZOOM = 10;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-10-19 11:29:10 +00:00
|
|
|
BOOL ViewShell::IsPageFlipMode(void) const
|
|
|
|
{
|
|
|
|
return this->ISA(DrawViewShell) && mpContentWindow.get() != NULL &&
|
|
|
|
mpContentWindow->GetVisibleHeight() >= 1.0;
|
|
|
|
}
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
SfxViewFrame* ViewShell::GetViewFrame (void) const
|
|
|
|
{
|
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
|
|
|
return GetViewShell()->GetViewFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SFX-Slotmap und Standardinterface deklarieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2004-01-20 12:38:38 +00:00
|
|
|
TYPEINIT1(ViewShell, SfxShell);
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell::ViewShell (
|
|
|
|
SfxViewFrame* pFrame,
|
2004-07-13 14:03:16 +00:00
|
|
|
::Window* pParentWindow,
|
2004-01-20 12:38:38 +00:00
|
|
|
ViewShellBase& rViewShellBase,
|
|
|
|
bool bAllowCenter)
|
|
|
|
: SfxShell (&rViewShellBase),
|
2004-07-13 14:03:16 +00:00
|
|
|
mpContentWindow(NULL),
|
|
|
|
mpHorizontalScrollBar(NULL),
|
|
|
|
mpVerticalScrollBar(NULL),
|
|
|
|
mpHorizontalRuler(NULL),
|
|
|
|
mpVerticalRuler(NULL),
|
|
|
|
mpScrollBarBox(NULL),
|
|
|
|
mbHasRulers(false),
|
|
|
|
mpActiveWindow(NULL),
|
|
|
|
mpView(NULL),
|
|
|
|
pFrameView(NULL),
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow(NULL),
|
2004-07-13 14:03:16 +00:00
|
|
|
pZoomList(NULL),
|
|
|
|
aViewPos(),
|
|
|
|
aViewSize(),
|
|
|
|
aScrBarWH(),
|
|
|
|
bCenterAllowed(bAllowCenter),
|
|
|
|
bStartShowWithDialog(FALSE),
|
2006-07-13 09:32:38 +00:00
|
|
|
mnPrintedHandoutPageNum(1),
|
2004-07-13 14:03:16 +00:00
|
|
|
maAllWindowRectangle(),
|
|
|
|
meShellType(ST_NONE),
|
|
|
|
mpParentWindow(pParentWindow),
|
2004-01-20 12:38:38 +00:00
|
|
|
mpWindowUpdater (new ::sd::WindowUpdater()),
|
2004-07-13 14:03:16 +00:00
|
|
|
mpImpl(new Implementation(*this))
|
2004-01-20 12:38:38 +00:00
|
|
|
{
|
|
|
|
Construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
ViewShell::ViewShell(
|
|
|
|
SfxViewFrame* pFrame,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
const ViewShell& rShell)
|
2004-01-20 12:38:38 +00:00
|
|
|
: SfxShell (rShell.GetViewShell()),
|
2004-07-13 14:03:16 +00:00
|
|
|
mpContentWindow(NULL),
|
|
|
|
mpHorizontalScrollBar(NULL),
|
|
|
|
mpVerticalScrollBar(NULL),
|
|
|
|
mpHorizontalRuler(NULL),
|
|
|
|
mpVerticalRuler(NULL),
|
|
|
|
mpScrollBarBox(NULL),
|
|
|
|
mbHasRulers(false),
|
|
|
|
mpActiveWindow(NULL),
|
|
|
|
mpView(NULL),
|
|
|
|
pFrameView(NULL),
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow(NULL),
|
2004-07-13 14:03:16 +00:00
|
|
|
pZoomList(NULL),
|
|
|
|
aViewPos(),
|
|
|
|
aViewSize(),
|
|
|
|
aScrBarWH(),
|
|
|
|
bCenterAllowed(rShell.bCenterAllowed),
|
|
|
|
bStartShowWithDialog(FALSE),
|
2006-07-13 09:32:38 +00:00
|
|
|
mnPrintedHandoutPageNum(1),
|
2004-07-13 14:03:16 +00:00
|
|
|
maAllWindowRectangle(),
|
|
|
|
meShellType(ST_NONE),
|
|
|
|
mpParentWindow(pParentWindow),
|
|
|
|
mpWindowUpdater (new ::sd::WindowUpdater()),
|
2004-11-26 14:14:48 +00:00
|
|
|
mpImpl(new Implementation(*this)),
|
|
|
|
mpLayerTabBar(NULL)
|
2004-01-20 12:38:38 +00:00
|
|
|
{
|
|
|
|
Construct();
|
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
|
|
|
|
ViewShell::~ViewShell()
|
|
|
|
{
|
2004-11-26 14:14:48 +00:00
|
|
|
SfxViewShell* pViewShell = GetViewShell();
|
|
|
|
OSL_ASSERT (pViewShell!=NULL);
|
|
|
|
|
|
|
|
// Call SfxViewShell::SetWindow() directly instead of the local
|
|
|
|
// SetActiveWindow() because the later one accesses the view that
|
|
|
|
// usually has been destroyed already in a derived destructor.
|
|
|
|
if (IsMainViewShell())
|
|
|
|
pViewShell->SetWindow (NULL);
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2004-11-26 14:14:48 +00:00
|
|
|
// Keep the content window from accessing in its destructor the
|
|
|
|
// WindowUpdater.
|
|
|
|
mpContentWindow->SetViewShell(NULL);
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
// Stop listening for window events.
|
2004-10-04 17:48:54 +00:00
|
|
|
// GetParentWindow()->RemoveEventListener (
|
|
|
|
// LINK(this,ViewShell,FrameWindowEventListener));
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (IsMainViewShell())
|
|
|
|
GetDocSh()->Disconnect(this);
|
2004-01-20 12:38:38 +00:00
|
|
|
|
|
|
|
delete pZoomList;
|
2004-11-26 14:14:48 +00:00
|
|
|
|
|
|
|
mpLayerTabBar.reset();
|
2006-03-21 16:49:01 +00:00
|
|
|
|
|
|
|
if (mpImpl->mpSubShellFactory.get() != NULL)
|
|
|
|
GetViewShellBase().GetViewShellManager().RemoveSubShellFactory(
|
|
|
|
this,mpImpl->mpSubShellFactory);
|
2004-01-20 12:38:38 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* gemeinsamer Initialiserungsanteil der beiden Konstruktoren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::Construct(void)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 12:38:38 +00:00
|
|
|
SfxViewShell* pViewShell = GetViewShell();
|
|
|
|
OSL_ASSERT (pViewShell!=NULL);
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (IsMainViewShell())
|
|
|
|
GetDocSh()->Connect (this);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
pZoomList = new ZoomList( this );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
mpContentWindow.reset(new ::sd::Window(GetParentWindow()));
|
|
|
|
SetActiveWindow (mpContentWindow.get());
|
|
|
|
|
|
|
|
GetParentWindow()->SetBackground (Wallpaper());
|
|
|
|
mpContentWindow->SetBackground (Wallpaper());
|
|
|
|
mpContentWindow->SetCenterAllowed(bCenterAllowed);
|
|
|
|
mpContentWindow->SetViewShell(this);
|
|
|
|
mpContentWindow->Show();
|
|
|
|
|
2004-11-16 15:18:10 +00:00
|
|
|
if ( ! GetDocSh()->IsPreview())
|
|
|
|
{
|
|
|
|
// Create scroll bars and the filler between the scroll bars.
|
|
|
|
mpHorizontalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
|
|
|
|
mpHorizontalScrollBar->EnableRTL (FALSE);
|
|
|
|
mpHorizontalScrollBar->SetRange(Range(0, 32000));
|
|
|
|
mpHorizontalScrollBar->SetScrollHdl(LINK(this, ViewShell, HScrollHdl));
|
|
|
|
mpHorizontalScrollBar->Show();
|
|
|
|
|
|
|
|
mpVerticalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG)));
|
|
|
|
mpVerticalScrollBar->SetRange(Range(0, 32000));
|
|
|
|
mpVerticalScrollBar->SetScrollHdl(LINK(this, ViewShell, VScrollHdl));
|
|
|
|
mpVerticalScrollBar->Show();
|
|
|
|
|
|
|
|
aScrBarWH = Size(
|
|
|
|
mpVerticalScrollBar->GetSizePixel().Width(),
|
|
|
|
mpHorizontalScrollBar->GetSizePixel().Height());
|
|
|
|
|
|
|
|
mpScrollBarBox.reset(new ScrollBarBox(GetParentWindow(), WB_SIZEABLE));
|
|
|
|
mpScrollBarBox->Show();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
String aName( RTL_CONSTASCII_USTRINGPARAM( "ViewShell" ));
|
|
|
|
SetName (aName);
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
GetDoc()->StartOnlineSpelling(FALSE);
|
2003-06-04 10:06:02 +00:00
|
|
|
|
|
|
|
mpWindowUpdater->SetViewShell (*this);
|
2004-01-20 12:38:38 +00:00
|
|
|
mpWindowUpdater->SetDocument (GetDoc());
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2004-09-17 12:50:32 +00:00
|
|
|
// Re-initialize the spell dialog.
|
|
|
|
::sd::SpellDialogChildWindow* pSpellDialog =
|
|
|
|
static_cast< ::sd::SpellDialogChildWindow*> (
|
|
|
|
GetViewFrame()->GetChildWindow (
|
|
|
|
::sd::SpellDialogChildWindow::GetChildWindowId()));
|
|
|
|
if (pSpellDialog != NULL)
|
|
|
|
pSpellDialog->InvalidateSpellDialog();
|
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
// Register the sub shell factory.
|
|
|
|
mpImpl->mpSubShellFactory.reset(new ViewShellObjectBarFactory(*this));
|
|
|
|
GetViewShellBase().GetViewShellManager().AddSubShellFactory(this,mpImpl->mpSubShellFactory);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-10-28 12:36:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
void ViewShell::Init (bool bIsMainViewShell)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-28 12:36:16 +00:00
|
|
|
mpImpl->mbIsInitialized = true;
|
2006-03-21 16:49:01 +00:00
|
|
|
SetIsMainViewShell(bIsMainViewShell);
|
2004-01-20 12:38:38 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
void ViewShell::Exit (void)
|
|
|
|
{
|
2006-01-24 13:44:57 +00:00
|
|
|
sd::View* pView = GetView();
|
|
|
|
if (pView!=NULL && pView->IsTextEdit())
|
|
|
|
{
|
|
|
|
pView->EndTextEdit();
|
|
|
|
pView->UnmarkAll();
|
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
Deactivate (TRUE);
|
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
SetIsMainViewShell(false);
|
2004-07-13 14:03:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Aktivierung: Arbeitsfenster den Fokus zuweisen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::Activate(BOOL bIsMDIActivate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
SfxShell::Activate(bIsMDIActivate);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Laut MI darf keiner GrabFocus rufen, der nicht genau weiss von
|
|
|
|
// welchem Window der Focus gegrabt wird. Da Activate() vom SFX teilweise
|
|
|
|
// asynchron verschickt wird, kann es sein, dass ein falsches Window
|
|
|
|
// den Focus hat (#29682#):
|
|
|
|
//GetViewFrame()->GetWindow().GrabFocus();
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->SetActive(TRUE);
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpVerticalRuler->SetActive(TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (bIsMDIActivate)
|
|
|
|
{
|
|
|
|
// Damit der Navigator auch einen aktuellen Status bekommt
|
|
|
|
SfxBoolItem aItem( SID_NAVIGATOR_INIT, TRUE );
|
2004-07-13 14:03:16 +00:00
|
|
|
if (GetDispatcher() != NULL)
|
|
|
|
GetDispatcher()->Execute(
|
|
|
|
SID_NAVIGATOR_INIT,
|
|
|
|
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
|
|
|
|
&aItem,
|
|
|
|
0L);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
SfxViewShell* pViewShell = GetViewShell();
|
|
|
|
OSL_ASSERT (pViewShell!=NULL);
|
2004-01-20 12:38:38 +00:00
|
|
|
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
|
2000-09-21 15:12:50 +00:00
|
|
|
rBindings.Invalidate( SID_3D_STATE, TRUE, FALSE );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
if (mpSlideShow && !mpSlideShow->isTerminated() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow->activate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->Activate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
if(!GetDocSh()->IsUIActive())
|
2001-09-13 10:22:42 +00:00
|
|
|
UpdatePreview( GetActualPage(), TRUE );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
::sd::View* pView = GetView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pView)
|
|
|
|
{
|
|
|
|
pView->ShowMarkHdl(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-18 11:50:58 +00:00
|
|
|
ReadFrameViewData( pFrameView );
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (IsMainViewShell())
|
|
|
|
GetDocSh()->Connect(this);
|
2002-02-27 14:08:05 +00:00
|
|
|
}
|
|
|
|
|
2004-10-04 17:48:54 +00:00
|
|
|
void ViewShell::UIActivating( SfxInPlaceClient* pCli )
|
2002-02-27 14:08:05 +00:00
|
|
|
{
|
2004-01-20 12:38:38 +00:00
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
2006-11-01 17:05:37 +00:00
|
|
|
GetViewShellBase().GetToolBarManager().ToolBarsDestroyed();
|
2002-02-27 14:08:05 +00:00
|
|
|
}
|
2001-11-13 11:04:37 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
2004-10-04 17:48:54 +00:00
|
|
|
void ViewShell::UIDeactivated( SfxInPlaceClient* pCli )
|
2002-02-27 14:08:05 +00:00
|
|
|
{
|
2004-01-20 12:38:38 +00:00
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
2006-11-01 17:05:37 +00:00
|
|
|
GetViewShellBase().GetToolBarManager().ToolBarsDestroyed();
|
|
|
|
if ( GetDrawView() )
|
|
|
|
GetViewShellBase().GetToolBarManager().SelectionHasChanged(*this, *GetDrawView());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Deaktivierung
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::Deactivate(BOOL bIsMDIActivate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-12-01 09:10:43 +00:00
|
|
|
// remove view from a still active drag'n'drop session
|
|
|
|
SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (IsMainViewShell())
|
|
|
|
GetDocSh()->Disconnect(this);
|
|
|
|
|
2003-12-01 09:10:43 +00:00
|
|
|
if( pDragTransferable )
|
|
|
|
pDragTransferable->SetView( NULL );
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
SfxViewShell* pViewShell = GetViewShell();
|
|
|
|
OSL_ASSERT (pViewShell!=NULL);
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// View-Attribute an der FrameView merken
|
|
|
|
WriteFrameViewData();
|
|
|
|
|
|
|
|
if (bIsMDIActivate)
|
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
if (mpSlideShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow->deactivate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->Deactivate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
::sd::View* pView = GetView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pView)
|
|
|
|
{
|
|
|
|
pView->HideMarkHdl(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->SetActive(FALSE);
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpVerticalRuler->SetActive(FALSE);
|
|
|
|
|
|
|
|
SfxShell::Deactivate(bIsMDIActivate);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
void ViewShell::Shutdown (void)
|
|
|
|
{
|
|
|
|
Exit ();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Keyboard event
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
BOOL ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-02-12 11:43:12 +00:00
|
|
|
BOOL bReturn(FALSE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-12 11:43:12 +00:00
|
|
|
if(pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
SetActiveWindow(pWin);
|
|
|
|
}
|
|
|
|
|
2001-02-12 11:43:12 +00:00
|
|
|
if(!bReturn)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-02-12 11:43:12 +00:00
|
|
|
// #76008#
|
|
|
|
// give key input first to SfxViewShell to give CTRL+Key
|
|
|
|
// (e.g. CTRL+SHIFT+'+', to front) priority.
|
2004-01-20 12:38:38 +00:00
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
|
|
|
bReturn = GetViewShell()->KeyInput(rKEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2001-02-12 11:43:12 +00:00
|
|
|
|
|
|
|
if(!bReturn)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
if(mpSlideShow)
|
2001-02-12 11:43:12 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
bReturn = mpSlideShow->keyInput(rKEvt);
|
2001-02-12 11:43:12 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
else if(HasCurrentFunction())
|
2001-02-12 11:43:12 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
bReturn = GetCurrentFunction()->KeyInput(rKEvt);
|
2001-02-12 11:43:12 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if(!bReturn && GetActiveWindow())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
KeyCode aKeyCode = rKEvt.GetKeyCode();
|
|
|
|
|
|
|
|
if (aKeyCode.IsMod1() && aKeyCode.IsShift()
|
|
|
|
&& aKeyCode.GetCode() == KEY_R)
|
|
|
|
{
|
|
|
|
// 3D-Kontext wieder zerstoeren
|
2004-07-13 14:03:16 +00:00
|
|
|
Base3D* pBase3D = (Base3D*) GetActiveWindow()->Get3DContext();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pBase3D)
|
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
pBase3D->Destroy(GetActiveWindow());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
InvalidateWindows();
|
|
|
|
bReturn = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return(bReturn);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* MouseButtonDown event
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-03-21 16:49:01 +00:00
|
|
|
// We have to lock tool bar updates while the mouse button is pressed in
|
|
|
|
// order to prevent the shape under the mouse to be moved (this happens
|
|
|
|
// when the number of docked tool bars changes as result of a changed
|
|
|
|
// selection; this changes the window size and thus the mouse position
|
|
|
|
// in model coordinates: with respect to model coordinates the mouse
|
|
|
|
// moves.)
|
|
|
|
OSL_ASSERT(mpImpl->mpUpdateLockForMouse.expired());
|
|
|
|
mpImpl->mpUpdateLockForMouse = ViewShell::Implementation::ToolBarManagerLock::Create(
|
|
|
|
GetViewShellBase().GetToolBarManager());
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pWin && !pWin->HasFocus() )
|
|
|
|
{
|
|
|
|
pWin->GrabFocus();
|
|
|
|
SetActiveWindow(pWin);
|
|
|
|
// GetViewFrame()->GetWindow().GrabFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
// MouseEvent in E3dView eintragen
|
2004-07-13 14:03:16 +00:00
|
|
|
if (GetView() != NULL)
|
|
|
|
GetView()->SetMouseEvent(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
if(mpSlideShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow->mouseButtonDown(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
else if (HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->MouseButtonDown(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* MouseMove event
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-03-21 16:49:01 +00:00
|
|
|
if (rMEvt.IsLeaveWindow())
|
|
|
|
{
|
|
|
|
if ( ! mpImpl->mpUpdateLockForMouse.expired())
|
|
|
|
{
|
|
|
|
::boost::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock(
|
|
|
|
mpImpl->mpUpdateLockForMouse);
|
|
|
|
if (pLock.get() != NULL)
|
|
|
|
pLock->Release();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pWin )
|
|
|
|
{
|
|
|
|
SetActiveWindow(pWin);
|
|
|
|
}
|
|
|
|
|
|
|
|
// MouseEvent in E3dView eintragen
|
2004-07-13 14:03:16 +00:00
|
|
|
if (GetView() != NULL)
|
|
|
|
GetView()->SetMouseEvent(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
Point aPosition = pWin->OutputToAbsoluteScreenPixel(rMEvt.GetPosPixel());
|
|
|
|
// if (saMousePosition != aPosition)
|
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
if(mpSlideShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow->mouseMove(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
else if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->MouseMove(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-03-21 16:49:01 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* MouseButtonUp event
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if ( pWin )
|
|
|
|
{
|
|
|
|
SetActiveWindow(pWin);
|
|
|
|
}
|
|
|
|
|
|
|
|
// MouseEvent in E3dView eintragen
|
2004-07-13 14:03:16 +00:00
|
|
|
if (GetView() != NULL)
|
|
|
|
GetView()->SetMouseEvent(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
if(mpSlideShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow->mouseButtonUp(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
else if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->MouseButtonUp(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-03-21 16:49:01 +00:00
|
|
|
|
|
|
|
if ( ! mpImpl->mpUpdateLockForMouse.expired())
|
|
|
|
{
|
|
|
|
::boost::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock(
|
|
|
|
mpImpl->mpUpdateLockForMouse);
|
|
|
|
if (pLock.get() != NULL)
|
|
|
|
pLock->Release();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Command event
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
|
2005-01-28 15:27:09 +00:00
|
|
|
{
|
|
|
|
BOOL bDone = HandleScrollCommand (rCEvt, pWin);
|
|
|
|
|
|
|
|
if( !bDone )
|
|
|
|
{
|
2005-11-16 08:22:34 +00:00
|
|
|
if( rCEvt.GetCommand() == COMMAND_INPUTLANGUAGECHANGE )
|
|
|
|
{
|
|
|
|
//#i42732# update state of fontname if input language changes
|
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONT );
|
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
|
|
|
|
}
|
|
|
|
else if(mpSlideShow)
|
2005-01-28 15:27:09 +00:00
|
|
|
{
|
|
|
|
mpSlideShow->command(rCEvt);
|
|
|
|
}
|
2005-12-14 16:32:08 +00:00
|
|
|
else if(HasCurrentFunction())
|
2005-01-28 15:27:09 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
GetCurrentFunction()->Command(rCEvt);
|
2005-01-28 15:27:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
long ViewShell::Notify(NotifyEvent& rNEvt, ::sd::Window* pWin)
|
|
|
|
{
|
|
|
|
// handle scroll commands when they arrived at child windows
|
|
|
|
long nRet = FALSE;
|
|
|
|
if( rNEvt.GetType() == EVENT_COMMAND )
|
|
|
|
{
|
|
|
|
// note: dynamic_cast is not possible as GetData() returns a void*
|
|
|
|
CommandEvent* pCmdEvent = reinterpret_cast< CommandEvent* >(rNEvt.GetData());
|
|
|
|
nRet = HandleScrollCommand(*pCmdEvent, pWin);
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
BOOL bDone = FALSE;
|
|
|
|
|
|
|
|
switch( rCEvt.GetCommand() )
|
|
|
|
{
|
2005-01-28 15:27:09 +00:00
|
|
|
case COMMAND_WHEEL:
|
|
|
|
case COMMAND_STARTAUTOSCROLL:
|
|
|
|
case COMMAND_AUTOSCROLL:
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
const CommandWheelData* pData = rCEvt.GetWheelData();
|
|
|
|
|
2005-12-07 16:44:06 +00:00
|
|
|
if (pData != NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-07 16:44:06 +00:00
|
|
|
if (pData->IsMod1())
|
2002-08-20 12:03:50 +00:00
|
|
|
{
|
2005-12-07 16:44:06 +00:00
|
|
|
if( !GetDocSh()->IsUIActive() )
|
|
|
|
{
|
|
|
|
const long nOldZoom = GetActiveWindow()->GetZoom();
|
|
|
|
long nNewZoom;
|
|
|
|
|
|
|
|
if( pData->GetDelta() < 0L )
|
|
|
|
nNewZoom = Max( (long) pWin->GetMinZoom(), (long)(nOldZoom - DELTA_ZOOM) );
|
|
|
|
else
|
|
|
|
nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)(nOldZoom + DELTA_ZOOM) );
|
|
|
|
|
|
|
|
SetZoom( nNewZoom );
|
|
|
|
Invalidate( SID_ATTR_ZOOM );
|
|
|
|
bDone = TRUE;
|
|
|
|
}
|
2002-08-20 12:03:50 +00:00
|
|
|
}
|
2005-12-07 16:44:06 +00:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-07 16:44:06 +00:00
|
|
|
if( mpContentWindow.get() == pWin )
|
|
|
|
{
|
|
|
|
ULONG nScrollLines = pData->GetScrollLines();
|
|
|
|
if(IsPageFlipMode())
|
|
|
|
nScrollLines = COMMAND_WHEEL_PAGESCROLL;
|
|
|
|
CommandWheelData aWheelData( pData->GetDelta(),pData->GetNotchDelta(),
|
|
|
|
nScrollLines,pData->GetMode(),pData->GetModifier(),pData->IsHorz() );
|
|
|
|
CommandEvent aReWrite( rCEvt.GetMousePosPixel(),rCEvt.GetCommand(),
|
|
|
|
rCEvt.IsMouseEvent(),(const void *) &aWheelData );
|
|
|
|
bDone = pWin->HandleScrollCommand( aReWrite,
|
|
|
|
mpHorizontalScrollBar.get(),
|
|
|
|
mpVerticalScrollBar.get());
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-01-28 15:27:09 +00:00
|
|
|
return bDone;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
void ViewShell::SetupRulers (void)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 19:36:02 +00:00
|
|
|
if (mbHasRulers && (mpContentWindow.get() != NULL) && (mpSlideShow==NULL) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
long nHRulerOfs = 0;
|
|
|
|
|
2004-10-28 12:36:16 +00:00
|
|
|
if ( mpVerticalRuler.get() == NULL )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
mpVerticalRuler.reset(CreateVRuler(GetActiveWindow()));
|
|
|
|
if ( mpVerticalRuler.get() != NULL )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
nHRulerOfs = mpVerticalRuler->GetSizePixel().Width();
|
|
|
|
mpVerticalRuler->SetActive(TRUE);
|
|
|
|
mpVerticalRuler->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2004-10-28 12:36:16 +00:00
|
|
|
if ( mpHorizontalRuler.get() == NULL )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow(), TRUE));
|
|
|
|
if ( mpHorizontalRuler.get() != NULL )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
mpHorizontalRuler->SetWinPos(nHRulerOfs);
|
|
|
|
mpHorizontalRuler->SetActive(TRUE);
|
|
|
|
mpHorizontalRuler->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2004-07-06 11:27:23 +00:00
|
|
|
}
|
2004-07-15 08:00:36 +00:00
|
|
|
/*
|
2004-07-06 11:27:23 +00:00
|
|
|
SvBorder aBorder (
|
|
|
|
bHasRuler && pVRulerArray[0]!=NULL
|
|
|
|
? pVRulerArray[0]->GetSizePixel().Width()
|
|
|
|
: 0,
|
|
|
|
bHasRuler && pHRulerArray[0]!=NULL
|
|
|
|
? pHRulerArray[0]->GetSizePixel().Height()
|
|
|
|
: 0,
|
|
|
|
aScrBarWH.Width(),
|
|
|
|
aScrBarWH.Height());
|
|
|
|
GetViewShellBase().SetBorderPixel (aBorder);
|
2004-07-15 08:00:36 +00:00
|
|
|
*/
|
2004-07-06 11:27:23 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL ViewShell::HasRuler (void)
|
|
|
|
{
|
|
|
|
return mbHasRulers;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::Resize (const Point& rPos, const Size& rSize)
|
|
|
|
{
|
|
|
|
SetupRulers ();
|
|
|
|
|
|
|
|
// AdjustPosSizePixel(rPos, rSize);
|
|
|
|
// Make sure that the new size is not degenerate.
|
|
|
|
if ( !rSize.Width() || !rSize.Height() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Remember the new position and size.
|
|
|
|
aViewPos = rPos;
|
|
|
|
aViewSize = rSize;
|
|
|
|
|
|
|
|
// Rearrange the UI elements to take care of the new position and size.
|
|
|
|
ArrangeGUIElements ();
|
|
|
|
// end of included AdjustPosSizePixel.
|
|
|
|
|
|
|
|
Size aS (GetParentWindow()->GetOutputSizePixel());
|
|
|
|
Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
|
|
|
|
Rectangle aVisArea = GetParentWindow()->PixelToLogic(
|
|
|
|
Rectangle( Point(0,0), aVisSizePixel));
|
|
|
|
Rectangle aCurrentVisArea (GetDocSh()->GetVisArea(ASPECT_CONTENT));
|
|
|
|
Rectangle aWindowRect = GetActiveWindow()->LogicToPixel(aCurrentVisArea);
|
|
|
|
if (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
|
|
|
|
&& IsMainViewShell())
|
|
|
|
{
|
|
|
|
// GetDocSh()->SetVisArea(aVisArea);
|
|
|
|
}
|
|
|
|
|
|
|
|
// VisAreaChanged(aVisArea);
|
|
|
|
|
|
|
|
::sd::View* pView = GetView();
|
|
|
|
|
|
|
|
if (pView)
|
|
|
|
{
|
|
|
|
pView->VisAreaChanged(GetActiveWindow());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SvBorder ViewShell::GetBorder (bool bOuterResize)
|
2004-01-20 12:38:38 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
SvBorder aBorder;
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Horizontal scrollbar.
|
|
|
|
if (mpHorizontalScrollBar.get()!=NULL
|
|
|
|
&& mpHorizontalScrollBar->IsVisible())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
aBorder.Bottom() = aScrBarWH.Height();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Vertical scrollbar.
|
|
|
|
if (mpVerticalScrollBar.get()!=NULL
|
|
|
|
&& mpVerticalScrollBar->IsVisible())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
aBorder.Right() = aScrBarWH.Width();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Place horizontal ruler below tab bar.
|
|
|
|
if (mbHasRulers && mpContentWindow.get() != NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
SetupRulers();
|
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
aBorder.Top() = mpHorizontalRuler->GetSizePixel().Height();
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
aBorder.Left() = mpVerticalRuler->GetSizePixel().Width();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
return aBorder;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
void ViewShell::ArrangeGUIElements (void)
|
|
|
|
{
|
|
|
|
bool bVisible = mpContentWindow->IsVisible();
|
2006-03-21 16:49:01 +00:00
|
|
|
if (mpImpl->mbArrangeActive)
|
2004-07-13 14:03:16 +00:00
|
|
|
return;
|
2006-03-21 16:49:01 +00:00
|
|
|
mpImpl->mbArrangeActive = true;
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Calculate border for in-place editing.
|
|
|
|
long nLeft = aViewPos.X();
|
|
|
|
long nTop = aViewPos.Y();
|
|
|
|
long nRight = aViewPos.X() + aViewSize.Width();
|
|
|
|
long nBottom = aViewPos.Y() + aViewSize.Height();
|
|
|
|
|
|
|
|
// Horizontal scrollbar.
|
|
|
|
if (mpHorizontalScrollBar.get()!=NULL
|
|
|
|
&& mpHorizontalScrollBar->IsVisible())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
int nLocalLeft = nLeft;
|
|
|
|
if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible())
|
|
|
|
nLocalLeft += mpLayerTabBar->GetSizePixel().Width();
|
|
|
|
nBottom -= aScrBarWH.Height();
|
|
|
|
mpHorizontalScrollBar->SetPosSizePixel (
|
|
|
|
Point(nLocalLeft,nBottom),
|
|
|
|
Size(nRight-nLocalLeft-aScrBarWH.Width(),aScrBarWH.Height()));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Vertical scrollbar.
|
|
|
|
if (mpVerticalScrollBar.get()!=NULL
|
|
|
|
&& mpVerticalScrollBar->IsVisible())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
nRight -= aScrBarWH.Width();
|
|
|
|
mpVerticalScrollBar->SetPosSizePixel (
|
|
|
|
Point(nRight,nTop),
|
|
|
|
Size (aScrBarWH.Width(),nBottom-nTop));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2002-05-22 12:35:03 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Filler in the lower right corner.
|
|
|
|
if (mpScrollBarBox.get() != NULL)
|
|
|
|
if (mpHorizontalScrollBar.get()!=NULL
|
|
|
|
&& mpHorizontalScrollBar->IsVisible()
|
|
|
|
&& mpVerticalScrollBar.get()!=NULL
|
|
|
|
&& mpVerticalScrollBar->IsVisible())
|
|
|
|
{
|
|
|
|
mpScrollBarBox->Show();
|
|
|
|
mpScrollBarBox->SetPosSizePixel(Point(nRight, nBottom), aScrBarWH);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mpScrollBarBox->Hide();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// Place horizontal ruler below tab bar.
|
|
|
|
if (mbHasRulers && mpContentWindow.get() != NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
{
|
|
|
|
Size aRulerSize = mpHorizontalRuler->GetSizePixel();
|
|
|
|
aRulerSize.Width() = nRight - nLeft;
|
|
|
|
mpHorizontalRuler->SetPosSizePixel (
|
|
|
|
Point(nLeft,nTop), aRulerSize);
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->SetBorderPos(
|
|
|
|
mpVerticalRuler->GetSizePixel().Width()-1);
|
|
|
|
nTop += aRulerSize.Height();
|
|
|
|
}
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
{
|
|
|
|
Size aRulerSize = mpVerticalRuler->GetSizePixel();
|
|
|
|
aRulerSize.Height() = nBottom - nTop;
|
|
|
|
mpVerticalRuler->SetPosSizePixel (
|
|
|
|
Point (nLeft,nTop), aRulerSize);
|
|
|
|
nLeft += aRulerSize.Width();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
// The size of the window of the center pane is set differently from
|
|
|
|
// that of the windows in the docking windows.
|
|
|
|
bool bSlideShowActive =
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow != NULL
|
|
|
|
&& ! mpSlideShow->isTerminated()
|
|
|
|
&& ! mpSlideShow->isFullScreen()
|
|
|
|
&& mpSlideShow->getAnimationMode() == ANIMATIONMODE_SHOW;
|
2004-07-13 14:03:16 +00:00
|
|
|
if ( ! bSlideShowActive)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
SfxViewShell* pViewShell = GetViewShell();
|
|
|
|
OSL_ASSERT (pViewShell!=NULL);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
mpContentWindow->SetPosSizePixel(
|
|
|
|
Point(nLeft,nTop),
|
|
|
|
Size(nRight-nLeft,nBottom-nTop));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
// Windows in the center and rulers at the left and top side.
|
2004-07-13 14:03:16 +00:00
|
|
|
maAllWindowRectangle = Rectangle(
|
2004-01-20 12:38:38 +00:00
|
|
|
aViewPos,
|
2004-07-13 14:03:16 +00:00
|
|
|
Size(aViewSize.Width()-aScrBarWH.Width(),
|
|
|
|
aViewSize.Height()-aScrBarWH.Height()));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpContentWindow.get() != NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
mpContentWindow->UpdateMapOrigin();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
UpdateScrollBars();
|
2006-03-21 16:49:01 +00:00
|
|
|
|
|
|
|
mpImpl->mbArrangeActive = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
void ViewShell::SetUIUnit(FieldUnit eUnit)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
// Set unit at horizontal and vertical rulers.
|
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->SetUnit(eUnit);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpVerticalRuler->SetUnit(eUnit);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* DefTab an den horizontalen Linealen setzen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::SetDefTabHRuler( UINT16 nDefTab )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->SetDefTabDist( nDefTab );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Tell the FmFormShell that the view shell is closing. Give it the
|
|
|
|
oportunity to prevent that.
|
|
|
|
*/
|
|
|
|
USHORT ViewShell::PrepareClose (BOOL bUI, BOOL bForBrowsing)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:03:16 +00:00
|
|
|
USHORT nResult = TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager().GetFormShell();
|
2004-06-03 11:00:00 +00:00
|
|
|
if (pFormShell != NULL)
|
|
|
|
nResult = pFormShell->PrepareClose (bUI, bForBrowsing);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-06-03 11:00:00 +00:00
|
|
|
return nResult;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::UpdatePreview (SdPage* pPage, BOOL bInit)
|
2001-09-13 10:22:42 +00:00
|
|
|
{
|
2005-01-27 13:24:13 +00:00
|
|
|
// Do nothing. After the actual preview has been removed,
|
|
|
|
// OutlineViewShell::UpdatePreview() is the place where something
|
|
|
|
// usefull is still done.
|
2001-09-13 10:22:42 +00:00
|
|
|
}
|
|
|
|
|
2006-01-10 13:39:43 +00:00
|
|
|
SfxUndoManager* ViewShell::ImpGetUndoManager (void) const
|
|
|
|
{
|
|
|
|
const ViewShell* pMainViewShell = GetViewShellBase().GetMainViewShell();
|
2002-01-16 10:19:41 +00:00
|
|
|
|
2006-01-10 13:39:43 +00:00
|
|
|
if( pMainViewShell == 0 )
|
|
|
|
pMainViewShell = this;
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2006-01-10 13:39:43 +00:00
|
|
|
::sd::View* pView = pMainViewShell->GetView();
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2006-01-10 13:39:43 +00:00
|
|
|
// check for text edit our outline view
|
|
|
|
if( pView )
|
2005-01-31 13:56:31 +00:00
|
|
|
{
|
2006-01-10 13:39:43 +00:00
|
|
|
if( pMainViewShell->GetShellType() == ViewShell::ST_OUTLINE )
|
2005-01-31 13:56:31 +00:00
|
|
|
{
|
2006-01-10 13:39:43 +00:00
|
|
|
OutlineView* pOlView = dynamic_cast< OutlineView* >( pView );
|
|
|
|
if( pOlView )
|
2005-01-31 13:56:31 +00:00
|
|
|
{
|
2006-01-10 13:39:43 +00:00
|
|
|
::Outliner* pOutl = pOlView->GetOutliner();
|
|
|
|
if( pOutl )
|
|
|
|
return &pOutl->GetUndoManager();
|
2005-01-31 13:56:31 +00:00
|
|
|
}
|
|
|
|
}
|
2006-01-10 13:39:43 +00:00
|
|
|
else if( pView->IsTextEdit() )
|
|
|
|
{
|
|
|
|
SdrOutliner* pOL = pView->GetTextEditOutliner();
|
|
|
|
if( pOL )
|
|
|
|
return &pOL->GetUndoManager();
|
|
|
|
}
|
2005-01-31 13:56:31 +00:00
|
|
|
}
|
2006-01-10 13:39:43 +00:00
|
|
|
|
|
|
|
if( GetDocSh() )
|
|
|
|
return GetDocSh()->GetUndoManager();
|
|
|
|
|
2005-01-31 13:56:31 +00:00
|
|
|
return NULL;
|
2002-01-16 10:19:41 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
SfxUndoManager* pUndoManager = ImpGetUndoManager();
|
|
|
|
if(pUndoManager)
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
|
|
|
|
if(nCount)
|
|
|
|
{
|
|
|
|
// prepare list
|
|
|
|
List aStringList;
|
2003-12-01 16:46:11 +00:00
|
|
|
sal_uInt16 a;
|
2002-01-16 10:19:41 +00:00
|
|
|
|
2003-12-01 16:46:11 +00:00
|
|
|
for( a = 0; a < nCount; a++)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
// generate one String in list per undo step
|
|
|
|
String* pInsertString = new String(pUndoManager->GetUndoActionComment(a));
|
|
|
|
aStringList.Insert(pInsertString, LIST_APPEND);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set item
|
|
|
|
rSet.Put(SfxStringListItem(SID_GETUNDOSTRINGS, &aStringList));
|
|
|
|
|
|
|
|
// delete Strings again
|
|
|
|
for(a = 0; a < nCount; a++)
|
|
|
|
delete (String*)aStringList.GetObject(a);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rSet.DisableItem(SID_GETUNDOSTRINGS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-08 14:28:48 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
SfxUndoManager* pUndoManager = ImpGetUndoManager();
|
|
|
|
if(pUndoManager)
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
|
|
|
|
if(nCount)
|
|
|
|
{
|
|
|
|
// prepare list
|
|
|
|
List aStringList;
|
2003-12-01 16:46:11 +00:00
|
|
|
sal_uInt16 a;
|
2002-01-16 10:19:41 +00:00
|
|
|
|
2003-12-01 16:46:11 +00:00
|
|
|
for( a = 0; a < nCount; a++)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
// generate one String in list per undo step
|
|
|
|
String* pInsertString = new String(pUndoManager->GetRedoActionComment(a));
|
|
|
|
aStringList.Insert(pInsertString, LIST_APPEND);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set item
|
|
|
|
rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList));
|
|
|
|
|
|
|
|
// delete Strings again
|
|
|
|
for(a = 0; a < nCount; a++)
|
|
|
|
delete (String*)aStringList.GetObject(a);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rSet.DisableItem(SID_GETREDOSTRINGS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-08 14:28:48 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::ImpSidUndo(BOOL bDrawViewShell, SfxRequest& rReq)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
SfxUndoManager* pUndoManager = ImpGetUndoManager();
|
|
|
|
sal_uInt16 nNumber(1);
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if(pReqArgs)
|
|
|
|
{
|
|
|
|
SfxUInt16Item* pUIntItem = (SfxUInt16Item*)&pReqArgs->Get(SID_UNDO);
|
|
|
|
nNumber = pUIntItem->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nNumber && pUndoManager)
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
|
|
|
|
if(nCount >= nNumber)
|
|
|
|
{
|
|
|
|
// #94637# when UndoStack is cleared by ModifyPageUndoAction
|
|
|
|
// the nCount may have changed, so test GetUndoActionCount()
|
|
|
|
while(nNumber-- && pUndoManager->GetUndoActionCount())
|
|
|
|
{
|
|
|
|
pUndoManager->Undo();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// #91081# refresh rulers, maybe UNDO was move of TAB marker in ruler
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mbHasRulers)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
Invalidate(SID_ATTR_TABSTOP);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This one is corresponding to the default handling
|
|
|
|
// of SID_UNDO in sfx2
|
|
|
|
GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
|
2002-03-08 14:28:48 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::ImpSidRedo(BOOL bDrawViewShell, SfxRequest& rReq)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
SfxUndoManager* pUndoManager = ImpGetUndoManager();
|
|
|
|
sal_uInt16 nNumber(1);
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if(pReqArgs)
|
|
|
|
{
|
|
|
|
SfxUInt16Item* pUIntItem = (SfxUInt16Item*)&pReqArgs->Get(SID_REDO);
|
|
|
|
nNumber = pUIntItem->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nNumber && pUndoManager)
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
|
|
|
|
if(nCount >= nNumber)
|
|
|
|
{
|
|
|
|
// #94637# when UndoStack is cleared by ModifyPageRedoAction
|
|
|
|
// the nCount may have changed, so test GetRedoActionCount()
|
|
|
|
while(nNumber-- && pUndoManager->GetRedoActionCount())
|
|
|
|
{
|
|
|
|
pUndoManager->Redo();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// #91081# refresh rulers, maybe REDO was move of TAB marker in ruler
|
2004-07-13 14:03:16 +00:00
|
|
|
if (mbHasRulers)
|
2002-01-16 10:19:41 +00:00
|
|
|
{
|
|
|
|
Invalidate(SID_ATTR_TABSTOP);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This one is corresponding to the default handling
|
|
|
|
// of SID_UNDO in sfx2
|
|
|
|
GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-03-08 14:28:48 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
void ViewShell::ExecReq( SfxRequest& rReq )
|
2002-03-08 14:28:48 +00:00
|
|
|
{
|
2002-11-01 10:15:42 +00:00
|
|
|
USHORT nSlot = rReq.GetSlot();
|
|
|
|
switch( nSlot )
|
2002-03-08 14:28:48 +00:00
|
|
|
{
|
|
|
|
case SID_MAIL_SCROLLBODY_PAGEDOWN:
|
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
FunctionReference xFunc( GetCurrentFunction() );
|
|
|
|
if( xFunc.is() )
|
2002-03-08 14:28:48 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
xFunc->ScrollStart();
|
2002-03-08 14:28:48 +00:00
|
|
|
ScrollLines( 0, -1 );
|
2005-12-14 16:32:08 +00:00
|
|
|
xFunc->ScrollEnd();
|
2002-03-08 14:28:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-11-01 10:15:42 +00:00
|
|
|
case SID_OUTPUT_QUALITY_COLOR:
|
|
|
|
case SID_OUTPUT_QUALITY_GRAYSCALE:
|
|
|
|
case SID_OUTPUT_QUALITY_BLACKWHITE:
|
|
|
|
case SID_OUTPUT_QUALITY_CONTRAST:
|
|
|
|
{
|
|
|
|
ULONG nMode = OUTPUT_DRAWMODE_COLOR;
|
|
|
|
|
|
|
|
switch( nSlot )
|
|
|
|
{
|
|
|
|
case SID_OUTPUT_QUALITY_COLOR: nMode = OUTPUT_DRAWMODE_COLOR; break;
|
|
|
|
case SID_OUTPUT_QUALITY_GRAYSCALE: nMode = OUTPUT_DRAWMODE_GRAYSCALE; break;
|
|
|
|
case SID_OUTPUT_QUALITY_BLACKWHITE: nMode = OUTPUT_DRAWMODE_BLACKWHITE; break;
|
|
|
|
case SID_OUTPUT_QUALITY_CONTRAST: nMode = OUTPUT_DRAWMODE_CONTRAST; break;
|
|
|
|
}
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
GetActiveWindow()->SetDrawMode( nMode );
|
2002-11-01 10:15:42 +00:00
|
|
|
pFrameView->SetDrawMode( nMode );
|
2003-11-24 16:21:16 +00:00
|
|
|
// #110094#-7
|
|
|
|
// GetView()->ReleaseMasterPagePaintCache();
|
2004-07-13 14:03:16 +00:00
|
|
|
GetActiveWindow()->Invalidate();
|
2002-11-01 10:15:42 +00:00
|
|
|
|
|
|
|
Invalidate();
|
|
|
|
rReq.Done();
|
|
|
|
break;
|
|
|
|
}
|
2002-03-08 14:28:48 +00:00
|
|
|
}
|
|
|
|
}
|
2002-04-23 10:52:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** This default implemenation returns only an empty reference. See derived
|
|
|
|
classes for more interesting examples.
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference<
|
2003-04-24 16:07:22 +00:00
|
|
|
::com::sun::star::accessibility::XAccessible>
|
2004-01-20 12:38:38 +00:00
|
|
|
ViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow)
|
2002-04-23 10:52:12 +00:00
|
|
|
{
|
|
|
|
return ::com::sun::star::uno::Reference<
|
2003-04-24 16:07:22 +00:00
|
|
|
::com::sun::star::accessibility::XAccessible> ();
|
2002-04-23 10:52:12 +00:00
|
|
|
}
|
2003-06-04 10:06:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
::sd::WindowUpdater* ViewShell::GetWindowUpdater (void) const
|
2003-06-04 10:06:02 +00:00
|
|
|
{
|
|
|
|
return mpWindowUpdater.get();
|
|
|
|
}
|
2004-01-20 12:38:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShellBase& ViewShell::GetViewShellBase (void) const
|
|
|
|
{
|
|
|
|
return *static_cast<ViewShellBase*>(GetViewShell());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell::ShellType ViewShell::GetShellType (void) const
|
|
|
|
{
|
|
|
|
return meShellType;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DrawDocShell* ViewShell::GetDocSh (void) const
|
|
|
|
{
|
|
|
|
return GetViewShellBase().GetDocShell();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SdDrawDocument* ViewShell::GetDoc (void) const
|
|
|
|
{
|
|
|
|
return GetViewShellBase().GetDocument();
|
|
|
|
}
|
|
|
|
|
|
|
|
ErrCode ViewShell::DoVerb (long nVerb)
|
|
|
|
{
|
|
|
|
return ERRCODE_NONE;
|
|
|
|
}
|
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
void ViewShell::SetCurrentFunction( const FunctionReference& xFunction)
|
|
|
|
{
|
|
|
|
if( mxCurrentFunction.is() && (mxOldFunction != mxCurrentFunction) )
|
|
|
|
mxCurrentFunction->Dispose();
|
|
|
|
FunctionReference xTemp( mxCurrentFunction );
|
|
|
|
mxCurrentFunction = xFunction;
|
|
|
|
}
|
2004-01-20 12:38:38 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
void ViewShell::SetOldFunction(const FunctionReference& xFunction)
|
|
|
|
{
|
|
|
|
if( mxOldFunction.is() && (xFunction != mxOldFunction) && (mxCurrentFunction != mxOldFunction) )
|
|
|
|
mxOldFunction->Dispose();
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
FunctionReference xTemp( mxOldFunction );
|
|
|
|
mxOldFunction = xFunction;
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
/** this method deactivates the current function. If an old function is
|
|
|
|
saved, this will become activated and current function.
|
|
|
|
*/
|
|
|
|
void ViewShell::Cancel()
|
2004-07-13 14:03:16 +00:00
|
|
|
{
|
2005-12-14 16:32:08 +00:00
|
|
|
if(mxCurrentFunction.is() && (mxCurrentFunction != mxOldFunction ))
|
|
|
|
{
|
|
|
|
FunctionReference xTemp( mxCurrentFunction );
|
|
|
|
mxCurrentFunction.clear();
|
|
|
|
xTemp->Deactivate();
|
|
|
|
xTemp->Dispose();
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
if(mxOldFunction.is())
|
|
|
|
{
|
|
|
|
mxCurrentFunction = mxOldFunction;
|
|
|
|
mxCurrentFunction->Activate();
|
|
|
|
}
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
void ViewShell::DeactivateCurrentFunction( bool bPermanent /* == false */ )
|
|
|
|
{
|
|
|
|
if( mxCurrentFunction.is() )
|
|
|
|
{
|
|
|
|
if(bPermanent && (mxOldFunction == mxCurrentFunction))
|
|
|
|
mxOldFunction.clear();
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
mxCurrentFunction->Deactivate();
|
|
|
|
if( mxCurrentFunction != mxOldFunction )
|
|
|
|
mxCurrentFunction->Dispose();
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
FunctionReference xTemp( mxCurrentFunction );
|
|
|
|
mxCurrentFunction.clear();
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
void ViewShell::DisposeFunctions()
|
|
|
|
{
|
|
|
|
if(mxCurrentFunction.is())
|
|
|
|
{
|
|
|
|
FunctionReference xTemp( mxCurrentFunction );
|
|
|
|
mxCurrentFunction.clear();
|
|
|
|
xTemp->Deactivate();
|
|
|
|
xTemp->Dispose();
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2005-12-14 16:32:08 +00:00
|
|
|
if(mxOldFunction.is())
|
|
|
|
{
|
|
|
|
FunctionReference xTemp( mxOldFunction );
|
|
|
|
mxOldFunction->Dispose();
|
|
|
|
mxOldFunction.clear();
|
|
|
|
}
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
void ViewShell::SetSlideShow(sd::Slideshow* pSlideShow)
|
2004-07-13 14:03:16 +00:00
|
|
|
{
|
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
if( mpSlideShow )
|
|
|
|
delete mpSlideShow;
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2004-11-26 19:36:02 +00:00
|
|
|
mpSlideShow = pSlideShow;
|
|
|
|
}
|
2004-07-13 14:03:16 +00:00
|
|
|
|
2006-03-21 16:49:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
bool ViewShell::IsMainViewShell (void) const
|
|
|
|
{
|
|
|
|
return GetViewShellBase().GetMainViewShell() == this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-08-04 08:01:43 +00:00
|
|
|
void ViewShell::SetIsMainViewShell (bool bIsMainViewShell)
|
|
|
|
{
|
|
|
|
if (bIsMainViewShell != mpImpl->mbIsMainViewShell)
|
|
|
|
{
|
|
|
|
mpImpl->mbIsMainViewShell = bIsMainViewShell;
|
|
|
|
if (bIsMainViewShell)
|
|
|
|
{
|
|
|
|
GetDocSh()->Connect (this);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GetDocSh()->Disconnect (this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
::sd::Window* ViewShell::GetActiveWindow (void) const
|
|
|
|
{
|
|
|
|
return mpActiveWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::Paint (const Rectangle& rRect, ::sd::Window* pWin)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::Draw(OutputDevice &rDev, const Region &rReg)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZoomList* ViewShell::GetZoomList (void)
|
|
|
|
{
|
|
|
|
return pZoomList;
|
|
|
|
}
|
|
|
|
|
2004-08-04 08:01:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::ShowUIControls (bool bVisible)
|
|
|
|
{
|
|
|
|
mpImpl->mbIsShowingUIControls = bVisible;
|
|
|
|
|
|
|
|
if (mbHasRulers)
|
|
|
|
{
|
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->Show( bVisible );
|
|
|
|
|
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpVerticalRuler->Show( bVisible );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mpVerticalScrollBar.get() != NULL)
|
|
|
|
mpVerticalScrollBar->Show( bVisible );
|
|
|
|
|
|
|
|
if (mpHorizontalScrollBar.get() != NULL)
|
|
|
|
mpHorizontalScrollBar->Show( bVisible );
|
|
|
|
|
2004-09-20 12:38:29 +00:00
|
|
|
if (mpScrollBarBox.get() != NULL)
|
|
|
|
mpScrollBarBox->Show(bVisible);
|
|
|
|
|
2004-08-04 08:01:43 +00:00
|
|
|
if (mpContentWindow.get() != NULL)
|
|
|
|
mpContentWindow->Show( bVisible );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-01-20 12:38:38 +00:00
|
|
|
} // end of namespace sd
|
2004-07-13 14:03:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== ViewShellObjectBarFactory =============================================
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
ViewShellObjectBarFactory::ViewShellObjectBarFactory (
|
|
|
|
::sd::ViewShell& rViewShell)
|
|
|
|
: mrViewShell (rViewShell)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShellObjectBarFactory::~ViewShellObjectBarFactory (void)
|
|
|
|
{
|
|
|
|
for (ShellCache::iterator aI(maShellCache.begin());
|
|
|
|
aI!=maShellCache.end();
|
|
|
|
aI++)
|
|
|
|
{
|
|
|
|
delete aI->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SfxShell* ViewShellObjectBarFactory::CreateShell (
|
|
|
|
::sd::ShellId nId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
::sd::FrameView* pFrameView)
|
|
|
|
{
|
|
|
|
SfxShell* pShell = NULL;
|
|
|
|
|
|
|
|
ShellCache::iterator aI (maShellCache.find(nId));
|
2004-12-09 15:13:30 +00:00
|
|
|
if (aI == maShellCache.end() || aI->second==NULL)
|
2004-07-13 14:03:16 +00:00
|
|
|
{
|
|
|
|
::sd::View* pView = mrViewShell.GetView();
|
|
|
|
switch (nId)
|
|
|
|
{
|
|
|
|
case RID_BEZIER_TOOLBOX:
|
|
|
|
pShell = new ::sd::BezierObjectBar(&mrViewShell, pView);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RID_DRAW_TEXT_TOOLBOX:
|
|
|
|
pShell = new ::sd::TextObjectBar(
|
|
|
|
&mrViewShell, mrViewShell.GetDoc()->GetPool(), pView);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RID_DRAW_GRAF_TOOLBOX:
|
|
|
|
pShell = new ::sd::GraphicObjectBar(&mrViewShell, pView);
|
|
|
|
break;
|
|
|
|
|
2004-08-12 08:20:24 +00:00
|
|
|
case RID_DRAW_MEDIA_TOOLBOX:
|
|
|
|
pShell = new ::sd::MediaObjectBar(&mrViewShell, pView);
|
|
|
|
break;
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
case RID_SVX_EXTRUSION_BAR:
|
|
|
|
pShell = new ::svx::ExtrusionBar(
|
|
|
|
&mrViewShell.GetViewShellBase());
|
|
|
|
break;
|
|
|
|
|
2004-10-12 12:14:18 +00:00
|
|
|
case RID_SVX_FONTWORK_BAR:
|
|
|
|
pShell = new ::svx::FontworkBar(
|
|
|
|
&mrViewShell.GetViewShellBase());
|
|
|
|
break;
|
|
|
|
|
2004-07-13 14:03:16 +00:00
|
|
|
default:
|
|
|
|
pShell = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pShell = aI->second;
|
|
|
|
|
|
|
|
return pShell;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellObjectBarFactory::ReleaseShell (SfxShell* pShell)
|
|
|
|
{
|
2006-03-21 16:49:01 +00:00
|
|
|
if (pShell != NULL)
|
|
|
|
delete pShell;
|
2004-07-13 14:03:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // end of anonymous namespace
|