2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: drviews1.cxx,v $
|
|
|
|
*
|
2005-01-27 13:32:26 +00:00
|
|
|
* $Revision: 1.50 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-01-27 13:32:26 +00:00
|
|
|
* last change: $Author: rt $ $Date: 2005-01-27 14:32:26 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
2004-10-04 17:43:02 +00:00
|
|
|
|
2004-10-28 12:34:18 +00:00
|
|
|
#include "DrawViewShell.hxx"
|
|
|
|
#include "ViewShellImplementation.hxx"
|
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
#ifndef _COM_SUN_STAR_EMBED_EMBEDSTATES_HPP_
|
|
|
|
#include <com/sun/star/embed/EmbedStates.hpp>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SVXIDS_HRC
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDPAGV_HXX //autogen
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXVIEWFRM_HXX //autogen
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFX_BINDINGS_HXX //autogen
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDOOLE2_HXX //autogen
|
|
|
|
#include <svx/svdoole2.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXDISPATCH_HXX //autogen
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SCRBAR_HXX //autogen
|
|
|
|
#include <vcl/scrbar.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDOGRAF_HXX //autogen
|
|
|
|
#include <svx/svdograf.hxx>
|
|
|
|
#endif
|
2004-03-30 14:54:23 +00:00
|
|
|
#ifndef _SVDOPAGE_HXX
|
|
|
|
#include <svx/svdopage.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SV_MSGBOX_HXX //autogen
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#endif
|
2004-10-04 17:43:02 +00:00
|
|
|
#include <sot/storage.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SVX_FMSHELL_HXX //autogen
|
|
|
|
#include <svx/fmshell.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _E3D_GLOBL3D_HXX
|
|
|
|
#include <svx/globl3d.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVX_FMGLOB_HXX
|
|
|
|
#include <svx/fmglob.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _OUTLINER_HXX //autogen
|
|
|
|
#include <svx/outliner.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
|
|
|
#include "misc.hxx"
|
|
|
|
|
|
|
|
#ifdef STARIMAGE_AVAILABLE
|
|
|
|
#ifndef _SIMDLL_HXX
|
|
|
|
#include <sim2/simdll.hxx>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2004-11-26 14:03:57 +00:00
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
|
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"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_FU_POOR_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fupoor.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdresid.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_FU_SELECTION_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fusel.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdpage.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_FRAME_VIEW_HXX
|
|
|
|
#include "FrameView.hxx"
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "stlpool.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_WINDOW_HXX
|
|
|
|
#include "Window.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_DRAWVIEW_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawview.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#include "Ruler.hxx"
|
|
|
|
#ifndef SD_CLIENT_HXX
|
|
|
|
#include "Client.hxx"
|
|
|
|
#endif
|
2004-11-26 19:30:41 +00:00
|
|
|
#ifndef _SD_SLIDESHOW_HXX
|
|
|
|
#include "slideshow.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "optsitem.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_FU_SEARCH_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fusearch.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_SPELL_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuspell.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_OUTLINER_HXX
|
|
|
|
#include "Outliner.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_ANIMATION_CHILD_WINDOW_HXX
|
|
|
|
#include "AnimationChildWindow.hxx"
|
|
|
|
#endif
|
2002-01-24 14:06:27 +00:00
|
|
|
#include "SdUnoDrawView.hxx"
|
2004-01-20 11:44:01 +00:00
|
|
|
#ifndef SD_OBJECT_BAR_MANAGER_HXX
|
|
|
|
#include "ObjectBarManager.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_VIEW_SHELL_BASE_HXX
|
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
#endif
|
2004-07-13 13:54:26 +00:00
|
|
|
#ifndef SD_LAYER_DIALOG_CHILD_WINDOW_HXX
|
|
|
|
#include "LayerDialogChildWindow.hxx"
|
|
|
|
#endif
|
|
|
|
#include "LayerTabBar.hxx"
|
2004-10-28 12:34:18 +00:00
|
|
|
#include "ViewShellManager.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize ( "", off )
|
|
|
|
#endif
|
|
|
|
|
2004-10-28 12:34:18 +00:00
|
|
|
namespace {
|
|
|
|
static const ::rtl::OUString MASTER_VIEW_TOOL_BAR_NAME(
|
|
|
|
::rtl::OUString::createFromAscii("masterviewtoolbar"));
|
|
|
|
}
|
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
using namespace com::sun::star;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
namespace sd {
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Activate(), beim ersten Aufruf wird eine Shell fuer den Object Bar erzeugt
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::Activate(BOOL bIsMDIActivate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShell::Activate(bIsMDIActivate);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
// When no object bars are active then activate some.
|
2004-11-26 14:28:31 +00:00
|
|
|
ObjectBarManager& rObjectBarManager (GetObjectBarManager());
|
|
|
|
if (rObjectBarManager.GetTopObjectBarId() == snInvalidShellId)
|
|
|
|
rObjectBarManager.SwitchObjectBar (
|
|
|
|
rObjectBarManager.GetDefaultObjectBarId());
|
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
|
|
|
|
aTabControl.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
|
|
|
|
aTabControl.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
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShell::Deactivate(bIsMDIActivate);
|
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
|
|
|
{
|
2004-11-26 14:03:57 +00:00
|
|
|
ObjectBarManager & rObjectBarManager = GetObjectBarManager();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// Um die Performance zu steigern wird jetzt die komplette
|
|
|
|
// Shell invalidiert statt alle Slots einzeln
|
|
|
|
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;
|
|
|
|
SdrGrafObj* pGrafObj = NULL;
|
|
|
|
|
2004-07-12 14:16:00 +00:00
|
|
|
if ( pDrView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-12 14:16:00 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
|
|
|
SdrMark* pMark = rMarkList.GetMark(0);
|
|
|
|
SdrObject* pObj = pMark->GetObj();
|
|
|
|
|
|
|
|
UINT32 nInv = pObj->GetObjInventor();
|
|
|
|
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
|
|
|
|
|
|
|
|
if (nInv = SdrInventor && nSdrObjKind == OBJ_OLE2)
|
|
|
|
{
|
|
|
|
pOleObj = (SdrOle2Obj*) pObj;
|
|
|
|
UpdateIMapDlg( pObj );
|
|
|
|
}
|
|
|
|
else if (nSdrObjKind == OBJ_GRAF)
|
|
|
|
{
|
|
|
|
pGrafObj = (SdrGrafObj*) pObj;
|
|
|
|
UpdateIMapDlg( pObj );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
ViewShellBase& rBase = GetViewShellBase();
|
|
|
|
Client* pIPClient = static_cast<Client*>(rBase.GetIPClient());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-10-04 17:43:02 +00:00
|
|
|
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
/**********************************************************************
|
|
|
|
* Ggf. OLE-Objekt beruecksichtigen und deaktivieren
|
|
|
|
**********************************************************************/
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
// this means we recently deselected an inplace active ole object so
|
|
|
|
// we need to deselect it now
|
2000-09-18 16:07:07 +00:00
|
|
|
if (!pOleObj)
|
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
pIPClient->GetObject()->changeState( embed::EmbedStates::RUNNING );
|
2000-09-18 16:07:07 +00:00
|
|
|
SFX_APP()->SetViewFrame( GetViewFrame() );
|
2004-01-20 11:44:01 +00:00
|
|
|
rBase.SetVerbs(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
pDrView->ShowMarkHdl(NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef();
|
|
|
|
if ( xObj.is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
rBase.SetVerbs( xObj->getSupportedVerbs() );
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( pOleObj )
|
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef();
|
|
|
|
if ( xObj.is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
rBase.SetVerbs( xObj->getSupportedVerbs() );
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-04 17:43:02 +00:00
|
|
|
rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pFuActual )
|
|
|
|
{
|
|
|
|
pFuActual->SelectionHasChanged();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-11-26 14:28:31 +00:00
|
|
|
GetObjectBarManager().SelectionHasChanged (pDrView);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
// #96124# Invalidate for every subshell
|
2004-11-26 14:03:57 +00:00
|
|
|
rObjectBarManager.InvalidateAllObjectBars();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( SFX_APP()->GetHelpPI() )
|
|
|
|
SetHelpIdBySelection();
|
2001-08-21 14:28:23 +00:00
|
|
|
|
|
|
|
pDrView->UpdateSelectionClipboard( FALSE );
|
2002-01-24 14:06:27 +00:00
|
|
|
|
2004-06-03 10:58:25 +00:00
|
|
|
if (GetController() != NULL)
|
|
|
|
GetController()->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.
|
|
|
|
bZoomOnPage = 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 );
|
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 );
|
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;
|
|
|
|
|
2004-11-26 19:30:41 +00:00
|
|
|
/*
|
2000-09-18 16:07:07 +00:00
|
|
|
if( pFuSlideShow )
|
|
|
|
{
|
|
|
|
pFuSlideShow->Terminate();
|
|
|
|
bRet = FALSE;
|
|
|
|
}
|
2004-11-26 19:30:41 +00:00
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( bRet && pFuActual )
|
|
|
|
{
|
|
|
|
USHORT nID = pFuActual->GetSlotID();
|
|
|
|
if (nID == SID_TEXTEDIT || nID == SID_ATTR_CHAR)
|
|
|
|
{
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( !bRet )
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
aCloseTimer.SetTimeoutHdl( LINK( this, DrawViewShell, CloseHdl ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
aCloseTimer.SetTimeout( 20 );
|
|
|
|
aCloseTimer.Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
if (eEditMode != eEMode
|
|
|
|
|| mbIsLayerModeActive != bIsLayerModeActive)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-28 12:34:18 +00:00
|
|
|
ViewShellManager::UpdateLocker aLock (
|
|
|
|
GetViewShellBase().GetViewShellManager());
|
|
|
|
|
2003-04-24 13:41:23 +00:00
|
|
|
USHORT nActualPageNum = 0;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
SdUnoDrawView* pController =
|
2004-06-03 10:58:25 +00:00
|
|
|
static_cast<SdUnoDrawView*>(GetController());
|
2004-01-20 11:44:01 +00:00
|
|
|
if (pController != NULL)
|
2002-01-24 14:06:27 +00:00
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
pController->FireChangeEditMode (eEMode == EM_MASTERPAGE);
|
2004-07-13 13:54:26 +00:00
|
|
|
pController->FireChangeLayerMode (bIsLayerModeActive);
|
2002-01-24 14:06:27 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pDrView->IsTextEdit() )
|
|
|
|
{
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
}
|
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
LayerTabBar* pLayerBar = GetLayerTabControl();
|
|
|
|
if (pLayerBar != NULL)
|
|
|
|
pLayerBar->EndEditMode();
|
2000-09-18 16:07:07 +00:00
|
|
|
aTabControl.EndEditMode();
|
|
|
|
|
|
|
|
if (ePageKind == PK_HANDOUT)
|
|
|
|
{
|
|
|
|
// Bei Handzetteln nur MasterPage zulassen
|
|
|
|
eEMode = EM_MASTERPAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
eEditMode = 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.
|
|
|
|
bool bShowMasterViewToolbar (eEditMode == EM_MASTERPAGE
|
|
|
|
&& GetShellType() != ViewShell::ST_HANDOUT);
|
|
|
|
|
|
|
|
// If the master view toolbar is not shown we hide it before
|
|
|
|
// switching the edit mode.
|
|
|
|
if (mpImpl->mbIsInitialized
|
|
|
|
&& IsMainViewShell()
|
|
|
|
&& ! bShowMasterViewToolbar)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-01-21 15:37:29 +00:00
|
|
|
GetObjectBarManager().HideToolBar (MASTER_VIEW_TOOL_BAR_NAME);
|
|
|
|
}
|
2004-10-28 12:34:18 +00:00
|
|
|
|
2005-01-21 15:37:29 +00:00
|
|
|
if (eEditMode == EM_PAGE)
|
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
/******************************************************************
|
|
|
|
* PAGEMODE
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
aTabControl.Clear();
|
|
|
|
|
|
|
|
SdPage* pPage;
|
|
|
|
String aPageName;
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT nPageCnt = GetDoc()->GetSdPageCount(ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
for (USHORT i = 0; i < nPageCnt; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
pPage = GetDoc()->GetSdPage(i, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
aPageName = pPage->GetName();
|
|
|
|
aTabControl.InsertPage(i + 1, aPageName);
|
|
|
|
|
|
|
|
if ( pPage->IsSelected() && nActualPageNum == 0 )
|
|
|
|
{
|
|
|
|
nActualPageNum = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-22 09:31:25 +00:00
|
|
|
aTabControl.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
|
|
|
|
|
|
|
if (!pActualPage)
|
|
|
|
{
|
|
|
|
// Sofern es keine pActualPage gibt, wird die erste genommen
|
2004-01-20 11:44:01 +00:00
|
|
|
pActualPage = GetDoc()->GetSdPage(0, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aTabControl.Clear();
|
|
|
|
USHORT nActualMasterPageNum = 0;
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
for (USHORT i = 0; i < nMasterPageCnt; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
|
|
|
|
aTabControl.InsertPage(i + 1, aLayoutName);
|
|
|
|
|
2004-07-12 14:16:00 +00:00
|
|
|
if (&(pActualPage->TRG_GetMasterPage()) == pMaster)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nActualMasterPageNum = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
aTabControl.SetCurPageId(nActualMasterPageNum + 1);
|
|
|
|
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.
|
|
|
|
if (mpImpl->mbIsInitialized
|
|
|
|
&& IsMainViewShell()
|
|
|
|
&& bShowMasterViewToolbar)
|
|
|
|
{
|
|
|
|
GetObjectBarManager().ShowToolBar (MASTER_VIEW_TOOL_BAR_NAME);
|
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
|
|
|
{
|
|
|
|
aTabControl.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.
|
|
|
|
if (eEditMode == EM_PAGE)
|
|
|
|
aTabControl.SetCurPageId (nActualPageNum + 1);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-07-13 13:54:26 +00:00
|
|
|
if (GetViewFrame()->KnowsChildWindow(
|
|
|
|
LayerDialogChildWindow::GetChildWindowId()))
|
|
|
|
{
|
|
|
|
GetViewFrame()->SetChildWindow(
|
|
|
|
LayerDialogChildWindow::GetChildWindowId(),
|
|
|
|
IsLayerModeActive());
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
ResetActualLayer();
|
|
|
|
|
|
|
|
Invalidate( SID_PAGEMODE );
|
|
|
|
Invalidate( SID_LAYERMODE );
|
|
|
|
Invalidate( SID_MASTERPAGE );
|
|
|
|
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
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
// return aTabControl.GetSizePixel().Width();
|
|
|
|
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 ...
|
2004-01-20 11:44:01 +00:00
|
|
|
UINT16 nMetric = GetDoc()->GetUIUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nMetric == 0xffff )
|
2000-10-12 07:50:16 +00:00
|
|
|
nMetric = GetModuleFieldUnit();
|
|
|
|
|
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
|
2004-01-20 11:44:01 +00:00
|
|
|
UINT16 nMetric = GetDoc()->GetUIUnit();
|
2000-10-12 07:50:16 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nMetric == 0xffff )
|
2000-10-12 07:50:16 +00:00
|
|
|
nMetric = GetModuleFieldUnit();
|
|
|
|
|
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
|
|
|
{
|
2004-07-13 13:54:26 +00:00
|
|
|
const long int nMax = aViewSize.Width() - aScrBarWH.Width()
|
|
|
|
- aTabControl.GetPosPixel().X() ;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Size aTabSize = aTabControl.GetSizePixel();
|
|
|
|
aTabSize.Width() = Min(pTab->GetSplitSize(), (long)(nMax-1));
|
|
|
|
|
|
|
|
aTabControl.SetSizePixel(aTabSize);
|
2004-07-13 13:54:26 +00:00
|
|
|
GetLayerTabControl()->SetSizePixel(aTabSize);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Point aPos = aTabControl.GetPosPixel();
|
|
|
|
aPos.X() += aTabSize.Width();
|
|
|
|
|
|
|
|
Size aScrSize(nMax - aTabSize.Width(), aScrBarWH.Height());
|
2004-07-13 13:54:26 +00:00
|
|
|
mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* 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
|
|
|
{
|
|
|
|
USHORT nCurrentPage = aTabControl.GetCurPageId() - 1;
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT nPageCount = (eEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(ePageKind):GetDoc()->GetMasterSdPageCount(ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
if (nPageCount > 0)
|
|
|
|
nCurrentPage = Min((USHORT)(nPageCount - 1), nCurrentPage);
|
|
|
|
else
|
|
|
|
nCurrentPage = 0;
|
|
|
|
|
|
|
|
if (eEditMode == EM_PAGE)
|
|
|
|
{
|
|
|
|
|
|
|
|
// Update fuer TabControl
|
|
|
|
aTabControl.Clear();
|
|
|
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
String aPageName;
|
|
|
|
|
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
pPage = GetDoc()->GetSdPage(i, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
aPageName = pPage->GetName();
|
|
|
|
aTabControl.InsertPage(i + 1, aPageName);
|
|
|
|
|
|
|
|
// 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
|
|
|
}
|
|
|
|
|
|
|
|
aTabControl.SetCurPageId(nCurrentPage + 1);
|
|
|
|
}
|
|
|
|
else // EM_MASTERPAGE
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pActualPage = GetDoc()->GetMasterSdPage(nCurrentPage, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
aTabControl.Clear();
|
|
|
|
USHORT nActualMasterPageNum = 0;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
for (USHORT i = 0; i < nMasterPageCnt; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
aTabControl.InsertPage(i + 1, aLayoutName);
|
|
|
|
|
|
|
|
if (pActualPage == pMaster)
|
|
|
|
nActualMasterPageNum = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
aTabControl.SetCurPageId(nActualMasterPageNum + 1);
|
|
|
|
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
|
|
|
{
|
2004-07-12 14:16:00 +00:00
|
|
|
if ( pDrView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-12 14:16:00 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
|
|
|
SdrMark* pMark = rMarkList.GetMark(0);
|
|
|
|
SdrObject* pObj = pMark->GetObj();
|
|
|
|
|
|
|
|
UINT32 nInv = pObj->GetObjInventor();
|
|
|
|
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
|
|
|
|
|
|
|
|
if (nInv = SdrInventor && nSdrObjKind == OBJ_OLE2)
|
|
|
|
{
|
|
|
|
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)
|
|
|
|
**************************************************************/
|
|
|
|
pDrView->HideMarkHdl(NULL);
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
|
|
|
SdrPageView* pPV = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
pPV->GetObjList()->InsertObject( pSdrOle2Obj );
|
|
|
|
pDrView->ReplaceObject( pObj, *pPV, pTempSdrGrafObj );
|
|
|
|
|
|
|
|
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
|
|
|
{
|
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
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage)
|
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.
|
|
|
|
// This is not as bad a hack as it may lock since making SwitchPage()
|
|
|
|
// more robust with respect to invalid page numbers this if statement is
|
|
|
|
// a good thing anyway.
|
|
|
|
if (nSelectedPage == SDRPAGE_NOTFOUND)
|
|
|
|
nSelectedPage = 0;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if (IsSwitchPageAllowed())
|
|
|
|
{
|
|
|
|
bOK = TRUE;
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
BOOL bIsChanged = GetDoc()->IsChanged();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pActualPage)
|
|
|
|
{
|
2004-10-28 12:34:18 +00:00
|
|
|
// When in master page mode then the given index defines a
|
|
|
|
// master page and may be larger then the number of slides.
|
|
|
|
// Probably we should jump over this whole block.
|
|
|
|
SdPage* pNewPage = NULL;
|
|
|
|
if (GetDoc()->GetSdPageCount(ePageKind) > nSelectedPage)
|
|
|
|
pNewPage = GetDoc()->GetSdPage(nSelectedPage, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pActualPage == pNewPage)
|
|
|
|
{
|
|
|
|
if (eEditMode == EM_MASTERPAGE)
|
|
|
|
{
|
2004-07-12 14:16:00 +00:00
|
|
|
pNewPage = (SdPage*)(&(pNewPage->TRG_GetMasterPage()));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SdrPageView* pPV = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if (pPV && pNewPage == (SdPage*) pPV->GetPage() &&
|
|
|
|
pNewPage->GetName() == aTabControl.GetPageText(nSelectedPage+1))
|
|
|
|
{
|
|
|
|
// Die Seite wird schon angezeigt
|
|
|
|
return(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pActualPage = NULL;
|
|
|
|
|
|
|
|
if (eEditMode == EM_PAGE)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
pActualPage = GetDoc()->GetSdPage(nSelectedPage, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Passt die selektierte Seite zur MasterPage?
|
2004-01-20 11:44:01 +00:00
|
|
|
USHORT nPageCount = GetDoc()->GetSdPageCount(ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pPage = GetDoc()->GetSdPage(i, ePageKind);
|
2004-07-12 14:16:00 +00:00
|
|
|
if(pPage && pPage->IsSelected() && pMaster == &(pPage->TRG_GetMasterPage()))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pActualPage = pPage;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pActualPage)
|
|
|
|
{
|
|
|
|
// Die erste Seite nehmen, welche zur MasterPage passt
|
|
|
|
for (USHORT i = 0; i < nPageCount; i++)
|
|
|
|
{
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pPage = GetDoc()->GetSdPage(i, ePageKind);
|
2004-07-12 14:16:00 +00:00
|
|
|
if(pPage && pMaster == &(pPage->TRG_GetMasterPage()))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pActualPage = pPage;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
for (USHORT i = 0; i < GetDoc()->GetSdPageCount(ePageKind); i++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Alle Seiten deselektieren
|
2004-01-20 11:44:01 +00:00
|
|
|
GetDoc()->SetSelected( GetDoc()->GetSdPage(i, ePageKind), FALSE);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!pActualPage)
|
|
|
|
{
|
|
|
|
// Sofern es keine pActualPage gibt, wird die erste genommen
|
2004-01-20 11:44:01 +00:00
|
|
|
pActualPage = GetDoc()->GetSdPage(0, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// diese Seite auch selektieren (pActualPage zeigt immer auf Zeichenseite,
|
|
|
|
// nie auf eine Masterpage)
|
2004-01-20 11:44:01 +00:00
|
|
|
GetDoc()->SetSelected(pActualPage, TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-11-26 19:30:41 +00:00
|
|
|
if( !mpSlideShow || ( mpSlideShow->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
|
|
|
|
2002-02-05 12:33:17 +00:00
|
|
|
if( pActualPage )
|
|
|
|
pActualPage->SetAutoLayout( pActualPage->GetAutoLayout() );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if (eEditMode == EM_PAGE)
|
|
|
|
{
|
|
|
|
/**********************************************************************
|
|
|
|
* PAGEMODE
|
|
|
|
**********************************************************************/
|
2004-01-20 11:44:01 +00:00
|
|
|
GetDoc()->SetSelected(pActualPage, TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SdrPageView* pPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if (pPageView)
|
|
|
|
{
|
|
|
|
pFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
|
|
|
|
pFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
|
|
|
|
pFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
|
|
|
|
|
|
|
|
if (ePageKind == PK_NOTES)
|
|
|
|
{
|
|
|
|
pFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
else if (ePageKind == PK_HANDOUT)
|
|
|
|
{
|
|
|
|
pFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->HideAllPages();
|
|
|
|
pDrView->ShowPage(pActualPage, Point(0, 0));
|
2004-01-20 11:44:01 +00:00
|
|
|
SdUnoDrawView* pController =
|
2004-06-03 10:58:25 +00:00
|
|
|
static_cast<SdUnoDrawView*>(GetController());
|
2004-01-20 11:44:01 +00:00
|
|
|
if (pController != NULL)
|
|
|
|
pController->FireSwitchCurrentPage (pActualPage);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
SdrPageView* pNewPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if (pNewPageView)
|
|
|
|
{
|
|
|
|
pNewPageView->SetVisibleLayers( pFrameView->GetVisibleLayers() );
|
|
|
|
pNewPageView->SetPrintableLayers( pFrameView->GetPrintableLayers() );
|
|
|
|
pNewPageView->SetLockedLayers( pFrameView->GetLockedLayers() );
|
|
|
|
|
|
|
|
if (ePageKind == PK_NOTES)
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetNotesHelpLines() );
|
|
|
|
}
|
|
|
|
else if (ePageKind == PK_HANDOUT)
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetHandoutHelpLines() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetStandardHelpLines() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
aTabControl.SetCurPageId(nSelectedPage+1);
|
|
|
|
String aPageName = pActualPage->GetName();
|
|
|
|
|
|
|
|
if (aTabControl.GetPageText(nSelectedPage+1) != aPageName)
|
|
|
|
{
|
|
|
|
aTabControl.SetPageText(nSelectedPage+1, aPageName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/**********************************************************************
|
|
|
|
* MASTERPAGE
|
|
|
|
**********************************************************************/
|
|
|
|
SdrPageView* pPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if (pPageView)
|
|
|
|
{
|
|
|
|
pFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
|
|
|
|
pFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
|
|
|
|
pFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
|
|
|
|
|
|
|
|
if (ePageKind == PK_NOTES)
|
|
|
|
{
|
|
|
|
pFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
else if (ePageKind == PK_HANDOUT)
|
|
|
|
{
|
|
|
|
pFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->HideAllPages();
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( !pMaster ) // Falls es diese Page nicht geben sollte
|
2004-01-20 11:44:01 +00:00
|
|
|
pMaster = GetDoc()->GetMasterSdPage(0, ePageKind);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
USHORT nNum = pMaster->GetPageNum();
|
|
|
|
pDrView->ShowMasterPagePgNum(nNum, Point(0, 0));
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
SdUnoDrawView* pController =
|
2004-06-03 10:58:25 +00:00
|
|
|
static_cast<SdUnoDrawView*>(GetController());
|
2004-01-20 11:44:01 +00:00
|
|
|
if (pController != NULL)
|
|
|
|
pController->FireSwitchCurrentPage (pMaster);
|
2002-01-30 10:40:42 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SdrPageView* pNewPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if (pNewPageView)
|
|
|
|
{
|
|
|
|
pNewPageView->SetVisibleLayers( pFrameView->GetVisibleLayers() );
|
|
|
|
pNewPageView->SetPrintableLayers( pFrameView->GetPrintableLayers() );
|
|
|
|
pNewPageView->SetLockedLayers( pFrameView->GetLockedLayers() );
|
|
|
|
|
|
|
|
if (ePageKind == PK_NOTES)
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetNotesHelpLines() );
|
|
|
|
}
|
|
|
|
else if (ePageKind == PK_HANDOUT)
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetHandoutHelpLines() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pNewPageView->SetHelpLines( pFrameView->GetStandardHelpLines() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String aLayoutName(pMaster->GetLayoutName());
|
|
|
|
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
|
|
|
|
|
|
|
|
aTabControl.SetCurPageId(nSelectedPage+1);
|
|
|
|
|
|
|
|
if (aTabControl.GetPageText(nSelectedPage+1) != aLayoutName)
|
|
|
|
{
|
|
|
|
aTabControl.SetPageText(nSelectedPage+1, aLayoutName);
|
|
|
|
}
|
2004-03-30 14:54:23 +00:00
|
|
|
|
|
|
|
if( ePageKind == PK_HANDOUT )
|
|
|
|
{
|
|
|
|
// set pages for all available handout presentation objects
|
|
|
|
sd::PresentationObjectList::iterator aIter( pMaster->GetPresObjList().begin() );
|
|
|
|
const sd::PresentationObjectList::iterator aEnd( pMaster->GetPresObjList().end() );
|
|
|
|
|
|
|
|
sal_uInt16 nPgNum = 0;
|
|
|
|
while( aIter != aEnd )
|
|
|
|
{
|
|
|
|
if( (*aIter).meKind == PRESOBJ_HANDOUT )
|
|
|
|
{
|
2004-07-12 14:16:00 +00:00
|
|
|
const sal_uInt16 nDestinationPageNum(2 * nPgNum + 1);
|
|
|
|
|
|
|
|
if(nDestinationPageNum < GetDoc()->GetPageCount())
|
|
|
|
{
|
|
|
|
static_cast<SdrPageObj*>((*aIter).mpObject)->SetReferencedPage(GetDoc()->GetPage(nDestinationPageNum));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static_cast<SdrPageObj*>((*aIter).mpObject)->SetReferencedPage(0L);
|
|
|
|
}
|
|
|
|
|
2004-03-30 14:54:23 +00:00
|
|
|
nPgNum++;
|
|
|
|
}
|
|
|
|
|
|
|
|
aIter++;
|
|
|
|
}
|
|
|
|
}
|
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);
|
2004-07-13 13:54:26 +00:00
|
|
|
pDrView->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);
|
2001-09-13 10:22:42 +00:00
|
|
|
UpdatePreview( pActualPage );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-11-26 19:30:41 +00:00
|
|
|
|
|
|
|
// if (pDrView->GetSlideShow())
|
|
|
|
// pDrView->SetAnimationMode(TRUE);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
GetDoc()->SetChanged(bIsChanged);
|
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
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
FmFormShell* pFormShell = static_cast<FmFormShell*>(
|
|
|
|
GetObjectBarManager().GetObjectBar(RID_FORMLAYER_TOOLBOX));
|
2004-01-20 11:44:01 +00:00
|
|
|
if (pFormShell!=NULL && !pFormShell->PrepareClose (FALSE))
|
|
|
|
bOK = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
return bOK && !bInEffectAssignment;
|
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;
|
|
|
|
String aActiveLayer = pDrView->GetActiveLayer();
|
|
|
|
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 nNewLayer = 0;
|
|
|
|
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 )
|
|
|
|
{
|
|
|
|
if (eEditMode == 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;
|
|
|
|
SdrPageView* pPV = pDrView->GetPageViewPvNum(0);
|
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
|
|
|
|
2004-07-13 13:54:26 +00:00
|
|
|
if (!pDrView->GetPageViewPvNum(0)->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
|
|
|
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
|
|
|
|
{
|
|
|
|
nActiveLayer = ( eEditMode == EM_MASTERPAGE ) ? 2 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->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 );
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Setzt die HelpId in Abhaengigkeit von der Selektion
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:44:01 +00:00
|
|
|
void DrawViewShell::SetHelpIdBySelection()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
UINT32 nHelpId = 0;
|
2004-07-12 14:16:00 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( rMarkList.GetMarkCount() > 0 )
|
|
|
|
{
|
|
|
|
SdrObject* pObj = rMarkList.GetMark(0)->GetObj();
|
|
|
|
UINT32 nInventor = pObj->GetObjInventor();
|
|
|
|
UINT16 nObjId = pObj->GetObjIdentifier();
|
|
|
|
|
|
|
|
if( nInventor == SdrInventor)
|
|
|
|
{
|
|
|
|
switch ( nObjId )
|
|
|
|
{
|
|
|
|
case OBJ_LINE:
|
|
|
|
// Alle Linien
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_RECT:
|
|
|
|
// Gefuellt: Rechteck, Quadrat, Rechteck abgerundet, Quadrat abgerundet
|
|
|
|
// Ungefuellt: Rechteck, Quadrat, Rechteck abgerundet, Quadrat abgerundet
|
|
|
|
nHelpId = SID_DRAWTBX_RECTANGLES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_CIRC:
|
|
|
|
// Gefuellt: Ellipse, Kreis
|
|
|
|
// Ungefuellt: Ellipse, Kreis
|
|
|
|
nHelpId = SID_DRAWTBX_ELLIPSES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_SECT:
|
|
|
|
// Gefuellt: Ellipsensektor, Kreissektor
|
|
|
|
// Ungefuellt: Ellipsensektor, Kreissektor
|
|
|
|
nHelpId = SID_DRAWTBX_ELLIPSES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_CARC:
|
|
|
|
// Ellipsenbogen, Kreisbogen
|
|
|
|
nHelpId = SID_DRAWTBX_ELLIPSES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_CCUT:
|
|
|
|
// Gefuellt: Ellipsensegment, Kreissegment
|
|
|
|
// Ungefuellt: Ellipsensegment, Kreissegment
|
|
|
|
nHelpId = SID_DRAWTBX_ELLIPSES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_POLY:
|
|
|
|
// Gefuellt: Polygon, Polygon 45
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_PLIN:
|
|
|
|
// Ungefuellt: Polygon, Polygon 45
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_PATHLINE:
|
|
|
|
// Ungefuellt: Kurve, Freihandlinie
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_PATHFILL:
|
|
|
|
// Gefuellt: Kurve, Freihandlinie
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_TEXT:
|
|
|
|
// Text, Text an Rahmen
|
|
|
|
nHelpId = SID_DRAWTBX_TEXT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_TITLETEXT:
|
|
|
|
nHelpId = SID_DRAWTBX_TEXT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_OUTLINETEXT:
|
|
|
|
nHelpId = SID_DRAWTBX_TEXT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_GRAF:
|
|
|
|
// Graphik
|
|
|
|
nHelpId = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_OLE2:
|
|
|
|
// OLE
|
|
|
|
nHelpId = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_EDGE:
|
|
|
|
// Alle Verbinder
|
|
|
|
nHelpId = SID_DRAWTBX_CONNECTORS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_CAPTION:
|
|
|
|
// Legende
|
|
|
|
nHelpId = SID_DRAWTBX_TEXT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_PAGE:
|
|
|
|
// Seitendarstellungsobjekt
|
|
|
|
nHelpId = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_MEASURE:
|
|
|
|
// Masslinie
|
|
|
|
nHelpId = SID_DRAWTBX_LINES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OBJ_UNO:
|
|
|
|
// UNO
|
|
|
|
nHelpId = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( nInventor == E3dInventor)
|
|
|
|
{
|
|
|
|
// Alle 3D-Objekte
|
|
|
|
nHelpId = SID_DRAWTBX_3D_OBJECTS;
|
|
|
|
}
|
|
|
|
else if( nInventor == FmFormInventor)
|
|
|
|
{
|
|
|
|
// Alle FormControls
|
|
|
|
nHelpId = HID_FM_CTL_SELECTION;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 )
|
2004-01-20 11:44:01 +00:00
|
|
|
nPage = GetDoc()->GetSdPage( nPage, ePageKind )->GetPageNum();
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2004-11-26 19:30:41 +00:00
|
|
|
if( mpSlideShow )
|
|
|
|
return DND_ACTION_NONE;
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2002-11-29 13:55:51 +00:00
|
|
|
return pDrView->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 )
|
2004-01-20 11:44:01 +00:00
|
|
|
nPage = GetDoc()->GetSdPage( nPage, ePageKind )->GetPageNum();
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2004-11-26 19:30:41 +00:00
|
|
|
if( mpSlideShow )
|
|
|
|
return DND_ACTION_NONE;
|
2001-03-08 10:28:38 +00:00
|
|
|
|
2002-11-29 13:55:51 +00:00
|
|
|
return pDrView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer );
|
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
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize ( "", on )
|
|
|
|
#endif
|
2003-03-27 09:58:12 +00:00
|
|
|
|