From 2540371688363897d184e248f6f84396b1ca6ff9 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 21 Jan 2009 14:22:27 +0000 Subject: CWS-TOOLING: integrate CWS sjfixes10 2009-01-15 14:02:24 +0100 af r266369 : #i88851# Finding the right font size is now an iterative process. 2009-01-15 11:01:59 +0100 wg r266354 : i97985 2009-01-15 10:57:33 +0100 wg r266353 : i97985 2009-01-15 10:48:53 +0100 wg r266347 : i97985 2009-01-15 10:48:23 +0100 wg r266346 : i97985 2009-01-15 10:46:47 +0100 wg r266345 : i97985 2009-01-15 10:45:43 +0100 wg r266344 : i97985 2009-01-15 10:45:14 +0100 wg r266343 : i97985 2009-01-15 10:44:38 +0100 wg r266342 : i97985 2009-01-15 10:43:56 +0100 wg r266341 : i97985 2009-01-15 10:42:50 +0100 wg r266340 : i97985 2009-01-15 10:41:40 +0100 wg r266339 : i97985 2009-01-15 10:39:46 +0100 wg r266337 : i97985 2009-01-15 10:00:09 +0100 hde r266336 : i98065 2009-01-13 15:48:20 +0100 wg r266232 : i97985 2009-01-13 13:22:05 +0100 wg r266217 : i97985 2009-01-13 12:34:05 +0100 wg r266210 : i97985 2009-01-13 12:30:56 +0100 wg r266209 : i97985 2009-01-13 12:26:56 +0100 wg r266208 : i97985 2009-01-12 15:58:06 +0100 wg r266165 : i97985 2009-01-12 15:43:24 +0100 wg r266163 : i97985 2009-01-08 16:21:47 +0100 sj r266023 : fixed warning 2009-01-08 15:33:34 +0100 sj r266017 : fixed warning 2009-01-06 18:13:42 +0100 sj r265935 : CWS-TOOLING: rebase CWS sjfixes10 to trunk@265758 (milestone: DEV300:m38) 2008-12-10 16:54:02 +0100 af r265206 : #i43354# Do not delete all unused master pages automatically. 2008-12-04 13:12:50 +0100 af r264836 : #i92795# Use BitmapEx for icons to allow transparency. 2008-12-02 17:01:49 +0100 af r264723 : #i93082# Fixed SID_INSERTPAGE_LAYOUT_MENU. 2008-11-28 14:37:28 +0100 af r264555 : #i88851# Changed association of Ctrl-'?' to views. 2008-11-28 11:38:52 +0100 af r264535 : #i96681# Set version to 1.0.2 2008-11-28 11:30:04 +0100 af r264533 : #i88851# Ctrl-1,2,3 switch to slide overview, notes, normal view. 2008-11-27 16:41:25 +0100 af r264505 : #i92144# Removed unused code. 2008-11-26 15:29:56 +0100 af r264401 : #i92574# Do not lock configuration controller when main pane is not available. 2008-11-21 10:13:40 +0100 sj r264112 : #i96146# applied patch (ambiguous && ||) 2008-11-20 20:12:06 +0100 sj r264097 : #i96083# applied patch (ambigous && ||) 2008-11-20 19:13:53 +0100 sj r264096 : #i96163# applied patch (ambigous && ||) 2008-11-20 18:39:10 +0100 sj r264093 : #i96165# applied patch (ambigous && ||) 2008-11-03 18:12:29 +0100 sj r263303 : #i93996# fixed word wrapping problem 2008-11-03 18:11:02 +0100 sj r263302 : #i93996# fixed word wrapping problem 2008-11-03 18:08:41 +0100 sj r263301 : #i93996# fixed word wrapping problem 2008-11-03 18:06:45 +0100 sj r263300 : #i93996# fixed word wrapping problem 2008-11-03 18:05:00 +0100 sj r263299 : #i94831,i93616# fixed crash when importing diagonal cell border lines, fixed table import 2008-11-03 18:00:43 +0100 sj r263298 : #i93718# spellchecking is no longer triggering the autolayout of connector objects --- sdext/source/minimizer/optimizerdialog.cxx | 2 +- .../source/presenter/PresenterBitmapContainer.cxx | 27 -- .../source/presenter/PresenterBitmapContainer.hxx | 6 - sdext/source/presenter/PresenterCanvasHelper.cxx | 69 ---- sdext/source/presenter/PresenterCanvasHelper.hxx | 15 - sdext/source/presenter/PresenterControlCreator.cxx | 356 --------------------- sdext/source/presenter/PresenterControlCreator.hxx | 119 ------- sdext/source/presenter/PresenterController.cxx | 60 +++- sdext/source/presenter/PresenterController.hxx | 13 +- sdext/source/presenter/PresenterGeometryHelper.cxx | 96 ------ sdext/source/presenter/PresenterGeometryHelper.hxx | 14 +- sdext/source/presenter/PresenterHelpView.cxx | 37 ++- sdext/source/presenter/PresenterHelper.cxx | 31 -- sdext/source/presenter/PresenterHelper.hxx | 12 - sdext/source/presenter/PresenterNotesView.cxx | 30 -- sdext/source/presenter/PresenterNotesView.hxx | 2 - .../presenter/PresenterPaneBorderManager.cxx | 7 + .../presenter/PresenterPaneBorderManager.hxx | 8 + .../presenter/PresenterPaneBorderPainter.cxx | 30 -- sdext/source/presenter/PresenterPaneFactory.cxx | 4 + sdext/source/presenter/PresenterScreen.cxx | 68 +--- sdext/source/presenter/PresenterScreen.hxx | 8 - sdext/source/presenter/PresenterSlideSorter.cxx | 17 - sdext/source/presenter/PresenterSlideSorter.hxx | 1 - sdext/source/presenter/PresenterSprite.cxx | 21 -- sdext/source/presenter/PresenterSprite.hxx | 2 - sdext/source/presenter/PresenterSpritePane.cxx | 183 ----------- sdext/source/presenter/PresenterWindowManager.cxx | 8 - sdext/source/presenter/PresenterWindowManager.hxx | 1 - sdext/source/presenter/description.xml | 2 +- sdext/source/presenter/makefile.mk | 1 - .../Office/extension/PresenterScreen.xcu | 38 ++- 32 files changed, 150 insertions(+), 1138 deletions(-) delete mode 100644 sdext/source/presenter/PresenterControlCreator.cxx delete mode 100644 sdext/source/presenter/PresenterControlCreator.hxx (limited to 'sdext') diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx index eac4d6bd27bb..c1bd8646ff89 100644 --- a/sdext/source/minimizer/optimizerdialog.cxx +++ b/sdext/source/minimizer/optimizerdialog.cxx @@ -280,7 +280,7 @@ sal_Bool OptimizerDialog::execute() void OptimizerDialog::SwitchPage( sal_Int16 nNewStep ) { - if ( ( nNewStep != mnCurrentStep ) && ( nNewStep <= MAX_STEP ) || ( nNewStep >= 0 ) ) + if ( ( nNewStep != mnCurrentStep ) && ( ( nNewStep <= MAX_STEP ) || ( nNewStep >= 0 ) ) ) { sal_Int16 nOldStep = mnCurrentStep; if ( nNewStep == 0 ) diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx index 97748aed7ad4..76b82b3797cf 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -499,31 +499,4 @@ void PresenterBitmapContainer::BitmapDescriptor::SetBitmap ( -void PresenterBitmapContainer::BitmapDescriptor::Update ( - const Reference& rxDevice) -{ - if (mxNormalBitmap.is() && ! mxMouseOverBitmap.is()) - { - const geometry::IntegerSize2D aSize (mxNormalBitmap->getSize()); - Reference xHighlight(rxDevice->createCompatibleBitmap(aSize)); - if (xHighlight.is()) - { - Reference xHighlightCanvas (xHighlight, UNO_QUERY); - if (xHighlightCanvas.is()) - { - double aColor[] = {0,0,0,128}; - xHighlightCanvas->drawBitmapModulated( - mxNormalBitmap, - rendering::ViewState(geometry::AffineMatrix2D(1,0,0,0,1,0), NULL), - rendering::RenderState(geometry::AffineMatrix2D(1,0,0,0,1,0), NULL, - Sequence(aColor,4),rendering::CompositeOperation::SOURCE)); - mxMouseOverBitmap = xHighlight; - } - } - } -} - - - - } } // end of namespace ::sdext::presenter diff --git a/sdext/source/presenter/PresenterBitmapContainer.hxx b/sdext/source/presenter/PresenterBitmapContainer.hxx index d3d7297bc052..0cd873957790 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.hxx +++ b/sdext/source/presenter/PresenterBitmapContainer.hxx @@ -89,12 +89,6 @@ public: TexturingMode meHorizontalTexturingMode; TexturingMode meVerticalTexturingMode; - /** Fill in missing bitmaps by making mxNormalIcon lighter or - darker. - */ - void Update ( - const css::uno::Reference& rxDevice); - private: css::uno::Reference mxNormalBitmap; css::uno::Reference mxMouseOverBitmap; diff --git a/sdext/source/presenter/PresenterCanvasHelper.cxx b/sdext/source/presenter/PresenterCanvasHelper.cxx index 2915aae42ada..450e29b1b3c9 100644 --- a/sdext/source/presenter/PresenterCanvasHelper.cxx +++ b/sdext/source/presenter/PresenterCanvasHelper.cxx @@ -117,7 +117,6 @@ void PresenterCanvasHelper::PaintRectangle ( if (rpBitmap->meHorizontalTexturingMode == PresenterBitmapDescriptor::Repeat || rpBitmap->meVerticalTexturingMode == PresenterBitmapDescriptor::Repeat) { - // PaintTexture( PaintTiledBitmap( Reference(rpBitmap->GetNormalBitmap(), UNO_QUERY), rxCanvas, @@ -154,26 +153,6 @@ void PresenterCanvasHelper::PaintRectangle ( -void PresenterCanvasHelper::PaintRectangle ( - const SharedBitmapDescriptor& rpBitmap, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::awt::Rectangle& rOuterBoundingBox, - const css::awt::Rectangle& rContentBoundingBox) -{ - rendering::ViewState aViewState (geometry::AffineMatrix2D(1,0,0, 0,1,0),NULL); - rendering::RenderState aRenderState( - geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL, - Sequence(3), - rendering::CompositeOperation::SOURCE); - PaintRectangle(rpBitmap,rxCanvas,rRepaintBox,rOuterBoundingBox,rContentBoundingBox, - aViewState, aRenderState); -} - - - - void PresenterCanvasHelper::PaintTiledBitmap ( const css::uno::Reference& rxTexture, const css::uno::Reference& rxCanvas, @@ -230,54 +209,6 @@ void PresenterCanvasHelper::PaintTiledBitmap ( -void PresenterCanvasHelper::PaintTexture ( - const css::uno::Reference& rxTexture, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::uno::Reference& rxPolygon, - const css::rendering::ViewState& rDefaultViewState, - const css::rendering::RenderState& rDefaultRenderState) -{ - if ( ! rxCanvas.is() || ! rxCanvas->getDevice().is()) - return; - - if ( ! rxTexture.is()) - return; - - if ( ! rxPolygon.is()) - return; - - // Set the repaint box as clip rectangle at the view state. - rendering::ViewState aViewState (rDefaultViewState); - aViewState.Clip = PresenterGeometryHelper::CreatePolygon(rRepaintBox, rxCanvas->getDevice()); - - - // Setup the texture. - Sequence aTextures (1); - const geometry::IntegerSize2D aBitmapSize(rxTexture->getSize()); - aTextures[0] = rendering::Texture ( - geometry::AffineMatrix2D( - aBitmapSize.Width,0,0, - 0,aBitmapSize.Height,0), - 1, - 0, - rxTexture, - NULL, - NULL, - rendering::StrokeAttributes(), - rendering::TexturingMode::REPEAT, - rendering::TexturingMode::REPEAT); - - rxCanvas->fillTexturedPolyPolygon( - rxPolygon, - aViewState, - rDefaultRenderState, - aTextures); -} - - - - void PresenterCanvasHelper::PaintBitmap ( const css::uno::Reference& rxBitmap, const awt::Point& rLocation, diff --git a/sdext/source/presenter/PresenterCanvasHelper.hxx b/sdext/source/presenter/PresenterCanvasHelper.hxx index 2fae044bf1cd..90d4dec2deec 100644 --- a/sdext/source/presenter/PresenterCanvasHelper.hxx +++ b/sdext/source/presenter/PresenterCanvasHelper.hxx @@ -63,13 +63,6 @@ public: const css::awt::Rectangle& rBackgroundBoundingBox, const css::awt::Rectangle& rContentBoundingBox) const; - static void PaintRectangle ( - const SharedBitmapDescriptor& rpBitmap, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::awt::Rectangle& rBackgroundBoundingBox, - const css::awt::Rectangle& rContentBoundingBox); - static void PaintRectangle ( const SharedBitmapDescriptor& rpBitmap, const css::uno::Reference& rxCanvas, @@ -91,14 +84,6 @@ private: const css::rendering::ViewState maDefaultViewState; const css::rendering::RenderState maDefaultRenderState; - static void PaintTexture ( - const css::uno::Reference& rxTexture, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::uno::Reference& rxPolygon, - const css::rendering::ViewState& rDefaultViewState, - const css::rendering::RenderState& rDefaultRenderState); - static void PaintTiledBitmap ( const css::uno::Reference& rxTexture, const css::uno::Reference& rxCanvas, diff --git a/sdext/source/presenter/PresenterControlCreator.cxx b/sdext/source/presenter/PresenterControlCreator.cxx deleted file mode 100644 index 4050d5dca605..000000000000 --- a/sdext/source/presenter/PresenterControlCreator.cxx +++ /dev/null @@ -1,356 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PresenterControlCreator.cxx,v $ - * - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sdext.hxx" - -#include "PresenterControlCreator.hxx" -#include "PresenterHelper.hxx" -#include -#include -#include -#include -#include -#include - - - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using ::rtl::OUString; - -namespace sdext { namespace presenter { - -PresenterControlCreator::PresenterControlCreator ( - const Reference& rxContext, - const Reference& rxParentWindow, - const sal_Int32 nToolBarHeight) - : mxComponentContext(rxContext), - mxControlContainerWindow(), - mxControlContainer(), - mxModelNameContainer(), - mxControlFactory(), - mnControlCount(0), - mnToolBarHeight(nToolBarHeight) -{ - if (CreateContainer()) - CreateContainerWindow(rxParentWindow); -} - - - - -PresenterControlCreator::~PresenterControlCreator (void) -{ -} - - - - -sal_Int32 PresenterControlCreator::GetToolBarHeight (void) const -{ - return mnToolBarHeight; -} - - - - -Reference PresenterControlCreator::GetContainerWindow (void) const -{ - return mxControlContainerWindow; -} - - - - -Reference PresenterControlCreator::GetContainer (void) const -{ - return mxControlContainer; -} - - - - -bool PresenterControlCreator::CreateContainer (void) -{ - try - { - Reference xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - - mxControlContainer = Reference( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.UnoControlContainer"), - mxComponentContext), - UNO_QUERY_THROW); - - Reference xControlModel ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.UnoControlDialogModel"), - mxComponentContext), - UNO_QUERY_THROW); - mxModelNameContainer = Reference( - xControlModel, UNO_QUERY_THROW); - - Reference xControl (mxControlContainer, UNO_QUERY_THROW); - xControl->setModel(xControlModel); - - mxControlFactory = Reference( - xControlModel, UNO_QUERY_THROW); - - return true; - } - catch (RuntimeException&) - { - OSL_ASSERT(false); - } - - return false; -} - - - - -void PresenterControlCreator::CreateContainerWindow ( - const Reference& rxParentWindow) -{ - try - { - Reference xControl (mxControlContainer, UNO_QUERY_THROW); - Reference xContainerPeer (rxParentWindow, UNO_QUERY_THROW); - Reference xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - Reference xToolkit ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.Toolkit"), - mxComponentContext), - UNO_QUERY_THROW); - xControl->createPeer(xToolkit, xContainerPeer); - - mxControlContainerWindow = Reference(mxControlContainer, UNO_QUERY_THROW); - mxControlContainerWindow->setEnable(sal_True); - mxControlContainerWindow->setVisible(sal_True); - } - catch (RuntimeException&) - { - OSL_ASSERT(false); - } -} - - - - -Reference PresenterControlCreator::AddButton ( - const OUString& rsName, - const OUString& rsImageName, - const Property pUserProperties[]) -{ - Property aButtonDefaultProperties[] = { - {(sal_Char*)"PushButtonType", Any(awt::PushButtonType_STANDARD)}, - {NULL, Any()} - }; - Reference xControl( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlButton"), - aButtonDefaultProperties, - pUserProperties)); - if (xControl.is()) - { - Reference xButton (xControl, UNO_QUERY_THROW); - if (xButton.is()) - xButton->setActionCommand(rsName); - - - Reference xGraphic ( - PresenterHelper::GetGraphic(mxComponentContext, rsImageName)); - if (xGraphic.is()) - { - Property aButtonGraphicProperties[] = { - {(sal_Char*)"Graphic", Any(xGraphic)}, - {(sal_Char*)"Label", Any(OUString())}, - {NULL, Any()} - }; - SetModelProperties ( - Reference(xControl->getModel(), UNO_QUERY), - aButtonGraphicProperties); - } - } - - return xControl; -} - - - - -Reference PresenterControlCreator::AddLabel ( - const OUString& rsName, - const OUString& rsDefaultText, - const Property pUserProperties[]) -{ - Property aLabelDefaultProperties[] = { - {(sal_Char*)"Label", Any(rsDefaultText)}, - {(sal_Char*)"VerticalAlign", Any(style::VerticalAlignment_MIDDLE)}, - {NULL, Any()} - }; - Reference xLabel( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlFixedTextModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlFixedText"), - aLabelDefaultProperties, - pUserProperties)); - if (xLabel.is()) - { - Reference xText (xLabel, UNO_QUERY); - if (xText.is()) - xText->setAlignment(1); - } - return xLabel; -} - - - - -Reference PresenterControlCreator::AddEdit ( - const OUString& rsName, - const Property pUserProperties[]) -{ - Property aEditDefaultProperties[] = { - {NULL, Any()} - }; - Reference xControl( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlEdit"), - aEditDefaultProperties, - pUserProperties)); - return xControl; -} - - - - -Reference PresenterControlCreator::AddControl ( - const OUString& rsName, - const OUString& rsModelServiceName, - const OUString& rsControlServiceName, - const Property pControlDefaultProperties[], - const Property pUserProperties[]) -{ - Reference xControl; - Property aPropertyDefaults[] = { - {(sal_Char*)"Enabled", Any(sal_True)}, - {(sal_Char*)"Width", Any((sal_Int16)mnToolBarHeight)}, - {(sal_Char*)"Height", Any((sal_Int16)mnToolBarHeight)}, - {(sal_Char*)"Label", Any(rsName)}, - {(sal_Char*)"PositionX", Any((sal_Int32)0)}, - {(sal_Char*)"PositionY", Any((sal_Int16)0)}, - {(sal_Char*)"Step", Any((sal_Int16)0)}, - {(sal_Char*)"TabIndex", Any((sal_Int16)mnControlCount)}, - {(sal_Char*)"Name", Any(rsName)}, - {NULL, Any()} - }; - try - { - // Create the model for the control. - Reference xControlModel ( - mxControlFactory->createInstance(rsModelServiceName), - UNO_QUERY_THROW); - Reference xPropertySet (xControlModel, UNO_QUERY_THROW); - SetModelProperties(xPropertySet, aPropertyDefaults); - SetModelProperties(xPropertySet, pControlDefaultProperties); - SetModelProperties(xPropertySet, pUserProperties); - mxModelNameContainer->insertByName(rsName, Any(xControlModel)); - - // Create the control for the control. - Reference xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - xControl = Reference ( - xFactory->createInstanceWithContext(rsControlServiceName, mxComponentContext), - UNO_QUERY_THROW); - - // Combine model and control. - xControl->setModel(xControlModel); - - // Add the new control to the parent container. - mxControlContainer->addControl(rsName, xControl); - - Reference xWindow (xControl, UNO_QUERY_THROW); - xWindow->setEnable(sal_True); - xWindow->setVisible(sal_True); - - mnControlCount += 1; - } - catch (Exception& rException) - { - (void)rException; - OSL_TRACE("caught exception in PresenterControlCreator::AddControl()"); - } - - return xControl; -} - - - - -void PresenterControlCreator::SetModelProperties ( - const Reference& rxSet, - const Property pProperties[]) -{ - if ( ! rxSet.is()) - return; - if (pProperties == NULL) - return; - - for (sal_Int32 nIndex=0; pProperties[nIndex].msName!=NULL; ++nIndex) - { - try - { - rxSet->setPropertyValue( - OUString::createFromAscii(pProperties[nIndex].msName), - pProperties[nIndex].maValue); - } - catch (Exception& rException) - { - (void)rException; - OSL_TRACE("caught exception in PresenterControlCreator::SetModelProperties() for property %s", - pProperties[nIndex].msName); - } - } -} - - - - -} } // end of namespace ::sdext::presenter diff --git a/sdext/source/presenter/PresenterControlCreator.hxx b/sdext/source/presenter/PresenterControlCreator.hxx deleted file mode 100644 index 8602c1623f49..000000000000 --- a/sdext/source/presenter/PresenterControlCreator.hxx +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PresenterControlCreator.hxx,v $ - * - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SDEXT_PRESENTER_CONTROL_CREATOR_HXX -#define SDEXT_PRESENTER_CONTROL_CREATOR_HXX - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace css = ::com::sun::star; - -namespace sdext { namespace presenter { - -/** This class creates an AWT container window and a set of child controls. -*/ -class PresenterControlCreator - : private ::boost::noncopyable -{ -public: - /** Create a container window with the given window as its parent. - */ - explicit PresenterControlCreator ( - const css::uno::Reference& rxContext, - const css::uno::Reference& rxParentWindow, - const sal_Int32 nHeight); - ~PresenterControlCreator (void); - - sal_Int32 GetToolBarHeight (void) const; - - class Property {public: sal_Char* msName; css::uno::Any maValue; }; - - css::uno::Reference AddButton ( - const ::rtl::OUString& rsName, - const ::rtl::OUString& rsImageName, - const Property pProperties[]); - - css::uno::Reference AddLabel ( - const ::rtl::OUString& rsName, - const ::rtl::OUString& rsDefaultText, - const Property pProperties[]); - - css::uno::Reference AddEdit ( - const ::rtl::OUString& rsName, - const Property pProperties[]); - - /** Return the container window. - */ - css::uno::Reference GetContainerWindow (void) const; - css::uno::Reference GetContainer (void) const; - -private: - css::uno::Reference mxComponentContext; - css::uno::Reference< - css::awt::XWindow> mxControlContainerWindow; - css::uno::Reference< - css::awt::XControlContainer> mxControlContainer; - css::uno::Reference< - css::container::XNameContainer> mxModelNameContainer; - css::uno::Reference< - css::lang::XMultiServiceFactory> mxControlFactory; - sal_Int32 mnControlCount; - const sal_Int32 mnToolBarHeight; - - bool CreateContainer (void); - void CreateContainerWindow ( - const css::uno::Reference< - css::awt::XWindow>& rxParentWindow); - - css::uno::Reference AddControl ( - const ::rtl::OUString& rsName, - const ::rtl::OUString& rsModelServiceName, - const ::rtl::OUString& rsControlServiceName, - const Property pDefaultProperties[], - const Property pUserProperties[]); - - void SetModelProperties ( - const css::uno::Reference& rxSet, - const Property pProperties[]); - -}; - -} } // end of namespace ::sdext::presenter - -#endif diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index f4d34c660738..bcf88fddfa95 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -481,14 +481,6 @@ Reference -Reference PresenterController::GetParentWindow (void) const -{ - return mxMainWindow; -} - - - - rtl::Reference PresenterController::GetPaneContainer (void) const { return mpPaneContainer; @@ -982,9 +974,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) case awt::Key::NUM7: case awt::Key::NUM8: case awt::Key::NUM9: - if (mnPendingSlideNumber == -1) - mnPendingSlideNumber = 0; - UpdatePendingSlideNumber(mnPendingSlideNumber * 10 + rEvent.KeyCode-awt::Key::NUM0); + HandleNumericKeyPress(rEvent.KeyCode-awt::Key::NUM0, rEvent.Modifiers); break; case awt::Key::RETURN: @@ -1027,6 +1017,54 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) +void PresenterController::HandleNumericKeyPress ( + const sal_Int32 nKey, + const sal_Int32 nModifiers) +{ + switch (nModifiers) + { + case 0: + if (mnPendingSlideNumber == -1) + mnPendingSlideNumber = 0; + UpdatePendingSlideNumber(mnPendingSlideNumber * 10 + nKey); + break; + + case awt::KeyModifier::MOD1: + // Ctrl-1, Ctrl-2, and Ctrl-3 are used to switch between views + // (slide view, notes view, normal) + mnPendingSlideNumber = -1; + if (mpWindowManager.get() == NULL) + return; + switch(nKey) + { + case 1: + mpWindowManager->SetSlideSorterState(false); + mpWindowManager->SetHelpViewState(false); + mpWindowManager->SetLayoutMode(PresenterWindowManager::Standard); + break; + case 2: + mpWindowManager->SetSlideSorterState(false); + mpWindowManager->SetHelpViewState(false); + mpWindowManager->SetLayoutMode(PresenterWindowManager::Notes); + break; + case 3: + mpWindowManager->SetHelpViewState(false); + mpWindowManager->SetSlideSorterState(true); + break; + default: + // Ignore unsupported key. + break; + } + + default: + // Ignore unsupported modifiers. + break; + } +} + + + + //----- XFocusListener -------------------------------------------------------- void SAL_CALL PresenterController::focusGained (const css::awt::FocusEvent& rEvent) diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx index 2d8478eca179..70e3e6bf748f 100644 --- a/sdext/source/presenter/PresenterController.hxx +++ b/sdext/source/presenter/PresenterController.hxx @@ -117,7 +117,6 @@ public: ::rtl::Reference GetWindowManager (void) const; css::uno::Reference GetSlideShowController (void) const; - css::uno::Reference GetParentWindow (void) const; rtl::Reference GetPaneContainer (void) const; ::rtl::Reference GetPaneBorderPainter (void) const; ::boost::shared_ptr GetAnimator (void) const; @@ -244,6 +243,18 @@ private: void LoadTheme (const css::uno::Reference& rxPane); void UpdatePendingSlideNumber (const sal_Int32 nPendingSlideNumber); + /** This method is called when the user pressed one of the numerical + keys. Depending on the modifier, numeric keys switch to another + slide (no modifier), or change to another view (Ctrl modifier). + @param nKey + Numeric value that is printed on the pressed key. For example + pressing the key '4' will result in the value 4, not the ASCII + code (0x34?). + @param nModifiers + The modifier bit field as provided by the key up event. + */ + void HandleNumericKeyPress (const sal_Int32 nKey, const sal_Int32 nModifiers); + void ThrowIfDisposed (void) const throw (::com::sun::star::lang::DisposedException); }; diff --git a/sdext/source/presenter/PresenterGeometryHelper.cxx b/sdext/source/presenter/PresenterGeometryHelper.cxx index e6427ab4175a..9e8aaaa86bb1 100644 --- a/sdext/source/presenter/PresenterGeometryHelper.cxx +++ b/sdext/source/presenter/PresenterGeometryHelper.cxx @@ -63,41 +63,6 @@ sal_Int32 Height (const sal_Int32 nTop, const sal_Int32 nBottom) } -void SetBezierCurve ( - geometry::RealBezierSegment2D& rBezierSegment, - const double nX, - const double nY, - const double nDX1, - const double nDY1, - const double nDX2, - const double nDY2) -{ - rBezierSegment.Px = nX; - rBezierSegment.Py = nY; - rBezierSegment.C1x = nX + nDX1; - rBezierSegment.C1y = nY + nDY1; - rBezierSegment.C2x = nX + nDX1 + nDX2; - rBezierSegment.C2y = nY + nDY1 + nDY2; -} - - - -void SetBezierLine ( - geometry::RealBezierSegment2D& rBezierSegment, - const double nX1, - const double nY1, - const double nX2, - const double nY2) -{ - rBezierSegment.Px = nX1; - rBezierSegment.Py = nY1; - rBezierSegment.C1x = 0.666 * nX1 + 0.334 * nX2; - rBezierSegment.C1y = 0.666 * nY1 + 0.334 * nY2; - rBezierSegment.C2x = 0.333 * nX1 + 0.667 * nX2; - rBezierSegment.C2y = 0.333 * nY1 + 0.667 * nY2; -} - - } // end of anonymous namespace @@ -167,15 +132,6 @@ geometry::RealRectangle2D PresenterGeometryHelper::ConvertRectangle ( -css::awt::Size PresenterGeometryHelper::ConvertSize ( - const css::geometry::RealSize2D& rSize) -{ - return awt::Size(Round(rSize.Width), Round(rSize.Height)); -} - - - - awt::Rectangle PresenterGeometryHelper::TranslateRectangle ( const css::awt::Rectangle& rBox, const sal_Int32 nXOffset, @@ -221,19 +177,6 @@ geometry::RealRectangle2D PresenterGeometryHelper::Intersection ( -bool PresenterGeometryHelper::IsInside ( - const css::awt::Rectangle& rBox, - const css::awt::Point& rPoint) -{ - return rBox.X <= rPoint.X - && rBox.Y <= rPoint.Y - && rBox.X+rBox.Width > rPoint.X - && rBox.Y+rBox.Height > rPoint.Y; -} - - - - bool PresenterGeometryHelper::IsInside ( const css::geometry::RealRectangle2D& rBox, const css::geometry::RealPoint2D& rPoint) @@ -392,43 +335,4 @@ Reference PresenterGeometryHelper::CreatePolygon( } - - -Reference PresenterGeometryHelper::CreatePolygon( - const css::awt::Rectangle& rBox, - const double nRadius, - const Reference& rxDevice) -{ - if ( ! rxDevice.is()) - return NULL; - - Sequence > aPolygon(1); - aPolygon[0] = Sequence(8); - const double nLeft = rBox.X; - const double nTop = rBox.Y; - const double nRight = rBox.X + rBox.Width - 1; - const double nBottom = rBox.Y + rBox.Height - 1; - - - SetBezierCurve(aPolygon[0][0], nLeft + nRadius, nTop, -nRadius, 0, 0,0); - SetBezierLine(aPolygon[0][1], nLeft, nTop+nRadius, nLeft, nBottom-nRadius); - - SetBezierCurve(aPolygon[0][2], nLeft, nBottom-nRadius, 0,nRadius, 0,0); - SetBezierLine(aPolygon[0][3], nLeft+nRadius, nBottom, nRight-nRadius, nBottom); - - SetBezierCurve(aPolygon[0][4], nRight-nRadius, nBottom, nRadius,0, 0,0); - SetBezierLine(aPolygon[0][5], nRight, nBottom-nRadius, nRight, nTop+nRadius); - - SetBezierCurve(aPolygon[0][6], nRight, nTop+nRadius, 0,-nRadius, 0,0); - SetBezierLine(aPolygon[0][7], nRight-nRadius, nTop, nLeft+nRadius, nTop); - - Reference xPolygon ( - rxDevice->createCompatibleBezierPolyPolygon(aPolygon), - UNO_QUERY_THROW); - if (xPolygon.is()) - xPolygon->setClosed(0, sal_True); - - return xPolygon; -} - } } diff --git a/sdext/source/presenter/PresenterGeometryHelper.hxx b/sdext/source/presenter/PresenterGeometryHelper.hxx index bfe9fb357b05..1a0a53c2f5cd 100644 --- a/sdext/source/presenter/PresenterGeometryHelper.hxx +++ b/sdext/source/presenter/PresenterGeometryHelper.hxx @@ -69,8 +69,8 @@ public: static css::geometry::RealRectangle2D ConvertRectangle ( const css::awt::Rectangle& rBox); - static css::awt::Size ConvertSize ( - const css::geometry::RealSize2D& rSize); + // static css::awt::Size ConvertSize ( + // const css::geometry::RealSize2D& rSize); static css::awt::Rectangle TranslateRectangle ( const css::awt::Rectangle& rBox, @@ -85,10 +85,6 @@ public: const css::geometry::RealRectangle2D& rBox1, const css::geometry::RealRectangle2D& rBox2); - static bool IsInside ( - const css::awt::Rectangle& rBox, - const css::awt::Point& rPoint); - static bool IsInside ( const css::geometry::RealRectangle2D& rBox, const css::geometry::RealPoint2D& rPoint); @@ -125,10 +121,12 @@ public: /** Create a polygon for a rounded rectangle. */ - static css::uno::Reference CreatePolygon( + /* static css::uno::Reference CreatePolygon( const css::awt::Rectangle& rBox, const double nRadius, - const css::uno::Reference& rxDevice); + const css::uno::Reference& + rxDevice); + */ }; } } diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index 16f746cbdc1d..9b1137c09954 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -430,30 +430,33 @@ void PresenterHelpView::ProcessString ( void PresenterHelpView::CheckFontSize (void) { - const awt::Rectangle aWindowBox (mxWindow->getPosSize()); + if (mpFont.get() == NULL) + return; - double nY (gnVerticalBorder); - TextContainer::iterator iBlock (mpTextContainer->begin()); - TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); - for ( ; iBlock!=iBlockEnd; ++iBlock) - nY += ::std::max( - (*iBlock)->maLeft.GetHeight(), - (*iBlock)->maRight.GetHeight()); + const awt::Rectangle aWindowBox (mxWindow->getPosSize()); - if (nY > aWindowBox.Height-gnVerticalBorder) + // Scaling down and then reformatting can cause the text to be too large + // still. So do this again and again until the text size is + // small enough. Restrict the number of loops. + for (int nLoopCount=0; nLoopCount<5; ++nLoopCount) { - // Font is too large. Make it smaller. + double nY (gnVerticalBorder); + TextContainer::iterator iBlock (mpTextContainer->begin()); + TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); + for ( ; iBlock!=iBlockEnd; ++iBlock) + nY += ::std::max( + (*iBlock)->maLeft.GetHeight(), + (*iBlock)->maRight.GetHeight()); + + if (nY <= aWindowBox.Height-gnVerticalBorder) + break; - if (mpFont.get() == NULL) - { - // No font to work with. - return; - } + // Font is too large. Make it smaller. // Use a simple linear transformation to calculate initial guess of // a size that lets all help text be shown inside the window. - sal_Int32 nFontSizeGuess ( - sal_Int32(mpFont->mnSize * (aWindowBox.Height-gnVerticalBorder) / nY)); + const double nScale (::std::min(0.95,double(aWindowBox.Height-gnVerticalBorder) / nY)); + sal_Int32 nFontSizeGuess (::std::max(sal_Int32(1),sal_Int32(mpFont->mnSize * nScale))); mpFont->mnSize = nFontSizeGuess; mpFont->mxFont = NULL; mpFont->PrepareFont(mxCanvas); diff --git a/sdext/source/presenter/PresenterHelper.cxx b/sdext/source/presenter/PresenterHelper.cxx index 57f055534075..e012005e2e92 100644 --- a/sdext/source/presenter/PresenterHelper.cxx +++ b/sdext/source/presenter/PresenterHelper.cxx @@ -94,35 +94,4 @@ Reference PresenterHelper::GetSlideShowContr -Reference PresenterHelper::GetGraphic ( - const Reference& rxContext, - const OUString& rsName) -{ - Reference xGraphic; - - try - { - // Create GraphicProvider. - Reference xFactory ( - rxContext->getServiceManager(), UNO_QUERY_THROW); - Reference xProvider ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.graphic.GraphicProvider"), - rxContext), - UNO_QUERY_THROW); - - // Ask the provider to obtain a graphic - Sequence aProperties (1); - aProperties[0].Name = OUString::createFromAscii("URL"); - aProperties[0].Value <<= rsName; - xGraphic = xProvider->queryGraphic(aProperties); - } - catch (const Exception&) - { - OSL_ASSERT(false); - } - - return xGraphic; -} - } } // end of namespace ::sdext::presenter diff --git a/sdext/source/presenter/PresenterHelper.hxx b/sdext/source/presenter/PresenterHelper.hxx index 84dac0019b27..118087221bad 100644 --- a/sdext/source/presenter/PresenterHelper.hxx +++ b/sdext/source/presenter/PresenterHelper.hxx @@ -71,18 +71,6 @@ public: static css::uno::Reference GetSlideShowController ( const css::uno::Reference& rxController); - /** Load a bitmap from a file (or other place) that has the given URL - and return it. - @param rxContext - The component context is used to create the necessary - temporarily used services to load the graphic object. - @param rsURL - URL of a file or other place that points to a bitmap resource. - */ - static css::uno::Reference GetGraphic ( - const css::uno::Reference& rxContext, - const ::rtl::OUString& rsURL); - private: PresenterHelper (void); ~PresenterHelper (void); diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 83bfcf6e14bb..fce82f93faee 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -407,14 +407,6 @@ void PresenterNotesView::SetSlide (const Reference& rxNotesP -Reference PresenterNotesView::GetWindow (void) const -{ - return mxParentWindow; -} - - - - //----- lang::XEventListener ------------------------------------------------- void SAL_CALL PresenterNotesView::disposing (const lang::EventObject& rEventObject) @@ -1207,28 +1199,6 @@ Reference PresenterNotesView::BitmapFactory::CreateBitmap ( Reference xTextBitmap ( mxTextView->getPropertyValue(A2S("Bitmap")), UNO_QUERY); - /* - // Create bitmap of same size that has the right background. - Reference xBitmap ( - mxCanvas->getDevice()->createCompatibleAlphaBitmap(xTextBitmap->getSize())); - Reference xBitmapCanvas (xBitmap, UNO_QUERY); - rendering::ViewState aViewState (geometry::AffineMatrix2D(1,0,0, 0,1,0),NULL); - rendering::RenderState aRenderState( - geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL, - Sequence(3), - rendering::CompositeOperation::SOURCE); - const awt::Rectangle aBox (0,0,mnWidth,nHeight); - PresenterCanvasHelper::PaintRectangle( - mpBackground, - xBitmapCanvas, - aBox, - aBox, - css::awt::Rectangle()); - xBitmapCanvas->drawBitmap(xTextBitmap, aViewState, aRenderState); - - return xBitmap; -*/ return xTextBitmap; } diff --git a/sdext/source/presenter/PresenterNotesView.hxx b/sdext/source/presenter/PresenterNotesView.hxx index 8dcbc1a3e121..c9d4974c8cfe 100644 --- a/sdext/source/presenter/PresenterNotesView.hxx +++ b/sdext/source/presenter/PresenterNotesView.hxx @@ -96,8 +96,6 @@ public: void SetSlide ( const css::uno::Reference& rxNotesPage); - css::uno::Reference GetWindow (void) const; - void ChangeFontSize (const sal_Int32 nSizeChange); // lang::XEventListener diff --git a/sdext/source/presenter/PresenterPaneBorderManager.cxx b/sdext/source/presenter/PresenterPaneBorderManager.cxx index e7b85b9f5922..279af6def692 100644 --- a/sdext/source/presenter/PresenterPaneBorderManager.cxx +++ b/sdext/source/presenter/PresenterPaneBorderManager.cxx @@ -32,6 +32,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sdext.hxx" +// The body of this file is only used when PresenterWindowManager defines +// the preprocessor symbol ENABLE_PANE_RESIZING, which by default is not the +// case. +#ifdef ENABLE_PANE_RESIZING + #include "PresenterPaneBorderManager.hxx" #include "PresenterController.hxx" #include "PresenterPaintManager.hxx" @@ -577,3 +582,5 @@ void PresenterPaneBorderManager::ThrowIfDisposed (void) } } // end of namespace ::sd::presenter + +#endif // ENABLE_PANE_RESIZING diff --git a/sdext/source/presenter/PresenterPaneBorderManager.hxx b/sdext/source/presenter/PresenterPaneBorderManager.hxx index 9b3f645ea05a..c8f71edb0e94 100644 --- a/sdext/source/presenter/PresenterPaneBorderManager.hxx +++ b/sdext/source/presenter/PresenterPaneBorderManager.hxx @@ -32,6 +32,11 @@ #ifndef SDEXT_PRESENTER_PRESENTER_PANE_BORDER_MANAGER_HXX #define SDEXT_PRESENTER_PRESENTER_PANE_BORDER_MANAGER_HXX +// The body of this file is only used when PresenterWindowManager defines +// the preprocessor symbol ENABLE_PANE_RESIZING, which by default is not the +// case. +#ifdef ENABLE_PANE_RESIZING + #include #include #include @@ -167,4 +172,7 @@ private: } } // end of namespace ::sd::presenter +#endif // ENABLE_PANE_RESIZING + #endif + diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index d43fbd87e558..e2122f23dccc 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -110,7 +110,6 @@ namespace { BorderSize maOuterBorderSize; BorderSize maTotalBorderSize; enum Side { Left, Top, Right, Bottom }; - sal_Int32 GetBorderSize (const Side eSide) const; private: void UpdateBorderSizes (void); SharedBitmapDescriptor GetBitmap( @@ -162,9 +161,6 @@ private: bool mbHasCallout; awt::Point maCalloutAnchor; - void PaintFrameBackground ( - const awt::Rectangle& rInnerBox, - const awt::Rectangle& rOuterBox); void PaintBitmap( const awt::Rectangle& rBox, const awt::Rectangle& rUpdateBox, @@ -733,17 +729,6 @@ void PresenterPaneBorderPainter::Renderer::SetCalloutAnchor ( -void PresenterPaneBorderPainter::Renderer::PaintFrameBackground ( - const awt::Rectangle& rOuterBox, - const awt::Rectangle& rInnerBox) -{ - (void)rOuterBox; - (void)rInnerBox; -} - - - - void PresenterPaneBorderPainter::Renderer::PaintBitmap( const awt::Rectangle& rBox, const awt::Rectangle& rUpdateBox, @@ -1089,21 +1074,6 @@ const Reference RendererPaneStyle::GetFont ( -sal_Int32 RendererPaneStyle::GetBorderSize (const Side eSide) const -{ - switch (eSide) - { - case Left : return maTotalBorderSize.mnLeft; - case Right : return maTotalBorderSize.mnRight; - case Top : return maTotalBorderSize.mnTop; - case Bottom : return maTotalBorderSize.mnBottom; - } - return 0; -} - - - - void RendererPaneStyle::UpdateBorderSizes (void) { maTotalBorderSize.mnLeft = maInnerBorderSize.mnLeft + maOuterBorderSize.mnLeft; diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index ebfb8905967b..9c9be61222ce 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -176,6 +176,8 @@ Reference SAL_CALL PresenterPaneFactory::createResource ( const Reference& rxPaneId) throw (RuntimeException) { + ThrowIfDisposed(); + if ( ! rxPaneId.is()) return NULL; @@ -217,6 +219,8 @@ Reference SAL_CALL PresenterPaneFactory::createResource ( void SAL_CALL PresenterPaneFactory::releaseResource (const Reference& rxResource) throw (RuntimeException) { + ThrowIfDisposed(); + if ( ! rxResource.is()) throw lang::IllegalArgumentException(); diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 755822ce1387..015884abfb25 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -428,6 +428,13 @@ void PresenterScreen::InitializePresenterScreen (void) Reference xCC( xCM->getConfigurationController()); mxConfigurationControllerWeak = xCC; + Reference xMainPaneId( + GetMainPaneId(xPresentation)); + // An empty reference means that the presenter screen can + // not or must not be displayed. + if ( ! xMainPaneId.is()) + return; + if (xCC.is() && xContext.is()) { // Store the current configuration so that we can restore it when @@ -437,13 +444,6 @@ void PresenterScreen::InitializePresenterScreen (void) try { - Reference xMainPaneId( - GetMainPaneId(xPresentation)); - // An empty reference means that the presenter screen can - // not or must not be displayed. - if ( ! xMainPaneId.is()) - return; - // At the moment the presenter controller is displayed in its // own full screen window that is controlled by the same // configuration controller as the Impress document from @@ -609,46 +609,6 @@ Reference PresenterScreen::GetMainPaneId ( -void PresenterScreen::DeactivatePanes (const Reference& rxCC) -{ - OSL_ASSERT(rxCC.is()); - - Reference xContext (mxContextWeak); - if ( ! xContext.is()) - return; - Reference xCenterPaneId(ResourceId::create( - xContext, - PresenterHelper::msCenterPaneURL)); - if ( ! xCenterPaneId.is()) - return; - - Reference xCurrentConfiguration (rxCC->getCurrentConfiguration()); - if (xCurrentConfiguration.is()) - { - // First explicitly deactivate the view in the center pane. This - // view is used as marker by some other modules and it is important - // that its deactivation is requested first. - const Sequence > aViews (xCurrentConfiguration->getResources( - xCenterPaneId, - PresenterHelper::msViewURLPrefix, - AnchorBindingMode_DIRECT)); - for (sal_Int32 nIndex=0; nIndexrequestResourceDeactivation(aViews[nIndex]); - - // Now deactivate all top level panes and and all resources anchored - // to them. - const Sequence > aPanes (xCurrentConfiguration->getResources( - xCenterPaneId, - PresenterHelper::msPaneURLPrefix, - AnchorBindingMode_DIRECT)); - for (sal_Int32 nIndex=0; nIndexrequestResourceDeactivation(aPanes[nIndex]); - } -} - - - - void PresenterScreen::RequestShutdownPresenterScreen (void) { // Restore the configuration that was active before the presenter screen @@ -965,18 +925,4 @@ void PresenterScreen::SetupView( -void PresenterScreen::ThrowIfDisposed (void) const - throw (::com::sun::star::lang::DisposedException) -{ - if (rBHelper.bDisposed || rBHelper.bInDispose) - { - throw lang::DisposedException ( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "PresenterScreen object has already been disposed")), - const_cast(static_cast(this))); - } -} - - - } } // end of namespace ::sdext::presenter diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx index e9849d0f4015..7f7171477e25 100644 --- a/sdext/source/presenter/PresenterScreen.hxx +++ b/sdext/source/presenter/PresenterScreen.hxx @@ -170,12 +170,6 @@ private: ViewDescriptorContainer maViewDescriptors; - /** Deactivate the currently active panes to make room for the full - screen pane and the presenter panes. - */ - void DeactivatePanes ( - const css::uno::Reference& rxCC); - void ShutdownPresenterScreen (void); /** Create and initialize the factory for presenter view specific panes. @@ -249,8 +243,6 @@ private: */ css::uno::Reference GetMainPaneId ( const css::uno::Reference& rxPresentation) const; - - void ThrowIfDisposed (void) const throw (::com::sun::star::lang::DisposedException); }; } } diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 73a2eaf9cdab..f29a311f2013 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -93,7 +93,6 @@ namespace sdext { namespace presenter { namespace { sal_Int32 round (const double nValue) { return sal::static_int_cast(0.5 + nValue); } sal_Int32 floor (const double nValue) { return sal::static_int_cast(nValue); } - double sqr (const double nValue) { return nValue*nValue; } } @@ -125,7 +124,6 @@ public: const sal_Int32 nRelativeHorizontalPosition, const sal_Int32 nRelativeVerticalPosition) const; css::awt::Rectangle GetBoundingBox (const sal_Int32 nSlideIndex) const; - geometry::IntegerSize2D GetPreviewSize (void) const; void ForAllVisibleSlides (const ::boost::function& rAction); sal_Int32 GetFirstVisibleSlideIndex (void) const; sal_Int32 GetLastVisibleSlideIndex (void) const; @@ -1240,13 +1238,6 @@ bool PresenterSlideSorter::ProvideCanvas (void) -void PresenterSlideSorter::Close (void) -{ -} - - - - void PresenterSlideSorter::ThrowIfDisposed (void) throw (lang::DisposedException) { @@ -1579,14 +1570,6 @@ awt::Rectangle PresenterSlideSorter::Layout::GetBoundingBox (const sal_Int32 nSl -geometry::IntegerSize2D PresenterSlideSorter::Layout::GetPreviewSize (void) const -{ - return maPreviewSize; -} - - - - void PresenterSlideSorter::Layout::ForAllVisibleSlides (const ::boost::function& rAction) { for (sal_Int32 nRow=mnFirstVisibleRow; nRow<=mnLastVisibleRow; ++nRow) diff --git a/sdext/source/presenter/PresenterSlideSorter.hxx b/sdext/source/presenter/PresenterSlideSorter.hxx index 9004ff7a845e..a86b36180eed 100644 --- a/sdext/source/presenter/PresenterSlideSorter.hxx +++ b/sdext/source/presenter/PresenterSlideSorter.hxx @@ -224,7 +224,6 @@ private: void SetVerticalOffset (const double nYOffset); void GotoSlide (const sal_Int32 nSlideIndex); bool ProvideCanvas (void); - void Close (void); /** This method throws a DisposedException when the object has already been disposed. diff --git a/sdext/source/presenter/PresenterSprite.cxx b/sdext/source/presenter/PresenterSprite.cxx index 72b824d30ef5..0199030aa4b5 100644 --- a/sdext/source/presenter/PresenterSprite.cxx +++ b/sdext/source/presenter/PresenterSprite.cxx @@ -290,25 +290,4 @@ void PresenterSprite::DisposeSprite (void) -void PresenterSprite::SetToBitmap (const Reference& rxBitmap) -{ - const geometry::IntegerSize2D aSize (rxBitmap->getSize()); - Resize(geometry::RealSize2D(aSize.Width, aSize.Height)); - - Reference xCanvas (GetCanvas()); - if (xCanvas.is() && rxBitmap.is()) - { - xCanvas->drawBitmap( - rxBitmap, - rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), - rendering::RenderState( - geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL, - uno::Sequence(4), - rendering::CompositeOperation::SOURCE)); - - } -} - - } } //end of namespace sdext::presenter diff --git a/sdext/source/presenter/PresenterSprite.hxx b/sdext/source/presenter/PresenterSprite.hxx index 39f82f332553..93f6a4f88f66 100644 --- a/sdext/source/presenter/PresenterSprite.hxx +++ b/sdext/source/presenter/PresenterSprite.hxx @@ -82,8 +82,6 @@ public: void SetAlpha (const double nAlpha); double GetAlpha (void) const; - void SetToBitmap (const css::uno::Reference& rxBitmap); - void Update (void); private: diff --git a/sdext/source/presenter/PresenterSpritePane.cxx b/sdext/source/presenter/PresenterSpritePane.cxx index b5a98de897a3..c22add7c9299 100644 --- a/sdext/source/presenter/PresenterSpritePane.cxx +++ b/sdext/source/presenter/PresenterSpritePane.cxx @@ -45,58 +45,6 @@ using ::rtl::OUString; namespace sdext { namespace presenter { -//===== TransparentBorderPainter ============================================== - -namespace { - typedef ::cppu::WeakComponentImplHelper1< - css::drawing::framework::XPaneBorderPainter - > TransparentBorderPainterInterfaceBase; -} - -class TransparentBorderPainter - : private ::boost::noncopyable, - protected ::cppu::BaseMutex, - public TransparentBorderPainterInterfaceBase -{ -public: - TransparentBorderPainter (void); - virtual ~TransparentBorderPainter (void); - - // XPaneBorderPainter - - virtual css::awt::Rectangle SAL_CALL addBorder ( - const rtl::OUString& rsPaneBorderStyleName, - const css::awt::Rectangle& rRectangle, - css::drawing::framework::BorderType eBorderType) - throw(css::uno::RuntimeException); - - virtual css::awt::Rectangle SAL_CALL removeBorder ( - const rtl::OUString& rsPaneBorderStyleName, - const css::awt::Rectangle& rRectangle, - css::drawing::framework::BorderType eBorderType) - throw(css::uno::RuntimeException); - - virtual void SAL_CALL paint ( - const rtl::OUString& rsPaneBorderStyleName, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rOuterBorderRectangle, - const css::awt::Rectangle& rRepaintArea, - const rtl::OUString& rsTitle) - throw(css::uno::RuntimeException); - -private: - double mnLeft; - double mnTop; - double mnRight; - double mnBottom; - - void ThrowIfDisposed (void) const - throw (::com::sun::star::lang::DisposedException); -}; - - - - //===== PresenterSpritePane ========================================================= PresenterSpritePane::PresenterSpritePane (const Reference& rxContext, @@ -258,7 +206,6 @@ void SAL_CALL PresenterSpritePane::windowPaint (const awt::PaintEvent& rEvent) void PresenterSpritePane::ShowTransparentBorder (void) { - // mxBorderPainter = new TransparentBorderPainter(); } @@ -314,134 +261,4 @@ void PresenterSpritePane::CreateCanvases ( -//===== TransparentBorderPainter ============================================== - -TransparentBorderPainter::TransparentBorderPainter (void) - : TransparentBorderPainterInterfaceBase(m_aMutex), - mnLeft(50), - mnTop(50), - mnRight(50), - mnBottom(50) -{ -} - - - - -TransparentBorderPainter::~TransparentBorderPainter (void) -{ -} - - - - -// XPaneBorderPainter - -css::awt::Rectangle SAL_CALL TransparentBorderPainter::addBorder ( - const rtl::OUString& rsPaneBorderStyleName, - const css::awt::Rectangle& rRectangle, - css::drawing::framework::BorderType eBorderType) - throw(css::uno::RuntimeException) -{ - (void)rsPaneBorderStyleName; - - switch (eBorderType) - { - case drawing::framework::BorderType_INNER_BORDER: - default: - return rRectangle; - - case drawing::framework::BorderType_OUTER_BORDER: - case drawing::framework::BorderType_TOTAL_BORDER: - return awt::Rectangle( - sal::static_int_cast(rRectangle.X - mnLeft), - sal::static_int_cast(rRectangle.Y - mnTop), - sal::static_int_cast(rRectangle.Width + (mnLeft + mnRight)), - sal::static_int_cast(rRectangle.Height + (mnTop + mnBottom))); - } -} - - - - -css::awt::Rectangle SAL_CALL TransparentBorderPainter::removeBorder ( - const rtl::OUString& rsPaneBorderStyleName, - const css::awt::Rectangle& rRectangle, - css::drawing::framework::BorderType eBorderType) - throw(css::uno::RuntimeException) -{ - (void)rsPaneBorderStyleName; - - switch (eBorderType) - { - case drawing::framework::BorderType_INNER_BORDER: - default: - return rRectangle; - - case drawing::framework::BorderType_OUTER_BORDER: - case drawing::framework::BorderType_TOTAL_BORDER: - return awt::Rectangle( - sal::static_int_cast(rRectangle.X + mnLeft), - sal::static_int_cast(rRectangle.Y + mnTop), - sal::static_int_cast(rRectangle.Width - (mnLeft + mnRight)), - sal::static_int_cast(rRectangle.Height - (mnTop + mnBottom))); - } -} - - - - -void SAL_CALL TransparentBorderPainter::paint ( - const rtl::OUString& rsPaneBorderStyleName, - const css::uno::Reference& rxCanvas, - const css::awt::Rectangle& rOuterBorderRectangle, - const css::awt::Rectangle& rRepaintArea, - const rtl::OUString& rsTitle) - throw(css::uno::RuntimeException) -{ - (void)rsPaneBorderStyleName; - (void)rRepaintArea; - (void)rsTitle; - - rendering::ViewState aViewState( - geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL); - - rendering::RenderState aRenderState( - geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL, - Sequence(4), - rendering::CompositeOperation::SOURCE); - - aRenderState.DeviceColor[0] = 0.5; - aRenderState.DeviceColor[1] = 0.5; - aRenderState.DeviceColor[2] = 0.5; - aRenderState.DeviceColor[3] = 0.5; - - Reference xPolygon ( - PresenterGeometryHelper::CreatePolygon(rOuterBorderRectangle, rxCanvas->getDevice())); - if (xPolygon.is()) - rxCanvas->fillPolyPolygon( - xPolygon, - aViewState, - aRenderState); -} - - - - -void TransparentBorderPainter::ThrowIfDisposed (void) const - throw (::com::sun::star::lang::DisposedException) -{ - if (rBHelper.bDisposed || rBHelper.bInDispose) - { - throw lang::DisposedException ( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "TransparentBorderPainter object has already been disposed")), - const_cast(static_cast(this))); - } -} - - - } } // end of namespace ::sd::presenter diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 7ae68ad78d1b..273753e0b4da 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -230,14 +230,6 @@ void PresenterWindowManager::SetParentPane ( -Reference PresenterWindowManager::GetParentWidnow (void) const -{ - return mxParentWindow; -} - - - - void PresenterWindowManager::SetTheme (const ::boost::shared_ptr& rpTheme) { mpTheme = rpTheme; diff --git a/sdext/source/presenter/PresenterWindowManager.hxx b/sdext/source/presenter/PresenterWindowManager.hxx index 216b5f2cee98..2b71fc6b4311 100644 --- a/sdext/source/presenter/PresenterWindowManager.hxx +++ b/sdext/source/presenter/PresenterWindowManager.hxx @@ -92,7 +92,6 @@ public: void SAL_CALL disposing (void); void SetParentPane (const css::uno::Reference& rxPane); - css::uno::Reference GetParentWidnow (void) const; void SetTheme (const ::boost::shared_ptr& rpTheme); void NotifyPaneCreation (const PresenterPaneContainer::SharedPaneDescriptor& rpDescriptor); void NotifyViewCreation (const css::uno::Reference& rxView); diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml index f084763d1401..11213c0aa639 100644 --- a/sdext/source/presenter/description.xml +++ b/sdext/source/presenter/description.xml @@ -17,7 +17,7 @@ - + diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index e0b11d22acbf..9b3e725b0d42 100644 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -67,7 +67,6 @@ SLOFILES= \ $(SLO)$/PresenterButton.obj \ $(SLO)$/PresenterCanvasHelper.obj \ $(SLO)$/PresenterConfigurationAccess.obj \ - $(SLO)$/PresenterControlCreator.obj \ $(SLO)$/PresenterController.obj \ $(SLO)$/PresenterCurrentSlideObserver.obj \ $(SLO)$/PresenterFrameworkObserver.obj \ diff --git a/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu b/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu index 2de5ec7a6987..4fd6b68b974d 100644 --- a/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu +++ b/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu @@ -468,7 +468,7 @@ - Alt+Page Up + Alt-Page Up Previous slide without effects @@ -476,7 +476,7 @@ - Alt+Page Down + Alt-Page Down Next slide without effects @@ -500,7 +500,7 @@ - 'W', ',' + 'W', ',' Whites/Unwhites the screen @@ -562,6 +562,38 @@ Scroll notes up/down + + + + + + + + + + + Ctrl-'1' + + + Shows the Presenter Console + + + + + Ctrl-'2' + + + Shows the Presentation Notes + + + + + Ctrl-'3' + + + Shows the Slides Overview + + -- cgit v1.2.3