2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 22:03:39 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2004-10-04 17:43:02 +00:00
|
|
|
|
2006-09-16 18:36:12 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-10-28 12:34:18 +00:00
|
|
|
#include "DrawViewShell.hxx"
|
|
|
|
#include "ViewShellImplementation.hxx"
|
|
|
|
|
2006-03-21 16:42:53 +00:00
|
|
|
#include "DrawController.hxx"
|
2004-10-04 17:43:02 +00:00
|
|
|
#include <com/sun/star/embed/EmbedStates.hpp>
|
2005-10-19 11:28:19 +00:00
|
|
|
|
|
|
|
#include "comphelper/anytostring.hxx"
|
2008-07-01 12:38:26 +00:00
|
|
|
#include "comphelper/scopeguard.hxx"
|
2005-10-19 11:28:19 +00:00
|
|
|
#include "cppuhelper/exc_hlp.hxx"
|
|
|
|
#include "rtl/ref.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <svx/svdoole2.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <vcl/scrbar.hxx>
|
|
|
|
#include <svx/svdograf.hxx>
|
2004-03-30 14:54:23 +00:00
|
|
|
#include <svx/svdopage.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/msgbox.hxx>
|
2004-10-04 17:43:02 +00:00
|
|
|
#include <sot/storage.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/fmshell.hxx>
|
|
|
|
#include <svx/globl3d.hxx>
|
|
|
|
#include <svx/fmglob.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/outliner.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "misc.hxx"
|
|
|
|
|
|
|
|
#ifdef STARIMAGE_AVAILABLE
|
|
|
|
#include <sim2/simdll.hxx>
|
|
|
|
#endif
|
|
|
|
|
2004-11-26 14:03:57 +00:00
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
|
2009-12-02 10:19:06 +01:00
|
|
|
#include "view/viewoverlaymanager.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "glob.hrc"
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "helpids.h"
|
|
|
|
|
|
|
|
#include "app.hxx"
|
|
|
|
#include "fupoor.hxx"
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "fusel.hxx"
|
|
|
|
#include "sdpage.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "FrameView.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "stlpool.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "Window.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawview.hxx"
|
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#include "Ruler.hxx"
|
|
|
|
#include "Client.hxx"
|
2004-11-26 19:30:41 +00:00
|
|
|
#include "slideshow.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "optsitem.hxx"
|
|
|
|
#include "fusearch.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "Outliner.hxx"
|
|
|
|
#include "AnimationChildWindow.hxx"
|
2002-01-24 14:06:27 +00:00
|
|
|
#include "SdUnoDrawView.hxx"
|
2006-03-21 16:42:53 +00:00
|
|
|
#include "ToolBarManager.hxx"
|
|
|
|
#include "FormShellManager.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "ViewShellBase.hxx"
|
2004-07-13 13:54:26 +00:00
|
|
|
#include "LayerDialogChildWindow.hxx"
|
|
|
|
#include "LayerTabBar.hxx"
|
2004-10-28 12:34:18 +00:00
|
|
|
#include "ViewShellManager.hxx"
|
2005-04-18 10:17:16 +00:00
|
|
|
#include "ViewShellHint.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-01-19 11:57:01 +00:00
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <boost/bind.hpp>
|
|
|
|
|
2007-09-06 12:56:11 +00:00
|
|
|
#ifdef _MSC_VER
|
2008-07-01 12:38:26 +00:00
|
|
|
#if (_MSC_VER < 1400)
|
2000-09-18 16:07:07 +00:00
|
|
|
#pragma optimize ( "", off )
|
|
|
|
#endif
|
2008-07-01 12:38:26 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
using namespace com::sun::star;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
void DrawViewShell::Activate(BOOL bIsMDIActivate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-04-18 10:17:16 +00:00
|
|
|
ViewShell::Activate(bIsMDIActivate);
|
2002-02-27 14:08:05 +00:00
|
|
|
}
|
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
void DrawViewShell::UIActivating( SfxInPlaceClient* pCli )
|
2002-02-27 14:08:05 +00:00
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
ViewShell::UIActivating(pCli);
|
2002-02-27 14:08:05 +00:00
|
|
|
|
|
|
|
// #94252# Disable own controls
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Disable();
|
2004-07-13 13:54:26 +00:00
|
|
|
if (GetLayerTabControl() != NULL)
|
|
|
|
GetLayerTabControl()->Disable();
|
2002-02-27 14:08:05 +00:00
|
|
|
}
|
2001-11-13 11:04:37 +00:00
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli )
|
2002-02-27 14:08:05 +00:00
|
|
|
{
|
2001-11-13 11:04:37 +00:00
|
|
|
// #94252# Enable own controls
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Enable();
|
2004-07-13 13:54:26 +00:00
|
|
|
if (GetLayerTabControl() != NULL)
|
|
|
|
GetLayerTabControl()->Enable();
|
2002-02-27 14:08:05 +00:00
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
ViewShell::UIDeactivated(pCli);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Deactivate()
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::Deactivate(BOOL bIsMDIActivate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-04-18 10:17:16 +00:00
|
|
|
ViewShell::Deactivate(bIsMDIActivate);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-03-23 14:31:39 +01:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
class LockUI
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
void Lock(bool bLock);
|
|
|
|
SfxViewFrame *mpFrame;
|
|
|
|
public:
|
|
|
|
LockUI(SfxViewFrame *pFrame) : mpFrame(pFrame) { Lock(true); }
|
|
|
|
~LockUI() { Lock(false); }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void LockUI::Lock(bool bLock)
|
|
|
|
{
|
|
|
|
if (!mpFrame)
|
|
|
|
return;
|
|
|
|
mpFrame->Enable( !bLock );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Wird gerufen, wenn sich der Selektionszustand der View aendert
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2004-07-13 13:54:26 +00:00
|
|
|
void DrawViewShell::SelectionHasChanged (void)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Invalidate();
|
|
|
|
|
|
|
|
//Update3DWindow(); // 3D-Controller
|
|
|
|
SfxBoolItem aItem( SID_3D_STATE, TRUE );
|
2000-09-21 15:12:50 +00:00
|
|
|
GetViewFrame()->GetDispatcher()->Execute(
|
|
|
|
SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SdrOle2Obj* pOleObj = NULL;
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if ( mpDrawView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
|
|
|
SdrMark* pMark = rMarkList.GetMark(0);
|
2006-07-25 10:48:02 +00:00
|
|
|
SdrObject* pObj = pMark->GetMarkedSdrObj();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
UINT32 nInv = pObj->GetObjInventor();
|
|
|
|
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pOleObj = (SdrOle2Obj*) pObj;
|
|
|
|
UpdateIMapDlg( pObj );
|
|
|
|
}
|
|
|
|
else if (nSdrObjKind == OBJ_GRAF)
|
|
|
|
UpdateIMapDlg( pObj );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShellBase& rBase = GetViewShellBase();
|
2005-10-19 11:28:19 +00:00
|
|
|
rBase.SetVerbs(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-10-19 11:28:19 +00:00
|
|
|
try
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-10-19 11:28:19 +00:00
|
|
|
Client* pIPClient = static_cast<Client*>(rBase.GetIPClient());
|
|
|
|
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-10-19 11:28:19 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* Ggf. OLE-Objekt beruecksichtigen und deaktivieren
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
// this means we recently deselected an inplace active ole object so
|
|
|
|
// we need to deselect it now
|
|
|
|
if (!pOleObj)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-03-23 14:31:39 +01:00
|
|
|
//#i47279# disable frame until after object has completed unload
|
|
|
|
LockUI aUILock(GetViewFrame());
|
2006-11-01 17:05:23 +00:00
|
|
|
pIPClient->DeactivateObject();
|
2006-12-13 16:57:19 +00:00
|
|
|
//HMHmpDrView->ShowMarkHdl();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-19 11:28:19 +00:00
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef();
|
|
|
|
if ( xObj.is() )
|
|
|
|
{
|
|
|
|
rBase.SetVerbs( xObj->getSupportedVerbs() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2005-10-19 11:28:19 +00:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-10-19 11:28:19 +00:00
|
|
|
if ( pOleObj )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-10-19 11:28:19 +00:00
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef();
|
|
|
|
if ( xObj.is() )
|
|
|
|
{
|
|
|
|
rBase.SetVerbs( xObj->getSupportedVerbs() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2005-10-19 11:28:19 +00:00
|
|
|
}
|
|
|
|
catch( ::com::sun::star::uno::Exception& e )
|
|
|
|
{
|
|
|
|
(void)e;
|
|
|
|
DBG_ERROR(
|
|
|
|
(rtl::OString("sd::DrawViewShell::SelectionHasChanged(), "
|
|
|
|
"exception caught: ") +
|
|
|
|
rtl::OUStringToOString(
|
|
|
|
comphelper::anyToString( cppu::getCaughtException() ),
|
|
|
|
RTL_TEXTENCODING_UTF8 )).getStr() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 16:26:33 +00:00
|
|
|
if( HasCurrentFunction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:26:33 +00:00
|
|
|
GetCurrentFunction()->SelectionHasChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-06-27 14:47:19 +00:00
|
|
|
GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
// #96124# Invalidate for every subshell
|
2008-04-03 14:10:53 +00:00
|
|
|
GetViewShellBase().GetViewShellManager()->InvalidateAllSubShells(this);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->UpdateSelectionClipboard( FALSE );
|
2002-01-24 14:06:27 +00:00
|
|
|
|
2006-03-21 16:42:53 +00:00
|
|
|
GetViewShellBase().GetDrawController().FireSelectionChangeListener();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Zoomfaktor setzen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::SetZoom( long nZoom )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2002-11-12 09:24:49 +00:00
|
|
|
// Make sure that the zoom factor will not be recalculated on
|
|
|
|
// following window resizings.
|
2006-12-13 16:57:19 +00:00
|
|
|
mbZoomOnPage = FALSE;
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShell::SetZoom( nZoom );
|
2000-09-21 15:12:50 +00:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
|
2008-10-29 11:47:54 +00:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
|
2009-12-02 10:19:06 +01:00
|
|
|
mpViewOverlayManager->onZoomChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Zoomrechteck fuer aktives Fenster einstellen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShell::SetZoomRect( rZoomRect );
|
2000-09-21 15:12:50 +00:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
|
2008-10-29 11:47:54 +00:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
|
2009-12-02 10:19:06 +01:00
|
|
|
mpViewOverlayManager->onZoomChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* PrepareClose, ggfs. Texteingabe beenden, damit andere Viewshells ein
|
|
|
|
|* aktualisiertes Textobjekt vorfinden
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT DrawViewShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
if ( ViewShell::PrepareClose(bUI, bForBrowsing) != TRUE )
|
2000-09-18 16:07:07 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
BOOL bRet = TRUE;
|
|
|
|
|
2005-12-14 16:26:33 +00:00
|
|
|
if( bRet && HasCurrentFunction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:26:33 +00:00
|
|
|
USHORT nID = GetCurrentFunction()->GetSlotID();
|
2000-09-18 16:07:07 +00:00
|
|
|
if (nID == SID_TEXTEDIT || nID == SID_ATTR_CHAR)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->SdrEndTextEdit();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( !bRet )
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
maCloseTimer.SetTimeoutHdl( LINK( this, DrawViewShell, CloseHdl ) );
|
|
|
|
maCloseTimer.SetTimeout( 20 );
|
|
|
|
maCloseTimer.Start();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Status (Enabled/Disabled) von Menue-SfxSlots setzen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode != eEMode || mbIsLayerModeActive != bIsLayerModeActive)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-01-28 15:26:19 +00:00
|
|
|
ViewShellManager::UpdateLock aLock (GetViewShellBase().GetViewShellManager());
|
2004-10-28 12:34:18 +00:00
|
|
|
|
2003-04-24 13:41:23 +00:00
|
|
|
USHORT nActualPageNum = 0;
|
|
|
|
|
2006-03-21 16:42:53 +00:00
|
|
|
GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EM_MASTERPAGE);
|
|
|
|
GetViewShellBase().GetDrawController().FireChangeLayerMode (bIsLayerModeActive);
|
2002-01-24 14:06:27 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if ( mpDrawView->IsTextEdit() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->SdrEndTextEdit();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
LayerTabBar* pLayerBar = GetLayerTabControl();
|
|
|
|
if (pLayerBar != NULL)
|
|
|
|
pLayerBar->EndEditMode();
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.EndEditMode();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mePageKind == PK_HANDOUT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Bei Handzetteln nur MasterPage zulassen
|
|
|
|
eEMode = EM_MASTERPAGE;
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
meEditMode = eEMode;
|
2004-07-13 13:54:26 +00:00
|
|
|
mbIsLayerModeActive = bIsLayerModeActive;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-01-21 15:37:29 +00:00
|
|
|
// Determine whether to show the master view toolbar. The master
|
|
|
|
// page mode has to be active and the shell must not be a handout
|
|
|
|
// view.
|
2006-12-13 16:57:19 +00:00
|
|
|
bool bShowMasterViewToolbar (meEditMode == EM_MASTERPAGE
|
2005-01-21 15:37:29 +00:00
|
|
|
&& GetShellType() != ViewShell::ST_HANDOUT);
|
|
|
|
|
|
|
|
// If the master view toolbar is not shown we hide it before
|
|
|
|
// switching the edit mode.
|
2008-09-30 06:36:06 +00:00
|
|
|
if (::sd::ViewShell::mpImpl->mbIsInitialized
|
2005-01-21 15:37:29 +00:00
|
|
|
&& IsMainViewShell()
|
|
|
|
&& ! bShowMasterViewToolbar)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2007-06-27 14:47:19 +00:00
|
|
|
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
|
2005-01-21 15:37:29 +00:00
|
|
|
}
|
2004-10-28 12:34:18 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
2005-01-21 15:37:29 +00:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
/******************************************************************
|
|
|
|
* PAGEMODE
|
|
|
|
******************************************************************/
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Clear();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SdPage* pPage;
|
|
|
|
String aPageName;
|
2006-12-13 16:57:19 +00:00
|
|
|
USHORT nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
for (USHORT i = 0; i < nPageCnt; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pPage = GetDoc()->GetSdPage(i, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
aPageName = pPage->GetName();
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.InsertPage(i + 1, aPageName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ( pPage->IsSelected() && nActualPageNum == 0 )
|
|
|
|
{
|
|
|
|
nActualPageNum = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nActualPageNum + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SwitchPage(nActualPageNum);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/******************************************************************
|
|
|
|
* MASTERPAGE
|
|
|
|
******************************************************************/
|
2004-01-20 11:44:01 +00:00
|
|
|
GetViewFrame()->SetChildWindow(
|
|
|
|
AnimationChildWindow::GetChildWindowId(), FALSE );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (!mpActualPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
// Sofern es keine mpActualPage gibt, wird die erste genommen
|
|
|
|
mpActualPage = GetDoc()->GetSdPage(0, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Clear();
|
2000-09-18 16:07:07 +00:00
|
|
|
USHORT nActualMasterPageNum = 0;
|
2006-12-13 16:57:19 +00:00
|
|
|
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
for (USHORT i = 0; i < nMasterPageCnt; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.InsertPage(i + 1, aLayoutName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (&(mpActualPage->TRG_GetMasterPage()) == pMaster)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nActualMasterPageNum = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nActualMasterPageNum + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
SwitchPage(nActualMasterPageNum);
|
2005-01-21 15:37:29 +00:00
|
|
|
}
|
2004-10-28 12:34:18 +00:00
|
|
|
|
2005-01-21 15:37:29 +00:00
|
|
|
// If the master view toolbar is to be shown we turn it on after the
|
|
|
|
// edit mode has been changed.
|
2008-09-30 06:36:06 +00:00
|
|
|
if (::sd::ViewShell::mpImpl->mbIsInitialized
|
2005-01-21 15:37:29 +00:00
|
|
|
&& IsMainViewShell()
|
|
|
|
&& bShowMasterViewToolbar)
|
|
|
|
{
|
2007-06-27 14:47:19 +00:00
|
|
|
GetViewShellBase().GetToolBarManager()->SetToolBar(
|
2006-03-21 16:42:53 +00:00
|
|
|
ToolBarManager::TBG_MASTER_MODE,
|
|
|
|
ToolBarManager::msMasterViewToolBar);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if ( ! mbIsLayerModeActive)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Show();
|
2003-05-22 09:31:25 +00:00
|
|
|
// Set the tab control only for draw pages. For master page
|
|
|
|
// this has been done already above.
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
|
|
|
maTabControl.SetCurPageId (nActualPageNum + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2005-02-24 14:09:01 +00:00
|
|
|
/*AF: The LayerDialogChildWindow is not used anymore (I hope).
|
2004-07-13 13:54:26 +00:00
|
|
|
if (GetViewFrame()->KnowsChildWindow(
|
|
|
|
LayerDialogChildWindow::GetChildWindowId()))
|
|
|
|
{
|
|
|
|
GetViewFrame()->SetChildWindow(
|
|
|
|
LayerDialogChildWindow::GetChildWindowId(),
|
|
|
|
IsLayerModeActive());
|
|
|
|
}
|
2005-02-24 14:09:01 +00:00
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
ResetActualLayer();
|
|
|
|
|
|
|
|
Invalidate( SID_PAGEMODE );
|
|
|
|
Invalidate( SID_LAYERMODE );
|
|
|
|
Invalidate( SID_MASTERPAGE );
|
2009-09-18 10:15:03 +00:00
|
|
|
Invalidate( SID_DELETE_MASTER_PAGE );
|
|
|
|
Invalidate( SID_DELETE_PAGE );
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate( SID_SLIDE_MASTERPAGE );
|
|
|
|
Invalidate( SID_TITLE_MASTERPAGE );
|
|
|
|
Invalidate( SID_NOTES_MASTERPAGE );
|
|
|
|
Invalidate( SID_HANDOUT_MASTERPAGE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool DrawViewShell::IsLayerModeActive (void) const
|
|
|
|
{
|
|
|
|
return mbIsLayerModeActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Groesse des TabControls und der ModeButtons zurueckgeben
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
long DrawViewShell::GetHCtrlWidth()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
// return maTabControl.GetSizePixel().Width();
|
2004-07-13 13:54:26 +00:00
|
|
|
return 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Horizontales Lineal erzeugen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
SvxRuler* DrawViewShell::CreateHRuler (::sd::Window* pWin, BOOL bIsFirst)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
Ruler* pRuler;
|
2000-09-18 16:07:07 +00:00
|
|
|
WinBits aWBits;
|
|
|
|
USHORT nFlags = SVXRULER_SUPPORT_OBJECT;
|
|
|
|
|
|
|
|
if ( bIsFirst )
|
|
|
|
{
|
|
|
|
aWBits = WB_HSCROLL | WB_3DLOOK | WB_BORDER | WB_EXTRAFIELD;
|
|
|
|
nFlags |= ( SVXRULER_SUPPORT_SET_NULLOFFSET |
|
|
|
|
SVXRULER_SUPPORT_TABS |
|
|
|
|
SVXRULER_SUPPORT_PARAGRAPH_MARGINS ); // Neu
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aWBits = WB_HSCROLL | WB_3DLOOK | WB_BORDER;
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
pRuler = new Ruler (*this, GetParentWindow(), pWin, nFlags,
|
2004-01-20 11:44:01 +00:00
|
|
|
GetViewFrame()->GetBindings(), aWBits);
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetSourceUnit(pWin->GetMapMode().GetMapUnit());
|
|
|
|
|
|
|
|
// Metric ...
|
2006-12-13 16:57:19 +00:00
|
|
|
UINT16 nMetric = (UINT16)GetDoc()->GetUIUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nMetric == 0xffff )
|
2010-02-02 23:59:20 +01:00
|
|
|
nMetric = (UINT16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetUnit( FieldUnit( nMetric ) );
|
|
|
|
|
|
|
|
// ... und auch DefTab am Lineal einstellen
|
2004-01-20 11:44:01 +00:00
|
|
|
pRuler->SetDefTabDist( GetDoc()->GetDefaultTabulator() ); // Neu
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Fraction aUIScale(pWin->GetMapMode().GetScaleX());
|
2004-01-20 11:44:01 +00:00
|
|
|
aUIScale *= GetDoc()->GetUIScale();
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetZoom(aUIScale);
|
|
|
|
|
|
|
|
return pRuler;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Vertikales Lineal erzeugen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
SvxRuler* DrawViewShell::CreateVRuler(::sd::Window* pWin)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
Ruler* pRuler;
|
2000-09-18 16:07:07 +00:00
|
|
|
WinBits aWBits = WB_VSCROLL | WB_3DLOOK | WB_BORDER;
|
|
|
|
USHORT nFlags = SVXRULER_SUPPORT_OBJECT;
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
pRuler = new Ruler(*this, GetParentWindow(), pWin, nFlags,
|
2004-01-20 11:44:01 +00:00
|
|
|
GetViewFrame()->GetBindings(), aWBits);
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetSourceUnit(pWin->GetMapMode().GetMapUnit());
|
|
|
|
|
2002-01-17 12:09:43 +00:00
|
|
|
// #96629# Metric same as HRuler, use document setting
|
2006-12-13 16:57:19 +00:00
|
|
|
UINT16 nMetric = (UINT16)GetDoc()->GetUIUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nMetric == 0xffff )
|
2010-02-02 23:59:20 +01:00
|
|
|
nMetric = (UINT16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetUnit( FieldUnit( nMetric ) );
|
|
|
|
|
|
|
|
Fraction aUIScale(pWin->GetMapMode().GetScaleY());
|
2004-01-20 11:44:01 +00:00
|
|
|
aUIScale *= GetDoc()->GetUIScale();
|
2000-09-18 16:07:07 +00:00
|
|
|
pRuler->SetZoom(aUIScale);
|
|
|
|
|
|
|
|
return pRuler;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Horizontales Lineal aktualisieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::UpdateHRuler()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Invalidate( SID_ATTR_LONG_LRSPACE );
|
|
|
|
Invalidate( SID_RULER_PAGE_POS );
|
2001-09-18 13:59:01 +00:00
|
|
|
Invalidate( SID_RULER_OBJECT );
|
2002-09-27 11:41:31 +00:00
|
|
|
Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if (mpHorizontalRuler.get() != NULL)
|
|
|
|
mpHorizontalRuler->ForceUpdate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Vertikales Lineal aktualisieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::UpdateVRuler()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Invalidate( SID_ATTR_LONG_LRSPACE );
|
|
|
|
Invalidate( SID_RULER_PAGE_POS );
|
2001-09-18 13:59:01 +00:00
|
|
|
Invalidate( SID_RULER_OBJECT );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if (mpVerticalRuler.get() != NULL)
|
|
|
|
mpVerticalRuler->ForceUpdate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Metrik setzen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::SetUIUnit(FieldUnit eUnit)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShell::SetUIUnit(eUnit);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* TabControl nach Splitteraenderung aktualisieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
const long int nMax = maViewSize.Width() - maScrBarWH.Width()
|
|
|
|
- maTabControl.GetPosPixel().X() ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
Size aTabSize = maTabControl.GetSizePixel();
|
2000-09-18 16:07:07 +00:00
|
|
|
aTabSize.Width() = Min(pTab->GetSplitSize(), (long)(nMax-1));
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetSizePixel(aTabSize);
|
2004-07-13 13:54:26 +00:00
|
|
|
GetLayerTabControl()->SetSizePixel(aTabSize);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
Point aPos = maTabControl.GetPosPixel();
|
2000-09-18 16:07:07 +00:00
|
|
|
aPos.X() += aTabSize.Width();
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
Size aScrSize(nMax - aTabSize.Width(), maScrBarWH.Height());
|
2004-07-13 13:54:26 +00:00
|
|
|
mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-02-17 08:46:36 +00:00
|
|
|
/// inherited from sd::ViewShell
|
|
|
|
SdPage* DrawViewShell::getCurrentPage() const
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
const sal_Int32 nPageCount = (meEditMode == EM_PAGE)?
|
|
|
|
GetDoc()->GetSdPageCount(mePageKind):
|
|
|
|
GetDoc()->GetMasterSdPageCount(mePageKind);
|
2005-02-17 08:46:36 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
sal_Int32 nCurrentPage = maTabControl.GetCurPageId() - 1;
|
2005-02-17 08:46:36 +00:00
|
|
|
DBG_ASSERT( (nPageCount>0) && (nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!" );
|
|
|
|
if( (nPageCount < 0) || (nCurrentPage>=nPageCount) )
|
|
|
|
nCurrentPage = 0; // play safe here
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
2005-02-17 08:46:36 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
return GetDoc()->GetSdPage((USHORT)nCurrentPage, mePageKind);
|
2005-02-17 08:46:36 +00:00
|
|
|
}
|
|
|
|
else // EM_MASTERPAGE
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
return GetDoc()->GetMasterSdPage((USHORT)nCurrentPage, mePageKind);
|
2005-02-17 08:46:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* neue aktuelle Seite auswaehlen, falls sich die Seitenfolge geaendert
|
|
|
|
|* hat (z. B. durch Undo)
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::ResetActualPage()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
USHORT nCurrentPage = maTabControl.GetCurPageId() - 1;
|
|
|
|
USHORT nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
if (nPageCount > 0)
|
|
|
|
nCurrentPage = Min((USHORT)(nPageCount - 1), nCurrentPage);
|
|
|
|
else
|
|
|
|
nCurrentPage = 0;
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
// Update fuer TabControl
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.Clear();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
String aPageName;
|
|
|
|
|
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pPage = GetDoc()->GetSdPage(i, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
aPageName = pPage->GetName();
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.InsertPage(i + 1, aPageName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Selektionskennungen der Seiten korrigieren
|
2004-01-20 11:44:01 +00:00
|
|
|
GetDoc()->SetSelected(pPage, i == nCurrentPage);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nCurrentPage + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else // EM_MASTERPAGE
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pActualPage = GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
|
|
|
|
maTabControl.Clear();
|
2000-09-18 16:07:07 +00:00
|
|
|
USHORT nActualMasterPageNum = 0;
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
for (USHORT i = 0; i < nMasterPageCnt; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.InsertPage(i + 1, aLayoutName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pActualPage == pMaster)
|
|
|
|
nActualMasterPageNum = i;
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nActualMasterPageNum + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
SwitchPage(nActualMasterPageNum);
|
|
|
|
}
|
|
|
|
|
|
|
|
GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE,
|
|
|
|
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Verb auf OLE-Objekt anwenden
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
ErrCode DrawViewShell::DoVerb(long nVerb)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
if ( mpDrawView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
|
|
|
SdrMark* pMark = rMarkList.GetMark(0);
|
2006-07-25 10:48:02 +00:00
|
|
|
SdrObject* pObj = pMark->GetMarkedSdrObj();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
UINT32 nInv = pObj->GetObjInventor();
|
|
|
|
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ActivateObject( (SdrOle2Obj*) pObj, nVerb);
|
|
|
|
}
|
|
|
|
#ifdef STARIMAGE_AVAILABLE
|
|
|
|
else if (nInv = SdrInventor && nSdrObjKind == OBJ_GRAF &&
|
|
|
|
((SdrGrafObj*) pObj)->GetGraphicType() == GRAPHIC_BITMAP &&
|
|
|
|
SFX_APP()->HasFeature(SFX_FEATURE_SIMAGE))
|
|
|
|
{
|
|
|
|
SdrGrafObj* pSdrGrafObj = (SdrGrafObj*) pObj;
|
|
|
|
short nOK = RET_YES;
|
|
|
|
|
|
|
|
if ( pSdrGrafObj->GetFileName().Len() )
|
|
|
|
{
|
|
|
|
// Graphik ist gelinkt, soll der Link aufgehoben werden?
|
|
|
|
QueryBox aBox(pWindow, WB_YES_NO | WB_DEF_YES,
|
|
|
|
String( SdResId(STR_REMOVE_LINK) ) );
|
|
|
|
nOK = aBox.Execute();
|
|
|
|
|
|
|
|
if (nOK == RET_YES)
|
|
|
|
{
|
|
|
|
// Link aufheben (File- und Filtername zuruecksetzen)
|
|
|
|
pSdrGrafObj->SetGraphicLink(String(), String());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nOK == RET_YES)
|
|
|
|
{
|
|
|
|
/**************************************************************
|
|
|
|
* OLE-Objekt erzeugen, StarImage starten
|
|
|
|
* Grafik-Objekt loeschen (durch OLE-Objekt ersetzt)
|
|
|
|
**************************************************************/
|
2006-12-13 16:57:19 +00:00
|
|
|
//HMHmpDrView->HideMarkHdl();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SvStorageRef aStor = new SvStorage(String());
|
|
|
|
SvInPlaceObjectRef aNewIPObj = &((SvFactory*)SvInPlaceObject::ClassFactory())
|
2001-02-11 16:12:15 +00:00
|
|
|
->CreateAndInit(SimModuleDummy::GetID(SOFFICE_FILEFORMAT_CURRENT), aStor);
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( aNewIPObj.Is() )
|
|
|
|
{
|
|
|
|
SdrGrafObj* pTempSdrGrafObj = (SdrGrafObj*) pSdrGrafObj->Clone ();
|
|
|
|
|
|
|
|
SvEmbeddedInfoObject * pInfo;
|
|
|
|
pInfo = GetViewFrame()->GetObjectShell()->
|
|
|
|
InsertObject( aNewIPObj, String() );
|
|
|
|
|
|
|
|
String aName;
|
|
|
|
if (pInfo)
|
|
|
|
{
|
|
|
|
aName = pInfo->GetObjName();
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle aRect = pObj->GetLogicRect();
|
|
|
|
SdrOle2Obj* pSdrOle2Obj = new SdrOle2Obj( aNewIPObj,
|
|
|
|
aName, aRect );
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPV = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
pPV->GetObjList()->InsertObject( pSdrOle2Obj );
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->ReplaceObjectAtView( pObj, *pPV, pTempSdrGrafObj );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
pSdrOle2Obj->SetLogicRect(aRect);
|
|
|
|
aNewIPObj->SetVisAreaSize(aRect.GetSize());
|
|
|
|
|
|
|
|
SimDLL::Update(aNewIPObj, pTempSdrGrafObj->GetGraphic(), pWindow);
|
|
|
|
ActivateObject(pSdrOle2Obj, SVVERB_SHOW);
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
Client* pClient = (Client*) GetIPClient();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pClient)
|
|
|
|
pClient->SetSdrGrafObj( pTempSdrGrafObj );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* OLE-Object aktivieren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
BOOL DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
BOOL bActivated = FALSE;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
if ( !GetDocSh()->IsUIActive() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-03-21 16:42:53 +00:00
|
|
|
ToolBarManager::UpdateLock aLock (GetViewShellBase().GetToolBarManager());
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
bActivated = ViewShell::ActivateObject(pObj, nVerb);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
OSL_ASSERT(GetViewShell()!=NULL);
|
|
|
|
Client* pClient = static_cast<Client*>(GetViewShell()->GetIPClient());
|
2000-09-18 16:07:07 +00:00
|
|
|
if (pClient)
|
|
|
|
pClient->SetSdrGrafObj(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return(bActivated);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Auf gewuenschte Seite schalten
|
|
|
|
|* Der Parameter nSelectedPage bezieht sich auf den aktuellen EditMode
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2008-07-01 12:38:26 +00:00
|
|
|
void LclResetFlag (bool& rbFlag) {rbFlag = false;}
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-07-01 12:38:26 +00:00
|
|
|
/** Under some circumstances there are nested calls to SwitchPage() and
|
|
|
|
may crash the application (activation of form controls when the
|
|
|
|
shell of the edit view is not on top of the shell stack, see issue
|
|
|
|
83888 for details.) Therefore the nested calls are ignored (they
|
|
|
|
would jump to the wrong page anyway.)
|
|
|
|
*/
|
|
|
|
if (mbIsInSwitchPage)
|
|
|
|
return FALSE;
|
|
|
|
mbIsInSwitchPage = true;
|
|
|
|
comphelper::ScopeGuard aGuard (::boost::bind(LclResetFlag, ::boost::ref(mbIsInSwitchPage)));
|
|
|
|
|
2006-01-19 11:57:01 +00:00
|
|
|
if (GetActiveWindow()->IsInPaint())
|
|
|
|
{
|
|
|
|
// Switching the current page while a Paint is being executed is
|
2007-04-03 15:29:15 +00:00
|
|
|
// dangerous. So, post it for later execution and return.
|
2006-01-19 11:57:01 +00:00
|
|
|
maAsynchronousSwitchPageCall.Post(::boost::bind(
|
|
|
|
::std::mem_fun(&DrawViewShell::SwitchPage),
|
|
|
|
this,
|
|
|
|
nSelectedPage));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
BOOL bOK = FALSE;
|
|
|
|
|
2004-08-04 08:01:06 +00:00
|
|
|
// With the current implementation of FuSlideShow there is a problem
|
|
|
|
// when it dsplays the show in a window: When the show is stopped it
|
|
|
|
// returns at one point in time SDRPAGE_NOTFOUND as current page index.
|
|
|
|
// Because FuSlideShow is currently being rewritten this bug is fixed
|
|
|
|
// here.
|
2007-04-03 15:29:15 +00:00
|
|
|
// This is not as bad a hack as it may look because making SwitchPage()
|
|
|
|
// more robust with respect to invalid page numbers is a good thing
|
|
|
|
// anyway.
|
2004-08-04 08:01:06 +00:00
|
|
|
if (nSelectedPage == SDRPAGE_NOTFOUND)
|
2006-12-13 16:57:19 +00:00
|
|
|
{
|
2004-08-04 08:01:06 +00:00
|
|
|
nSelectedPage = 0;
|
2006-12-13 16:57:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Make sure that the given page index points to an existing page. Move
|
|
|
|
// the index into the valid range if necessary.
|
|
|
|
USHORT nPageCount = (meEditMode == EM_PAGE)
|
|
|
|
? GetDoc()->GetSdPageCount(mePageKind)
|
|
|
|
: GetDoc()->GetMasterSdPageCount(mePageKind);
|
|
|
|
if (nSelectedPage >= nPageCount)
|
|
|
|
nSelectedPage = nPageCount-1;
|
|
|
|
}
|
2005-10-19 11:28:19 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if (IsSwitchPageAllowed())
|
|
|
|
{
|
2008-07-01 12:38:26 +00:00
|
|
|
ModifyGuard aGuard2( GetDoc() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-05-03 13:03:20 +00:00
|
|
|
bOK = TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mpActualPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-28 12:34:18 +00:00
|
|
|
SdPage* pNewPage = NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_MASTERPAGE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
if( GetDoc()->GetMasterSdPageCount(mePageKind) > nSelectedPage )
|
|
|
|
pNewPage = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
|
2005-10-11 07:19:10 +00:00
|
|
|
|
|
|
|
if( pNewPage )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPV = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-10-25 10:53:38 +00:00
|
|
|
String sPageText (pNewPage->GetLayoutName());
|
|
|
|
sPageText.Erase(sPageText.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
if (pPV
|
|
|
|
&& pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
|
2006-12-13 16:57:19 +00:00
|
|
|
&& sPageText == maTabControl.GetPageText(nSelectedPage+1))
|
2005-10-11 07:19:10 +00:00
|
|
|
{
|
|
|
|
// this slide is already visible
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-03 14:10:53 +00:00
|
|
|
OSL_ASSERT(mpFrameView!=NULL);
|
|
|
|
mpFrameView->SetSelectedPage(nSelectedPage);
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (GetDoc()->GetSdPageCount(mePageKind) > nSelectedPage)
|
|
|
|
pNewPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mpActualPage == pNewPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPV = mpDrawView->GetSdrPageView();
|
2005-10-11 07:19:10 +00:00
|
|
|
|
2008-07-01 12:38:26 +00:00
|
|
|
SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage());
|
|
|
|
if (pPV
|
|
|
|
&& pNewPage == pCurrentPage
|
|
|
|
&& pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1))
|
2005-10-11 07:19:10 +00:00
|
|
|
{
|
|
|
|
// this slide is already visible
|
|
|
|
return TRUE;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if( mpDrawView )
|
|
|
|
mpDrawView->SdrEndTextEdit();
|
2005-04-22 12:28:19 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
mpActualPage = NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpActualPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Passt die selektierte Seite zur MasterPage?
|
2006-12-13 16:57:19 +00:00
|
|
|
USHORT nPageCount = GetDoc()->GetSdPageCount(mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
|
2004-07-12 14:16:00 +00:00
|
|
|
if(pPage && pPage->IsSelected() && pMaster == &(pPage->TRG_GetMasterPage()))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpActualPage = pPage;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (!mpActualPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Die erste Seite nehmen, welche zur MasterPage passt
|
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
|
2004-07-12 14:16:00 +00:00
|
|
|
if(pPage && pMaster == &(pPage->TRG_GetMasterPage()))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpActualPage = pPage;
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
for (USHORT i = 0; i < GetDoc()->GetSdPageCount(mePageKind); i++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Alle Seiten deselektieren
|
2006-12-13 16:57:19 +00:00
|
|
|
GetDoc()->SetSelected( GetDoc()->GetSdPage(i, mePageKind), FALSE);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (!mpActualPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
// Sofern es keine mpActualPage gibt, wird die erste genommen
|
|
|
|
mpActualPage = GetDoc()->GetSdPage(0, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
// diese Seite auch selektieren (mpActualPage zeigt immer auf Zeichenseite,
|
2000-09-18 16:07:07 +00:00
|
|
|
// nie auf eine Masterpage)
|
2006-12-13 16:57:19 +00:00
|
|
|
GetDoc()->SetSelected(mpActualPage, TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-04-03 14:10:53 +00:00
|
|
|
rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetDoc() ) );
|
|
|
|
if( !xSlideshow.is() || !xSlideshow->isRunning() || ( xSlideshow->getAnimationMode() != ANIMATIONMODE_SHOW ) )
|
2002-01-09 11:55:49 +00:00
|
|
|
{
|
|
|
|
// VisArea zuziehen, um ggf. Objekte zu deaktivieren
|
|
|
|
// !!! only if we are not in presentation mode (#96279) !!!
|
2004-01-20 11:44:01 +00:00
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
|
|
|
GetViewShell()->DisconnectAllClients();
|
2002-01-09 11:55:49 +00:00
|
|
|
VisAreaChanged(Rectangle(Point(), Size(1, 1)));
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_PAGE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
/**********************************************************************
|
|
|
|
* PAGEMODE
|
|
|
|
**********************************************************************/
|
2006-12-13 16:57:19 +00:00
|
|
|
GetDoc()->SetSelected(mpActualPage, TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pPageView)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
|
|
|
|
mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
|
|
|
|
mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mePageKind == PK_NOTES)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-13 16:57:19 +00:00
|
|
|
else if (mePageKind == PK_HANDOUT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->HideSdrPage();
|
|
|
|
mpDrawView->ShowSdrPage(mpActualPage);
|
|
|
|
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(mpActualPage);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pNewPageView)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
|
|
|
|
pNewPageView->SetPrintableLayers( mpFrameView->GetPrintableLayers() );
|
|
|
|
pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mePageKind == PK_NOTES)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-13 16:57:19 +00:00
|
|
|
else if (mePageKind == PK_HANDOUT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nSelectedPage+1);
|
|
|
|
String aPageName = mpActualPage->GetName();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (maTabControl.GetPageText(nSelectedPage+1) != aPageName)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetPageText(nSelectedPage+1, aPageName);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/**********************************************************************
|
|
|
|
* MASTERPAGE
|
|
|
|
**********************************************************************/
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pPageView)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
|
|
|
|
mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
|
|
|
|
mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mePageKind == PK_NOTES)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-13 16:57:19 +00:00
|
|
|
else if (mePageKind == PK_HANDOUT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->HideSdrPage();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( !pMaster ) // Falls es diese Page nicht geben sollte
|
2006-12-13 16:57:19 +00:00
|
|
|
pMaster = GetDoc()->GetMasterSdPage(0, mePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
USHORT nNum = pMaster->GetPageNum();
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->ShowSdrPage(mpDrawView->GetModel()->GetMasterPage(nNum));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-03-21 16:42:53 +00:00
|
|
|
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(pMaster);
|
2002-01-30 10:40:42 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pNewPageView)
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
|
|
|
|
pNewPageView->SetPrintableLayers( mpFrameView->GetPrintableLayers() );
|
|
|
|
pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (mePageKind == PK_NOTES)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-13 16:57:19 +00:00
|
|
|
else if (mePageKind == PK_HANDOUT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetCurPageId(nSelectedPage+1);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (maTabControl.GetPageText(nSelectedPage+1) != aLayoutName)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
maTabControl.SetPageText(nSelectedPage+1, aLayoutName);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-03-30 14:54:23 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if( mePageKind == PK_HANDOUT )
|
2004-03-30 14:54:23 +00:00
|
|
|
{
|
|
|
|
// set pages for all available handout presentation objects
|
2006-01-10 13:34:02 +00:00
|
|
|
sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
|
|
|
|
SdrObject* pObj = 0;
|
2009-11-23 16:27:16 +01:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
while( (pObj = rShapeList.getNextShape(pObj)) != 0 )
|
2004-03-30 14:54:23 +00:00
|
|
|
{
|
2006-01-10 13:34:02 +00:00
|
|
|
if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT )
|
2004-03-30 14:54:23 +00:00
|
|
|
{
|
2009-11-23 16:27:16 +01:00
|
|
|
// #i105146# We want no content to be displayed for PK_HANDOUT,
|
|
|
|
// so just never set a page as content
|
|
|
|
static_cast<SdrPageObj*>(pObj)->SetReferencedPage(0);
|
2004-03-30 14:54:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
|
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
|
2000-09-18 16:07:07 +00:00
|
|
|
VisAreaChanged(aVisAreaWin);
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->VisAreaChanged(GetActiveWindow());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Damit der Navigator (und das Effekte-Window) das mitbekommt (/-men)
|
2000-09-21 15:12:50 +00:00
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, TRUE, FALSE);
|
2003-03-27 09:58:12 +00:00
|
|
|
rBindings.Invalidate(SID_STATUS_PAGE, TRUE, FALSE);
|
2009-09-18 10:15:03 +00:00
|
|
|
rBindings.Invalidate(SID_DELETE_MASTER_PAGE, TRUE, FALSE);
|
|
|
|
rBindings.Invalidate(SID_DELETE_PAGE, TRUE, FALSE);
|
2010-01-21 18:32:05 +01:00
|
|
|
rBindings.Invalidate(SID_ASSIGN_LAYOUT,TRUE,FALSE);
|
2010-07-07 14:32:15 +02:00
|
|
|
rBindings.Invalidate(SID_INSERTPAGE,TRUE,FALSE);
|
2006-12-13 16:57:19 +00:00
|
|
|
UpdatePreview( mpActualPage );
|
2009-09-16 13:55:36 +00:00
|
|
|
|
|
|
|
mpDrawView->AdjustMarkHdl();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (bOK);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Pruefen, ob ein Seitenwechsel erlaubt ist
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
BOOL DrawViewShell::IsSwitchPageAllowed() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
bool bOK = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-04-03 14:10:53 +00:00
|
|
|
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
|
2004-01-20 11:44:01 +00:00
|
|
|
if (pFormShell!=NULL && !pFormShell->PrepareClose (FALSE))
|
|
|
|
bOK = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
return bOK;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* neue aktuelle Seite auswaehlen, falls sich die Seitenfolge geaendert
|
|
|
|
|* hat (z. B. durch Undo)
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::ResetActualLayer()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
LayerTabBar* pLayerBar = GetLayerTabControl();
|
|
|
|
if (pLayerBar != NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
// remember old layer cound and current layer id
|
|
|
|
// this is needed when one layer is renamed to
|
|
|
|
// restore current layer
|
|
|
|
USHORT nOldLayerCnt = pLayerBar->GetPageCount();
|
|
|
|
USHORT nOldLayerId = pLayerBar->GetCurPageId();
|
|
|
|
|
|
|
|
/*************************************************************
|
|
|
|
* Update fuer LayerTab
|
|
|
|
*************************************************************/
|
|
|
|
pLayerBar->Clear();
|
|
|
|
|
|
|
|
String aName;
|
2006-12-13 16:57:19 +00:00
|
|
|
String aActiveLayer = mpDrawView->GetActiveLayer();
|
2004-07-13 13:54:26 +00:00
|
|
|
String aBackgroundLayer( SdResId(STR_LAYER_BCKGRND) );
|
|
|
|
String aBackgroundObjLayer( SdResId(STR_LAYER_BCKGRNDOBJ) );
|
|
|
|
String aLayoutLayer( SdResId(STR_LAYER_LAYOUT) );
|
|
|
|
String aControlsLayer( SdResId(STR_LAYER_CONTROLS) );
|
|
|
|
String aMeasureLinesLayer( SdResId(STR_LAYER_MEASURELINES) );
|
|
|
|
USHORT nActiveLayer = SDRLAYER_NOTFOUND;
|
|
|
|
SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
|
|
|
|
USHORT nLayerCnt = rLayerAdmin.GetLayerCount();
|
|
|
|
|
|
|
|
for ( USHORT nLayer = 0; nLayer < nLayerCnt; nLayer++ )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
aName = rLayerAdmin.GetLayer(nLayer)->GetName();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if ( aName == aActiveLayer )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
nActiveLayer = nLayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( aName != aBackgroundLayer )
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
if (meEditMode == EM_MASTERPAGE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
// Layer der Page nicht auf MasterPage anzeigen
|
|
|
|
if (aName != aLayoutLayer &&
|
|
|
|
aName != aControlsLayer &&
|
|
|
|
aName != aMeasureLinesLayer)
|
|
|
|
{
|
|
|
|
pLayerBar->InsertPage(nLayer+1, aName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
TabBarPageBits nBits = 0;
|
2006-12-13 16:57:19 +00:00
|
|
|
SdrPageView* pPV = mpDrawView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if (pPV && !pPV->IsLayerVisible(aName))
|
|
|
|
{
|
|
|
|
// Unsichtbare Layer werden anders dargestellt
|
|
|
|
nBits = TPB_SPECIAL;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
pLayerBar->SetPageBits(nLayer+1, nBits);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-07-13 13:54:26 +00:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
// Layer der MasterPage nicht auf Page anzeigen
|
|
|
|
if ( aName != aBackgroundObjLayer )
|
|
|
|
{
|
|
|
|
pLayerBar->InsertPage(nLayer+1, aName);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
TabBarPageBits nBits = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
if (!mpDrawView->GetSdrPageView()->IsLayerVisible(aName))
|
2004-07-13 13:54:26 +00:00
|
|
|
{
|
|
|
|
// Unsichtbare Layer werden anders dargestellt
|
|
|
|
nBits = TPB_SPECIAL;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
pLayerBar->SetPageBits(nLayer+1, nBits);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if ( nActiveLayer == SDRLAYER_NOTFOUND )
|
2003-03-27 09:58:12 +00:00
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
if( nOldLayerCnt == pLayerBar->GetPageCount() )
|
|
|
|
{
|
|
|
|
nActiveLayer = nOldLayerId - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-13 16:57:19 +00:00
|
|
|
nActiveLayer = ( meEditMode == EM_MASTERPAGE ) ? 2 : 0;
|
2004-07-13 13:54:26 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayer + 1) );
|
2003-03-27 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
pLayerBar->SetCurPageId(nActiveLayer + 1);
|
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER );
|
2009-09-18 10:15:03 +00:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Verzoegertes Close ausfuehren
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
IMPL_LINK( DrawViewShell, CloseHdl, Timer*, pTimer )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pTimer->Stop();
|
2003-06-12 07:02:36 +00:00
|
|
|
GetViewFrame()->GetBindings().Execute( SID_CLOSEWIN );
|
2000-09-18 16:07:07 +00:00
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
|
2001-03-08 10:28:38 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* AcceptDrop
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
sal_Int8 DrawViewShell::AcceptDrop (
|
|
|
|
const AcceptDropEvent& rEvt,
|
|
|
|
DropTargetHelper& rTargetHelper,
|
|
|
|
::sd::Window* pTargetWindow,
|
|
|
|
USHORT nPage,
|
|
|
|
USHORT nLayer )
|
2001-03-08 10:28:38 +00:00
|
|
|
{
|
|
|
|
if( nPage != SDRPAGE_NOTFOUND )
|
2006-12-13 16:57:19 +00:00
|
|
|
nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2008-04-03 14:10:53 +00:00
|
|
|
if( SlideShow::IsRunning( GetViewShellBase() ) )
|
2004-11-26 19:30:41 +00:00
|
|
|
return DND_ACTION_NONE;
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2006-12-13 16:57:19 +00:00
|
|
|
return mpDrawView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer );
|
2001-03-08 10:28:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* ExecuteDrop
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
sal_Int8 DrawViewShell::ExecuteDrop (
|
|
|
|
const ExecuteDropEvent& rEvt,
|
|
|
|
DropTargetHelper& rTargetHelper,
|
|
|
|
::sd::Window* pTargetWindow,
|
|
|
|
USHORT nPage,
|
|
|
|
USHORT nLayer)
|
2001-03-08 10:28:38 +00:00
|
|
|
{
|
|
|
|
if( nPage != SDRPAGE_NOTFOUND )
|
2006-12-13 16:57:19 +00:00
|
|
|
nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2008-04-03 14:10:53 +00:00
|
|
|
if( SlideShow::IsRunning( GetViewShellBase() ) )
|
2004-11-26 19:30:41 +00:00
|
|
|
return DND_ACTION_NONE;
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2005-04-18 10:17:16 +00:00
|
|
|
Broadcast(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
|
2006-12-13 16:57:19 +00:00
|
|
|
sal_Int8 nResult (mpDrawView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ));
|
2005-04-18 10:17:16 +00:00
|
|
|
Broadcast(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
|
|
|
|
|
|
|
|
return nResult;
|
2001-03-08 10:28:38 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
} // end of namespace sd
|
|
|
|
|
2007-09-06 12:56:11 +00:00
|
|
|
#ifdef _MSC_VER
|
2008-07-01 12:38:26 +00:00
|
|
|
#if (_MSC_VER < 1400)
|
2000-09-18 16:07:07 +00:00
|
|
|
#pragma optimize ( "", on )
|
|
|
|
#endif
|
2008-07-01 12:38:26 +00:00
|
|
|
#endif
|
2003-03-27 09:58:12 +00:00
|
|
|
|
2010-10-12 15:51:52 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|