Files
libreoffice/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx

1135 lines
38 KiB
C++
Raw Normal View History

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* 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.
*
* 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).
*
* 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.
*
************************************************************************/
#include "precompiled_sd.hxx"
#include <com/sun/star/presentation/XPresentation2.hpp>
#include "controller/SlsSlotManager.hxx"
#include "SlideSorter.hxx"
#include "SlideSorterViewShell.hxx"
#include "controller/SlideSorterController.hxx"
#include "controller/SlsPageSelector.hxx"
#include "controller/SlsClipboard.hxx"
#include "controller/SlsSelectionFunction.hxx"
#include "controller/SlsFocusManager.hxx"
#include "controller/SlsCurrentSlideManager.hxx"
#include "controller/SlsSelectionManager.hxx"
#include "SlsHideSlideFunction.hxx"
#include "SlsCommand.hxx"
#include "model/SlideSorterModel.hxx"
#include "model/SlsPageEnumerationProvider.hxx"
#include "model/SlsPageDescriptor.hxx"
#include "view/SlideSorterView.hxx"
#include "view/SlsLayouter.hxx"
#include "view/SlsViewOverlay.hxx"
#include "framework/FrameworkHelper.hxx"
#include "Window.hxx"
#include "fupoor.hxx"
#include "fuzoom.hxx"
#include "fucushow.hxx"
#include "fusldlg.hxx"
#include "fuexpand.hxx"
#include "fusumry.hxx"
#include "fuscale.hxx"
#include "slideshow.hxx"
#include "app.hrc"
#include "strings.hrc"
#include "sdresid.hxx"
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
#include "ViewShellBase.hxx"
#include "ViewShellImplementation.hxx"
#include "sdattr.hxx"
#include "FrameView.hxx"
#include "zoomlist.hxx"
#include "sdpage.hxx"
#include "sdxfer.hxx"
#include "helpids.h"
#include "glob.hrc"
#include "unmodpg.hxx"
#include "DrawViewShell.hxx"
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svxids.hrc>
#include <svx/zoomitem.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <vcl/msgbox.hxx>
#include <svl/intitem.hxx>
#include <svl/whiter.hxx>
#include <svl/itempool.hxx>
#include <svl/aeitem.hxx>
#include <com/sun/star/presentation/FadeEffect.hpp>
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawPages.hpp>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
namespace sd { namespace slidesorter { namespace controller {
SlotManager::SlotManager (SlideSorter& rSlideSorter)
: mrSlideSorter(rSlideSorter),
maCommandQueue()
{
}
SlotManager::~SlotManager (void)
{
}
void SlotManager::FuTemporary (SfxRequest& rRequest)
{
SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
SlideSorterViewShell* pShell
= dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell());
if (pShell == NULL)
return;
switch (rRequest.GetSlot())
{
case SID_PRESENTATION:
case SID_REHEARSE_TIMINGS:
ShowSlideShow (rRequest);
pShell->Cancel();
rRequest.Done();
break;
case SID_HIDE_SLIDE:
case SID_SHOW_SLIDE:
HideSlideFunction::Create(mrSlideSorter, rRequest);
break;
case SID_PAGES_PER_ROW:
if (rRequest.GetArgs() != NULL)
{
SFX_REQUEST_ARG(rRequest, pPagesPerRow, SfxUInt16Item,
SID_PAGES_PER_ROW, FALSE);
if (pPagesPerRow != NULL)
{
sal_Int32 nColumnCount = pPagesPerRow->GetValue();
// Force the given number of columns by setting the
// minimal and maximal number of columns to the same
// value.
mrSlideSorter.GetView().GetLayouter().SetColumnCount (
nColumnCount, nColumnCount);
// Force a repaint and re-layout.
pShell->ArrangeGUIElements ();
// Rearrange the UI-elements controlled by the
// controller and force a rearrangement of the view.
mrSlideSorter.GetController().Rearrange(true);
}
}
rRequest.Done();
break;
case SID_SELECTALL:
mrSlideSorter.GetController().GetPageSelector().SelectAllPages();
rRequest.Done();
break;
case SID_SLIDE_TRANSITIONS_PANEL:
{
// Make the slide transition panel visible (expand it) in the
// tool pane.
if (mrSlideSorter.GetViewShellBase() != NULL)
framework::FrameworkHelper::Instance(*mrSlideSorter.GetViewShellBase())
->RequestTaskPanel(sd::framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
rRequest.Ignore ();
break;
}
case SID_PRESENTATION_DLG:
FuSlideShowDlg::Create (
pShell,
mrSlideSorter.GetView().GetWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
break;
case SID_CUSTOMSHOW_DLG:
FuCustomShowDlg::Create (
pShell,
mrSlideSorter.GetView().GetWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
break;
case SID_EXPAND_PAGE:
FuExpandPage::Create (
pShell,
mrSlideSorter.GetView().GetWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
break;
case SID_SUMMARY_PAGE:
FuSummaryPage::Create (
pShell,
mrSlideSorter.GetView().GetWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
break;
case SID_INSERTPAGE:
case SID_INSERT_MASTER_PAGE:
InsertSlide(rRequest);
rRequest.Done();
break;
case SID_DELETE_PAGE:
case SID_DELETE_MASTER_PAGE:
case SID_DELETE: // we need SID_CUT to handle the delete key
// (DEL -> accelerator -> SID_CUT).
if (mrSlideSorter.GetModel().GetPageCount() > 1)
{
mrSlideSorter.GetController().GetSelectionManager()->DeleteSelectedPages();
}
rRequest.Done();
break;
case SID_RENAMEPAGE:
case SID_RENAME_MASTER_PAGE:
RenameSlide ();
rRequest.Done ();
break;
case SID_ASSIGN_LAYOUT:
{
2010-01-13 19:12:02 +01:00
pShell->mpImpl->AssignLayout( rRequest, mrSlideSorter.GetModel().GetPageType() );
rRequest.Done ();
}
break;
default:
break;
}
}
void SlotManager::FuPermanent (SfxRequest& rRequest)
{
ViewShell* pShell = mrSlideSorter.GetViewShell();
if (pShell == NULL)
return;
if(pShell->GetCurrentFunction().is())
{
FunctionReference xEmpty;
if (pShell->GetOldFunction() == pShell->GetCurrentFunction())
pShell->SetOldFunction(xEmpty);
pShell->GetCurrentFunction()->Deactivate();
pShell->SetCurrentFunction(xEmpty);
}
switch(rRequest.GetSlot())
{
case SID_OBJECT_SELECT:
pShell->SetCurrentFunction( SelectionFunction::Create(mrSlideSorter, rRequest) );
rRequest.Done();
break;
default:
break;
}
if(pShell->GetOldFunction().is())
{
pShell->GetOldFunction()->Deactivate();
FunctionReference xEmpty;
pShell->SetOldFunction(xEmpty);
}
if(pShell->GetCurrentFunction().is())
{
pShell->GetCurrentFunction()->Activate();
pShell->SetOldFunction(pShell->GetCurrentFunction());
}
//! das ist nur bis das ENUM-Slots sind
// Invalidate( SID_OBJECT_SELECT );
}
void SlotManager::FuSupport (SfxRequest& rRequest)
{
switch (rRequest.GetSlot())
{
case SID_STYLE_FAMILY:
if (rRequest.GetArgs() != NULL)
{
SdDrawDocument* pDocument
= mrSlideSorter.GetModel().GetDocument();
if (pDocument != NULL)
{
const SfxPoolItem& rItem (
rRequest.GetArgs()->Get(SID_STYLE_FAMILY));
pDocument->GetDocSh()->SetStyleFamily(
static_cast<const SfxUInt16Item&>(rItem).GetValue());
}
}
break;
case SID_PASTE:
{
SdTransferable* pTransferClip = SD_MOD()->pTransferClip;
if( pTransferClip )
{
SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell();
DrawDocShell* pDocShell = dynamic_cast<DrawDocShell*>(pTransferDocShell);
if (pDocShell && pDocShell->GetDoc()->GetPageCount() > 1)
{
mrSlideSorter.GetController().GetClipboard().HandleSlotCall(rRequest);
break;
}
}
ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
if (pBase != NULL)
{
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
if (pDrawViewShell.get() != NULL)
pDrawViewShell->FuSupport(rRequest);
}
}
break;
case SID_CUT:
case SID_COPY:
case SID_DELETE:
mrSlideSorter.GetController().GetClipboard().HandleSlotCall(rRequest);
break;
case SID_DRAWINGMODE:
case SID_NOTESMODE:
case SID_HANDOUTMODE:
case SID_DIAMODE:
case SID_OUTLINEMODE:
{
ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
if (pBase != NULL)
{
framework::FrameworkHelper::Instance(*pBase)->HandleModeChangeSlot(
rRequest.GetSlot(), rRequest);
rRequest.Done();
}
break;
}
case SID_UNDO :
{
SlideSorterViewShell* pViewShell
= dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell());
if (pViewShell != NULL)
pViewShell->ImpSidUndo (FALSE, rRequest);
break;
}
case SID_REDO :
{
SlideSorterViewShell* pViewShell
= dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell());
if (pViewShell != NULL)
pViewShell->ImpSidRedo (FALSE, rRequest);
break;
}
default:
break;
}
}
void SlotManager::ExecCtrl (SfxRequest& rRequest)
{
ViewShell* pViewShell = mrSlideSorter.GetViewShell();
USHORT nSlot = rRequest.GetSlot();
switch (nSlot)
{
case SID_RELOAD:
{
// Undo-Manager leeren
mrSlideSorter.GetModel().GetDocument()->GetDocSh()->ClearUndoBuffer();
// Normale Weiterleitung an ViewFrame zur Ausfuehrung
if (pViewShell != NULL)
pViewShell->GetViewFrame()->ExecuteSlot(rRequest);
// Muss sofort beendet werden
return;
}
case SID_OUTPUT_QUALITY_COLOR:
case SID_OUTPUT_QUALITY_GRAYSCALE:
case SID_OUTPUT_QUALITY_BLACKWHITE:
case SID_OUTPUT_QUALITY_CONTRAST:
{
// flush page cache
if (pViewShell != NULL)
pViewShell->ExecReq (rRequest);
break;
}
case SID_MAIL_SCROLLBODY_PAGEDOWN:
{
if (pViewShell != NULL)
pViewShell->ExecReq (rRequest);
break;
}
case SID_OPT_LOCALE_CHANGED:
{
mrSlideSorter.GetController().UpdateAllPages();
if (pViewShell != NULL)
pViewShell->UpdatePreview (pViewShell->GetActualPage());
rRequest.Done();
break;
}
case SID_SEARCH_DLG:
// We have to handle the SID_SEARCH_DLG slot explicitly because
// in some cases (when the slide sorter is displayed in the
// center pane) we want to disable the search dialog. Therefore
// we have to handle the execution of that slot as well.
// We try to do that by forwarding the request to the view frame
// of the view shell.
if (pViewShell != NULL)
pViewShell->GetViewFrame()->ExecuteSlot(rRequest);
break;
default:
break;
}
}
void SlotManager::GetAttrState (SfxItemSet& rSet)
{
// Iteratate over all items.
SfxWhichIter aIter (rSet);
USHORT nWhich = aIter.FirstWhich();
while (nWhich)
{
USHORT nSlotId (nWhich);
if (SfxItemPool::IsWhich(nWhich) && mrSlideSorter.GetViewShell()!=NULL)
nSlotId = mrSlideSorter.GetViewShell()->GetPool().GetSlotId(nWhich);
switch (nSlotId)
{
case SID_PAGES_PER_ROW:
rSet.Put (
SfxUInt16Item (
nSlotId,
(USHORT)mrSlideSorter.GetView().GetLayouter().GetColumnCount()
)
);
break;
}
nWhich = aIter.NextWhich();
}
}
void SlotManager::GetMenuState ( SfxItemSet& rSet)
{
EditMode eEditMode = mrSlideSorter.GetModel().GetEditMode();
ViewShell* pShell = mrSlideSorter.GetViewShell();
DrawDocShell* pDocShell = mrSlideSorter.GetModel().GetDocument()->GetDocSh();
if (pShell!=NULL && pShell->GetCurrentFunction().is())
{
USHORT nSId = pShell->GetCurrentFunction()->GetSlotID();
rSet.Put( SfxBoolItem( nSId, TRUE ) );
}
rSet.Put( SfxBoolItem( SID_DRAWINGMODE, FALSE ) );
rSet.Put( SfxBoolItem( SID_DIAMODE, TRUE ) );
rSet.Put( SfxBoolItem( SID_OUTLINEMODE, FALSE ) );
rSet.Put( SfxBoolItem( SID_NOTESMODE, FALSE ) );
rSet.Put( SfxBoolItem( SID_HANDOUTMODE, FALSE ) );
// Vorlagenkatalog darf nicht aufgerufen werden
rSet.DisableItem(SID_STYLE_CATALOG);
if (pShell!=NULL && pShell->IsMainViewShell())
{
rSet.DisableItem(SID_SPELL_DIALOG);
rSet.DisableItem(SID_SEARCH_DLG);
}
if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_EXPAND_PAGE))
{
bool bDisable = true;
if (eEditMode == EM_PAGE)
{
// At least one of the selected pages has to contain an outline
// presentation objects in order to enable the expand page menu
// entry.
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
while (aSelectedPages.HasMoreElements())
{
SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE);
if (pObj!=NULL && !pObj->IsEmptyPresObj())
bDisable = false;
}
}
if (bDisable)
rSet.DisableItem (SID_EXPAND_PAGE);
}
if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_SUMMARY_PAGE))
{
bool bDisable = true;
if (eEditMode == EM_PAGE)
{
// At least one of the selected pages has to contain a title
// presentation objects in order to enable the summary page menu
// entry.
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
while (aSelectedPages.HasMoreElements())
{
SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
SdrObject* pObj = pPage->GetPresObj(PRESOBJ_TITLE);
if (pObj!=NULL && !pObj->IsEmptyPresObj())
bDisable = false;
}
}
if (bDisable)
rSet.DisableItem (SID_SUMMARY_PAGE);
}
// Starten der Praesentation moeglich?
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PRESENTATION ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REHEARSE_TIMINGS ) )
{
BOOL bDisable = TRUE;
model::PageEnumeration aAllPages (
model::PageEnumerationProvider::CreateAllPagesEnumeration(mrSlideSorter.GetModel()));
while (aAllPages.HasMoreElements())
{
SdPage* pPage = aAllPages.GetNextElement()->GetPage();
if( !pPage->IsExcluded() )
bDisable = FALSE;
}
if( bDisable || pDocShell->IsPreview())
{
rSet.DisableItem( SID_PRESENTATION );
rSet.DisableItem( SID_REHEARSE_TIMINGS );
}
}
// Disable the rename slots when there are no or more than one slides/master
// pages selected.
if (rSet.GetItemState(SID_RENAMEPAGE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_RENAME_MASTER_PAGE) == SFX_ITEM_AVAILABLE)
{
if (mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount() != 1)
{
rSet.DisableItem(SID_RENAMEPAGE);
rSet.DisableItem(SID_RENAME_MASTER_PAGE);
}
}
if (rSet.GetItemState(SID_HIDE_SLIDE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_SHOW_SLIDE) == SFX_ITEM_AVAILABLE)
{
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
HideSlideFunction::ExclusionState eState (
HideSlideFunction::GetExclusionState(aSelectedPages));
switch (eState)
{
case HideSlideFunction::MIXED:
// Show both entries.
break;
case HideSlideFunction::EXCLUDED:
rSet.DisableItem(SID_HIDE_SLIDE);
break;
case HideSlideFunction::INCLUDED:
rSet.DisableItem(SID_SHOW_SLIDE);
break;
case HideSlideFunction::UNDEFINED:
rSet.DisableItem(SID_HIDE_SLIDE);
rSet.DisableItem(SID_SHOW_SLIDE);
break;
}
}
PageKind ePageKind = mrSlideSorter.GetModel().GetPageType();
if( (eEditMode == EM_MASTERPAGE) && (ePageKind != PK_HANDOUT ) )
{
rSet.DisableItem(SID_ASSIGN_LAYOUT);
}
if( (eEditMode == EM_MASTERPAGE) || (ePageKind==PK_NOTES) )
{
rSet.DisableItem(SID_INSERTPAGE);
}
}
void SlotManager::GetClipboardState ( SfxItemSet& rSet)
{
SdTransferable* pTransferClip = SD_MOD()->pTransferClip;
if (rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE)
{
// Keine eigenen Clipboard-Daten?
if ( !pTransferClip || !pTransferClip->GetDocShell() )
{
rSet.DisableItem(SID_PASTE);
rSet.DisableItem(SID_PASTE_SPECIAL);
}
else
{
SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell();
if( !pTransferDocShell || ( (DrawDocShell*) pTransferDocShell)->GetDoc()->GetPageCount() <= 1 )
{
bool bIsPastingSupported (false);
// No or just one page. Check if there is anything that can be
// pasted via a DrawViewShell.
ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
if (pBase != NULL)
{
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
if (pDrawViewShell.get() != NULL)
{
TransferableDataHelper aDataHelper (
TransferableDataHelper::CreateFromSystemClipboard(
pDrawViewShell->GetActiveWindow()));
if (aDataHelper.GetFormatCount() > 0)
bIsPastingSupported = true;
}
}
if ( ! bIsPastingSupported)
{
rSet.DisableItem(SID_PASTE);
rSet.DisableItem(SID_PASTE_SPECIAL);
}
}
}
}
// Cut, copy and paste of master pages is not yet implemented properly
if (rSet.GetItemState(SID_COPY) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_CUT) == SFX_ITEM_AVAILABLE)
{
if (mrSlideSorter.GetModel().GetEditMode() == EM_MASTERPAGE)
{
if (rSet.GetItemState(SID_CUT) == SFX_ITEM_AVAILABLE)
rSet.DisableItem(SID_CUT);
if (rSet.GetItemState(SID_COPY) == SFX_ITEM_AVAILABLE)
rSet.DisableItem(SID_COPY);
if (rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE)
rSet.DisableItem(SID_PASTE);
if (rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE)
rSet.DisableItem(SID_PASTE_SPECIAL);
}
}
// Cut, copy, and delete page are disabled when there is no selection.
if (rSet.GetItemState(SID_CUT) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_COPY) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_DELETE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_DELETE_PAGE) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_DELETE_MASTER_PAGE) == SFX_ITEM_AVAILABLE)
{
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
// For copy to work we have to have at least one selected page.
if ( ! aSelectedPages.HasMoreElements())
rSet.DisableItem(SID_COPY);
bool bDisable = false;
// The operations that lead to the deletion of a page are valid if
// a) there is at least one selected page
// b) deleting the selected pages leaves at least one page in the
// document
// c) selected master pages must not be used by slides.
// Test a).
if ( ! aSelectedPages.HasMoreElements())
bDisable = true;
// Test b): Count the number of selected pages. It has to be less
// than the number of all pages.
else if (mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount()
>= mrSlideSorter.GetController().GetPageSelector().GetPageCount())
bDisable = true;
// Test c): Iterate over the selected pages and look for a master
// page that is used by at least one page.
else while (aSelectedPages.HasMoreElements())
{
SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
int nUseCount (mrSlideSorter.GetModel().GetDocument()
->GetMasterPageUserCount(pPage));
if (nUseCount > 0)
{
bDisable = true;
break;
}
}
if (bDisable)
{
rSet.DisableItem(SID_CUT);
rSet.DisableItem(SID_DELETE_PAGE);
rSet.DisableItem(SID_DELETE_MASTER_PAGE);
}
}
}
void SlotManager::GetStatusBarState (SfxItemSet& rSet)
{
// Seitenanzeige und Layout
/*
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_PAGE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_LAYOUT ) )
*/
SdPage* pPage = NULL;
SdPage* pFirstPage = NULL;
USHORT nFirstPage;
USHORT nSelectedPages = (USHORT)mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
String aPageStr;
String aLayoutStr;
if (nSelectedPages > 0)
aPageStr = String(SdResId(STR_SD_PAGE));
if (nSelectedPages == 1)
{
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
pPage = aSelectedPages.GetNextElement()->GetPage();
nFirstPage = pPage->GetPageNum()/2;
pFirstPage = pPage;
aPageStr += sal_Unicode(' ');
aPageStr += String::CreateFromInt32( nFirstPage + 1 );
aPageStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " / " ));
aPageStr += String::CreateFromInt32(
mrSlideSorter.GetModel().GetPageCount());
aLayoutStr = pFirstPage->GetLayoutName();
aLayoutStr.Erase( aLayoutStr.SearchAscii( SD_LT_SEPARATOR ) );
}
rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
2008-10-29 11:47:54 +00:00
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_ZOOMSLIDER ) )
{
rSet.Put( SfxVoidItem( SID_ATTR_ZOOMSLIDER ) );
}
}
void SlotManager::ShowSlideShow( SfxRequest& rReq)
{
Reference< XPresentation2 > xPresentation( mrSlideSorter.GetModel().GetDocument()->getPresentation() );
if( xPresentation.is() )
{
if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
xPresentation->start();
else
xPresentation->rehearseTimings();
}
}
void SlotManager::RenameSlide (void)
{
PageKind ePageKind = mrSlideSorter.GetModel().GetPageType();
View* pDrView = &mrSlideSorter.GetView();
if (ePageKind==PK_STANDARD || ePageKind==PK_NOTES)
{
if ( pDrView->IsTextEdit() )
{
pDrView->SdrEndTextEdit();
}
SdPage* pSelectedPage = NULL;
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
if (aSelectedPages.HasMoreElements())
pSelectedPage = aSelectedPages.GetNextElement()->GetPage();
if (pSelectedPage != NULL)
{
String aTitle( SdResId( STR_TITLE_RENAMESLIDE ) );
String aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
String aPageName = pSelectedPage->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog(
mrSlideSorter.GetActiveWindow(),
aPageName, aDescr);
DBG_ASSERT(aNameDlg, "Dialogdiet fail!");
aNameDlg->SetText( aTitle );
aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true );
aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
if( aNameDlg->Execute() == RET_OK )
{
String aNewName;
aNameDlg->GetName( aNewName );
if( ! aNewName.Equals( aPageName ) )
{
#ifdef DBG_UTIL
bool bResult =
#endif
RenameSlideFromDrawViewShell(
pSelectedPage->GetPageNum()/2, aNewName );
DBG_ASSERT( bResult, "Couldn't rename slide" );
}
}
delete aNameDlg;
// Tell the slide sorter about the name change (necessary for
// accessibility.)
mrSlideSorter.GetController().PageNameHasChanged(
(pSelectedPage->GetPageNum()-1)/2, aPageName);
}
}
}
IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
{
if( ! pDialog )
return 0;
String aNewName;
pDialog->GetName( aNewName );
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
SdPage* pCurrentPage = NULL;
if (pDescriptor.get() != NULL)
pCurrentPage = pDescriptor->GetPage();
return ( (pCurrentPage!=NULL && aNewName.Equals( pCurrentPage->GetName() ))
|| (mrSlideSorter.GetViewShell()
&& mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) ));
}
bool SlotManager::RenameSlideFromDrawViewShell( USHORT nPageId, const String & rName )
{
BOOL bOutDummy;
SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
if( pDocument->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND )
return false;
SdPage* pPageToRename = NULL;
PageKind ePageKind = mrSlideSorter.GetModel().GetPageType();
SfxUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
if( mrSlideSorter.GetModel().GetEditMode() == EM_PAGE )
{
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
if (pDescriptor.get() != NULL)
pPageToRename = pDescriptor->GetPage();
if (pPageToRename != NULL)
{
// Undo
SdPage* pUndoPage = pPageToRename;
SdrLayerAdmin & rLayerAdmin = pDocument->GetLayerAdmin();
BYTE nBackground = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), FALSE );
BYTE nBgObj = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), FALSE );
SetOfByte aVisibleLayers = pPageToRename->TRG_GetMasterPageVisibleLayers();
// (#67720#)
ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
pManager, pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(),
aVisibleLayers.IsSet( nBackground ),
aVisibleLayers.IsSet( nBgObj ));
pManager->AddUndoAction( pAction );
// rename
pPageToRename->SetName( rName );
if( ePageKind == PK_STANDARD )
{
// also rename notes-page
SdPage* pNotesPage = pDocument->GetSdPage( nPageId, PK_NOTES );
if (pNotesPage != NULL)
pNotesPage->SetName (rName);
}
}
}
else
{
// rename MasterPage -> rename LayoutTemplate
pPageToRename = pDocument->GetMasterSdPage( nPageId, ePageKind );
if (pPageToRename != NULL)
{
const String aOldLayoutName( pPageToRename->GetLayoutName() );
pManager->AddUndoAction( new RenameLayoutTemplateUndoAction( pDocument, aOldLayoutName, rName ) );
pDocument->RenameLayoutTemplate( aOldLayoutName, rName );
}
}
bool bSuccess = pPageToRename!=NULL && ( FALSE != rName.Equals( pPageToRename->GetName()));
if( bSuccess )
{
// user edited page names may be changed by the page so update control
// aTabControl.SetPageText( nPageId, rName );
// set document to modified state
pDocument->SetChanged( TRUE );
// inform navigator about change
SfxBoolItem aItem( SID_NAVIGATOR_INIT, TRUE );
if (mrSlideSorter.GetViewShell() != NULL)
mrSlideSorter.GetViewShell()->GetDispatcher()->Execute(
SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
}
return bSuccess;
}
/** Insert a slide. The insertion position depends on a) the selection and
b) the mouse position when there is no selection.
When there is a selection then insertion takes place after the last
slide of the selection. For this to work all but the last selected
slide are deselected first.
Otherwise, when there is no selection but the insertion marker is visible
the slide is inserted at that position. The slide before that marker is
selected first.
When both the selection and the insertion marker are not visible--can
that happen?--the new slide is inserted after the last slide.
*/
void SlotManager::InsertSlide (SfxRequest& rRequest)
{
PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
// The fallback insertion position is after the last slide.
sal_Int32 nInsertionIndex (rSelector.GetPageCount() - 1);
if (rSelector.GetSelectedPageCount() > 0)
{
// Deselect all but the last selected slide.
bool bLastSelectedSlideSeen (false);
for (int nIndex=rSelector.GetPageCount()-1; nIndex>=0; --nIndex)
{
if (rSelector.IsPageSelected(nIndex))
CWS-TOOLING: integrate CWS cmcfixes51 2008-12-08 10:12:55 +0100 cmc r264975 : #i96203# protect with ifdefs to avoid unused symbol on mac 2008-12-05 12:23:47 +0100 cmc r264898 : CWS-TOOLING: rebase CWS cmcfixes51 to trunk@264807 (milestone: DEV300:m37) 2008-12-01 14:45:17 +0100 cmc r264606 : #i76655# ehlos apparently required 2008-11-28 17:49:30 +0100 cmc r264567 : #i96655# remove newly unused method 2008-11-28 10:41:28 +0100 cmc r264531 : #i96647# better ppc-bridges flushCode impl 2008-11-27 12:58:40 +0100 cmc r264478 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:32:49 +0100 cmc r264476 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:26:02 +0100 cmc r264475 : #i96655# redundant old table export helpers 2008-11-27 11:49:06 +0100 cmc r264473 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:38:35 +0100 cmc r264471 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:14:21 +0100 cmc r264467 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:06:22 +0100 cmc r264464 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:58:18 +0100 cmc r264462 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:41:44 +0100 cmc r264461 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:19:24 +0100 cmc r264460 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:13:39 +0100 cmc r264459 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:06:14 +0100 cmc r264458 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:59:54 +0100 cmc r264457 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:52:51 +0100 cmc r264456 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:48:26 +0100 cmc r264454 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:40:20 +0100 cmc r264452 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:35:26 +0100 cmc r264451 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:31:00 +0100 cmc r264450 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:24:08 +0100 cmc r264449 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:26:15 +0100 cmc r264443 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:21:01 +0100 cmc r264442 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:09:40 +0100 cmc r264441 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:51:56 +0100 cmc r264440 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:49:09 +0100 cmc r264439 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:09:54 +0100 cmc r264432 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:07:40 +0100 cmc r264431 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:28:02 +0100 cmc r264429 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:27:39 +0100 cmc r264428 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:18:36 +0100 cmc r264426 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 16:22:16 +0100 cmc r264415 : #i96624# make implicit braces and brackets explicit to avoid warnings 2008-11-26 16:00:23 +0100 cmc r264409 : #i90426# remove warnings from svtools 2008-11-26 15:59:17 +0100 cmc r264408 : #i90426# remove warnings 2008-11-26 15:47:32 +0100 cmc r264404 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:46:57 +0100 cmc r264394 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:19:50 +0100 cmc r264387 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:15:26 +0100 cmc r264386 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:11:26 +0100 cmc r264384 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:44:23 +0100 cmc r264380 : #i96084# comfirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:12:24 +0100 cmc r264372 : #i96604# silence new warnings 2008-11-26 12:35:02 +0100 cmc r264369 : #i96203# make qstarter work in 3-layer land 2008-11-26 12:33:04 +0100 cmc r264368 : #i96170# ensure gtypes are up and running
2008-12-11 07:05:03 +00:00
{
if (bLastSelectedSlideSeen)
rSelector.DeselectPage (nIndex);
else
{
nInsertionIndex = nIndex;
bLastSelectedSlideSeen = true;
}
CWS-TOOLING: integrate CWS cmcfixes51 2008-12-08 10:12:55 +0100 cmc r264975 : #i96203# protect with ifdefs to avoid unused symbol on mac 2008-12-05 12:23:47 +0100 cmc r264898 : CWS-TOOLING: rebase CWS cmcfixes51 to trunk@264807 (milestone: DEV300:m37) 2008-12-01 14:45:17 +0100 cmc r264606 : #i76655# ehlos apparently required 2008-11-28 17:49:30 +0100 cmc r264567 : #i96655# remove newly unused method 2008-11-28 10:41:28 +0100 cmc r264531 : #i96647# better ppc-bridges flushCode impl 2008-11-27 12:58:40 +0100 cmc r264478 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:32:49 +0100 cmc r264476 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:26:02 +0100 cmc r264475 : #i96655# redundant old table export helpers 2008-11-27 11:49:06 +0100 cmc r264473 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:38:35 +0100 cmc r264471 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:14:21 +0100 cmc r264467 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:06:22 +0100 cmc r264464 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:58:18 +0100 cmc r264462 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:41:44 +0100 cmc r264461 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:19:24 +0100 cmc r264460 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:13:39 +0100 cmc r264459 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:06:14 +0100 cmc r264458 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:59:54 +0100 cmc r264457 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:52:51 +0100 cmc r264456 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:48:26 +0100 cmc r264454 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:40:20 +0100 cmc r264452 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:35:26 +0100 cmc r264451 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:31:00 +0100 cmc r264450 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:24:08 +0100 cmc r264449 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:26:15 +0100 cmc r264443 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:21:01 +0100 cmc r264442 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:09:40 +0100 cmc r264441 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:51:56 +0100 cmc r264440 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:49:09 +0100 cmc r264439 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:09:54 +0100 cmc r264432 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:07:40 +0100 cmc r264431 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:28:02 +0100 cmc r264429 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:27:39 +0100 cmc r264428 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:18:36 +0100 cmc r264426 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 16:22:16 +0100 cmc r264415 : #i96624# make implicit braces and brackets explicit to avoid warnings 2008-11-26 16:00:23 +0100 cmc r264409 : #i90426# remove warnings from svtools 2008-11-26 15:59:17 +0100 cmc r264408 : #i90426# remove warnings 2008-11-26 15:47:32 +0100 cmc r264404 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:46:57 +0100 cmc r264394 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:19:50 +0100 cmc r264387 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:15:26 +0100 cmc r264386 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:11:26 +0100 cmc r264384 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:44:23 +0100 cmc r264380 : #i96084# comfirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:12:24 +0100 cmc r264372 : #i96604# silence new warnings 2008-11-26 12:35:02 +0100 cmc r264369 : #i96203# make qstarter work in 3-layer land 2008-11-26 12:33:04 +0100 cmc r264368 : #i96170# ensure gtypes are up and running
2008-12-11 07:05:03 +00:00
}
}
}
// No selection. Is there an insertion indicator?
else if (mrSlideSorter.GetView().GetOverlay()
CWS-TOOLING: integrate CWS aw065 2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation 2009-06-16 15:45:28 +0200 wg r273021 : i102838 2009-06-16 12:46:07 +0200 wg r273016 : i102833 2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper 2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected 2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added 2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added 2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect 2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition 2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct) 2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync 2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync 2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync 2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49) 2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives 2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged() 2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition 2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping 2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping 2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped 2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped 2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped 2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped 2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state 2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state 2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state 2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state 2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state 2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state 2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications 2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications 2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications 2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications 2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications 2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications 2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications 2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds 2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling 2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications 2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications 2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications 2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations 2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked 2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared 2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes 2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes 2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH 2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH 2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH 2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync 2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync 2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47) 2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed 2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done 2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done 2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done 2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done 2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected 2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected 2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected 2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected 2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done 2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done 2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done 2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done 2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done 2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done 2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done 2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done 2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done 2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping 2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes 2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes 2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes 2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change 2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
.GetInsertionIndicatorOverlay().isVisible())
{
// Select the page before the insertion indicator.
nInsertionIndex = mrSlideSorter.GetView().GetOverlay()
.GetInsertionIndicatorOverlay().GetInsertionPageIndex();
nInsertionIndex --;
rSelector.SelectPage (nInsertionIndex);
}
CWS-TOOLING: integrate CWS impress178 2009-10-16 19:54:41 +0200 sj r276995 : removed warning 2009-10-16 17:46:12 +0200 sj r276993 : #i103757# applied patch (fixed crash if model changes) 2009-10-16 16:06:07 +0200 sj r276985 : CWS-TOOLING: rebase CWS impress178 to branches/OOO320@276942 (milestone: OOO320:m2) 2009-10-08 13:51:23 +0200 sj r276790 : #i105654# fixed closing of line geometry 2009-10-07 17:26:56 +0200 sj r276762 : #i105606# fixed object shadow 2009-10-07 17:25:39 +0200 sj r276761 : minor improvements 2009-10-07 11:48:26 +0200 af r276745 : #i103047# Prevent context menu of LayoutMenu from being shown when user clicks on background. 2009-10-07 11:33:59 +0200 af r276743 : #i99866# Set position of the design control manually. 2009-10-06 17:18:23 +0200 sj r276721 : minor improvements 2009-10-05 18:34:23 +0200 sj r276692 : #105606# fixed fontsize problem 2009-10-05 17:26:21 +0200 af r276691 : #i105354# Never process more than one request in a row. 2009-10-02 13:24:25 +0200 af r276639 : #i94242# Taking insertion position of slide sorter correctly into account. 2009-10-01 13:46:47 +0200 aw r276602 : #i102224# some Polygon/PolyPolygon usages in SVMConverter ignored the possible curve status of tools::Polygon; added at least an AdaptiveSubdivide 2009-10-01 12:33:56 +0200 aw r276588 : #i102224# ImplWritePolyPolygon killed the curve information at the PolyPolygon by NOT copying the flags 2009-09-30 17:48:56 +0200 aw r276567 : #i102224# removed GetSimple() from Polygon and PolyPolygon, replaced completely with AdaptiveSubdivide 2009-09-30 15:45:46 +0200 aw r276559 : #i102048# secured primitive creation for dimension lines with linestyle none 2009-09-30 14:56:41 +0200 af r276556 : #i105471# Reordered statements in ~SdModule. 2009-09-30 14:47:12 +0200 aw r276555 : #i105373# corrected curve ignoring places in MetaFile export
2009-10-27 15:01:25 +00:00
// Is there a stored insertion position?
else if (mrSlideSorter.GetController().GetSelectionManager()->GetInsertionPosition() >= 0)
{
nInsertionIndex
= mrSlideSorter.GetController().GetSelectionManager()->GetInsertionPosition() - 1;
rSelector.SelectPage(nInsertionIndex);
}
// Select the last page when there is at least one page.
else if (rSelector.GetPageCount() > 0)
{
nInsertionIndex = rSelector.GetPageCount() - 1;
rSelector.SelectPage (nInsertionIndex);
}
// Hope for the best that CreateOrDuplicatePage() can cope with an empty
// selection.
else
{
nInsertionIndex = -1;
}
USHORT nPageCount ((USHORT)mrSlideSorter.GetModel().GetPageCount());
rSelector.DisableBroadcasting();
// In order for SlideSorterController::GetActualPage() to select the
// selected page as current page we have to turn off the focus
// temporarily.
{
FocusManager::FocusHider aTemporaryFocusHider (
mrSlideSorter.GetController().GetFocusManager());
SdPage* pPreviousPage = NULL;
if (nInsertionIndex >= 0)
pPreviousPage = mrSlideSorter.GetModel()
.GetPageDescriptor(nInsertionIndex)->GetPage();
if (mrSlideSorter.GetModel().GetEditMode() == EM_PAGE)
{
SlideSorterViewShell* pShell = dynamic_cast<SlideSorterViewShell*>(
mrSlideSorter.GetViewShell());
if (pShell != NULL)
{
pShell->CreateOrDuplicatePage (
rRequest,
mrSlideSorter.GetModel().GetPageType(),
pPreviousPage);
}
}
else
{
// Use the API to create a new page.
SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
pDocument->getUnoModel(), UNO_QUERY);
if (xMasterPagesSupplier.is())
{
Reference<drawing::XDrawPages> xMasterPages (
xMasterPagesSupplier->getMasterPages());
if (xMasterPages.is())
{
xMasterPages->insertNewByIndex (nInsertionIndex+1);
// Create shapes for the default layout.
SdPage* pMasterPage = pDocument->GetMasterSdPage(
(USHORT)(nInsertionIndex+1), PK_STANDARD);
pMasterPage->CreateTitleAndLayout (TRUE,TRUE);
}
}
}
}
// When a new page has been inserted then select it and make it the
// current page.
mrSlideSorter.GetView().LockRedraw(TRUE);
if (mrSlideSorter.GetModel().GetPageCount() > nPageCount)
{
nInsertionIndex++;
model::SharedPageDescriptor pDescriptor = mrSlideSorter.GetModel().GetPageDescriptor(nInsertionIndex);
if (pDescriptor.get() != NULL)
mrSlideSorter.GetController().GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
}
rSelector.EnableBroadcasting();
mrSlideSorter.GetView().LockRedraw(FALSE);
}
void SlotManager::ExecuteCommandAsynchronously (::std::auto_ptr<Command> pCommand)
{
// Ownership of command is (implicitely) transferred to the queue.
maCommandQueue.push(pCommand.get());
pCommand.release();
Application::PostUserEvent(LINK(this,SlotManager,UserEventCallback));
}
IMPL_LINK(SlotManager, UserEventCallback, void*, EMPTYARG)
{
if ( ! maCommandQueue.empty())
{
Command* pCommand = maCommandQueue.front();
maCommandQueue.pop();
if (pCommand != NULL)
{
// The queue ownes the command that has just been removed from
// it. Therefore it is deleted after it has been executed.
(*pCommand)();
delete pCommand;
}
}
return 1;
}
} } } // end of namespace ::sd::slidesorter::controller