Files
libreoffice/sd/source/ui/view/drviews1.cxx

1442 lines
47 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +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
*
* 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
*
* 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
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
#include "DrawViewShell.hxx"
#include "ViewShellImplementation.hxx"
#include "DrawController.hxx"
#include <com/sun/star/embed/EmbedStates.hpp>
#include "comphelper/anytostring.hxx"
#include "comphelper/scopeguard.hxx"
#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>
#include <svx/svdopage.hxx>
2000-09-18 16:07:07 +00:00
#include <vcl/msgbox.hxx>
#include <sot/storage.hxx>
2000-09-18 16:07:07 +00:00
#include <svx/fmshell.hxx>
#include <svx/globl3d.hxx>
#include <svx/fmglob.hxx>
#include <editeng/outliner.hxx>
2000-09-18 16:07:07 +00:00
#include "misc.hxx"
#ifdef STARIMAGE_AVAILABLE
#include <sim2/simdll.hxx>
#endif
#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"
#include "FrameView.hxx"
2000-09-18 16:07:07 +00:00
#include "stlpool.hxx"
#include "Window.hxx"
2000-09-18 16:07:07 +00:00
#include "drawview.hxx"
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
#include "Ruler.hxx"
#include "Client.hxx"
#include "slideshow.hxx"
2000-09-18 16:07:07 +00:00
#include "optsitem.hxx"
#include "fusearch.hxx"
#include "Outliner.hxx"
#include "AnimationChildWindow.hxx"
2002-01-24 14:06:27 +00:00
#include "SdUnoDrawView.hxx"
#include "ToolBarManager.hxx"
#include "FormShellManager.hxx"
#include "ViewShellBase.hxx"
#include "LayerDialogChildWindow.hxx"
#include "LayerTabBar.hxx"
#include "ViewShellManager.hxx"
#include "ViewShellHint.hxx"
2000-09-18 16:07:07 +00:00
#include <sfx2/request.hxx>
#include <boost/bind.hpp>
#ifdef _MSC_VER
#if (_MSC_VER < 1400)
2000-09-18 16:07:07 +00:00
#pragma optimize ( "", off )
#endif
#endif
2000-09-18 16:07:07 +00:00
using namespace com::sun::star;
namespace sd {
void DrawViewShell::Activate(BOOL bIsMDIActivate)
2000-09-18 16:07:07 +00:00
{
ViewShell::Activate(bIsMDIActivate);
}
void DrawViewShell::UIActivating( SfxInPlaceClient* pCli )
{
ViewShell::UIActivating(pCli);
// #94252# Disable own controls
maTabControl.Disable();
if (GetLayerTabControl() != NULL)
GetLayerTabControl()->Disable();
}
void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli )
{
// #94252# Enable own controls
maTabControl.Enable();
if (GetLayerTabControl() != NULL)
GetLayerTabControl()->Enable();
ViewShell::UIDeactivated(pCli);
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Deactivate()
|*
\************************************************************************/
void DrawViewShell::Deactivate(BOOL bIsMDIActivate)
2000-09-18 16:07:07 +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
|*
\************************************************************************/
void DrawViewShell::SelectionHasChanged (void)
2000-09-18 16:07:07 +00:00
{
Invalidate();
//Update3DWindow(); // 3D-Controller
SfxBoolItem aItem( SID_3D_STATE, TRUE );
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;
if ( mpDrawView->AreObjectsMarked() )
2000-09-18 16:07:07 +00:00
{
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
2000-09-18 16:07:07 +00:00
if (rMarkList.GetMarkCount() == 1)
{
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObj = pMark->GetMarkedSdrObj();
2000-09-18 16:07:07 +00:00
UINT32 nInv = pObj->GetObjInventor();
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
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 );
}
}
ViewShellBase& rBase = GetViewShellBase();
rBase.SetVerbs(0);
2000-09-18 16:07:07 +00:00
try
2000-09-18 16:07:07 +00:00
{
Client* pIPClient = static_cast<Client*>(rBase.GetIPClient());
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
2000-09-18 16:07:07 +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());
pIPClient->DeactivateObject();
//HMHmpDrView->ShowMarkHdl();
2000-09-18 16:07:07 +00:00
}
else
{
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
2000-09-18 16:07:07 +00:00
{
if ( pOleObj )
2000-09-18 16:07:07 +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
{
rBase.SetVerbs( uno::Sequence < embed::VerbDescriptor >() );
2000-09-18 16:07:07 +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
}
if( HasCurrentFunction() )
2000-09-18 16:07:07 +00:00
{
GetCurrentFunction()->SelectionHasChanged();
2000-09-18 16:07:07 +00:00
}
else
{
GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView);
2000-09-18 16:07:07 +00:00
}
// #96124# Invalidate for every subshell
GetViewShellBase().GetViewShellManager()->InvalidateAllSubShells(this);
2000-09-18 16:07:07 +00:00
mpDrawView->UpdateSelectionClipboard( FALSE );
2002-01-24 14:06:27 +00:00
GetViewShellBase().GetDrawController().FireSelectionChangeListener();
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Zoomfaktor setzen
|*
\************************************************************************/
void DrawViewShell::SetZoom( long nZoom )
2000-09-18 16:07:07 +00:00
{
// Make sure that the zoom factor will not be recalculated on
// following window resizings.
mbZoomOnPage = FALSE;
ViewShell::SetZoom( nZoom );
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
|*
\************************************************************************/
void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
2000-09-18 16:07:07 +00:00
{
ViewShell::SetZoomRect( rZoomRect );
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
|*
\************************************************************************/
USHORT DrawViewShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
2000-09-18 16:07:07 +00:00
{
if ( ViewShell::PrepareClose(bUI, bForBrowsing) != TRUE )
2000-09-18 16:07:07 +00:00
return FALSE;
BOOL bRet = TRUE;
if( bRet && HasCurrentFunction() )
2000-09-18 16:07:07 +00:00
{
USHORT nID = GetCurrentFunction()->GetSlotID();
2000-09-18 16:07:07 +00:00
if (nID == SID_TEXTEDIT || nID == SID_ATTR_CHAR)
{
mpDrawView->SdrEndTextEdit();
2000-09-18 16:07:07 +00:00
}
}
else if( !bRet )
{
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
|*
\************************************************************************/
void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
2000-09-18 16:07:07 +00:00
{
if (meEditMode != eEMode || mbIsLayerModeActive != bIsLayerModeActive)
2000-09-18 16:07:07 +00:00
{
ViewShellManager::UpdateLock aLock (GetViewShellBase().GetViewShellManager());
USHORT nActualPageNum = 0;
GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EM_MASTERPAGE);
GetViewShellBase().GetDrawController().FireChangeLayerMode (bIsLayerModeActive);
2002-01-24 14:06:27 +00:00
if ( mpDrawView->IsTextEdit() )
2000-09-18 16:07:07 +00:00
{
mpDrawView->SdrEndTextEdit();
2000-09-18 16:07:07 +00:00
}
LayerTabBar* pLayerBar = GetLayerTabControl();
if (pLayerBar != NULL)
pLayerBar->EndEditMode();
maTabControl.EndEditMode();
2000-09-18 16:07:07 +00:00
if (mePageKind == PK_HANDOUT)
2000-09-18 16:07:07 +00:00
{
// Bei Handzetteln nur MasterPage zulassen
eEMode = EM_MASTERPAGE;
}
meEditMode = eEMode;
mbIsLayerModeActive = bIsLayerModeActive;
2000-09-18 16:07:07 +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 (meEditMode == EM_MASTERPAGE
&& GetShellType() != ViewShell::ST_HANDOUT);
// If the master view toolbar is not shown we hide it before
// switching the edit mode.
if (::sd::ViewShell::mpImpl->mbIsInitialized
&& IsMainViewShell()
&& ! bShowMasterViewToolbar)
2000-09-18 16:07:07 +00:00
{
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
}
if (meEditMode == EM_PAGE)
{
2000-09-18 16:07:07 +00:00
/******************************************************************
* PAGEMODE
******************************************************************/
maTabControl.Clear();
2000-09-18 16:07:07 +00:00
SdPage* pPage;
String aPageName;
USHORT nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
2000-09-18 16:07:07 +00:00
for (USHORT i = 0; i < nPageCnt; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
2000-09-18 16:07:07 +00:00
aPageName = pPage->GetName();
maTabControl.InsertPage(i + 1, aPageName);
2000-09-18 16:07:07 +00:00
if ( pPage->IsSelected() && nActualPageNum == 0 )
{
nActualPageNum = i;
}
}
maTabControl.SetCurPageId(nActualPageNum + 1);
2000-09-18 16:07:07 +00:00
SwitchPage(nActualPageNum);
}
else
{
/******************************************************************
* MASTERPAGE
******************************************************************/
GetViewFrame()->SetChildWindow(
AnimationChildWindow::GetChildWindowId(), FALSE );
2000-09-18 16:07:07 +00:00
if (!mpActualPage)
2000-09-18 16:07:07 +00:00
{
// Sofern es keine mpActualPage gibt, wird die erste genommen
mpActualPage = GetDoc()->GetSdPage(0, mePageKind);
2000-09-18 16:07:07 +00:00
}
maTabControl.Clear();
2000-09-18 16:07:07 +00:00
USHORT nActualMasterPageNum = 0;
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
2000-09-18 16:07:07 +00:00
for (USHORT i = 0; i < nMasterPageCnt; i++)
{
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));
maTabControl.InsertPage(i + 1, aLayoutName);
2000-09-18 16:07:07 +00:00
if (&(mpActualPage->TRG_GetMasterPage()) == pMaster)
2000-09-18 16:07:07 +00:00
{
nActualMasterPageNum = i;
}
}
maTabControl.SetCurPageId(nActualMasterPageNum + 1);
2000-09-18 16:07:07 +00:00
SwitchPage(nActualMasterPageNum);
}
// If the master view toolbar is to be shown we turn it on after the
// edit mode has been changed.
if (::sd::ViewShell::mpImpl->mbIsInitialized
&& IsMainViewShell()
&& bShowMasterViewToolbar)
{
GetViewShellBase().GetToolBarManager()->SetToolBar(
ToolBarManager::TBG_MASTER_MODE,
ToolBarManager::msMasterViewToolBar);
2000-09-18 16:07:07 +00:00
}
if ( ! mbIsLayerModeActive)
2000-09-18 16:07:07 +00:00
{
maTabControl.Show();
// Set the tab control only for draw pages. For master page
// this has been done already above.
if (meEditMode == EM_PAGE)
maTabControl.SetCurPageId (nActualPageNum + 1);
2000-09-18 16:07:07 +00:00
}
/*AF: The LayerDialogChildWindow is not used anymore (I hope).
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_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 );
}
}
bool DrawViewShell::IsLayerModeActive (void) const
{
return mbIsLayerModeActive;
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Groesse des TabControls und der ModeButtons zurueckgeben
|*
\************************************************************************/
long DrawViewShell::GetHCtrlWidth()
2000-09-18 16:07:07 +00:00
{
// return maTabControl.GetSizePixel().Width();
return 0;
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Horizontales Lineal erzeugen
|*
\************************************************************************/
SvxRuler* DrawViewShell::CreateHRuler (::sd::Window* pWin, BOOL bIsFirst)
2000-09-18 16:07:07 +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;
pRuler = new Ruler (*this, GetParentWindow(), pWin, nFlags,
GetViewFrame()->GetBindings(), aWBits);
2000-09-18 16:07:07 +00:00
pRuler->SetSourceUnit(pWin->GetMapMode().GetMapUnit());
// Metric ...
UINT16 nMetric = (UINT16)GetDoc()->GetUIUnit();
2000-09-18 16:07:07 +00:00
if( nMetric == 0xffff )
nMetric = (UINT16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
2000-09-18 16:07:07 +00:00
pRuler->SetUnit( FieldUnit( nMetric ) );
// ... und auch DefTab am Lineal einstellen
pRuler->SetDefTabDist( GetDoc()->GetDefaultTabulator() ); // Neu
2000-09-18 16:07:07 +00:00
Fraction aUIScale(pWin->GetMapMode().GetScaleX());
aUIScale *= GetDoc()->GetUIScale();
2000-09-18 16:07:07 +00:00
pRuler->SetZoom(aUIScale);
return pRuler;
}
/*************************************************************************
|*
|* Vertikales Lineal erzeugen
|*
\************************************************************************/
SvxRuler* DrawViewShell::CreateVRuler(::sd::Window* pWin)
2000-09-18 16:07:07 +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;
pRuler = new Ruler(*this, GetParentWindow(), pWin, nFlags,
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
UINT16 nMetric = (UINT16)GetDoc()->GetUIUnit();
2000-09-18 16:07:07 +00:00
if( nMetric == 0xffff )
nMetric = (UINT16)GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit();
2000-09-18 16:07:07 +00:00
pRuler->SetUnit( FieldUnit( nMetric ) );
Fraction aUIScale(pWin->GetMapMode().GetScaleY());
aUIScale *= GetDoc()->GetUIScale();
2000-09-18 16:07:07 +00:00
pRuler->SetZoom(aUIScale);
return pRuler;
}
/*************************************************************************
|*
|* Horizontales Lineal aktualisieren
|*
\************************************************************************/
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
if (mpHorizontalRuler.get() != NULL)
mpHorizontalRuler->ForceUpdate();
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Vertikales Lineal aktualisieren
|*
\************************************************************************/
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
if (mpVerticalRuler.get() != NULL)
mpVerticalRuler->ForceUpdate();
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Metrik setzen
|*
\************************************************************************/
void DrawViewShell::SetUIUnit(FieldUnit eUnit)
2000-09-18 16:07:07 +00:00
{
ViewShell::SetUIUnit(eUnit);
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* TabControl nach Splitteraenderung aktualisieren
|*
\************************************************************************/
IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab )
2000-09-18 16:07:07 +00:00
{
const long int nMax = maViewSize.Width() - maScrBarWH.Width()
- maTabControl.GetPosPixel().X() ;
2000-09-18 16:07:07 +00:00
Size aTabSize = maTabControl.GetSizePixel();
2000-09-18 16:07:07 +00:00
aTabSize.Width() = Min(pTab->GetSplitSize(), (long)(nMax-1));
maTabControl.SetSizePixel(aTabSize);
GetLayerTabControl()->SetSizePixel(aTabSize);
2000-09-18 16:07:07 +00:00
Point aPos = maTabControl.GetPosPixel();
2000-09-18 16:07:07 +00:00
aPos.X() += aTabSize.Width();
Size aScrSize(nMax - aTabSize.Width(), maScrBarWH.Height());
mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize);
2000-09-18 16:07:07 +00:00
return 0;
}
/// inherited from sd::ViewShell
SdPage* DrawViewShell::getCurrentPage() const
{
const sal_Int32 nPageCount = (meEditMode == EM_PAGE)?
GetDoc()->GetSdPageCount(mePageKind):
GetDoc()->GetMasterSdPageCount(mePageKind);
sal_Int32 nCurrentPage = maTabControl.GetCurPageId() - 1;
DBG_ASSERT( (nPageCount>0) && (nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!" );
if( (nPageCount < 0) || (nCurrentPage>=nPageCount) )
nCurrentPage = 0; // play safe here
if (meEditMode == EM_PAGE)
{
return GetDoc()->GetSdPage((USHORT)nCurrentPage, mePageKind);
}
else // EM_MASTERPAGE
{
return GetDoc()->GetMasterSdPage((USHORT)nCurrentPage, mePageKind);
}
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* neue aktuelle Seite auswaehlen, falls sich die Seitenfolge geaendert
|* hat (z. B. durch Undo)
|*
\************************************************************************/
void DrawViewShell::ResetActualPage()
2000-09-18 16:07:07 +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;
if (meEditMode == EM_PAGE)
2000-09-18 16:07:07 +00:00
{
// Update fuer TabControl
maTabControl.Clear();
2000-09-18 16:07:07 +00:00
SdPage* pPage = NULL;
String aPageName;
for (USHORT i = 0; i < nPageCount; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
2000-09-18 16:07:07 +00:00
aPageName = pPage->GetName();
maTabControl.InsertPage(i + 1, aPageName);
2000-09-18 16:07:07 +00:00
// Selektionskennungen der Seiten korrigieren
GetDoc()->SetSelected(pPage, i == nCurrentPage);
2000-09-18 16:07:07 +00:00
}
maTabControl.SetCurPageId(nCurrentPage + 1);
2000-09-18 16:07:07 +00:00
}
else // EM_MASTERPAGE
{
SdPage* pActualPage = GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
maTabControl.Clear();
2000-09-18 16:07:07 +00:00
USHORT nActualMasterPageNum = 0;
USHORT nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
2000-09-18 16:07:07 +00:00
for (USHORT i = 0; i < nMasterPageCnt; i++)
{
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));
maTabControl.InsertPage(i + 1, aLayoutName);
2000-09-18 16:07:07 +00:00
if (pActualPage == pMaster)
nActualMasterPageNum = i;
}
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
|*
\************************************************************************/
ErrCode DrawViewShell::DoVerb(long nVerb)
2000-09-18 16:07:07 +00:00
{
if ( mpDrawView->AreObjectsMarked() )
2000-09-18 16:07:07 +00:00
{
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
2000-09-18 16:07:07 +00:00
if (rMarkList.GetMarkCount() == 1)
{
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObj = pMark->GetMarkedSdrObj();
2000-09-18 16:07:07 +00:00
UINT32 nInv = pObj->GetObjInventor();
UINT16 nSdrObjKind = pObj->GetObjIdentifier();
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)
**************************************************************/
//HMHmpDrView->HideMarkHdl();
2000-09-18 16:07:07 +00:00
SvStorageRef aStor = new SvStorage(String());
SvInPlaceObjectRef aNewIPObj = &((SvFactory*)SvInPlaceObject::ClassFactory())
->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 = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
pPV->GetObjList()->InsertObject( pSdrOle2Obj );
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);
Client* pClient = (Client*) GetIPClient();
2000-09-18 16:07:07 +00:00
if (pClient)
pClient->SetSdrGrafObj( pTempSdrGrafObj );
}
}
}
#endif
}
}
return 0;
}
/*************************************************************************
|*
|* OLE-Object aktivieren
|*
\************************************************************************/
BOOL DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
2000-09-18 16:07:07 +00:00
{
BOOL bActivated = FALSE;
if ( !GetDocSh()->IsUIActive() )
2000-09-18 16:07:07 +00:00
{
ToolBarManager::UpdateLock aLock (GetViewShellBase().GetToolBarManager());
bActivated = ViewShell::ActivateObject(pObj, nVerb);
2000-09-18 16:07:07 +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
|*
\************************************************************************/
void LclResetFlag (bool& rbFlag) {rbFlag = false;}
BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage)
2000-09-18 16:07:07 +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)));
if (GetActiveWindow()->IsInPaint())
{
// Switching the current page while a Paint is being executed is
// dangerous. So, post it for later execution and return.
maAsynchronousSwitchPageCall.Post(::boost::bind(
::std::mem_fun(&DrawViewShell::SwitchPage),
this,
nSelectedPage));
return FALSE;
}
2000-09-18 16:07:07 +00:00
BOOL bOK = FALSE;
// 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 look because making SwitchPage()
// more robust with respect to invalid page numbers is a good thing
// anyway.
if (nSelectedPage == SDRPAGE_NOTFOUND)
{
nSelectedPage = 0;
}
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;
}
2000-09-18 16:07:07 +00:00
if (IsSwitchPageAllowed())
{
ModifyGuard aGuard2( GetDoc() );
2000-09-18 16:07:07 +00:00
bOK = TRUE;
2000-09-18 16:07:07 +00:00
if (mpActualPage)
2000-09-18 16:07:07 +00:00
{
SdPage* pNewPage = NULL;
2000-09-18 16:07:07 +00:00
if (meEditMode == EM_MASTERPAGE)
2000-09-18 16:07:07 +00:00
{
if( GetDoc()->GetMasterSdPageCount(mePageKind) > nSelectedPage )
pNewPage = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
if( pNewPage )
2000-09-18 16:07:07 +00:00
{
SdrPageView* pPV = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
String sPageText (pNewPage->GetLayoutName());
sPageText.Erase(sPageText.SearchAscii(SD_LT_SEPARATOR));
if (pPV
&& pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
&& sPageText == maTabControl.GetPageText(nSelectedPage+1))
{
// this slide is already visible
return TRUE;
}
}
}
else
{
OSL_ASSERT(mpFrameView!=NULL);
mpFrameView->SetSelectedPage(nSelectedPage);
if (GetDoc()->GetSdPageCount(mePageKind) > nSelectedPage)
pNewPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
2000-09-18 16:07:07 +00:00
if (mpActualPage == pNewPage)
2000-09-18 16:07:07 +00:00
{
SdrPageView* pPV = mpDrawView->GetSdrPageView();
SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage());
if (pPV
&& pNewPage == pCurrentPage
&& pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1))
{
// this slide is already visible
return TRUE;
}
2000-09-18 16:07:07 +00:00
}
}
}
if( mpDrawView )
mpDrawView->SdrEndTextEdit();
mpActualPage = NULL;
2000-09-18 16:07:07 +00:00
if (meEditMode == EM_PAGE)
2000-09-18 16:07:07 +00:00
{
mpActualPage = GetDoc()->GetSdPage(nSelectedPage, mePageKind);
2000-09-18 16:07:07 +00:00
}
else
{
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
2000-09-18 16:07:07 +00:00
// Passt die selektierte Seite zur MasterPage?
USHORT nPageCount = GetDoc()->GetSdPageCount(mePageKind);
2000-09-18 16:07:07 +00:00
for (USHORT i = 0; i < nPageCount; i++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
if(pPage && pPage->IsSelected() && pMaster == &(pPage->TRG_GetMasterPage()))
2000-09-18 16:07:07 +00:00
{
mpActualPage = pPage;
2000-09-18 16:07:07 +00:00
break;
}
}
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++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
if(pPage && pMaster == &(pPage->TRG_GetMasterPage()))
2000-09-18 16:07:07 +00:00
{
mpActualPage = pPage;
2000-09-18 16:07:07 +00:00
break;
}
}
}
}
for (USHORT i = 0; i < GetDoc()->GetSdPageCount(mePageKind); i++)
2000-09-18 16:07:07 +00:00
{
// Alle Seiten deselektieren
GetDoc()->SetSelected( GetDoc()->GetSdPage(i, mePageKind), FALSE);
2000-09-18 16:07:07 +00:00
}
if (!mpActualPage)
2000-09-18 16:07:07 +00:00
{
// Sofern es keine mpActualPage gibt, wird die erste genommen
mpActualPage = GetDoc()->GetSdPage(0, mePageKind);
2000-09-18 16:07:07 +00:00
}
// diese Seite auch selektieren (mpActualPage zeigt immer auf Zeichenseite,
2000-09-18 16:07:07 +00:00
// nie auf eine Masterpage)
GetDoc()->SetSelected(mpActualPage, TRUE);
2000-09-18 16:07:07 +00:00
rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetDoc() ) );
if( !xSlideshow.is() || !xSlideshow->isRunning() || ( xSlideshow->getAnimationMode() != ANIMATIONMODE_SHOW ) )
{
// VisArea zuziehen, um ggf. Objekte zu deaktivieren
// !!! only if we are not in presentation mode (#96279) !!!
OSL_ASSERT (GetViewShell()!=NULL);
GetViewShell()->DisconnectAllClients();
VisAreaChanged(Rectangle(Point(), Size(1, 1)));
}
2000-09-18 16:07:07 +00:00
if (meEditMode == EM_PAGE)
2000-09-18 16:07:07 +00:00
{
/**********************************************************************
* PAGEMODE
**********************************************************************/
GetDoc()->SetSelected(mpActualPage, TRUE);
2000-09-18 16:07:07 +00:00
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
if (pPageView)
{
mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
2000-09-18 16:07:07 +00:00
if (mePageKind == PK_NOTES)
2000-09-18 16:07:07 +00:00
{
mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
else if (mePageKind == PK_HANDOUT)
2000-09-18 16:07:07 +00:00
{
mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
else
{
mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
}
mpDrawView->HideSdrPage();
mpDrawView->ShowSdrPage(mpActualPage);
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(mpActualPage);
2000-09-18 16:07:07 +00:00
SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
if (pNewPageView)
{
pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
pNewPageView->SetPrintableLayers( mpFrameView->GetPrintableLayers() );
pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
2000-09-18 16:07:07 +00:00
if (mePageKind == PK_NOTES)
2000-09-18 16:07:07 +00:00
{
pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
2000-09-18 16:07:07 +00:00
}
else if (mePageKind == PK_HANDOUT)
2000-09-18 16:07:07 +00:00
{
pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
2000-09-18 16:07:07 +00:00
}
else
{
pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
2000-09-18 16:07:07 +00:00
}
}
maTabControl.SetCurPageId(nSelectedPage+1);
String aPageName = mpActualPage->GetName();
2000-09-18 16:07:07 +00:00
if (maTabControl.GetPageText(nSelectedPage+1) != aPageName)
2000-09-18 16:07:07 +00:00
{
maTabControl.SetPageText(nSelectedPage+1, aPageName);
2000-09-18 16:07:07 +00:00
}
}
else
{
/**********************************************************************
* MASTERPAGE
**********************************************************************/
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
if (pPageView)
{
mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
2000-09-18 16:07:07 +00:00
if (mePageKind == PK_NOTES)
2000-09-18 16:07:07 +00:00
{
mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
else if (mePageKind == PK_HANDOUT)
2000-09-18 16:07:07 +00:00
{
mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
else
{
mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
2000-09-18 16:07:07 +00:00
}
}
mpDrawView->HideSdrPage();
2000-09-18 16:07:07 +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
pMaster = GetDoc()->GetMasterSdPage(0, mePageKind);
2000-09-18 16:07:07 +00:00
USHORT nNum = pMaster->GetPageNum();
mpDrawView->ShowSdrPage(mpDrawView->GetModel()->GetMasterPage(nNum));
2000-09-18 16:07:07 +00:00
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(pMaster);
2002-01-30 10:40:42 +00:00
SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
if (pNewPageView)
{
pNewPageView->SetVisibleLayers( mpFrameView->GetVisibleLayers() );
pNewPageView->SetPrintableLayers( mpFrameView->GetPrintableLayers() );
pNewPageView->SetLockedLayers( mpFrameView->GetLockedLayers() );
2000-09-18 16:07:07 +00:00
if (mePageKind == PK_NOTES)
2000-09-18 16:07:07 +00:00
{
pNewPageView->SetHelpLines( mpFrameView->GetNotesHelpLines() );
2000-09-18 16:07:07 +00:00
}
else if (mePageKind == PK_HANDOUT)
2000-09-18 16:07:07 +00:00
{
pNewPageView->SetHelpLines( mpFrameView->GetHandoutHelpLines() );
2000-09-18 16:07:07 +00:00
}
else
{
pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() );
2000-09-18 16:07:07 +00:00
}
}
String aLayoutName(pMaster->GetLayoutName());
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
maTabControl.SetCurPageId(nSelectedPage+1);
2000-09-18 16:07:07 +00:00
if (maTabControl.GetPageText(nSelectedPage+1) != aLayoutName)
2000-09-18 16:07:07 +00:00
{
maTabControl.SetPageText(nSelectedPage+1, aLayoutName);
2000-09-18 16:07:07 +00:00
}
if( mePageKind == PK_HANDOUT )
{
// set pages for all available handout presentation objects
sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
SdrObject* pObj = 0;
while( (pObj = rShapeList.getNextShape(pObj)) != 0 )
{
if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT )
{
// #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);
}
}
}
2000-09-18 16:07:07 +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);
mpDrawView->VisAreaChanged(GetActiveWindow());
2000-09-18 16:07:07 +00:00
// Damit der Navigator (und das Effekte-Window) das mitbekommt (/-men)
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, TRUE, FALSE);
rBindings.Invalidate(SID_STATUS_PAGE, TRUE, FALSE);
rBindings.Invalidate(SID_DELETE_MASTER_PAGE, TRUE, FALSE);
rBindings.Invalidate(SID_DELETE_PAGE, TRUE, FALSE);
rBindings.Invalidate(SID_ASSIGN_LAYOUT,TRUE,FALSE);
rBindings.Invalidate(SID_INSERTPAGE,TRUE,FALSE);
UpdatePreview( mpActualPage );
CWS-TOOLING: integrate CWS impressnotes01 2009-09-11 13:52:41 +0200 cl r276061 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@276043 (milestone: DEV300:m58) 2009-09-10 15:44:57 +0200 cl r276039 : #i103139# continued work on the impress annotation feature 2009-09-10 14:52:31 +0200 cl r276032 : #i103139# continued work on the impress annotation feature 2009-09-10 14:50:32 +0200 cl r276031 : #i103139# continued work on the impress annotation feature 2009-09-10 14:48:29 +0200 cl r276030 : #i103139# continued work on the impress annotation feature 2009-09-10 11:36:11 +0200 cl r276027 : #i103139# continued work on the impress annotation feature 2009-09-09 20:22:41 +0200 cl r276018 : #i103139# continued work on the impress annotation feature 2009-09-09 20:21:45 +0200 cl r276017 : #i103139# continued work on the impress annotation feature 2009-09-09 19:32:29 +0200 sj r276015 : #i103139# added import of comments (ppt binary) 2009-09-09 19:31:07 +0200 sj r276014 : #i103139# added import of comments (ppt binary) 2009-09-09 19:16:41 +0200 cl r276011 : #i103139# continued work on the impress annotation feature 2009-09-09 19:15:19 +0200 cl r276010 : #i103139# continued work on the impress annotation feature 2009-09-09 16:27:19 +0200 cl r276001 : #i104579# fixed isEmptyPresObj() 2009-09-09 15:12:02 +0200 cl r275997 : #i103139# continued work on the impress annotation feature 2009-09-09 15:06:29 +0200 sj r275996 : #i103139# added import of comments (ppt binary) 2009-09-09 14:53:01 +0200 cl r275995 : #i103139# continued work on the impress annotation feature 2009-09-09 14:51:32 +0200 cl r275994 : #i103139# continued work on the impress annotation feature 2009-09-09 12:11:17 +0200 cl r275982 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:55 +0200 cl r275981 : #i103139# continued work on the impress annotation feature 2009-09-09 11:47:23 +0200 cl r275980 : #i103139# continued work on the impress annotation feature 2009-09-09 11:44:47 +0200 cl r275978 : #i104315# added missing tab pages 2009-09-08 16:04:44 +0200 cl r275936 : #i103139# continued work on the impress annotation feature 2009-09-08 16:03:28 +0200 cl r275935 : #i103139# continued work on the impress annotation feature 2009-09-08 11:45:47 +0200 cl r275920 : #i103139# continued work on the impress annotation feature 2009-09-08 11:41:51 +0200 cl r275919 : #i103139# continued work on the impress annotation feature 2009-09-07 18:30:55 +0200 cl r275910 : #i103139# continued work on the impress annotation feature 2009-09-07 18:29:37 +0200 cl r275909 : #i103139# continued work on the impress annotation feature 2009-09-07 17:25:43 +0200 cl r275905 : #i103139# continued work on the impress annotation feature 2009-09-07 12:00:28 +0200 cl r275884 : #i103139# continued work on the impress annotation feature 2009-09-06 14:14:00 +0200 cl r275859 : #i103139# continued work on the impress annotation feature 2009-09-05 20:57:24 +0200 cl r275854 : #i103139# continued work on the impress annotation feature 2009-09-05 20:56:29 +0200 cl r275853 : #i103139# continued work on the impress annotation feature 2009-09-05 20:55:27 +0200 cl r275852 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:42 +0200 cl r275851 : #i103139# continued work on the impress annotation feature 2009-09-05 20:11:09 +0200 cl r275850 : #i103139# continued work on the impress annotation feature 2009-09-05 17:43:33 +0200 cl r275845 : #i103139# continued work on the impress annotation feature 2009-09-05 17:04:41 +0200 cl r275843 : #i103139# continued work on the impress annotation feature 2009-09-05 17:03:26 +0200 cl r275842 : #i103139# continued work on the impress annotation feature 2009-09-05 17:02:53 +0200 cl r275841 : #i103139# continued work on the impress annotation feature 2009-09-05 13:15:04 +0200 pl r275839 : #i104823# WB_NEEDSFOCUS 2009-09-05 13:14:41 +0200 pl r275838 : #i104823# WB_NEEDSFOCUS 2009-09-04 17:48:21 +0200 cl r275826 : #i103139# continued work on the impress annotation feature 2009-09-04 17:35:03 +0200 cl r275825 : #i103139# continued work on the impress annotation feature 2009-09-04 17:15:46 +0200 cl r275824 : #i103139# continued work on the impress annotation feature 2009-09-04 17:12:54 +0200 cl r275823 : #i103139# continued work on the impress annotation feature 2009-09-04 17:05:23 +0200 cl r275822 : #i103139# continued work on the impress annotation feature 2009-09-04 16:48:28 +0200 cl r275820 : #i103139# continued work on the impress annotation feature 2009-09-04 16:44:02 +0200 cl r275818 : #i103139# continued work on the impress annotation feature 2009-09-04 16:43:23 +0200 cl r275817 : #i103139# continued work on the impress annotation feature 2009-09-04 16:06:04 +0200 cl r275812 : #i103139# continued work on the impress annotation feature 2009-09-04 16:05:45 +0200 cl r275811 : #i103139# continued work on the impress annotation feature 2009-09-04 15:04:33 +0200 cl r275806 : #i103139# continued work on the impress annotation feature 2009-09-04 11:43:14 +0200 cl r275795 : #i103139# continued work on the impress annotation feature 2009-09-04 11:27:10 +0200 cl r275793 : #i103139# continued work on the impress annotation feature 2009-09-04 11:10:02 +0200 cl r275792 : #i103139# continued work on the impress annotation feature 2009-09-04 11:07:05 +0200 cl r275790 : #i103139# continued work on the impress annotation feature 2009-09-04 11:05:01 +0200 cl r275789 : #i103139# continued work on the impress annotation feature 2009-09-04 10:55:51 +0200 cl r275785 : #i103139# renamed notes to comments 2009-09-04 10:54:57 +0200 cl r275784 : #i103139# renamed notes to comments 2009-09-03 20:37:35 +0200 cl r275772 : #i103139# continued work on the impress annotation feature 2009-09-03 20:35:31 +0200 cl r275771 : #i103139# continued work on the impress annotation feature 2009-09-01 18:17:55 +0200 cl r275680 : #i103139# continued work on the impress annotation feature 2009-09-01 18:15:08 +0200 cl r275678 : #i103139# continued work on the impress annotation feature 2009-09-01 18:13:38 +0200 cl r275677 : #i103139# continued work on the impress annotation feature 2009-08-18 12:35:42 +0200 cl r275089 : fixed merge error 2009-08-18 11:39:58 +0200 cl r275086 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@275001 (milestone: DEV300:m55) 2009-07-30 13:45:10 +0200 cl r274481 : fixed merge errrors 2009-07-30 13:41:21 +0200 cl r274480 : fixed merge errrors 2009-07-30 13:39:40 +0200 cl r274478 : fixed merge errrors 2009-07-22 18:07:30 +0200 cl r274256 : CWS-TOOLING: rebase CWS impressnotes01 to trunk@273858 (milestone: DEV300:m52) 2009-07-21 17:21:31 +0200 cl r274208 : merging 2009-07-20 14:28:34 +0200 cl r274137 : #i103139# annotation support for impress 2009-07-20 14:28:04 +0200 cl r274136 : #i103139# annotation support for impress 2009-07-20 14:27:20 +0200 cl r274135 : #i103139# annotation support for impress 2009-07-20 14:21:17 +0200 cl r274134 : #i103139# annotation support for impress 2009-07-20 14:20:56 +0200 cl r274133 : #i103139# annotation support for impress 2009-07-20 14:20:09 +0200 cl r274132 : #i103139# annotation support for impress 2009-07-20 14:19:00 +0200 cl r274131 : #i103139# annotation support for impress 2009-07-20 14:17:50 +0200 cl r274130 : #i103139# annotation support for impress 2009-07-20 14:12:24 +0200 cl r274129 : #i103139# annotation support for impress 2009-07-20 13:52:03 +0200 cl r274128 : #i103139# annotation support for impress 2009-07-20 13:51:11 +0200 cl r274127 : #i103139# annotation support for impress 2009-07-20 13:48:59 +0200 cl r274126 : #i103139# annotation support for impress 2009-07-20 13:43:56 +0200 cl r274125 : #i103139# annotation support for impress 2009-07-20 13:31:55 +0200 cl r274123 : #i103139# annotation support for impress 2009-07-20 13:30:45 +0200 cl r274122 : #i103139# annotation support for impress
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
|*
\************************************************************************/
BOOL DrawViewShell::IsSwitchPageAllowed() const
2000-09-18 16:07:07 +00:00
{
bool bOK = true;
2000-09-18 16:07:07 +00:00
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
if (pFormShell!=NULL && !pFormShell->PrepareClose (FALSE))
bOK = false;
2000-09-18 16:07:07 +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)
|*
\************************************************************************/
void DrawViewShell::ResetActualLayer()
2000-09-18 16:07:07 +00:00
{
LayerTabBar* pLayerBar = GetLayerTabControl();
if (pLayerBar != NULL)
2000-09-18 16:07:07 +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 = mpDrawView->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 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
{
aName = rLayerAdmin.GetLayer(nLayer)->GetName();
2000-09-18 16:07:07 +00:00
if ( aName == aActiveLayer )
2000-09-18 16:07:07 +00:00
{
nActiveLayer = nLayer;
}
if ( aName != aBackgroundLayer )
{
if (meEditMode == EM_MASTERPAGE)
2000-09-18 16:07:07 +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
TabBarPageBits nBits = 0;
SdrPageView* pPV = mpDrawView->GetSdrPageView();
2000-09-18 16:07:07 +00:00
if (pPV && !pPV->IsLayerVisible(aName))
{
// Unsichtbare Layer werden anders dargestellt
nBits = TPB_SPECIAL;
}
2000-09-18 16:07:07 +00:00
pLayerBar->SetPageBits(nLayer+1, nBits);
}
2000-09-18 16:07:07 +00:00
}
else
2000-09-18 16:07:07 +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
TabBarPageBits nBits = 0;
2000-09-18 16:07:07 +00:00
if (!mpDrawView->GetSdrPageView()->IsLayerVisible(aName))
{
// Unsichtbare Layer werden anders dargestellt
nBits = TPB_SPECIAL;
}
2000-09-18 16:07:07 +00:00
pLayerBar->SetPageBits(nLayer+1, nBits);
}
2000-09-18 16:07:07 +00:00
}
}
}
if ( nActiveLayer == SDRLAYER_NOTFOUND )
{
if( nOldLayerCnt == pLayerBar->GetPageCount() )
{
nActiveLayer = nOldLayerId - 1;
}
else
{
nActiveLayer = ( meEditMode == EM_MASTERPAGE ) ? 2 : 0;
}
mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayer + 1) );
}
pLayerBar->SetCurPageId(nActiveLayer + 1);
GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER );
GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER );
2000-09-18 16:07:07 +00:00
}
}
/*************************************************************************
|*
|* Verzoegertes Close ausfuehren
|*
\************************************************************************/
IMPL_LINK( DrawViewShell, CloseHdl, Timer*, pTimer )
2000-09-18 16:07:07 +00:00
{
pTimer->Stop();
GetViewFrame()->GetBindings().Execute( SID_CLOSEWIN );
2000-09-18 16:07:07 +00:00
return 0L;
}
2001-03-08 10:28:38 +00:00
/*************************************************************************
|*
|* AcceptDrop
|*
\************************************************************************/
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 )
nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
2001-03-08 10:28:38 +00:00
if( SlideShow::IsRunning( GetViewShellBase() ) )
return DND_ACTION_NONE;
2001-03-08 10:28:38 +00:00
return mpDrawView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer );
2001-03-08 10:28:38 +00:00
}
/*************************************************************************
|*
|* ExecuteDrop
|*
\************************************************************************/
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 )
nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
2001-03-08 10:28:38 +00:00
if( SlideShow::IsRunning( GetViewShellBase() ) )
return DND_ACTION_NONE;
2001-03-08 10:28:38 +00:00
Broadcast(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
sal_Int8 nResult (mpDrawView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ));
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
} // end of namespace sd
#ifdef _MSC_VER
#if (_MSC_VER < 1400)
2000-09-18 16:07:07 +00:00
#pragma optimize ( "", on )
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */