From 44d83b68fd07342fdad4003ce4007e26669979f4 Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 29 Jun 2009 15:15:41 +0200 Subject: #103174# Code from the ecntablet and eraser CWS; optionally improves user paint interactions in slideshow --- sd/source/ui/slideshow/makefile.mk | 4 + sd/source/ui/slideshow/slideshow.hrc | 22 +- sd/source/ui/slideshow/slideshow.src | 110 ++++++++++ sd/source/ui/slideshow/slideshowimpl.cxx | 335 ++++++++++++++++++++++++++++--- sd/source/ui/slideshow/slideshowimpl.hxx | 9 +- 5 files changed, 446 insertions(+), 34 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index e157ba99d3bc..b9b3cc9ee84f 100644 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -43,6 +43,10 @@ AUTOSEG=true .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk +.IF "$(ENABLE_PRESENTER_EXTRA_UI)"="YES" +CDEFS+= -DENABLE_PRESENTER_EXTRA_UI +.ENDIF + # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 8a9799321738..11a5f9807bb1 100644 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - #ifndef SD_SLIDESHOW_HRC_ #define SD_SLIDESHOW_HRC_ @@ -38,8 +37,23 @@ #define CM_SCREEN_BLACK 5 #define CM_SCREEN_WHITE 6 #define CM_ENDSHOW 7 -#define CM_FIRST_SLIDE 8 -#define CM_LAST_SLIDE 9 -#define CM_SLIDES 10 +#define CM_ERASE_INK 8 +#define CM_ERASE_ALLINK 9 +#define CM_ERASE_INK_PEN 10 +#define CM_ERASE_INK_PEN_VERY_THIN 11 +#define CM_ERASE_INK_PEN_THIN 12 +#define CM_ERASE_INK_PEN_NORMAL 13 +#define CM_ERASE_INK_PEN_THICK 14 +#define CM_ERASE_INK_PEN_VERY_THICK 15 +#define CM_COLOR_PEN 16 +#define CM_WIDTH_PEN 17 +#define CM_WIDTH_PEN_VERY_THIN 18 +#define CM_WIDTH_PEN_THIN 19 +#define CM_WIDTH_PEN_NORMAL 20 +#define CM_WIDTH_PEN_THICK 21 +#define CM_WIDTH_PEN_VERY_THICK 22 +#define CM_FIRST_SLIDE 23 +#define CM_LAST_SLIDE 24 +#define CM_SLIDES 25 #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index ec57d3e84897..7d5a05c463bd 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -75,6 +75,56 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem + { + Identifier = CM_WIDTH_PEN; + Text [ en-US ] = "~Pen Width" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_WIDTH_PEN_VERY_THIN; + Text [ en-US ] = "~Very thin"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_THIN; + Text [ en-US ] = "~Thin"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_NORMAL; + Text [ en-US ] = "~Normal"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_THICK; + Text [ en-US ] = "~Thick"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_VERY_THICK; + Text [ en-US ] = "~Very Thick"; + }; + }; + }; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_COLOR_PEN ; + Text [ en-US ] = "~Change Color" ; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem { Identifier = CM_SCREEN; Text [ en-US ] = "~Screen" ; @@ -101,6 +151,66 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem + { + Identifier = CM_ERASE_ALLINK ; + Text [ en-US ] = "~Erase All Ink" ; + }; + MenuItem + { + Identifier = CM_ERASE_INK ; + Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_ERASE_ALLINK ; + Text [ en-US ] = "~Erase All Ink" ; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN; + Text [ en-US ] = "~Eraser Size" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_ERASE_INK_PEN_VERY_THIN; + Text [ en-US ] = "~Very thin"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_THIN; + Text [ en-US ] = "~Thin"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_NORMAL; + Text [ en-US ] = "~Normal"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_THICK; + Text [ en-US ] = "~Thick"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_VERY_THICK; + Text [ en-US ] = "~Very Thick"; + }; + }; + }; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index c0b4857f3f6b..e56c93f72b13 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -34,6 +34,7 @@ #include +#include "com/sun/star/frame/XComponentLoader.hpp" #include #include #include @@ -86,6 +87,7 @@ #include "canvas/elapsedtime.hxx" #include "canvas/prioritybooster.hxx" #include "avmedia/mediawindow.hxx" +#include "svtools/colrdlg.hxx" #include #include @@ -169,7 +171,7 @@ public: bool nextSlide(); bool previousSlide(); - void displayCurrentSlide( const Reference< XSlideShow >& xShow ); + void displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages); sal_Int32 getNextSlideIndex() const; sal_Int32 getPreviousSlideIndex() const; @@ -466,7 +468,7 @@ bool AnimationSlideController::previousSlide() return jumpToSlideIndex( getPreviousSlideIndex() ); } -void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow ) +void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages ) { const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber(); @@ -488,7 +490,7 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow } if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) ) - xShow->displaySlide( xSlide, xAnimNode, aProperties ); + xShow->displaySlide( xSlide, xDrawPages, xAnimNode, aProperties ); } } @@ -523,7 +525,11 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x0000FF00L ) +, mnUserPaintColor( 0x00000000L ) +, mdUserPaintStrokeWidth ( 4.0 ) +, mbEraseAllInk(false) +, mbEraseInk(false) +, mnEraseInkSize(100.0) , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -1087,7 +1093,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), - -1, Any( static_cast(0x0000FF00L) ), + -1, Any( static_cast(0x00000000L) ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1394,7 +1400,8 @@ void SlideshowImpl::displayCurrentSlide() if( mpSlideController.get() && mxShow.is() ) { - mpSlideController->displayCurrentSlide( mxShow ); + Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW ); + mpSlideController->displayCurrentSlide( mxShow, xDrawPages ); registerShapeEvents(mpSlideController->getCurrentSlideNumber()); update(); @@ -1411,6 +1418,12 @@ void SlideshowImpl::displayCurrentSlide() void SlideshowImpl::endPresentation() { + if( maPresSettings.mbMouseAsPen) + { + Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); + if( xDocFactory.is() ) + mxShow->registerUserPaintPolygons(xDocFactory); + } if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -2112,6 +2125,12 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) ); +#ifdef ENABLE_PRESENTER_EXTRA_UI + //adding button to contextual menu for erasing functionnalities for UserPaintOverlay + pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); + pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); +#endif + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ); @@ -2179,6 +2198,100 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) } } + PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); + + // populate color width list + if( pWidthMenu ) + { + if(! maPresSettings.mbMouseAsPen) + { + pMenu->EnableItem( CM_WIDTH_PEN, FALSE ); + } + else + { + sal_Int32 nIterator; + double nWidth; + + nWidth = 4.0; + for( nIterator = 1; nIterator < 6; nIterator++) + { + switch(nIterator) + { + case 1: + nWidth = 4.0; + break; + case 2: + nWidth = 100.0; + break; + case 3: + nWidth = 150.0; + break; + case 4: + nWidth = 200.0; + break; + case 5: + nWidth = 400.0; + break; + default: + break; + } + + pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE); + if( nWidth == mdUserPaintStrokeWidth) + pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) ); + + } + } + } + +#ifdef ENABLE_PRESENTER_EXTRA_UI + PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); + + // populate eraser width list + if( pEraseWidthMenu ) + { + if(! maPresSettings.mbMouseAsPen) + { + pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE ); + } + else + { + sal_Int32 nEIterator; + double nEWidth; + + nEWidth = 100.0; + for( nEIterator = 1; nEIterator < 6; nEIterator++) + { + switch(nEIterator) + { + case 1: + nEWidth = 100.0; + break; + case 2: + nEWidth = 200.0; + break; + case 3: + nEWidth = 300.0; + break; + case 4: + nEWidth = 400.0; + break; + case 5: + nEWidth = 500.0; + break; + default: + break; + } + + pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); + if( nEWidth == mnEraseInkSize) + pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); + + } + } + } +#endif + pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) ); pMenu->Execute( mpShowWindow, maPopupMousePos ); delete pMenu; @@ -2241,32 +2354,134 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; + case CM_COLOR_PEN: + if( maPresSettings.mbMouseAsPen ) + { + //Open a color picker based on SvColorDialog + ::Color aColor( mnUserPaintColor ); + SvColorDialog aColorDlg( mpShowWindow); + aColorDlg.SetColor( aColor ); - case CM_ENDSHOW: - // in case the user cancels the presentation, switch to current slide - // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) - { - if( mpSlideController->getCurrentSlideNumber() != -1 ) + if (aColorDlg.Execute() ) + { + aColor = aColorDlg.GetColor(); + mnUserPaintColor = aColor.GetColor(); + setPenColor(mnUserPaintColor); + } + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_VERY_THIN: + if( maPresSettings.mbMouseAsPen ) { - mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); + setPenWidth(4.0); + mbWasPaused = false; } - } - endPresentation(); - break; - default: - sal_Int32 nPageNumber = nMenuId - CM_SLIDES; - const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); - if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) - { - mpShowWindow->RestartShow( nPageNumber ); - } - else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) - { - displaySlideNumber( nPageNumber ); - } - mbWasPaused = false; - break; + break; + + case CM_WIDTH_PEN_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(100.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_NORMAL: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(150.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(200.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_VERY_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_ALLINK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseAllInk(true); + mbWasPaused = false; + } + break; + case CM_ERASE_INK_PEN_VERY_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(100.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(200.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_NORMAL: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(300.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_INK_PEN_VERY_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(500.0); + mbWasPaused = false; + } + break; + + case CM_ENDSHOW: + // in case the user cancels the presentation, switch to current slide + // in edit mode + if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + { + if( mpSlideController->getCurrentSlideNumber() != -1 ) + { + mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); + } + } + endPresentation(); + break; + default: + sal_Int32 nPageNumber = nMenuId - CM_SLIDES; + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); + if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) + { + mpShowWindow->RestartShow( nPageNumber ); + } + else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + { + displaySlideNumber( nPageNumber ); + } + mbWasPaused = false; + break; } } @@ -2859,6 +3074,33 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc aPenProp.Value = aValue; mxShow->setProperty( aPenProp ); + //for StrokeWidth : + Any aValueWidth; + if( maPresSettings.mbMouseAsPen ) + aValueWidth <<= mdUserPaintStrokeWidth; + + beans::PropertyValue aPenPropWidth; + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); + aPenPropWidth.Value = aValueWidth; + + mxShow->setProperty( aPenPropWidth ); + + //for EraseAllInk : + Any aValueEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseAllInk <<= mbEraseAllInk; + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value = aValueEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + //for EraseInk : + Any aValueEraseInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseInk <<= mnEraseInkSize; + beans::PropertyValue aPenPropEraseInk; + aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); + aPenPropEraseInk.Value = aValueEraseInk; + mxShow->setProperty( aPenPropEraseInk ); } catch( Exception& e ) { @@ -2872,6 +3114,23 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc } } +// -------------------------------------------------------------------- +double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + return mdUserPaintStrokeWidth; +} + + +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mdUserPaintStrokeWidth = dStrokeWidth; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update color and width +} // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -2890,6 +3149,24 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep setUsePen( sal_True ); // update color } +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbEraseAllInk=bEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update erase all ink bool +} + + +void SAL_CALL SlideshowImpl::setEraseInk( double nEraseInkSize ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mnEraseInkSize=nEraseInkSize; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update erase ink size +} // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index b9d5506ff2f3..b492288b3f0c 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -200,8 +200,12 @@ public: virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException); virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); + virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseInk( double nEraseInkSize ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -380,7 +384,10 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; - + double mdUserPaintStrokeWidth; + bool mbEraseAllInk; + bool mbEraseInk; + double mnEraseInkSize; /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; -- cgit From 54e4becdc5eee38a4ef85f8bab8d6258c54e2faf Mon Sep 17 00:00:00 2001 From: thb Date: Thu, 2 Jul 2009 16:36:09 +0200 Subject: Better wording, better menu, and better code; kudos to ericb for the patch --- sd/source/ui/slideshow/slideshow.src | 55 +++++++++++++++----------------- sd/source/ui/slideshow/slideshowimpl.cxx | 18 ++++------- 2 files changed, 31 insertions(+), 42 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 7d5a05c463bd..07df291e428f 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -118,35 +118,13 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Color" ; + Text [ en-US ] = "~Change Pen Color" ; }; MenuItem { Separator = TRUE; }; MenuItem - { - Identifier = CM_SCREEN; - Text [ en-US ] = "~Screen" ; - - SubMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = CM_SCREEN_BLACK; - Text [ en-US ] = "~Black"; - }; - MenuItem - { - Identifier = CM_SCREEN_WHITE; - Text [ en-US ] = "~White"; - }; - }; - }; - }; - MenuItem { Separator = TRUE; }; @@ -165,11 +143,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem - { - Identifier = CM_ERASE_ALLINK ; - Text [ en-US ] = "~Erase All Ink" ; - }; - MenuItem { Identifier = CM_ERASE_INK_PEN; Text [ en-US ] = "~Eraser Size" ; @@ -206,14 +179,36 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; }; + MenuItem + { + Separator = TRUE; + }; MenuItem { - Separator = TRUE; + Identifier = CM_SCREEN; + Text [ en-US ] = "~Screen" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_SCREEN_BLACK; + Text [ en-US ] = "~Black"; + }; + MenuItem + { + Identifier = CM_SCREEN_WHITE; + Text [ en-US ] = "~White"; + }; + }; + }; }; MenuItem { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; - }; + }; }; }; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index e56c93f72b13..c7966d805c01 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2354,8 +2354,10 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; + + if( maPresSettings.mbMouseAsPen ) + { case CM_COLOR_PEN: - if( maPresSettings.mbMouseAsPen ) { //Open a color picker based on SvColorDialog ::Color aColor( mnUserPaintColor ); @@ -2373,7 +2375,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_VERY_THIN: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(4.0); mbWasPaused = false; @@ -2381,7 +2382,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_THIN: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(100.0); mbWasPaused = false; @@ -2389,7 +2389,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_NORMAL: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(150.0); mbWasPaused = false; @@ -2397,7 +2396,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_THICK: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(200.0); mbWasPaused = false; @@ -2405,21 +2403,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_VERY_THICK: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(400.0); mbWasPaused = false; } break; +#ifdef ENABLE_PRESENTER_EXTRA_UI case CM_ERASE_ALLINK: - if( maPresSettings.mbMouseAsPen ) { setEraseAllInk(true); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THIN: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(100.0); mbWasPaused = false; @@ -2427,7 +2423,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_THIN: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(200.0); mbWasPaused = false; @@ -2435,7 +2430,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_NORMAL: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(300.0); mbWasPaused = false; @@ -2443,19 +2437,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_THICK: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(400.0); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THICK: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(500.0); mbWasPaused = false; } break; +#endif + } case CM_ENDSHOW: // in case the user cancels the presentation, switch to current slide -- cgit From bf54db8b13d611c461ba2db9030f7d92e1497baf Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 12 Nov 2009 13:50:09 +0100 Subject: #i105942# --- sd/source/filter/eppt/epptso.cxx | 103 +++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 53 deletions(-) (limited to 'sd/source') diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 75e5a4ba3227..6b0e12213449 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1963,54 +1963,68 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool } } - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX ) + rtl::OUString aCharHeightName, aCharWeightName, aCharLocaleName, aCharPostureName; + switch( nScriptType ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), bGetPropStateValue ) ) + case com::sun::star::i18n::ScriptType::ASIAN : { - float fFloat; - mAny >>= fFloat; - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) - mnCharAttr |= 1; + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightAsian" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightAsian" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleAsian" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureAsian" ) ); + break; + } + case com::sun::star::i18n::ScriptType::COMPLEX : + { + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightComplex" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleComplex" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ); + break; + } + default: + { + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ); + break; } } - else + + mnCharHeight = 24; + if ( GetPropertyValue( mAny, mXPropSet, aCharHeightName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ), bGetPropStateValue ) ) + float fVal; + if ( mAny >>= fVal ) { - float fFloat; - mAny >>= fFloat; - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) - mnCharAttr |= 1; + mnCharHeight = (sal_uInt16)( fVal + 0.5 ); + meCharHeight = GetPropertyState( mXPropSet, aCharHeightName ); } } - - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) - mnCharAttrHard |= 1; - - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX ) + if ( GetPropertyValue( mAny, mXPropSet, aCharWeightName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), bGetPropStateValue ) ) + float fFloat; + if ( mAny >>= fFloat ) { - ::com::sun::star::awt::FontSlant aFS; - mAny >>= aFS; - switch ( aFS ) - { - case ::com::sun::star::awt::FontSlant_OBLIQUE : - case ::com::sun::star::awt::FontSlant_ITALIC : - mnCharAttr |= 2; - break; - default: - break; - } + if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) + mnCharAttr |= 1; + if ( GetPropertyState( mXPropSet, aCharWeightName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) + mnCharAttrHard |= 1; } } - else + if ( GetPropertyValue( mAny, mXPropSet, aCharLocaleName, sal_False ) ) + { + com::sun::star::lang::Locale eLocale; + if ( mAny >>= eLocale ) + meCharLocale = eLocale; + } + if ( GetPropertyValue( mAny, mXPropSet, aCharPostureName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ), bGetPropStateValue ) ) + ::com::sun::star::awt::FontSlant aFS; + if ( mAny >>= aFS ) { - ::com::sun::star::awt::FontSlant aFS; - mAny >>= aFS; - switch ( aFS ) + switch( aFS ) { case ::com::sun::star::awt::FontSlant_OBLIQUE : case ::com::sun::star::awt::FontSlant_ITALIC : @@ -2019,12 +2033,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool default: break; } + if ( GetPropertyState( mXPropSet, aCharPostureName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) + mnCharAttrHard |= 2; } } - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) - mnCharAttrHard |= 2; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), bGetPropStateValue ) ) { sal_Int16 nVal; @@ -2050,13 +2063,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) mnCharAttrHard |= 16; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ), bGetPropStateValue ) ) - { - com::sun::star::lang::Locale eLocale; - if ( mAny >>= eLocale ) - meCharLocale = eLocale; - } - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharRelief" ) ), bGetPropStateValue ) ) { sal_Int16 nVal; @@ -2067,15 +2073,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) mnCharAttrHard |= 512; - mnCharHeight = 24; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), bGetPropStateValue ) ) - { - float fVal; - mAny >>= fVal; - mnCharHeight = (sal_uInt16)( fVal + 0.5 ); - } - meCharHeight = ePropState; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) ) { sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() ); -- cgit From d529dfa3b1bebe6f284cbc4d0779eb0a058074fb Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 13 Nov 2009 17:19:14 +0100 Subject: impress181: #i106770# applied patch from cmc --- sd/source/filter/eppt/epptso.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sd/source') diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 6b0e12213449..b234595e0b9b 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -2418,15 +2418,10 @@ void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight ) // from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, String& rFontName) { - StarSymbolToMSMultiFont *pConvert = 0; - FontFamily eFamily = FAMILY_DECORATIVE; - - if (!pConvert) - { - pConvert = CreateStarSymbolToMSMultiFont(); - } sal_Unicode cChar = rNumStr.GetChar(0); + StarSymbolToMSMultiFont *pConvert = CreateStarSymbolToMSMultiFont(); String sFont = pConvert->ConvertChar(cChar); + delete pConvert; if (sFont.Len()) { rNumStr = static_cast< sal_Unicode >(cChar | 0xF000); @@ -2442,7 +2437,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str let words own font substitution kick in */ rChrSet = RTL_TEXTENCODING_UNICODE; - eFamily = FAMILY_SWISS; rFontName = ::GetFontToken(rFontName, 0); } else @@ -2455,7 +2449,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str rFontName.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Wingdings")); rNumStr = static_cast< sal_Unicode >(0x6C); } - delete pConvert; } void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue ) -- cgit From 593892f63dc03cdf2478ed07adb807a033e2cc5a Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 16 Nov 2009 15:03:54 +0100 Subject: #i82435# enable drop of image link embedded --- sd/source/ui/view/sdview4.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sd/source') diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 72534b476a73..748c23338d44 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -377,9 +377,10 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG ) if( !pGraphicFilter->ImportGraphic( aGraphic, aURL ) ) { sal_Int8 nTempAction = ( aIter == maDropFileVector.begin() ) ? mnAction : 0; + const bool bLink = ( ( nTempAction & DND_ACTION_LINK ) != 0 ); SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL ); - if( pGrafObj ) + if( pGrafObj && bLink ) pGrafObj->SetGraphicLink( aCurrentDropFile, String() ); // return action from first inserted graphic -- cgit From 55c5ee94dee3182d7ba0d2961266f49db5561bb6 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 11 Dec 2009 14:31:09 +0100 Subject: impress181: #i107561#: now also exporting notes to pdf --- sd/source/ui/unoidl/unomodel.cxx | 52 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'sd/source') diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 8906059e57cf..aaa6920749c2 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -111,6 +112,12 @@ #include #include +#include +#include +#include +#include +#include + using ::rtl::OUString; #include @@ -1604,6 +1611,44 @@ sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc return nPage; } +void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDFExtOutDevData& rPDFExtOutDevData ) +{ + try + { + uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW ); + uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); + + sal_Int32 nIndex = 1; + + LanguageType eLanguage = Application::GetSettings().GetLanguage(); + while( xAnnotationEnumeration->hasMoreElements() ) + { + uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() ); + + geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() ); + uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); +// rtl::OUString sInitials( getInitials( sAuthor ) ); + util::DateTime aDateTime( xAnnotation->getDateTime() ); + + Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year ); + Time aTime; + String aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); + + vcl::PDFNote aNote; + String sTitle( xAnnotation->getAuthor() ); + sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) ); + sTitle += aStr; + aNote.Title = sTitle; + aNote.Contents = xText->getString(); + rPDFExtOutDevData.CreateNote( Rectangle( Point( static_cast< long >( aRealPoint2D.X * 100 ), + static_cast< long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote ); + } + } + catch( uno::Exception& ) + { + } +} + void ImplPDFExportShapeInteraction( uno::Reference< drawing::XShape > xShape, SdDrawDocument& rDoc, vcl::PDFExtOutDevData& rPDFExtOutDevData ) { const rtl::OUString sGroup ( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GroupShape" ) ); @@ -1842,11 +1887,14 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r const sal_Int32 nPageNumber = nRenderer + 1; PageKind ePageKind = PK_STANDARD; sal_Bool bExportNotesPages = sal_False; + sal_Bool bExportNotes = sal_False; for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) { if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) - rxOptions[ nProperty].Value >>= xRenderDevice; + rxOptions[ nProperty ].Value >>= xRenderDevice; + else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ) ) + rxOptions[ nProperty ].Value >>= bExportNotes; else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ) ) { rxOptions[ nProperty].Value >>= bExportNotesPages; @@ -1942,6 +1990,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) ); if ( xPage.is() ) { + if ( bExportNotes ) + ImplPDFExportComments( xPage, *pPDFExtOutDevData ); uno::Reference< beans::XPropertySet > xPagePropSet( xPage, uno::UNO_QUERY ); if( xPagePropSet.is() ) { -- cgit From af5c661b945658b1c0a2f61e66446d030abdbf40 Mon Sep 17 00:00:00 2001 From: ericb Date: Tue, 15 Dec 2009 23:12:19 +0100 Subject: #i97972# commit all changes since Thorsten rebase. Thanks to Nelle, Jonathan, Christian and ericb --- sd/source/ui/slideshow/makefile.mk | 5 +- sd/source/ui/slideshow/slideshow.cxx | 2 +- sd/source/ui/slideshow/slideshow.hrc | 43 +++++--- sd/source/ui/slideshow/slideshow.src | 45 +++++--- sd/source/ui/slideshow/slideshowimpl.cxx | 183 +++++++++++++++++++++++++------ sd/source/ui/slideshow/slideshowimpl.hxx | 20 +++- 6 files changed, 223 insertions(+), 75 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index b9b3cc9ee84f..7055d723df55 100644 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -43,8 +43,9 @@ AUTOSEG=true .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -.IF "$(ENABLE_PRESENTER_EXTRA_UI)"="YES" -CDEFS+= -DENABLE_PRESENTER_EXTRA_UI +.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" +RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI .ENDIF # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 6d5e3e31ad80..7df7e3e105f7 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -87,7 +87,7 @@ extern String getUiNameFromPageApiNameImpl( const ::rtl::OUString& rApiName ); namespace { /** This local version of the work window overloads DataChanged() so that it - can restart the slide show when a displau is added or removed. + can restart the slide show when a display is added or removed. */ class FullScreenWorkWindow : public WorkWindow { diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 11a5f9807bb1..85b2cf0f3009 100644 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -27,6 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #ifndef SD_SLIDESHOW_HRC_ #define SD_SLIDESHOW_HRC_ @@ -37,23 +38,29 @@ #define CM_SCREEN_BLACK 5 #define CM_SCREEN_WHITE 6 #define CM_ENDSHOW 7 -#define CM_ERASE_INK 8 -#define CM_ERASE_ALLINK 9 -#define CM_ERASE_INK_PEN 10 -#define CM_ERASE_INK_PEN_VERY_THIN 11 -#define CM_ERASE_INK_PEN_THIN 12 -#define CM_ERASE_INK_PEN_NORMAL 13 -#define CM_ERASE_INK_PEN_THICK 14 -#define CM_ERASE_INK_PEN_VERY_THICK 15 -#define CM_COLOR_PEN 16 -#define CM_WIDTH_PEN 17 -#define CM_WIDTH_PEN_VERY_THIN 18 -#define CM_WIDTH_PEN_THIN 19 -#define CM_WIDTH_PEN_NORMAL 20 -#define CM_WIDTH_PEN_THICK 21 -#define CM_WIDTH_PEN_VERY_THICK 22 -#define CM_FIRST_SLIDE 23 -#define CM_LAST_SLIDE 24 -#define CM_SLIDES 25 +#define CM_FIRST_SLIDE 8 +#define CM_LAST_SLIDE 9 +#define CM_SLIDES 10 +#ifdef ENABLE_PRESENTER_EXTRA_UI +//CM for extra presenter UI +#define CM_ERASE_ALLINK 11 +#define CM_ERASE_INK 12 +#define CM_ERASE_INK_PEN 13 +#define CM_ERASE_INK_PEN_VERY_THIN 14 +#define CM_ERASE_INK_PEN_THIN 15 +#define CM_ERASE_INK_PEN_NORMAL 16 +#define CM_ERASE_INK_PEN_THICK 17 +#define CM_ERASE_INK_PEN_VERY_THICK 18 +#define CM_COLOR_PEN 19 +#define CM_WIDTH_PEN 20 +#define CM_WIDTH_PEN_VERY_THIN 21 +#define CM_WIDTH_PEN_THIN 22 +#define CM_WIDTH_PEN_NORMAL 23 +#define CM_WIDTH_PEN_THICK 24 +#define CM_WIDTH_PEN_VERY_THICK 25 +#define CM_PEN_MODE 26 +#define CM_ERASE_MODE 27 +#define CM_POINTER_OPTION 28 +#endif //ENABLE_PRESENTER_EXTRA_UI #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 07df291e428f..ee21508deb38 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -74,13 +74,27 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; +#ifdef ENABLE_PRESENTER_EXTRA_UI MenuItem { - Identifier = CM_WIDTH_PEN; - Text [ en-US ] = "~Pen Width" ; - + Identifier = CM_PEN_MODE; + Text [ en-US ] = "~Pen Mode"; + }; + MenuItem + { + Identifier = CM_ERASE_MODE; + Text [ en-US ] = "~Eraser Mode"; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN; + Text [ en-US ] = "~Pen Width" ; SubMenu = Menu - { + { ItemList = { MenuItem @@ -115,8 +129,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; - MenuItem - { + MenuItem + { Identifier = CM_COLOR_PEN ; Text [ en-US ] = "~Change Pen Color" ; }; @@ -131,23 +145,23 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_ERASE_ALLINK ; - Text [ en-US ] = "~Erase All Ink" ; - }; - MenuItem - { - Identifier = CM_ERASE_INK ; - Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + Text [ en-US ] = "~Erase All Ink On Slide" ; }; + // MenuItem + // { + // Identifier = CM_ERASE_INK ; + // Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + // }; MenuItem { Separator = TRUE; }; MenuItem { - Identifier = CM_ERASE_INK_PEN; - Text [ en-US ] = "~Eraser Size" ; + Identifier = CM_ERASE_INK_PEN; + Text [ en-US ] = "~Eraser Width" ; - SubMenu = Menu + SubMenu = Menu { ItemList = { @@ -179,6 +193,7 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; }; +#endif MenuItem { Separator = TRUE; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index c7966d805c01..eb4a430116ff 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -468,6 +468,8 @@ bool AnimationSlideController::previousSlide() return jumpToSlideIndex( getPreviousSlideIndex() ); } + + void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages ) { const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber(); @@ -525,11 +527,15 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x00000000L ) +, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default +#ifdef ENABLE_PRESENTER_EXTRA_UI +, mbSwitchPenMode(true) +, mbSwitchEraserMode(false) , mdUserPaintStrokeWidth ( 4.0 ) , mbEraseAllInk(false) -, mbEraseInk(false) -, mnEraseInkSize(100.0) +//, mbEraseInk(false) +, mnEraseInkSize(100) +#endif , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -1093,6 +1099,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), + // User paint color is black by default. -1, Any( static_cast(0x00000000L) ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1418,12 +1425,14 @@ void SlideshowImpl::displayCurrentSlide() void SlideshowImpl::endPresentation() { +#ifdef ENABLE_PRESENTER_EXTRA_UI if( maPresSettings.mbMouseAsPen) { Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); if( xDocFactory.is() ) mxShow->registerUserPaintPolygons(xDocFactory); } +#endif if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -2128,7 +2137,12 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) #ifdef ENABLE_PRESENTER_EXTRA_UI //adding button to contextual menu for erasing functionnalities for UserPaintOverlay pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); - pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); + // Adding button to contextual menu for changing pen color + pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); + // Adding button to display if in Pen mode + pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen)); + // Adding button to displau if in Erase Mode + pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen)); #endif const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); @@ -2197,6 +2211,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK ); } } +#ifdef ENABLE_PRESENTER_EXTRA_UI PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); @@ -2244,7 +2259,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) } } -#ifdef ENABLE_PRESENTER_EXTRA_UI + PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); // populate eraser width list @@ -2286,6 +2301,10 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); if( nEWidth == mnEraseInkSize) pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); + if( mbSwitchPenMode ) + pMenu->CheckItem( (USHORT)(CM_PEN_MODE)); + if( mbSwitchEraserMode ) + pMenu->CheckItem( (USHORT)(CM_ERASE_MODE)); } } @@ -2354,7 +2373,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; - +#ifdef ENABLE_PRESENTER_EXTRA_UI if( maPresSettings.mbMouseAsPen ) { case CM_COLOR_PEN: @@ -2408,48 +2427,59 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) mbWasPaused = false; } break; -#ifdef ENABLE_PRESENTER_EXTRA_UI case CM_ERASE_ALLINK: { setEraseAllInk(true); mbWasPaused = false; } break; + case CM_PEN_MODE: + { + setPenMode(true); + mbWasPaused = false; + } + break; + case CM_ERASE_MODE: + { + setEraserMode(true); + mbWasPaused = false; + } + break; case CM_ERASE_INK_PEN_VERY_THIN: { - setEraseInk(100.0); + setEraseInk(100); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_THIN: { - setEraseInk(200.0); + setEraseInk(200); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_NORMAL: { - setEraseInk(300.0); + setEraseInk(300); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_THICK: { - setEraseInk(400.0); + setEraseInk(400); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THICK: { - setEraseInk(500.0); + setEraseInk(500); mbWasPaused = false; } break; -#endif } +#endif case CM_ENDSHOW: // in case the user cancels the presentation, switch to current slide @@ -3058,16 +3088,16 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc maPresSettings.mbMouseAsPen = bMouseAsPen; if( mxShow.is() ) try { + // For Pencolor; Any aValue; if( maPresSettings.mbMouseAsPen ) - // todo: take color from configuration - aValue <<= mnUserPaintColor; - + // TODO: take color from configuration + aValue <<= mnUserPaintColor; beans::PropertyValue aPenProp; aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" )); aPenProp.Value = aValue; - mxShow->setProperty( aPenProp ); +#ifdef ENABLE_PRESENTER_EXTRA_UI //for StrokeWidth : Any aValueWidth; if( maPresSettings.mbMouseAsPen ) @@ -3079,22 +3109,25 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc mxShow->setProperty( aPenPropWidth ); - //for EraseAllInk : - Any aValueEraseAllInk; + // for Pen Mode + Any aValueSwitchPenMode; if( maPresSettings.mbMouseAsPen ) - aValueEraseAllInk <<= mbEraseAllInk; - beans::PropertyValue aPenPropEraseAllInk; - aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); - aPenPropEraseAllInk.Value = aValueEraseAllInk; - mxShow->setProperty( aPenPropEraseAllInk ); - //for EraseInk : - Any aValueEraseInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseInk <<= mnEraseInkSize; - beans::PropertyValue aPenPropEraseInk; - aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); - aPenPropEraseInk.Value = aValueEraseInk; - mxShow->setProperty( aPenPropEraseInk ); + aValueSwitchPenMode <<= mbSwitchPenMode; + beans::PropertyValue aPenPropSwitchPenMode; + aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); + aPenPropSwitchPenMode.Value = aValueSwitchPenMode; + mxShow->setProperty( aPenPropSwitchPenMode ); + + //for EraseAllInk : + Any aValueEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseAllInk <<= mbEraseAllInk; + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value = aValueEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + mbEraseAllInk = false; // sets to false so not to have it applied again +#endif } catch( Exception& e ) { @@ -3108,23 +3141,64 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc } } +#ifdef ENABLE_PRESENTER_EXTRA_UI +void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + maPresSettings.mbMouseAsPen = bMouseAsPen; + if( mxShow.is() ) try + { + + //for EraseInk : + Any aValueEraseInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseInk <<= mnEraseInkSize; + beans::PropertyValue aPenPropEraseInk; + aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); + aPenPropEraseInk.Value = aValueEraseInk; + mxShow->setProperty( aPenPropEraseInk ); + + // for Erase Mode + Any aValueSwitchEraserMode; + if( maPresSettings.mbMouseAsPen ) + aValueSwitchEraserMode <<= mbSwitchEraserMode; + beans::PropertyValue aPenPropSwitchEraserMode; + aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" )); + aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode; + mxShow->setProperty( aPenPropSwitchEraserMode ); + } + catch( Exception& e ) + { + static_cast(e); + DBG_ERROR( + (OString("sd::SlideshowImpl::setUseEraser(), " + "exception caught: ") + + rtl::OUStringToOString( + comphelper::anyToString( cppu::getCaughtException() ), + RTL_TEXTENCODING_UTF8 )).getStr() ); + } +} + // -------------------------------------------------------------------- + double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); return mdUserPaintStrokeWidth; } - // -------------------------------------------------------------------- void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mdUserPaintStrokeWidth = dStrokeWidth; + mbSwitchPenMode = true; + mbSwitchEraserMode = !mbSwitchPenMode; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color and width } +#endif // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -3139,10 +3213,48 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnUserPaintColor = nColor; +#ifdef ENABLE_PRESENTER_EXTRA_UI + mbSwitchPenMode = true; + mbSwitchEraserMode = !mbSwitchPenMode; +#endif if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color } +#ifdef ENABLE_PRESENTER_EXTRA_UI +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbSwitchPenMode = bSwitchPenMode; + + if(mbSwitchPenMode == true){ + mbSwitchEraserMode = false; + }else{ + mbSwitchEraserMode = true; + } + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // Switch to Pen Mode + +} + +void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbSwitchEraserMode = bSwitchEraserMode; + if(mbSwitchEraserMode = true){ + mbSwitchPenMode = false; + }else{ + mbSwitchPenMode = true; + } + + if( maPresSettings.mbMouseAsPen ) + setUseEraser( sal_True ); // Switch to EraseMode + +} + + // -------------------------------------------------------------------- void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) @@ -3154,13 +3266,16 @@ void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeE } -void SAL_CALL SlideshowImpl::setEraseInk( double nEraseInkSize ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnEraseInkSize=nEraseInkSize; + mbSwitchPenMode = false; + mbSwitchEraserMode = true; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update erase ink size } +#endif // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index b492288b3f0c..ec90b433f9ee 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -200,12 +200,17 @@ public: virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException); virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); +#ifdef ENABLE_PRESENTER_EXTRA_UI + virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); + virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException); - virtual void SAL_CALL setEraseInk( double nEraseInkSize ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException); +#endif virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -384,10 +389,15 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; + +#ifdef ENABLE_PRESENTER_EXTRA_UI + bool mbSwitchPenMode; + bool mbSwitchEraserMode; double mdUserPaintStrokeWidth; bool mbEraseAllInk; - bool mbEraseInk; - double mnEraseInkSize; +// bool mbEraseInk; + sal_Int32 mnEraseInkSize; +#endif /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; -- cgit From 967d3ca09c737d657e3efec4121c87ef39af64fa Mon Sep 17 00:00:00 2001 From: thb Date: Wed, 16 Dec 2009 14:47:09 +0100 Subject: eraser01: #i97972# - Fixed two minor bugs * ran autoconf, to get the --enable-extra-presenter-ui option * fixed thinko when selecting eraser width (slideshow was switching to eraser mode then, but context menu stayed at pen) --- sd/source/ui/slideshow/slideshowimpl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index eb4a430116ff..9fd9bd6694bc 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -3273,7 +3273,7 @@ void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (Runti mbSwitchPenMode = false; mbSwitchEraserMode = true; if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update erase ink size + setUseEraser( sal_True ); // update erase ink size } #endif // -------------------------------------------------------------------- -- cgit From d30bcd05298ef4d1d07ba53f9a78941df0681b6c Mon Sep 17 00:00:00 2001 From: thb Date: Wed, 16 Dec 2009 15:02:20 +0100 Subject: eraser01: #i97972# - one more fix for erase all ink * make sd flags reflect the slideshow state after eraseAllInk was called. Fix is from Metrokid. --- sd/source/ui/slideshow/slideshowimpl.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 9fd9bd6694bc..a736f4a88a77 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -3261,6 +3261,8 @@ void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeE { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mbEraseAllInk=bEraseAllInk; + mbSwitchPenMode = true; + mbSwitchEraserMode = false; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update erase all ink bool } -- cgit From fcdda26bdb5285c2964987ab6243b495a6bb673e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 6 Jan 2010 10:58:09 +0100 Subject: removed unused variable --- sd/source/ui/unoidl/unomodel.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index aaa6920749c2..4dab2fbac616 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1618,8 +1618,6 @@ void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDF uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW ); uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); - sal_Int32 nIndex = 1; - LanguageType eLanguage = Application::GetSettings().GetLanguage(); while( xAnnotationEnumeration->hasMoreElements() ) { -- cgit From 5a57b4fbd058bb411ad38d37b4029b949fca1d20 Mon Sep 17 00:00:00 2001 From: ericb Date: Wed, 6 Jan 2010 16:41:36 +0100 Subject: eraser01: #i103174# cosmetic changes in sd before RfQA --- sd/source/ui/slideshow/slideshow.src | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index ee21508deb38..42459427f54f 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -147,11 +147,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU Identifier = CM_ERASE_ALLINK ; Text [ en-US ] = "~Erase All Ink On Slide" ; }; - // MenuItem - // { - // Identifier = CM_ERASE_INK ; - // Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; - // }; MenuItem { Separator = TRUE; -- cgit From 022eec80a272cddcf5ee6eda2b14236df1a4e30c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 13:23:47 +0000 Subject: cmcfixes69: #i108261# fix mismatch ifdefs --- sd/source/ui/unoidl/facreg.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx index b90832acaa51..959f22e30cf1 100644 --- a/sd/source/ui/unoidl/facreg.cxx +++ b/sd/source/ui/unoidl/facreg.cxx @@ -270,10 +270,8 @@ static ::boost::shared_ptr spFactoryMap; } // end of anonymous namespace -#ifdef __cplusplus extern "C" { -#endif SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, -- cgit From e9af447dcbc786acc2dcb8fff41d4d06a1f4c28d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 13 Jan 2010 17:55:09 +0100 Subject: swunolocking1: #i108161#: WeakReferenceHelper: Apple g++ 4.0.1 erroneously believes that it is ambiguous to use WeakReference::operator=(Reference). as a workaround, introduce WeakReferenceHelper::clear(), and fix all users. --- sd/source/ui/unoidl/unolayer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 96dd05a01267..17fad0f5fdc1 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -826,8 +826,8 @@ uno::Reference SdLayerManager::GetLayer (SdrLayer* pLayer) xLayer = new SdLayer (this, pLayer); // Remember the new xLayer for future calls. - xRef = uno::Reference (xLayer, uno::UNO_QUERY); - mpLayers->insert (xRef); + uno::WeakReference wRef(xLayer); + mpLayers->insert(wRef); } return xLayer; -- cgit From b15930156ffd1eae186c9996f8d2979c2e097685 Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 13 Jan 2010 19:13:55 +0100 Subject: impress181: #i107561#: now also exporting notes to pdf --- sd/source/ui/unoidl/unomodel.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 4dab2fbac616..89985f43f1dd 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1885,14 +1885,11 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r const sal_Int32 nPageNumber = nRenderer + 1; PageKind ePageKind = PK_STANDARD; sal_Bool bExportNotesPages = sal_False; - sal_Bool bExportNotes = sal_False; for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) { if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) rxOptions[ nProperty ].Value >>= xRenderDevice; - else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ) ) - rxOptions[ nProperty ].Value >>= bExportNotes; else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ) ) { rxOptions[ nProperty].Value >>= bExportNotesPages; @@ -1988,7 +1985,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) ); if ( xPage.is() ) { - if ( bExportNotes ) + if ( pPDFExtOutDevData->GetIsExportNotes() ) ImplPDFExportComments( xPage, *pPDFExtOutDevData ); uno::Reference< beans::XPropertySet > xPagePropSet( xPage, uno::UNO_QUERY ); if( xPagePropSet.is() ) -- cgit From 02f1b698feb68c70166be96eae9f557fbf076ac2 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 1 Feb 2010 15:41:57 +0100 Subject: #i10000# removed ifdef --- sd/source/ui/slideshow/slideshow.hrc | 2 -- 1 file changed, 2 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 85b2cf0f3009..34dbd5c6536b 100644 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -41,7 +41,6 @@ #define CM_FIRST_SLIDE 8 #define CM_LAST_SLIDE 9 #define CM_SLIDES 10 -#ifdef ENABLE_PRESENTER_EXTRA_UI //CM for extra presenter UI #define CM_ERASE_ALLINK 11 #define CM_ERASE_INK 12 @@ -61,6 +60,5 @@ #define CM_PEN_MODE 26 #define CM_ERASE_MODE 27 #define CM_POINTER_OPTION 28 -#endif //ENABLE_PRESENTER_EXTRA_UI #endif -- cgit