From ef238fc51189b007d5c4b20b6139c78984e18be0 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 1 Dec 2010 10:02:17 +0100 Subject: impressdefaults1: #i113018# use red as default pen color, enable pen context menu --- slideshow/source/engine/slide/slideimpl.cxx | 7 ------- 1 file changed, 7 deletions(-) (limited to 'slideshow/source/engine/slide/slideimpl.cxx') diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 55831ba1609f..d976ad4d9697 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -454,9 +454,7 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); -#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); -#endif } bool SlideImpl::prefetch() @@ -1259,12 +1257,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { -#ifdef ENABLE_PRESENTER_EXTRA_UI boost::shared_ptr pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, -#else - (void)xDrawPages; - boost::shared_ptr pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue, -#endif rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, -- cgit From c5ef5762391ce310884567b3eaa3b474e1aaab9b Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 2 Dec 2010 13:34:17 +0100 Subject: impressdefaults1: #i113019# fixes to make changing of user paint settings during slideshow work --- slideshow/source/engine/slide/slideimpl.cxx | 43 +++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 9 deletions(-) (limited to 'slideshow/source/engine/slide/slideimpl.cxx') diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index d976ad4d9697..2534b495ca90 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -139,6 +139,10 @@ public: virtual PolyPolygonVector getPolygons(); virtual void drawPolygons() const; virtual bool isPaintOverlayActive() const; + virtual void enablePaintOverlay(); + virtual void disablePaintOverlay(); + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + // TODO(F2): Rework SlideBitmap to no longer be based on XBitmap, // but on canvas-independent basegfx bitmaps @@ -156,6 +160,9 @@ private: virtual bool requestCursor( sal_Int16 nCursorShape ); virtual void resetCursor(); + void activatePaintOverlay(); + void deactivatePaintOverlay(); + /** Query whether the slide has animations at all If the slide doesn't have animations, show() displays @@ -174,9 +181,6 @@ private: */ bool isShowing() const; - void enablePaintOverlay(); - void disablePaintOverlay(); - /// Set all Shapes to their initial attributes for slideshow bool applyInitialShapeAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xRootAnimationNode ); @@ -419,6 +423,13 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra maContext.mrScreenUpdater.addViewUpdate(mpShapeManager); } +void SlideImpl::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) +{ + maUserPaintColor = aUserPaintColor; + mdUserPaintStrokeWidth = dUserPaintStrokeWidth; + mbUserPaintOverlayEnabled = bUserPaintEnabled; +} + SlideImpl::~SlideImpl() { if( mpShapeManager ) @@ -540,7 +551,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted ) // --------------------------------------------------------------- // enable paint overlay, if maUserPaintColor is valid - enablePaintOverlay(); + activatePaintOverlay(); // --------------------------------------------------------------- @@ -564,7 +575,7 @@ void SlideImpl::hide() // disable user paint overlay under all circumstances, // this slide now ceases to be active. - disablePaintOverlay(); + deactivatePaintOverlay(); // --------------------------------------------------------------- @@ -886,19 +897,33 @@ bool SlideImpl::implPrefetchShow() void SlideImpl::enablePaintOverlay() { - if( mbUserPaintOverlayEnabled ) + if( !mbUserPaintOverlayEnabled || !mbPaintOverlayActive ) + { + mbUserPaintOverlayEnabled = true; + activatePaintOverlay(); + } +} + +void SlideImpl::disablePaintOverlay() +{ +} + +void SlideImpl::activatePaintOverlay() +{ + if( mbUserPaintOverlayEnabled || !maPolygons.empty() ) { mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor, mdUserPaintStrokeWidth, maContext, - maPolygons ); + maPolygons, + mbUserPaintOverlayEnabled ); mbPaintOverlayActive = true; } } void SlideImpl::drawPolygons() const { - if( mbUserPaintOverlayEnabled ) + if( mpPaintOverlay ) mpPaintOverlay->drawPolygons(); } @@ -921,7 +946,7 @@ bool SlideImpl::isPaintOverlayActive() const return mbPaintOverlayActive; } -void SlideImpl::disablePaintOverlay() +void SlideImpl::deactivatePaintOverlay() { if(mbPaintOverlayActive) maPolygons = mpPaintOverlay->getPolygons(); -- cgit