diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-01-21 14:22:27 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-01-21 14:22:27 +0000 |
commit | 2540371688363897d184e248f6f84396b1ca6ff9 (patch) | |
tree | 2eb38d993bc3d810ba2a56e95024aa832b94bef0 /sdext/source | |
parent | 53ef57d5f9fe1f0d1cb1efbb372c10ce484b3f5d (diff) |
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
Diffstat (limited to 'sdext/source')
32 files changed, 150 insertions, 1138 deletions
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<rendering::XGraphicDevice>& rxDevice) -{ - if (mxNormalBitmap.is() && ! mxMouseOverBitmap.is()) - { - const geometry::IntegerSize2D aSize (mxNormalBitmap->getSize()); - Reference<rendering::XBitmap> xHighlight(rxDevice->createCompatibleBitmap(aSize)); - if (xHighlight.is()) - { - Reference<rendering::XBitmapCanvas> 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<double>(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<css::rendering::XGraphicDevice>& rxDevice); - private: css::uno::Reference<css::rendering::XBitmap> mxNormalBitmap; css::uno::Reference<css::rendering::XBitmap> 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<rendering::XBitmap>(rpBitmap->GetNormalBitmap(), UNO_QUERY), rxCanvas, @@ -154,26 +153,6 @@ void PresenterCanvasHelper::PaintRectangle ( -void PresenterCanvasHelper::PaintRectangle ( - const SharedBitmapDescriptor& rpBitmap, - const css::uno::Reference<css::rendering::XCanvas>& 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<double>(3), - rendering::CompositeOperation::SOURCE); - PaintRectangle(rpBitmap,rxCanvas,rRepaintBox,rOuterBoundingBox,rContentBoundingBox, - aViewState, aRenderState); -} - - - - void PresenterCanvasHelper::PaintTiledBitmap ( const css::uno::Reference<css::rendering::XBitmap>& rxTexture, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, @@ -230,54 +209,6 @@ void PresenterCanvasHelper::PaintTiledBitmap ( -void PresenterCanvasHelper::PaintTexture ( - const css::uno::Reference<css::rendering::XBitmap>& rxTexture, - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::uno::Reference<css::rendering::XPolyPolygon2D>& 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<rendering::Texture> 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<css::rendering::XBitmap>& 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 @@ -68,13 +68,6 @@ public: const css::uno::Reference<css::rendering::XCanvas>& 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<css::rendering::XCanvas>& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::awt::Rectangle& rBackgroundBoundingBox, const css::awt::Rectangle& rContentBoundingBox, const css::rendering::ViewState& rDefaultViewState, const css::rendering::RenderState& rDefaultRenderState); @@ -91,14 +84,6 @@ private: const css::rendering::ViewState maDefaultViewState; const css::rendering::RenderState maDefaultRenderState; - static void PaintTexture ( - const css::uno::Reference<css::rendering::XBitmap>& rxTexture, - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, - const css::awt::Rectangle& rRepaintBox, - const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon, - const css::rendering::ViewState& rDefaultViewState, - const css::rendering::RenderState& rDefaultRenderState); - static void PaintTiledBitmap ( const css::uno::Reference<css::rendering::XBitmap>& rxTexture, const css::uno::Reference<css::rendering::XCanvas>& 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 - * <http://www.openoffice.org/license.html> - * 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 <com/sun/star/awt/FontDescriptor.hpp> -#include <com/sun/star/awt/PushButtonType.hpp> -#include <com/sun/star/awt/XButton.hpp> -#include <com/sun/star/awt/XFixedText.hpp> -#include <com/sun/star/graphic/XGraphic.hpp> -#include <com/sun/star/style/VerticalAlignment.hpp> - - - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using ::rtl::OUString; - -namespace sdext { namespace presenter { - -PresenterControlCreator::PresenterControlCreator ( - const Reference<uno::XComponentContext>& rxContext, - const Reference<awt::XWindow>& 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<awt::XWindow> PresenterControlCreator::GetContainerWindow (void) const -{ - return mxControlContainerWindow; -} - - - - -Reference<awt::XControlContainer> PresenterControlCreator::GetContainer (void) const -{ - return mxControlContainer; -} - - - - -bool PresenterControlCreator::CreateContainer (void) -{ - try - { - Reference<lang::XMultiComponentFactory> xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - - mxControlContainer = Reference<awt::XControlContainer>( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.UnoControlContainer"), - mxComponentContext), - UNO_QUERY_THROW); - - Reference<awt::XControlModel> xControlModel ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.UnoControlDialogModel"), - mxComponentContext), - UNO_QUERY_THROW); - mxModelNameContainer = Reference<container::XNameContainer>( - xControlModel, UNO_QUERY_THROW); - - Reference<awt::XControl> xControl (mxControlContainer, UNO_QUERY_THROW); - xControl->setModel(xControlModel); - - mxControlFactory = Reference<lang::XMultiServiceFactory>( - xControlModel, UNO_QUERY_THROW); - - return true; - } - catch (RuntimeException&) - { - OSL_ASSERT(false); - } - - return false; -} - - - - -void PresenterControlCreator::CreateContainerWindow ( - const Reference<awt::XWindow>& rxParentWindow) -{ - try - { - Reference<awt::XControl> xControl (mxControlContainer, UNO_QUERY_THROW); - Reference<awt::XWindowPeer> xContainerPeer (rxParentWindow, UNO_QUERY_THROW); - Reference<lang::XMultiComponentFactory> xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - Reference<awt::XToolkit> xToolkit ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.awt.Toolkit"), - mxComponentContext), - UNO_QUERY_THROW); - xControl->createPeer(xToolkit, xContainerPeer); - - mxControlContainerWindow = Reference<awt::XWindow>(mxControlContainer, UNO_QUERY_THROW); - mxControlContainerWindow->setEnable(sal_True); - mxControlContainerWindow->setVisible(sal_True); - } - catch (RuntimeException&) - { - OSL_ASSERT(false); - } -} - - - - -Reference<awt::XControl> PresenterControlCreator::AddButton ( - const OUString& rsName, - const OUString& rsImageName, - const Property pUserProperties[]) -{ - Property aButtonDefaultProperties[] = { - {(sal_Char*)"PushButtonType", Any(awt::PushButtonType_STANDARD)}, - {NULL, Any()} - }; - Reference<awt::XControl> xControl( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlButton"), - aButtonDefaultProperties, - pUserProperties)); - if (xControl.is()) - { - Reference<awt::XButton> xButton (xControl, UNO_QUERY_THROW); - if (xButton.is()) - xButton->setActionCommand(rsName); - - - Reference<graphic::XGraphic> xGraphic ( - PresenterHelper::GetGraphic(mxComponentContext, rsImageName)); - if (xGraphic.is()) - { - Property aButtonGraphicProperties[] = { - {(sal_Char*)"Graphic", Any(xGraphic)}, - {(sal_Char*)"Label", Any(OUString())}, - {NULL, Any()} - }; - SetModelProperties ( - Reference<beans::XPropertySet>(xControl->getModel(), UNO_QUERY), - aButtonGraphicProperties); - } - } - - return xControl; -} - - - - -Reference<awt::XControl> 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<awt::XControl> xLabel( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlFixedTextModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlFixedText"), - aLabelDefaultProperties, - pUserProperties)); - if (xLabel.is()) - { - Reference<awt::XFixedText> xText (xLabel, UNO_QUERY); - if (xText.is()) - xText->setAlignment(1); - } - return xLabel; -} - - - - -Reference<awt::XControl> PresenterControlCreator::AddEdit ( - const OUString& rsName, - const Property pUserProperties[]) -{ - Property aEditDefaultProperties[] = { - {NULL, Any()} - }; - Reference<awt::XControl> xControl( - AddControl( - rsName, - OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel"), - OUString::createFromAscii("com.sun.star.awt.UnoControlEdit"), - aEditDefaultProperties, - pUserProperties)); - return xControl; -} - - - - -Reference<awt::XControl> PresenterControlCreator::AddControl ( - const OUString& rsName, - const OUString& rsModelServiceName, - const OUString& rsControlServiceName, - const Property pControlDefaultProperties[], - const Property pUserProperties[]) -{ - Reference<awt::XControl> 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<awt::XControlModel> xControlModel ( - mxControlFactory->createInstance(rsModelServiceName), - UNO_QUERY_THROW); - Reference<beans::XPropertySet> 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<lang::XMultiComponentFactory> xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - xControl = Reference<awt::XControl> ( - 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<awt::XWindow> 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<beans::XPropertySet>& 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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SDEXT_PRESENTER_CONTROL_CREATOR_HXX -#define SDEXT_PRESENTER_CONTROL_CREATOR_HXX - -#include <com/sun/star/awt/XControl.hpp> -#include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> - -#include <boost/noncopyable.hpp> - -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<css::uno::XComponentContext>& rxContext, - const css::uno::Reference<css::awt::XWindow>& 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<css::awt::XControl> AddButton ( - const ::rtl::OUString& rsName, - const ::rtl::OUString& rsImageName, - const Property pProperties[]); - - css::uno::Reference<css::awt::XControl> AddLabel ( - const ::rtl::OUString& rsName, - const ::rtl::OUString& rsDefaultText, - const Property pProperties[]); - - css::uno::Reference<css::awt::XControl> AddEdit ( - const ::rtl::OUString& rsName, - const Property pProperties[]); - - /** Return the container window. - */ - css::uno::Reference<css::awt::XWindow> GetContainerWindow (void) const; - css::uno::Reference<css::awt::XControlContainer> GetContainer (void) const; - -private: - css::uno::Reference<css::uno::XComponentContext> 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<css::awt::XControl> 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<css::beans::XPropertySet>& 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<presentation::XSlideShowController> -Reference<awt::XWindow> PresenterController::GetParentWindow (void) const -{ - return mxMainWindow; -} - - - - rtl::Reference<PresenterPaneContainer> 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<PresenterWindowManager> GetWindowManager (void) const; css::uno::Reference<css::presentation::XSlideShowController> GetSlideShowController (void) const; - css::uno::Reference<css::awt::XWindow> GetParentWindow (void) const; rtl::Reference<PresenterPaneContainer> GetPaneContainer (void) const; ::rtl::Reference<PresenterPaneBorderPainter> GetPaneBorderPainter (void) const; ::boost::shared_ptr<PresenterAnimator> GetAnimator (void) const; @@ -244,6 +243,18 @@ private: void LoadTheme (const css::uno::Reference<css::drawing::framework::XPane>& 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, @@ -222,19 +178,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<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon( } - - -Reference<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon( - const css::awt::Rectangle& rBox, - const double nRadius, - const Reference<rendering::XGraphicDevice>& rxDevice) -{ - if ( ! rxDevice.is()) - return NULL; - - Sequence<Sequence<geometry::RealBezierSegment2D> > aPolygon(1); - aPolygon[0] = Sequence<geometry::RealBezierSegment2D>(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<rendering::XPolyPolygon2D> 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, @@ -86,10 +86,6 @@ public: 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<css::rendering::XPolyPolygon2D> CreatePolygon( + /* static css::uno::Reference<css::rendering::XPolyPolygon2D> CreatePolygon( const css::awt::Rectangle& rBox, const double nRadius, - const css::uno::Reference<css::rendering::XGraphicDevice>& rxDevice); + const css::uno::Reference<css::rendering::XGraphicDevice>& + 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<presentation::XSlideShowController> PresenterHelper::GetSlideShowContr -Reference<graphic::XGraphic> PresenterHelper::GetGraphic ( - const Reference<uno::XComponentContext>& rxContext, - const OUString& rsName) -{ - Reference<graphic::XGraphic> xGraphic; - - try - { - // Create GraphicProvider. - Reference<lang::XMultiComponentFactory> xFactory ( - rxContext->getServiceManager(), UNO_QUERY_THROW); - Reference<graphic::XGraphicProvider> xProvider ( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.graphic.GraphicProvider"), - rxContext), - UNO_QUERY_THROW); - - // Ask the provider to obtain a graphic - Sequence<beans::PropertyValue> 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<css::presentation::XSlideShowController> GetSlideShowController ( const css::uno::Reference<css::frame::XController>& 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<css::graphic::XGraphic> GetGraphic ( - const css::uno::Reference<css::uno::XComponentContext>& 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<drawing::XDrawPage>& rxNotesP -Reference<awt::XWindow> PresenterNotesView::GetWindow (void) const -{ - return mxParentWindow; -} - - - - //----- lang::XEventListener ------------------------------------------------- void SAL_CALL PresenterNotesView::disposing (const lang::EventObject& rEventObject) @@ -1207,28 +1199,6 @@ Reference<rendering::XBitmap> PresenterNotesView::BitmapFactory::CreateBitmap ( Reference<rendering::XBitmap> xTextBitmap ( mxTextView->getPropertyValue(A2S("Bitmap")), UNO_QUERY); - /* - // Create bitmap of same size that has the right background. - Reference<rendering::XBitmap> xBitmap ( - mxCanvas->getDevice()->createCompatibleAlphaBitmap(xTextBitmap->getSize())); - Reference<rendering::XCanvas> 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<double>(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<css::drawing::XDrawPage>& rxNotesPage); - css::uno::Reference<css::awt::XWindow> 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 <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase3.hxx> #include <com/sun/star/awt/Point.hpp> @@ -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<rendering::XCanvasFont> 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<XResource> SAL_CALL PresenterPaneFactory::createResource ( const Reference<XResourceId>& rxPaneId) throw (RuntimeException) { + ThrowIfDisposed(); + if ( ! rxPaneId.is()) return NULL; @@ -217,6 +219,8 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource ( void SAL_CALL PresenterPaneFactory::releaseResource (const Reference<XResource>& 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<XConfigurationController> xCC( xCM->getConfigurationController()); mxConfigurationControllerWeak = xCC; + Reference<drawing::framework::XResourceId> 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<drawing::framework::XResourceId> 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<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( -void PresenterScreen::DeactivatePanes (const Reference<XConfigurationController>& rxCC) -{ - OSL_ASSERT(rxCC.is()); - - Reference<XComponentContext> xContext (mxContextWeak); - if ( ! xContext.is()) - return; - Reference<XResourceId> xCenterPaneId(ResourceId::create( - xContext, - PresenterHelper::msCenterPaneURL)); - if ( ! xCenterPaneId.is()) - return; - - Reference<XConfiguration> 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<Reference<XResourceId> > aViews (xCurrentConfiguration->getResources( - xCenterPaneId, - PresenterHelper::msViewURLPrefix, - AnchorBindingMode_DIRECT)); - for (sal_Int32 nIndex=0; nIndex<aViews.getLength(); ++nIndex) - rxCC->requestResourceDeactivation(aViews[nIndex]); - - // Now deactivate all top level panes and and all resources anchored - // to them. - const Sequence<Reference<XResourceId> > aPanes (xCurrentConfiguration->getResources( - xCenterPaneId, - PresenterHelper::msPaneURLPrefix, - AnchorBindingMode_DIRECT)); - for (sal_Int32 nIndex=0; nIndex<aPanes.getLength(); ++nIndex) - rxCC->requestResourceDeactivation(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<uno::XWeak*>(static_cast<const uno::XWeak*>(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<css::drawing::framework::XConfigurationController>& rxCC); - void ShutdownPresenterScreen (void); /** Create and initialize the factory for presenter view specific panes. @@ -249,8 +243,6 @@ private: */ css::uno::Reference<css::drawing::framework::XResourceId> GetMainPaneId ( const css::uno::Reference<css::presentation::XPresentation2>& 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<sal_Int32>(0.5 + nValue); } sal_Int32 floor (const double nValue) { return sal::static_int_cast<sal_Int32>(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<void(sal_Int32)>& 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<void(sal_Int32)>& 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<rendering::XBitmap>& rxBitmap) -{ - const geometry::IntegerSize2D aSize (rxBitmap->getSize()); - Resize(geometry::RealSize2D(aSize.Width, aSize.Height)); - - Reference<rendering::XCanvas> 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<double>(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<css::rendering::XBitmap>& 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<css::rendering::XCanvas>& 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<XComponentContext>& 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<sal_Int32>(rRectangle.X - mnLeft), - sal::static_int_cast<sal_Int32>(rRectangle.Y - mnTop), - sal::static_int_cast<sal_Int32>(rRectangle.Width + (mnLeft + mnRight)), - sal::static_int_cast<sal_Int32>(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<sal_Int32>(rRectangle.X + mnLeft), - sal::static_int_cast<sal_Int32>(rRectangle.Y + mnTop), - sal::static_int_cast<sal_Int32>(rRectangle.Width - (mnLeft + mnRight)), - sal::static_int_cast<sal_Int32>(rRectangle.Height - (mnTop + mnBottom))); - } -} - - - - -void SAL_CALL TransparentBorderPainter::paint ( - const rtl::OUString& rsPaneBorderStyleName, - const css::uno::Reference<css::rendering::XCanvas>& 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<double>(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<rendering::XPolyPolygon2D> 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<uno::XWeak*>(static_cast<const uno::XWeak*>(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<awt::XWindow> PresenterWindowManager::GetParentWidnow (void) const -{ - return mxParentWindow; -} - - - - void PresenterWindowManager::SetTheme (const ::boost::shared_ptr<PresenterTheme>& 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<css::drawing::framework::XPane>& rxPane); - css::uno::Reference<css::awt::XWindow> GetParentWidnow (void) const; void SetTheme (const ::boost::shared_ptr<PresenterTheme>& rpTheme); void NotifyPaneCreation (const PresenterPaneContainer::SharedPaneDescriptor& rpDescriptor); void NotifyViewCreation (const css::uno::Reference<css::drawing::framework::XView>& 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 @@ </simple-license> </registration> - <version value="1.0" /> + <version value="1.0.2" /> <platform value="UPDATED_PLATFORM" /> 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 @@ </node> <node oor:name="g" oor:op="replace"> <prop oor:name="Left"> - <value xml:lang="en-US">Alt+Page Up</value> + <value xml:lang="en-US">Alt-Page Up</value> </prop> <prop oor:name="Right"> <value xml:lang="en-US">Previous slide without effects</value> @@ -476,7 +476,7 @@ </node> <node oor:name="h" oor:op="replace"> <prop oor:name="Left"> - <value xml:lang="en-US">Alt+Page Down</value> + <value xml:lang="en-US">Alt-Page Down</value> </prop> <prop oor:name="Right"> <value xml:lang="en-US">Next slide without effects</value> @@ -500,7 +500,7 @@ </node> <node oor:name="k" oor:op="replace"> <prop oor:name="Left"> - <value xml:lang="en-US">'W', ','</value> + <value xml:lang="en-US">'W', ','</value> </prop> <prop oor:name="Right"> <value xml:lang="en-US">Whites/Unwhites the screen</value> @@ -562,6 +562,38 @@ <value xml:lang="en-US">Scroll notes up/down</value> </prop> </node> + <node oor:name="s_Separator" oor:op="replace"> + <prop oor:name="Left"> + <value xml:lang="en-US"> </value> + </prop> + <prop oor:name="Right"> + <value xml:lang="en-US"> </value> + </prop> + </node> + <node oor:name="t" oor:op="replace"> + <prop oor:name="Left"> + <value xml:lang="en-US">Ctrl-'1'</value> + </prop> + <prop oor:name="Right"> + <value xml:lang="en-US">Shows the Presenter Console</value> + </prop> + </node> + <node oor:name="u" oor:op="replace"> + <prop oor:name="Left"> + <value xml:lang="en-US">Ctrl-'2'</value> + </prop> + <prop oor:name="Right"> + <value xml:lang="en-US">Shows the Presentation Notes</value> + </prop> + </node> + <node oor:name="v" oor:op="replace"> + <prop oor:name="Left"> + <value xml:lang="en-US">Ctrl-'3'</value> + </prop> + <prop oor:name="Right"> + <value xml:lang="en-US">Shows the Slides Overview</value> + </prop> + </node> </node> </node> </node> |