2004-07-13 08:53:24 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 03:13:38 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2008-04-11 03:13:38 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2008-04-11 03:13:38 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2008-04-11 03:13:38 -05: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.
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2008-04-11 03:13:38 -05: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).
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
2008-04-11 03:13:38 -05: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.
|
2004-07-13 08:53:24 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-16 13:33:48 -05:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
2007-04-03 10:28:40 -05:00
|
|
|
|
2004-07-13 08:53:24 -05:00
|
|
|
#include "ViewShellImplementation.hxx"
|
|
|
|
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
#include "drawdoc.hxx"
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "glob.hrc"
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "helpids.h"
|
|
|
|
#include "sdattr.hxx"
|
|
|
|
#include "sdabstdlg.hxx"
|
|
|
|
#include "unmodpg.hxx"
|
|
|
|
#include "Window.hxx"
|
|
|
|
#include "optsitem.hxx"
|
|
|
|
#include "DrawDocShell.hxx"
|
2006-03-21 10:40:55 -06:00
|
|
|
#include "DrawController.hxx"
|
2004-11-16 09:38:11 -06:00
|
|
|
#include "FactoryIds.hxx"
|
2004-11-27 07:39:09 -06:00
|
|
|
#include "slideshow.hxx"
|
2005-01-21 09:37:09 -06:00
|
|
|
#include "TaskPaneViewShell.hxx"
|
2005-01-25 08:35:30 -06:00
|
|
|
#include "ViewShellBase.hxx"
|
2007-04-03 10:28:40 -05:00
|
|
|
#include "FrameView.hxx"
|
|
|
|
#include "DrawViewShell.hxx"
|
|
|
|
#include "ViewShellHint.hxx"
|
|
|
|
#include "framework/FrameworkHelper.hxx"
|
2004-07-13 08:53:24 -05:00
|
|
|
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/aeitem.hxx>
|
2008-01-28 07:57:02 -06:00
|
|
|
#include <svx/imapdlg.hxx>
|
2004-07-13 08:53:24 -05:00
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <basic/sbstar.hxx>
|
2006-01-10 07:33:04 -06:00
|
|
|
#include "undo/undoobjects.hxx"
|
2004-08-04 03:00:53 -05:00
|
|
|
|
2007-04-03 10:28:40 -05:00
|
|
|
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
|
|
|
|
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::drawing::framework;
|
|
|
|
using ::sd::framework::FrameworkHelper;
|
2004-08-04 03:00:53 -05:00
|
|
|
|
2006-03-21 10:40:55 -06:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
class ImpUndoDeleteWarning : public ModalDialog
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
FixedImage maImage;
|
|
|
|
FixedText maWarningFT;
|
|
|
|
CheckBox maDisableCB;
|
|
|
|
OKButton maYesBtn;
|
|
|
|
CancelButton maNoBtn;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpUndoDeleteWarning(Window* pParent);
|
|
|
|
BOOL IsWarningDisabled() const { return maDisableCB.IsChecked(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
ImpUndoDeleteWarning::ImpUndoDeleteWarning(Window* pParent)
|
|
|
|
: ModalDialog(pParent, SdResId(RID_UNDO_DELETE_WARNING)),
|
|
|
|
maImage(this, SdResId(IMG_UNDO_DELETE_WARNING)),
|
|
|
|
maWarningFT(this, SdResId(FT_UNDO_DELETE_WARNING)),
|
|
|
|
maDisableCB(this, SdResId(CB_UNDO_DELETE_DISABLE)),
|
|
|
|
maYesBtn(this, SdResId(BTN_UNDO_DELETE_YES)),
|
|
|
|
maNoBtn(this, SdResId(BTN_UNDO_DELETE_NO))
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
SetHelpId( HID_SD_UNDODELETEWARNING_DLG );
|
|
|
|
maDisableCB.SetHelpId( HID_SD_UNDODELETEWARNING_CBX );
|
|
|
|
|
|
|
|
maYesBtn.SetText(Button::GetStandardText(BUTTON_YES));
|
|
|
|
maNoBtn.SetText(Button::GetStandardText(BUTTON_NO));
|
|
|
|
maImage.SetImage(WarningBox::GetStandardImage());
|
|
|
|
|
|
|
|
// #93721# Set focus to YES-Button
|
|
|
|
maYesBtn.GrabFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end of anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:53:24 -05:00
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
ViewShell::Implementation::Implementation (ViewShell& rViewShell)
|
2004-08-04 03:00:53 -05:00
|
|
|
: mbIsShowingUIControls(false),
|
|
|
|
mbIsMainViewShell(false),
|
2006-03-21 10:40:55 -06:00
|
|
|
mbIsInitialized(false),
|
|
|
|
mbArrangeActive(false),
|
2006-12-12 12:09:04 -06:00
|
|
|
mpSubShellFactory(),
|
2006-03-21 10:40:55 -06:00
|
|
|
mpUpdateLockForMouse(),
|
2006-12-12 12:09:04 -06:00
|
|
|
mrViewShell(rViewShell)
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell::Implementation::~Implementation (void)
|
|
|
|
{
|
2006-03-21 10:40:55 -06:00
|
|
|
if ( ! mpUpdateLockForMouse.expired())
|
|
|
|
{
|
|
|
|
::boost::shared_ptr<ToolBarManagerLock> pLock(mpUpdateLockForMouse);
|
|
|
|
if (pLock.get() != NULL)
|
2006-10-24 07:37:42 -05:00
|
|
|
{
|
|
|
|
// Force the ToolBarManagerLock to be released even when the
|
|
|
|
// IsUICaptured() returns <TRUE/>.
|
|
|
|
pLock->Release(true);
|
|
|
|
}
|
2006-03-21 10:40:55 -06:00
|
|
|
}
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShell::Implementation::ProcessModifyPageSlot (
|
|
|
|
SfxRequest& rRequest,
|
|
|
|
SdPage* pCurrentPage,
|
|
|
|
PageKind ePageKind)
|
|
|
|
{
|
|
|
|
SdDrawDocument* pDocument = mrViewShell.GetDoc();
|
|
|
|
SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin();
|
|
|
|
BYTE aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE);
|
|
|
|
BYTE aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE);
|
2004-10-28 07:33:51 -05:00
|
|
|
SetOfByte aVisibleLayers;
|
2004-07-13 08:53:24 -05:00
|
|
|
BOOL bHandoutMode = FALSE;
|
|
|
|
SdPage* pHandoutMPage = NULL;
|
|
|
|
String aNewName;
|
|
|
|
|
|
|
|
// #95981#
|
|
|
|
String aOldName;
|
|
|
|
|
|
|
|
AutoLayout aNewAutoLayout;
|
|
|
|
|
|
|
|
BOOL bBVisible;
|
|
|
|
BOOL bBObjsVisible;
|
|
|
|
const SfxItemSet* pArgs = rRequest.GetArgs();
|
|
|
|
|
2006-01-19 05:56:48 -06:00
|
|
|
if (pCurrentPage != NULL && pCurrentPage->TRG_HasMasterPage())
|
2004-10-28 07:33:51 -05:00
|
|
|
aVisibleLayers = pCurrentPage->TRG_GetMasterPageVisibleLayers();
|
|
|
|
else
|
|
|
|
aVisibleLayers.SetAll();
|
|
|
|
|
2004-07-13 08:53:24 -05:00
|
|
|
do
|
|
|
|
{
|
2006-01-19 05:56:48 -06:00
|
|
|
if (pCurrentPage == NULL)
|
|
|
|
break;
|
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
if (!pArgs || pArgs->Count() == 1 || pArgs->Count() == 2 )
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
if (pArgs && pArgs->Count() == 2)
|
|
|
|
{
|
|
|
|
// We have been called with a request that contains two
|
|
|
|
// arguments. One was used as preselected layout in a
|
|
|
|
// dialog. We could select that layout in the
|
|
|
|
// layout panel instead.
|
|
|
|
/*
|
|
|
|
SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, FALSE);
|
|
|
|
eNewAutoLayout = (AutoLayout) pNewAutoLayout->GetValue
|
|
|
|
();
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make the layout menu visible in the tool pane.
|
|
|
|
SfxBoolItem aMakeToolPaneVisible (ID_VAL_ISVISIBLE, TRUE);
|
|
|
|
SfxUInt32Item aPanelId (ID_VAL_PANEL_INDEX,
|
|
|
|
::sd::toolpanel::TaskPaneViewShell::PID_LAYOUT);
|
2005-12-14 08:53:04 -06:00
|
|
|
SfxViewFrame* pFrame = mrViewShell.GetViewFrame();
|
|
|
|
if (pFrame!=NULL && pFrame->GetDispatcher()!=NULL)
|
|
|
|
{
|
|
|
|
pFrame->GetDispatcher()->Execute (
|
|
|
|
SID_TASK_PANE,
|
|
|
|
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
|
|
|
|
&aMakeToolPaneVisible,
|
|
|
|
&aPanelId,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ASSERT(pFrame!=NULL && pFrame->GetDispatcher()!=NULL,
|
|
|
|
"ViewShell::Implementation::ProcessModifyPageSlot(): can not get dispatcher");
|
|
|
|
}
|
2005-01-21 09:37:09 -06:00
|
|
|
|
|
|
|
// We have activated a non-modal control in the task pane.
|
|
|
|
// Because it does not return anything we can not do anything
|
|
|
|
// more right now and have to exit here.
|
|
|
|
break;
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
2005-01-21 09:37:09 -06:00
|
|
|
else if (pArgs->Count() == 4)
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
SFX_REQUEST_ARG (rRequest, pNewName, SfxStringItem, ID_VAL_PAGENAME, FALSE);
|
|
|
|
SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, FALSE);
|
|
|
|
SFX_REQUEST_ARG (rRequest, pBVisible, SfxBoolItem, ID_VAL_ISPAGEBACK, FALSE);
|
|
|
|
SFX_REQUEST_ARG (rRequest, pBObjsVisible, SfxBoolItem, ID_VAL_ISPAGEOBJ, FALSE);
|
|
|
|
AutoLayout aLayout ((AutoLayout)pNewAutoLayout->GetValue ());
|
2005-03-18 10:04:06 -06:00
|
|
|
if (aLayout >= AUTOLAYOUT__START
|
|
|
|
&& aLayout < AUTOLAYOUT__END)
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
aNewName = pNewName->GetValue ();
|
|
|
|
aNewAutoLayout = (AutoLayout) pNewAutoLayout->GetValue ();
|
|
|
|
bBVisible = pBVisible->GetValue ();
|
|
|
|
bBObjsVisible = pBObjsVisible->GetValue ();
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
|
|
|
|
rRequest.Ignore ();
|
|
|
|
break;
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
2005-01-21 09:37:09 -06:00
|
|
|
if (ePageKind == PK_HANDOUT)
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
bHandoutMode = TRUE;
|
|
|
|
pHandoutMPage = pDocument->GetMasterSdPage(0, PK_HANDOUT);
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
StarBASIC::FatalError (SbERR_WRONG_ARGS);
|
2004-07-13 08:53:24 -05:00
|
|
|
rRequest.Ignore ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
SdPage* pUndoPage =
|
|
|
|
bHandoutMode ? pHandoutMPage : pCurrentPage;
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
SfxUndoManager* pUndoManager = mrViewShell.GetDocSh()->GetUndoManager();
|
|
|
|
DBG_ASSERT(pUndoManager, "No UNDO MANAGER ?!?");
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2006-01-10 07:33:04 -06:00
|
|
|
if( pUndoManager )
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2006-01-10 07:33:04 -06:00
|
|
|
String aComment( SdResId(STR_UNDO_MODIFY_PAGE) );
|
|
|
|
pUndoManager->EnterListAction(aComment, aComment);
|
2005-01-21 09:37:09 -06:00
|
|
|
ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
|
|
|
|
pUndoManager, pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, bBObjsVisible);
|
|
|
|
pUndoManager->AddUndoAction(pAction);
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
// Clear the selection because the selectec object may be removed as
|
|
|
|
// a result of the ssignment of the layout.
|
|
|
|
mrViewShell.GetDrawView()->UnmarkAll();
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
if (!bHandoutMode)
|
|
|
|
{
|
|
|
|
if (pCurrentPage->GetName() != aNewName)
|
2004-07-13 08:53:24 -05:00
|
|
|
{
|
2005-01-21 09:37:09 -06:00
|
|
|
pCurrentPage->SetName(aNewName);
|
|
|
|
|
|
|
|
if (ePageKind == PK_STANDARD)
|
|
|
|
{
|
2005-01-25 08:35:30 -06:00
|
|
|
USHORT nPage = (pCurrentPage->GetPageNum()-1) / 2;
|
2005-01-21 09:37:09 -06:00
|
|
|
SdPage* pNotesPage = pDocument->GetSdPage(nPage, PK_NOTES);
|
2005-01-25 08:35:30 -06:00
|
|
|
if (pNotesPage != NULL)
|
|
|
|
pNotesPage->SetName(aNewName);
|
2005-01-21 09:37:09 -06:00
|
|
|
}
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
pCurrentPage->SetAutoLayout(aNewAutoLayout, TRUE);
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE);
|
|
|
|
aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE);
|
|
|
|
aVisibleLayers.Set(aBckgrnd, bBVisible);
|
|
|
|
aVisibleLayers.Set(aBckgrndObj, bBObjsVisible);
|
|
|
|
pCurrentPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pHandoutMPage->SetAutoLayout(aNewAutoLayout, TRUE);
|
|
|
|
}
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
mrViewShell.GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE,
|
|
|
|
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
BOOL bSetModified = TRUE;
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
if (pArgs && pArgs->Count() == 1)
|
|
|
|
{
|
|
|
|
bSetModified = (BOOL) ((SfxBoolItem&) pArgs->Get(SID_MODIFYPAGE)).GetValue();
|
|
|
|
}
|
2004-07-13 08:53:24 -05:00
|
|
|
|
2006-01-10 07:33:04 -06:00
|
|
|
pUndoManager->AddUndoAction( new UndoAutoLayoutPosAndSize( *pUndoPage ) );
|
|
|
|
pUndoManager->LeaveListAction();
|
|
|
|
|
2005-01-21 09:37:09 -06:00
|
|
|
pDocument->SetChanged(bSetModified);
|
|
|
|
}
|
2004-07-13 08:53:24 -05:00
|
|
|
}
|
|
|
|
while (false);
|
|
|
|
|
|
|
|
mrViewShell.Cancel();
|
|
|
|
rRequest.Done ();
|
|
|
|
}
|
|
|
|
|
2004-10-28 07:33:51 -05:00
|
|
|
|
2004-11-16 09:38:11 -06:00
|
|
|
|
|
|
|
|
2005-01-25 08:35:30 -06:00
|
|
|
void ViewShell::Implementation::AssignLayout (
|
|
|
|
SdPage* pPage,
|
|
|
|
AutoLayout aLayout)
|
|
|
|
{
|
|
|
|
// Transform the given request into the four argument form that is
|
|
|
|
// understood by ProcessModifyPageSlot().
|
|
|
|
SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin());
|
|
|
|
BYTE aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE));
|
|
|
|
BYTE aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE));
|
|
|
|
SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers());
|
|
|
|
SfxRequest aRequest (mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE);
|
|
|
|
aRequest.AppendItem(SfxStringItem (ID_VAL_PAGENAME, pPage->GetName()));
|
|
|
|
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
|
|
|
|
aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground)));
|
|
|
|
aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEOBJ, aVisibleLayers.IsSet(aBackgroundObject)));
|
|
|
|
|
|
|
|
// Forward the call with the new arguments.
|
|
|
|
ProcessModifyPageSlot (
|
|
|
|
aRequest,
|
|
|
|
pPage,
|
|
|
|
pPage->GetPageKind());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-11-16 09:38:11 -06:00
|
|
|
sal_uInt16 ViewShell::Implementation::GetViewId (void)
|
|
|
|
{
|
|
|
|
switch (mrViewShell.GetShellType())
|
|
|
|
{
|
|
|
|
case ViewShell::ST_IMPRESS:
|
|
|
|
case ViewShell::ST_NOTES:
|
|
|
|
case ViewShell::ST_HANDOUT:
|
|
|
|
return IMPRESS_FACTORY_ID;
|
|
|
|
|
|
|
|
case ViewShell::ST_DRAW:
|
|
|
|
return DRAW_FACTORY_ID;
|
|
|
|
|
|
|
|
case ViewShell::ST_OUTLINE:
|
|
|
|
return OUTLINE_FACTORY_ID;
|
|
|
|
|
|
|
|
case ViewShell::ST_SLIDE_SORTER:
|
|
|
|
return SLIDE_SORTER_FACTORY_ID;
|
|
|
|
|
|
|
|
case ViewShell::ST_PRESENTATION:
|
|
|
|
return PRESENTATION_FACTORY_ID;
|
|
|
|
|
|
|
|
// Since we have to return a view id for every possible shell type
|
|
|
|
// and there is not (yet) a proper ViewShellBase sub class for the
|
|
|
|
// remaining types we chose the Impress factory as a fall back.
|
|
|
|
case ViewShell::ST_TASK_PANE:
|
|
|
|
case ViewShell::ST_NONE:
|
|
|
|
default:
|
|
|
|
return IMPRESS_FACTORY_ID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-21 10:40:55 -06:00
|
|
|
|
2008-01-28 07:57:02 -06:00
|
|
|
SvxIMapDlg* ViewShell::Implementation::GetImageMapDialog (void)
|
|
|
|
{
|
|
|
|
SvxIMapDlg* pDialog = NULL;
|
|
|
|
SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow(
|
|
|
|
SvxIMapDlgChildWindow::GetChildWindowId());
|
|
|
|
if (pChildWindow != NULL)
|
|
|
|
pDialog = dynamic_cast<SvxIMapDlg*>(pChildWindow->GetWindow());
|
|
|
|
return pDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-21 10:40:55 -06:00
|
|
|
//===== ToolBarManagerLock ====================================================
|
|
|
|
|
|
|
|
class ViewShell::Implementation::ToolBarManagerLock::Deleter { public:
|
|
|
|
void operator() (ToolBarManagerLock* pObject) { delete pObject; }
|
|
|
|
};
|
|
|
|
|
|
|
|
::boost::shared_ptr<ViewShell::Implementation::ToolBarManagerLock>
|
|
|
|
ViewShell::Implementation::ToolBarManagerLock::Create (
|
2007-06-27 09:47:05 -05:00
|
|
|
const ::boost::shared_ptr<ToolBarManager>& rpManager)
|
2006-03-21 10:40:55 -06:00
|
|
|
{
|
|
|
|
::boost::shared_ptr<ToolBarManagerLock> pLock (
|
2007-06-27 09:47:05 -05:00
|
|
|
new ViewShell::Implementation::ToolBarManagerLock(rpManager),
|
2006-03-21 10:40:55 -06:00
|
|
|
ViewShell::Implementation::ToolBarManagerLock::Deleter());
|
|
|
|
pLock->mpSelf = pLock;
|
|
|
|
return pLock;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-27 09:47:05 -05:00
|
|
|
ViewShell::Implementation::ToolBarManagerLock::ToolBarManagerLock (
|
|
|
|
const ::boost::shared_ptr<ToolBarManager>& rpManager)
|
|
|
|
: mpLock(new ToolBarManager::UpdateLock(rpManager)),
|
2006-03-21 10:40:55 -06:00
|
|
|
maTimer()
|
|
|
|
{
|
|
|
|
// Start a timer that will unlock the ToolBarManager update lock when
|
|
|
|
// that is not done explicitly by calling Release().
|
|
|
|
maTimer.SetTimeoutHdl(LINK(this,ToolBarManagerLock,TimeoutCallback));
|
|
|
|
maTimer.SetTimeout(100);
|
|
|
|
maTimer.Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 12:09:04 -06:00
|
|
|
IMPL_LINK(ViewShell::Implementation::ToolBarManagerLock,TimeoutCallback,Timer*,EMPTYARG)
|
2006-03-21 10:40:55 -06:00
|
|
|
{
|
|
|
|
// If possible then release the lock now. Otherwise start the timer
|
|
|
|
// and try again later.
|
|
|
|
if (Application::IsUICaptured())
|
2007-06-27 09:47:05 -05:00
|
|
|
{
|
2006-03-21 10:40:55 -06:00
|
|
|
maTimer.Start();
|
2007-06-27 09:47:05 -05:00
|
|
|
}
|
2006-03-21 10:40:55 -06:00
|
|
|
else
|
2007-06-27 09:47:05 -05:00
|
|
|
{
|
2006-03-21 10:40:55 -06:00
|
|
|
mpSelf.reset();
|
2007-06-27 09:47:05 -05:00
|
|
|
}
|
2006-03-21 10:40:55 -06:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-24 07:37:42 -05:00
|
|
|
void ViewShell::Implementation::ToolBarManagerLock::Release (bool bForce)
|
2006-03-21 10:40:55 -06:00
|
|
|
{
|
|
|
|
// If possible then release the lock now. Otherwise try again when the
|
|
|
|
// timer expires.
|
2006-10-24 07:37:42 -05:00
|
|
|
if (bForce || ! Application::IsUICaptured())
|
2007-06-27 09:47:05 -05:00
|
|
|
{
|
2006-03-21 10:40:55 -06:00
|
|
|
mpSelf.reset();
|
2007-06-27 09:47:05 -05:00
|
|
|
}
|
2006-03-21 10:40:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell::Implementation::ToolBarManagerLock::~ToolBarManagerLock (void)
|
|
|
|
{
|
|
|
|
mpLock.reset();
|
|
|
|
}
|
|
|
|
|
2004-07-13 08:53:24 -05:00
|
|
|
} // end of namespace sd
|