diff options
26 files changed, 527 insertions, 603 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index a58577458a67..c3fb301a0fc3 100755 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -163,7 +163,7 @@ void SdDrawDocument::CreateLayoutTemplates() String aNullStr; ::basegfx::B2DPolyPolygon aNullPolyPolygon; - Color aNullCol(RGB_Color(COL_BLACK)); + Color aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE)); XDash aNullDash; XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE)); @@ -173,19 +173,20 @@ void SdDrawDocument::CreateLayoutTemplates() // Linienattribute (Extended OutputDevice) rISet.Put(XLineStyleItem(XLINE_SOLID)); - rISet.Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); + rISet.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE))); rISet.Put(XLineWidthItem(0)); rISet.Put(XLineDashItem(pPool,aNullDash)); rISet.Put(XLineStartItem(pPool,aNullPolyPolygon)); rISet.Put(XLineEndItem(pPool,aNullPolyPolygon)); - rISet.Put(XLineStartWidthItem(300)); - rISet.Put(XLineEndWidthItem(300)); + rISet.Put(XLineStartWidthItem(200)); + rISet.Put(XLineEndWidthItem(200)); rISet.Put(XLineStartCenterItem()); rISet.Put(XLineEndCenterItem()); + rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); // Fuellattribute (Extended OutputDevice) rISet.Put(XFillStyleItem(XFILL_SOLID)); - rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); // "Blue 8" + rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); rISet.Put(XFillGradientItem(pPool,aNullGrad)); rISet.Put(XFillHatchItem(pPool,aNullHatch)); @@ -198,8 +199,8 @@ void SdDrawDocument::CreateLayoutTemplates() // Schattenattribute (Drawing Engine) rISet.Put(SdrShadowItem(FALSE)); rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); - rISet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - rISet.Put(SdrShadowYDistItem(300)); + rISet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + rISet.Put(SdrShadowYDistItem(200)); Font aLatinFont, aCJKFont, aCTLFont; @@ -310,8 +311,8 @@ void SdDrawDocument::CreateLayoutTemplates() pISet->Put(SdrShadowItem(TRUE)); pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); - pISet->Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - pISet->Put(SdrShadowYDistItem(300)); + pISet->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + pISet->Put(SdrShadowYDistItem(200)); // ---- Objekt ohne Fllung ------------------------------------------- @@ -322,6 +323,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(XFILL_NONE)); + pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); // ---- Text ---------------------------------------------------------- @@ -513,6 +515,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(XFILL_NONE)); + pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT )); // 12 pt diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src index f1c7058ddf79..f1c7058ddf79 100755..100644 --- a/sd/source/core/glob.src +++ b/sd/source/core/glob.src diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 205e007d9e97..ef3d5d0ebe25 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -519,10 +519,11 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet(); rBackgroundObjectsSet.Put(SdrShadowItem(FALSE)); rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY))); - rBackgroundObjectsSet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz - rBackgroundObjectsSet.Put(SdrShadowYDistItem(300)); + rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz + rBackgroundObjectsSet.Put(SdrShadowYDistItem(200)); // #i16874# enable kerning by default but only for new documents rBackgroundObjectsSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) ); + rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); } /************************************************************************** @@ -1029,12 +1030,8 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT); SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , FALSE); - aNumberFormat.SetLSpace( 0 ); - aNumberFormat.SetAbsLSpace( 0 ); - aNumberFormat.SetFirstLineOffset( 0 ); - aNumRule.SetLevel( 0, aNumberFormat ); - for( USHORT i = 1; i < aNumRule.GetLevelCount(); i++ ) + for( USHORT i = 0; i < aNumRule.GetLevelCount(); i++ ) { const short nLSpace = (i + 1) * 600; aNumberFormat.SetLSpace(nLSpace); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 8b96e08b4a8c..9cdbc2f0cfba 100644..100755 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1953,6 +1953,16 @@ void CustomAnimationPane::onChange( bool bCreate ) { CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration ); + // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs + if( bHasText && (aTargets.size() == 1) ) + { + Reference< XShape > xShape( (*aIter), UNO_QUERY ); + if( xShape.is() && !hasVisibleShape( xShape ) ) + { + mpMainSequence->createTextGroup( pCreated, 1, -1.0, sal_False, sal_False ); + } + } + if( bFirst ) bFirst = false; else diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx index 4355da3011c9..3366a0ea98db 100755..100644 --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -46,6 +46,16 @@ using namespace ::com::sun::star::uno; #define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr)) +template< class T > T getSafeValue( const Any& rAny ) +{ + T value = T(); + bool bOk = (rAny >>= value); + + DBG_ASSERT( bOk, "SdOptionsItem, wrong type from configuration!" ); + (void)bOk; + + return value; +} // ----------------- // - SdOptionsItem - @@ -503,6 +513,9 @@ SdOptionsMisc::SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig ) : bPreviewChangedEffects( FALSE ), bPreviewTransitions( TRUE ), mnDisplay( 0 ), + mnPenColor( 0xff0000 ), + mnPenWidth( 150.0 ), + // The default for 6.1-and-above documents is to use printer-independent // formatting. mnPrinterIndependentLayout (1) @@ -541,7 +554,9 @@ BOOL SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() && IsPreviewTransitions() == rOpt.IsPreviewTransitions() && GetDisplay() == rOpt.GetDisplay() && - IsShowComments() == rOpt.IsShowComments() + IsShowComments() == rOpt.IsShowComments() && + GetPresentationPenColor() == rOpt.GetPresentationPenColor() && + GetPresentationPenWidth() == rOpt.GetPresentationPenWidth() ); } @@ -583,10 +598,13 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) con "PreviewChangedEffects", "PreviewTransitions", - "Display" + "Display", + + "PenColor", + "PenWidth" }; - rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 25 : 16 ); + rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 16 ); ppNames = aPropNames; } @@ -641,6 +659,12 @@ BOOL SdOptionsMisc::ReadData( const Any* pValues ) if( pValues[24].hasValue() ) SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue()); + + if( pValues[25].hasValue() ) + SetPresentationPenColor( getSafeValue< sal_Int32 >( pValues[ 25 ] ) ); + + if( pValues[26].hasValue() ) + SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) ); } return TRUE; @@ -684,6 +708,9 @@ BOOL SdOptionsMisc::WriteData( Any* pValues ) const pValues[ 23 ] <<= IsPreviewTransitions(); pValues[ 24 ] <<= GetDisplay(); + + pValues[ 25 ] <<= GetPresentationPenColor(); + pValues[ 26 ] <<= GetPresentationPenWidth(); } return TRUE; @@ -725,6 +752,9 @@ SdOptionsMiscItem::SdOptionsMiscItem( USHORT _nWhich, SdOptions* pOpts, ::sd::Fr maOptionsMisc.SetDisplay(pOpts->GetDisplay()); maOptionsMisc.SetShowComments( pOpts->IsShowComments() ); + + maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() ); + maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() ); } if( pView ) @@ -813,6 +843,9 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const pOpts->SetPreviewTransitions( maOptionsMisc.IsPreviewTransitions() ); pOpts->SetDisplay( maOptionsMisc.GetDisplay() ); + + pOpts->SetPresentationPenColor( maOptionsMisc.GetPresentationPenColor() ); + pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() ); } } diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src index 7e87b246d371..4fc88c3a6049 100644..100755 --- a/sd/source/ui/app/strings.src +++ b/sd/source/ui/app/strings.src @@ -784,7 +784,7 @@ String STR_PUBLISH_OUTLINE }; String STR_EYEDROPPER { - Text [ en-US ] = "Eyedropper" ; + Text [ en-US ] = "Color Replacer" ; }; String STR_UNDO_MORPHING { diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index c0d8235e97fb..a1ab9b853ff4 100755 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -312,40 +312,74 @@ void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj) sal_Bool bUseFillStyle, bUseNoFillStyle; bUseFillStyle = bUseNoFillStyle = sal_False; - if (nSlotId == SID_DRAW_RECT || // Rechteck - nSlotId == SID_DRAW_RECT_ROUND || // Rechteck, rund - nSlotId == SID_DRAW_SQUARE || // Quadrat - nSlotId == SID_DRAW_SQUARE_ROUND || // Quadrat, rund - nSlotId == SID_DRAW_ELLIPSE || // Ellipse - nSlotId == SID_DRAW_PIE || // Ellipsensegment - nSlotId == SID_DRAW_ELLIPSECUT || // Ellipsenabschnitt - nSlotId == SID_DRAW_CIRCLE || // Kreis - nSlotId == SID_DRAW_CIRCLEPIE || // Kreissegment - nSlotId == SID_DRAW_CIRCLECUT || // Ellipsenabschnitt - nSlotId == SID_DRAW_POLYGON || // Polygon - nSlotId == SID_DRAW_XPOLYGON || // 45-Polygon - nSlotId == SID_DRAW_FREELINE || // Freihandlinie - nSlotId == SID_DRAW_BEZIER_FILL) // Bezier + switch( nSlotId ) + { + case SID_DRAW_RECT: + case SID_DRAW_RECT_ROUND: + case SID_DRAW_SQUARE: + case SID_DRAW_SQUARE_ROUND: + case SID_DRAW_ELLIPSE: + case SID_DRAW_PIE: + case SID_DRAW_ELLIPSECUT: + case SID_DRAW_CIRCLE: + case SID_DRAW_CIRCLEPIE: + case SID_DRAW_CIRCLECUT: + case SID_DRAW_POLYGON: + case SID_DRAW_XPOLYGON: + case SID_DRAW_FREELINE: + case SID_DRAW_BEZIER_FILL: { bUseFillStyle = sal_True; + break; } - else if - (nSlotId == SID_DRAW_RECT_NOFILL || // Rechteck - nSlotId == SID_DRAW_RECT_ROUND_NOFILL || // Rechteck, rund - nSlotId == SID_DRAW_SQUARE_NOFILL || // Quadrat - nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL || // Quadrat, rund - nSlotId == SID_DRAW_ELLIPSE_NOFILL || // Ellipse - nSlotId == SID_DRAW_PIE_NOFILL || // Ellipsensegment - nSlotId == SID_DRAW_ELLIPSECUT_NOFILL || // Ellipsenabschnitt - nSlotId == SID_DRAW_CIRCLE_NOFILL || // Kreis - nSlotId == SID_DRAW_CIRCLEPIE_NOFILL || // Kreissegment - nSlotId == SID_DRAW_CIRCLECUT_NOFILL || // Ellipsenabschnitt - nSlotId == SID_DRAW_POLYGON_NOFILL || // Polygon - nSlotId == SID_DRAW_XPOLYGON_NOFILL || // 45-Polygon - nSlotId == SID_DRAW_FREELINE_NOFILL || // Freihandlinie - nSlotId == SID_DRAW_BEZIER_NOFILL) // Bezier + case SID_DRAW_RECT_NOFILL: + case SID_DRAW_RECT_ROUND_NOFILL: + case SID_DRAW_SQUARE_NOFILL: + case SID_DRAW_SQUARE_ROUND_NOFILL: + case SID_DRAW_ELLIPSE_NOFILL: + case SID_DRAW_PIE_NOFILL: + case SID_DRAW_ELLIPSECUT_NOFILL: + case SID_DRAW_CIRCLE_NOFILL: + case SID_DRAW_CIRCLEPIE_NOFILL: + case SID_DRAW_CIRCLECUT_NOFILL: + case SID_DRAW_POLYGON_NOFILL: + case SID_DRAW_XPOLYGON_NOFILL: + case SID_DRAW_FREELINE_NOFILL: + case SID_DRAW_LINE: + case SID_DRAW_XLINE: + case SID_CONNECTOR_ARROW_START: + case SID_CONNECTOR_ARROW_END: + case SID_CONNECTOR_ARROWS: + case SID_CONNECTOR_CIRCLE_START: + case SID_CONNECTOR_CIRCLE_END: + case SID_CONNECTOR_CIRCLES: + case SID_CONNECTOR_LINE: + case SID_CONNECTOR_LINE_ARROW_START: + case SID_CONNECTOR_LINE_ARROW_END: + case SID_CONNECTOR_LINE_ARROWS: + case SID_CONNECTOR_LINE_CIRCLE_START: + case SID_CONNECTOR_LINE_CIRCLE_END: + case SID_CONNECTOR_LINE_CIRCLES: + case SID_CONNECTOR_CURVE: + case SID_CONNECTOR_CURVE_ARROW_START: + case SID_CONNECTOR_CURVE_ARROW_END: + case SID_CONNECTOR_CURVE_ARROWS: + case SID_CONNECTOR_CURVE_CIRCLE_START: + case SID_CONNECTOR_CURVE_CIRCLE_END: + case SID_CONNECTOR_CURVE_CIRCLES: + case SID_CONNECTOR_LINES: + case SID_CONNECTOR_LINES_ARROW_START: + case SID_CONNECTOR_LINES_ARROW_END: + case SID_CONNECTOR_LINES_ARROWS: + case SID_CONNECTOR_LINES_CIRCLE_START: + case SID_CONNECTOR_LINES_CIRCLE_END: + case SID_CONNECTOR_LINES_CIRCLES: + case SID_DRAW_BEZIER_NOFILL: + case SID_LINE_ARROW_END: { bUseNoFillStyle = sal_True; + break; + } } SetStyleSheet( rAttr, pObj, bUseFillStyle, bUseNoFillStyle ); } diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 5cc3cc49ca88..4d03abd7b8bc 100755 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -163,40 +163,40 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt) if (!mpView->IsSnapEnabled()) mpView->SetSnapEnabled(TRUE); - BOOL bCntrl = rMEvt.IsMod1(); + BOOL bSnapModPressed = rMEvt.IsMod1(); BOOL bGridSnap = pFrameView->IsGridSnap(); - bGridSnap = (bCntrl != bGridSnap); + bGridSnap = (bSnapModPressed != bGridSnap); if (mpView->IsGridSnap() != bGridSnap) mpView->SetGridSnap(bGridSnap); BOOL bBordSnap = pFrameView->IsBordSnap(); - bBordSnap = (bCntrl != bBordSnap); + bBordSnap = (bSnapModPressed != bBordSnap); if (mpView->IsBordSnap() != bBordSnap) mpView->SetBordSnap(bBordSnap); BOOL bHlplSnap = pFrameView->IsHlplSnap(); - bHlplSnap = (bCntrl != bHlplSnap); + bHlplSnap = (bSnapModPressed != bHlplSnap); if (mpView->IsHlplSnap() != bHlplSnap) mpView->SetHlplSnap(bHlplSnap); BOOL bOFrmSnap = pFrameView->IsOFrmSnap(); - bOFrmSnap = (bCntrl != bOFrmSnap); + bOFrmSnap = (bSnapModPressed != bOFrmSnap); if (mpView->IsOFrmSnap() != bOFrmSnap) mpView->SetOFrmSnap(bOFrmSnap); BOOL bOPntSnap = pFrameView->IsOPntSnap(); - bOPntSnap = (bCntrl != bOPntSnap); + bOPntSnap = (bSnapModPressed != bOPntSnap); if (mpView->IsOPntSnap() != bOPntSnap) mpView->SetOPntSnap(bOPntSnap); BOOL bOConSnap = pFrameView->IsOConSnap(); - bOConSnap = (bCntrl != bOConSnap); + bOConSnap = (bSnapModPressed != bOConSnap); if (mpView->IsOConSnap() != bOConSnap) mpView->SetOConSnap(bOConSnap); @@ -229,7 +229,7 @@ BOOL FuDraw::MouseButtonDown(const MouseEvent& rMEvt) if ( bHelpLine && !mpView->IsCreateObj() - && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bCntrl)) ) + && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) ) { mpWindow->CaptureMouse(); mpView->BegDragHelpLine(nHelpLine, pPV); @@ -285,41 +285,41 @@ BOOL FuDraw::MouseMove(const MouseEvent& rMEvt) bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho(); } - BOOL bCntrl = rMEvt.IsMod1(); + BOOL bSnapModPressed = rMEvt.IsMod2(); mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy()); BOOL bGridSnap = pFrameView->IsGridSnap(); - bGridSnap = (bCntrl != bGridSnap); + bGridSnap = (bSnapModPressed != bGridSnap); if (mpView->IsGridSnap() != bGridSnap) mpView->SetGridSnap(bGridSnap); BOOL bBordSnap = pFrameView->IsBordSnap(); - bBordSnap = (bCntrl != bBordSnap); + bBordSnap = (bSnapModPressed != bBordSnap); if (mpView->IsBordSnap() != bBordSnap) mpView->SetBordSnap(bBordSnap); BOOL bHlplSnap = pFrameView->IsHlplSnap(); - bHlplSnap = (bCntrl != bHlplSnap); + bHlplSnap = (bSnapModPressed != bHlplSnap); if (mpView->IsHlplSnap() != bHlplSnap) mpView->SetHlplSnap(bHlplSnap); BOOL bOFrmSnap = pFrameView->IsOFrmSnap(); - bOFrmSnap = (bCntrl != bOFrmSnap); + bOFrmSnap = (bSnapModPressed != bOFrmSnap); if (mpView->IsOFrmSnap() != bOFrmSnap) mpView->SetOFrmSnap(bOFrmSnap); BOOL bOPntSnap = pFrameView->IsOPntSnap(); - bOPntSnap = (bCntrl != bOPntSnap); + bOPntSnap = (bSnapModPressed != bOPntSnap); if (mpView->IsOPntSnap() != bOPntSnap) mpView->SetOPntSnap(bOPntSnap); BOOL bOConSnap = pFrameView->IsOConSnap(); - bOConSnap = (bCntrl != bOConSnap); + bOConSnap = (bSnapModPressed != bOConSnap); if (mpView->IsOConSnap() != bOConSnap) mpView->SetOConSnap(bOConSnap); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 2ddf6a5fb885..5c380da547bc 100644..100755 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -436,6 +436,12 @@ BOOL FuSelection::MouseButtonDown(const MouseEvent& rMEvt) mpView->BegMarkObj(aMDPos); } } + + if( bMarked && bTempRotation && (nSlotId == SID_OBJECT_ROTATE) && !rMEvt.IsShift() && (rMEvt.GetClicks() != 2) ) + { + nSlotId = SID_OBJECT_SELECT; + Activate(); + } } } } @@ -711,6 +717,8 @@ BOOL FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if (nSlotId == SID_OBJECT_SELECT && mpView->IsRotateAllowed() + + && (rMEvt.GetClicks() != 2) && (mpViewShell->GetFrameView()->IsClickChangeRotation() || (pSingleObj && pSingleObj->GetObjInventor()==E3dInventor)) diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 2f3111665692..2835821796a1 100755 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -702,6 +702,17 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt) mpView->EndDragObj( mpView->IsDragWithCopy() ); mpView->ForceMarkedToAnotherPage(); mpView->SetCurrentObj(OBJ_TEXT); + + USHORT nDrgLog = USHORT ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); + + if ( mpView->IsRotateAllowed() && mpViewShell->GetFrameView()->IsClickChangeRotation() && (rMEvt.GetClicks() != 2) && + !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() && + Abs(aPnt.X() - aMDPos.X()) < nDrgLog && + Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + { + // toggle to rotation mode + mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_ROTATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); + } } else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft()) { diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx index 13088dfc64cb..419f661b1405 100755 --- a/sd/source/ui/inc/optsitem.hxx +++ b/sd/source/ui/inc/optsitem.hxx @@ -279,6 +279,9 @@ private: sal_Int32 mnDisplay; + sal_Int32 mnPenColor; + double mnPenWidth; + /** This value controls the device to use for formatting documents. The currently supported values are 0 for the current printer or 1 for the printer independent virtual device the can be retrieved from @@ -336,6 +339,12 @@ public: sal_Int32 GetDisplay() const { Init(); return mnDisplay; } void SetDisplay( sal_Int32 nDisplay = 0 ) { if( mnDisplay != nDisplay ) { OptionsChanged(); mnDisplay = nDisplay; } } + sal_Int32 GetPresentationPenColor() const { Init(); return mnPenColor; } + void SetPresentationPenColor( sal_Int32 nPenColor ) { if( mnPenColor != nPenColor ) { OptionsChanged(); mnPenColor = nPenColor; } } + + double GetPresentationPenWidth() const { Init(); return mnPenWidth; } + void SetPresentationPenWidth( double nPenWidth ) { if( mnPenWidth != nPenWidth ) { OptionsChanged(); mnPenWidth = nPenWidth; } } + void SetStartWithTemplate( BOOL bOn = TRUE ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } } void SetMarkedHitMovesAlways( BOOL bOn = TRUE ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } } void SetMoveOnlyDragging( BOOL bOn = TRUE ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } } diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index ad4f4d306c6b..62062d7e5461 100644..100755 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -40,8 +40,7 @@ AUTOSEG=true .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI -ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 709e2a79146e..f086f52cb73f 100644..100755 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -37,25 +37,20 @@ #define CM_ENDSHOW 7 #define CM_FIRST_SLIDE 8 #define CM_LAST_SLIDE 9 -#define CM_SLIDES 10 + //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 +#define CM_ERASE_ALLINK 10 +#define CM_COLOR_PEN 11 +#define CM_WIDTH_PEN 12 +#define CM_WIDTH_PEN_VERY_THIN 13 +#define CM_WIDTH_PEN_THIN 14 +#define CM_WIDTH_PEN_NORMAL 15 +#define CM_WIDTH_PEN_THICK 16 +#define CM_WIDTH_PEN_VERY_THICK 17 +#define CM_PEN_MODE 18 +#define CM_ERASE_MODE 19 +#define CM_POINTER_OPTION 20 + +#define CM_SLIDES 21 // this must be the last id! #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 02c225fb5ea9..78cd2aae0d9f 100644..100755 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -71,20 +71,10 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; -#ifdef ENABLE_PRESENTER_EXTRA_UI MenuItem { Identifier = CM_PEN_MODE; - Text [ en-US ] = "~Pen Mode"; - }; - MenuItem - { - Identifier = CM_ERASE_MODE; - Text [ en-US ] = "~Eraser Mode"; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "Mouse pointer as ~pen"; }; MenuItem { @@ -124,20 +114,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; MenuItem { - Separator = TRUE; - }; - MenuItem - { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Pen Color" ; - }; - MenuItem - { - Separator = TRUE; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "~Change Pen Color..." ; }; MenuItem { @@ -150,48 +128,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; MenuItem { - Identifier = CM_ERASE_INK_PEN; - Text [ en-US ] = "~Eraser Width" ; - - 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"; - }; - }; - }; - }; -#endif - MenuItem - { - Separator = TRUE; - }; - MenuItem - { Identifier = CM_SCREEN; Text [ en-US ] = "~Screen" ; @@ -216,6 +152,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU { 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 ee89da143910..67ac7e94cadb 100755 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -554,13 +554,11 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default -#ifdef ENABLE_PRESENTER_EXTRA_UI -, mbSwitchPenMode(true) +, mnUserPaintColor( 0x80ff0000L ) +, mbUsePen(false) +, mdUserPaintStrokeWidth ( 150.0 ) +#ifdef ENABLE_ERASER_UI , mbSwitchEraserMode(false) -, mdUserPaintStrokeWidth ( 4.0 ) -, mbEraseAllInk(false) -//, mbEraseInk(false) , mnEraseInkSize(100) #endif , mnEntryCounter(0) @@ -591,10 +589,26 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, mbAutoSaveWasOn = true; Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); + + mbUsePen = maPresSettings.mbMouseAsPen; + + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + mnUserPaintColor = pOptions->GetPresentationPenColor(); + mdUserPaintStrokeWidth = pOptions->GetPresentationPenWidth(); + } } SlideshowImpl::~SlideshowImpl() { + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + pOptions->SetPresentationPenColor(mnUserPaintColor); + pOptions->SetPresentationPenWidth(mdUserPaintStrokeWidth); + } + Application::RemoveEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); maDeactivateTimer.Stop(); @@ -1124,13 +1138,20 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) -1, Any( maPresSettings.mbManual != sal_False ), beans::PropertyState_DIRECT_VALUE ) ); - if( maPresSettings.mbMouseAsPen ) + if( mbUsePen ) { aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), // User paint color is black by default. - -1, Any( static_cast<sal_Int32>(0x00000000L) ), + -1, Any( mnUserPaintColor ), + beans::PropertyState_DIRECT_VALUE ) ); + + aProperties.push_back( + beans::PropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintStrokeWidth") ), + // User paint color is black by default. + -1, Any( mdUserPaintStrokeWidth ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1461,14 +1482,14 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects) 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) ); } @@ -2203,16 +2224,8 @@ 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)); - // 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 + pMenu->CheckItem( CM_PEN_MODE, mbUsePen); const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); @@ -2280,105 +2293,44 @@ 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); // populate color width list if( pWidthMenu ) { - if(! maPresSettings.mbMouseAsPen) - { - pMenu->EnableItem( CM_WIDTH_PEN, FALSE ); - } - else - { - sal_Int32 nIterator; - double nWidth; + 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) ); - - } - } - } - - - PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); - - // populate eraser width list - if( pEraseWidthMenu ) - { - if(! maPresSettings.mbMouseAsPen) + nWidth = 4.0; + for( nIterator = 1; nIterator < 6; nIterator++) { - pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE ); - } - else - { - sal_Int32 nEIterator; - double nEWidth; - - nEWidth = 100.0; - for( nEIterator = 1; nEIterator < 6; nEIterator++) + switch(nIterator) { - 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) ); - if( mbSwitchPenMode ) - pMenu->CheckItem( (USHORT)(CM_PEN_MODE)); - if( mbSwitchEraserMode ) - pMenu->CheckItem( (USHORT)(CM_ERASE_MODE)); - + 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) ); } } -#endif pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) ); pMenu->Execute( mpShowWindow, maPopupMousePos ); @@ -2442,139 +2394,93 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; -#ifdef ENABLE_PRESENTER_EXTRA_UI - if( maPresSettings.mbMouseAsPen ) - { - case CM_COLOR_PEN: - { - //Open a color picker based on SvColorDialog - ::Color aColor( mnUserPaintColor ); - SvColorDialog aColorDlg( mpShowWindow); - aColorDlg.SetColor( aColor ); - - if (aColorDlg.Execute() ) - { - aColor = aColorDlg.GetColor(); - mnUserPaintColor = aColor.GetColor(); - setPenColor(mnUserPaintColor); - } - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_VERY_THIN: - { - setPenWidth(4.0); - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_THIN: - { - setPenWidth(100.0); - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_NORMAL: - { - setPenWidth(150.0); - mbWasPaused = false; - } - break; + case CM_COLOR_PEN: + { + //Open a color picker based on SvColorDialog + ::Color aColor( mnUserPaintColor ); + SvColorDialog aColorDlg( mpShowWindow); + aColorDlg.SetColor( aColor ); - case CM_WIDTH_PEN_THICK: + if (aColorDlg.Execute() ) { - setPenWidth(200.0); - mbWasPaused = false; + aColor = aColorDlg.GetColor(); + setPenColor(aColor.GetColor()); } - break; + mbWasPaused = false; + } + break; - case CM_WIDTH_PEN_VERY_THICK: - { - setPenWidth(400.0); - mbWasPaused = false; - } - break; - 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); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_VERY_THIN: + { + setPenWidth(4.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THIN: - { - setEraseInk(200); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_THIN: + { + setPenWidth(100.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_NORMAL: - { - setEraseInk(300); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_NORMAL: + { + setPenWidth(150.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THICK: - { - setEraseInk(400); - mbWasPaused = false; - } - break; - case CM_ERASE_INK_PEN_VERY_THICK: - { - setEraseInk(500); - mbWasPaused = false; - } - break; - } -#endif + case CM_WIDTH_PEN_THICK: + { + setPenWidth(200.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() ) + case CM_WIDTH_PEN_VERY_THICK: + { + setPenWidth(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_ALLINK: + { + setEraseAllInk(true); + mbWasPaused = false; + } + break; + case CM_PEN_MODE: + { + setUsePen(!mbUsePen); + 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 ) { - displaySlideNumber( nPageNumber ); + mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); } - mbWasPaused = false; - break; + } + 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; } } @@ -2960,7 +2866,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) switch ( rReq.GetSlot() ) { case SID_NAVIGATOR_PEN: - setUsePen(!maPresSettings.mbMouseAsPen); + setUsePen(!mbUsePen); break; case SID_NAVIGATOR_PAGE: @@ -3146,7 +3052,7 @@ void SAL_CALL SlideshowImpl::setMouseVisible( sal_Bool bVisible ) throw (Runtime sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - return maPresSettings.mbMouseAsPen; + return mbUsePen; } // -------------------------------------------------------------------- @@ -3154,93 +3060,38 @@ sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - maPresSettings.mbMouseAsPen = bMouseAsPen; + mbUsePen = bMouseAsPen; if( mxShow.is() ) try { - // For Pencolor; + // For Pencolor; Any aValue; - if( maPresSettings.mbMouseAsPen ) - // TODO: take color from configuration - aValue <<= mnUserPaintColor; + if( mbUsePen ) + 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 ) - aValueWidth <<= mdUserPaintStrokeWidth; - - beans::PropertyValue aPenPropWidth; - aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); - aPenPropWidth.Value = aValueWidth; - - mxShow->setProperty( aPenPropWidth ); - - // for Pen Mode - Any aValueSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - 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 ) - { - static_cast<void>(e); - DBG_ERROR( - (OString("sd::SlideshowImpl::setUsePen(), " - "exception caught: ") + - rtl::OUStringToOString( - comphelper::anyToString( cppu::getCaughtException() ), - RTL_TEXTENCODING_UTF8 )).getStr() ); - } -} -#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 StrokeWidth : + if( mbUsePen ) + { + beans::PropertyValue aPenPropWidth; + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); + aPenPropWidth.Value <<= mdUserPaintStrokeWidth; + mxShow->setProperty( aPenPropWidth ); - //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 ); + // for Pen Mode + beans::PropertyValue aPenPropSwitchPenMode; + aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); + aPenPropSwitchPenMode.Value <<= sal_True; + mxShow->setProperty( aPenPropSwitchPenMode ); + } } catch( Exception& e ) { static_cast<void>(e); DBG_ERROR( - (OString("sd::SlideshowImpl::setUseEraser(), " + (OString("sd::SlideshowImpl::setUsePen(), " "exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), @@ -3262,12 +3113,9 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mdUserPaintStrokeWidth = dStrokeWidth; - mbSwitchPenMode = true; - mbSwitchEraserMode = !mbSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update color and width + setUsePen( true ); // enable pen mode, update color and width } -#endif + // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -3282,71 +3130,59 @@ 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 + setUsePen( true ); // enable pen mode, update color } -#ifdef ENABLE_PRESENTER_EXTRA_UI // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setUseEraser( ::sal_Bool /*_usepen*/ ) throw (css::uno::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) +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) 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 + setUsePen( bSwitchPenMode ); // SwitchPen Mode } - // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraseAllInk(bool bEraseAllInk) throw (RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mbEraseAllInk=bEraseAllInk; - mbSwitchPenMode = true; - mbSwitchEraserMode = false; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update erase all ink bool + if( bEraseAllInk ) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + if( mxShow.is() ) try + { + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value <<= bEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + } + catch( Exception& e ) + { + static_cast<void>(e); + DBG_ERROR( + (OString("sd::SlideshowImpl::setEraseAllInk(), " + "exception caught: ") + + rtl::OUStringToOString( + comphelper::anyToString( cppu::getCaughtException() ), + RTL_TEXTENCODING_UTF8 )).getStr() ); + } + } } +void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 /*nEraseInkSize*/ ) throw (css::uno::RuntimeException) +{ +} -void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraserMode( bool /*bSwitchEraserMode*/ ) throw (css::uno::RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - mnEraseInkSize=nEraseInkSize; - mbSwitchPenMode = false; - mbSwitchEraserMode = true; - if( maPresSettings.mbMouseAsPen ) - setUseEraser( 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 cb33c4a740c7..98a34959e0b9 100755 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -198,7 +198,6 @@ public: virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) 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); @@ -206,7 +205,6 @@ public: 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); @@ -396,14 +394,9 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; -#ifdef ENABLE_PRESENTER_EXTRA_UI - bool mbSwitchPenMode; - bool mbSwitchEraserMode; + bool mbUsePen; double mdUserPaintStrokeWidth; - bool mbEraseAllInk; -// bool mbEraseInk; - sal_Int32 mnEraseInkSize; -#endif + /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 6f6f49fdc93c..020f95b5af89 100755 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -329,6 +329,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) { short nSlotId = rReq.GetSlot(); + if( nSlotId == SID_OBJECT_ROTATE ) + { + // togle rotation + if( nOldSId == nSlotId ) + { + nSlotId = SID_OBJECT_SELECT; + rReq.SetSlot( nSlotId ); + } + } + if (nSlotId == SID_OBJECT_CROOK_ROTATE || nSlotId == SID_OBJECT_CROOK_SLANT || nSlotId == SID_OBJECT_CROOK_STRETCH) diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx index e49f8e7e1b63..7b60a463dd1c 100644 --- a/slideshow/source/engine/color.cxx +++ b/slideshow/source/engine/color.cxx @@ -267,7 +267,9 @@ namespace slideshow RGBColor::RGBColor(const RGBColor& rLHS) { - RGBColor(rLHS.getRed(), rLHS.getGreen(), rLHS.getBlue()); + maRGBTriple.mnRed = rLHS.getRed(); + maRGBTriple.mnGreen = rLHS.getGreen(); + maRGBTriple.mnBlue = rLHS.getBlue(); } RGBColor& RGBColor::operator=( const RGBColor& rLHS ){ diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk index beac66778518..fdc99cd1ad9f 100644 --- a/slideshow/source/engine/makefile.mk +++ b/slideshow/source/engine/makefile.mk @@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -CDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Common ---------------------------------------------------------- diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 84786c26a504..a5d8acea2140 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -653,20 +653,13 @@ ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const& sal_Int32 nOrdNumStart, bool bConvertingMasterPage ) : mxPage( xActualPage ), -#ifdef ENABLE_PRESENTER_EXTRA_UI mxPagesSupplier( xPagesSupplier ), -#else - mxPagesSupplier( NULL ), -#endif mrContext( rContext ), maPolygons(), maShapesStack(), mnAscendingPrio( nOrdNumStart ), mbConvertingMasterPage( bConvertingMasterPage ) { -#ifndef ENABLE_PRESENTER_EXTRA_UI - (void)xPagesSupplier; -#endif uno::Reference<drawing::XShapes> const xShapes( xPage, uno::UNO_QUERY_THROW ); maShapesStack.push( XShapesEntry(xShapes) ); diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 55831ba1609f..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 ) @@ -454,9 +465,7 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); -#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); -#endif } bool SlideImpl::prefetch() @@ -542,7 +551,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted ) // --------------------------------------------------------------- // enable paint overlay, if maUserPaintColor is valid - enablePaintOverlay(); + activatePaintOverlay(); // --------------------------------------------------------------- @@ -566,7 +575,7 @@ void SlideImpl::hide() // disable user paint overlay under all circumstances, // this slide now ceases to be active. - disablePaintOverlay(); + deactivatePaintOverlay(); // --------------------------------------------------------------- @@ -888,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(); } @@ -923,7 +946,7 @@ bool SlideImpl::isPaintOverlayActive() const return mbPaintOverlayActive; } -void SlideImpl::disablePaintOverlay() +void SlideImpl::deactivatePaintOverlay() { if(mbPaintOverlayActive) maPolygons = mpPaintOverlay->getPolygons(); @@ -1259,12 +1282,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { -#ifdef ENABLE_PRESENTER_EXTRA_UI boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, -#else - (void)xDrawPages; - boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue, -#endif rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 8d9fad06a3e3..d0ab4e33a1e3 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -70,8 +70,9 @@ namespace slideshow ActivitiesQueue& rActivitiesQueue, ScreenUpdater& rScreenUpdater, const UnoViewContainer& rViews, - Slide& rSlide, - const PolyPolygonVector& rPolygons ) : + Slide& rSlide, + const PolyPolygonVector& rPolygons, + bool bActive ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), maViews(), @@ -87,7 +88,8 @@ namespace slideshow //handle the "remove stroke by stroke" mode of erasing mbIsEraseModeActivated( false ), mrSlide(rSlide), - mnSize(100) + mnSize(100), + mbActive( bActive ) { std::for_each( rViews.begin(), rViews.end(), @@ -129,6 +131,8 @@ namespace slideshow bool colorChanged( RGBColor const& rUserColor ) { + mbIsLastPointValid = false; + mbActive = true; this->maStrokeColor = rUserColor; this->mbIsEraseModeActivated = false; return true; @@ -141,22 +145,15 @@ namespace slideshow return true; } - bool eraseAllInkChanged( bool const& rEraseAllInk ) + void repaintWithoutPolygons() { - this->mbIsEraseAllModeActivated= rEraseAllInk; - // if the erase all mode is activated it will remove all ink from slide, - // therefor destroy all the polygons stored - if(mbIsEraseAllModeActivated) - { - // The Erase Mode should be desactivated - mbIsEraseModeActivated = false; // must get access to the instance to erase all polygon for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; ++aIter ) { // fully clear view content to background color - (*aIter)->getCanvas()->clear(); + //(*aIter)->getCanvas()->clear(); //get via SlideImpl instance the bitmap of the slide unmodified to redraw it SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); @@ -181,7 +178,19 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } - maPolygons.clear(); + } + + bool eraseAllInkChanged( bool const& rEraseAllInk ) + { + this->mbIsEraseAllModeActivated= rEraseAllInk; + // if the erase all mode is activated it will remove all ink from slide, + // therefor destroy all the polygons stored + if(mbIsEraseAllModeActivated) + { + // The Erase Mode should be desactivated + mbIsEraseModeActivated = false; + repaintWithoutPolygons(); + maPolygons.clear(); } mbIsEraseAllModeActivated=false; return true; @@ -198,18 +207,25 @@ namespace slideshow bool switchPenMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = false; return true; } bool switchEraserMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = true; return true; } bool disable() { + mbIsLastPointValid = false; + mbIsLastMouseDownPosValid = false; + mbActive = false; return true; } @@ -235,6 +251,9 @@ namespace slideshow // MouseEventHandler methods virtual bool handleMousePressed( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -255,6 +274,9 @@ namespace slideshow virtual bool handleMouseReleased( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -289,6 +311,9 @@ namespace slideshow virtual bool handleMouseEntered( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + mbIsLastPointValid = true; maLastPoint.setX( e.X ); maLastPoint.setY( e.Y ); @@ -298,6 +323,9 @@ namespace slideshow virtual bool handleMouseExited( const awt::MouseEvent& ) { + if( !mbActive ) + return false; + mbIsLastPointValid = false; mbIsLastMouseDownPosValid = false; @@ -306,7 +334,16 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if(mbIsEraseModeActivated) + if( !mbActive ) + return false; + + if (e.Buttons == awt::MouseButton::RIGHT) + { + mbIsLastPointValid = false; + return false; + } + + if(mbIsEraseModeActivated) { //define the last point as an object //we suppose that there's no way this point could be valid @@ -421,6 +458,14 @@ namespace slideshow } + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + maStrokeColor = aUserPaintColor; + mnStrokeWidth = dUserPaintStrokeWidth; + mbActive = bUserPaintEnabled; + if( !mbActive ) + disable(); + } private: ActivitiesQueue& mrActivitiesQueue; @@ -438,17 +483,20 @@ namespace slideshow bool mbIsEraseModeActivated; Slide& mrSlide; sal_Int32 mnSize; + bool mbActive; }; UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) + const PolyPolygonVector& rPolygons, + bool bActive ) { UserPaintOverlaySharedPtr pRet( new UserPaintOverlay( rStrokeColor, nStrokeWidth, rContext, - rPolygons )); + rPolygons, + bActive)); return pRet; } @@ -456,7 +504,8 @@ namespace slideshow UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) : + const PolyPolygonVector& rPolygons, + bool bActive ) : mpHandler( new PaintOverlayHandler( rStrokeColor, nStrokeWidth, rContext.mrActivitiesQueue, @@ -464,7 +513,7 @@ namespace slideshow rContext.mrViewContainer, //adding a link to Slide dynamic_cast<Slide&>(rContext.mrCursorManager), - rPolygons )), + rPolygons, bActive )), mrMultiplexer( rContext.mrEventMultiplexer ) { mrMultiplexer.addClickHandler( mpHandler, 3.0 ); @@ -483,6 +532,12 @@ namespace slideshow mpHandler->drawPolygons(); } + void UserPaintOverlay::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + mpHandler->update_settings( bUserPaintEnabled, aUserPaintColor, dUserPaintStrokeWidth ); + } + + UserPaintOverlay::~UserPaintOverlay() { try diff --git a/slideshow/source/engine/slide/userpaintoverlay.hxx b/slideshow/source/engine/slide/userpaintoverlay.hxx index b92f5f2539b0..3a8e14c600c5 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.hxx +++ b/slideshow/source/engine/slide/userpaintoverlay.hxx @@ -69,16 +69,21 @@ namespace slideshow static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive); ~UserPaintOverlay(); PolyPolygonVector getPolygons(); void drawPolygons(); + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + + private: UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive ); ::boost::shared_ptr<PaintOverlayHandler> mpHandler; EventMultiplexer& mrMultiplexer; diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index d736c3f52d64..a909ade61ee2 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -458,7 +458,7 @@ private: boost::optional<RGBColor> maUserPaintColor; - boost::optional<double> maUserPaintStrokeWidth; + double maUserPaintStrokeWidth; //changed for the eraser project boost::optional<bool> maEraseAllInk; @@ -950,7 +950,7 @@ SlideSharedPtr SlideShowImpl::makeSlide( maShapeCursors, (aIter != maPolygons.end()) ? aIter->second : PolyPolygonVector(), maUserPaintColor ? *maUserPaintColor : RGBColor(), - *maUserPaintStrokeWidth, + maUserPaintStrokeWidth, !!maUserPaintColor, mbImageAnimationsAllowed, mbDisableAnimationZOrder) ); @@ -1112,11 +1112,7 @@ void SlideShowImpl::displaySlide( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); -#ifdef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier = xDrawPages; -#else - mxDrawPagesSupplier = NULL; -#endif stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, @@ -1620,6 +1616,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // enable user paint maUserPaintColor.reset( unoColor2RGBColor( nColor ) ); + if( mpCurrentSlide && !mpCurrentSlide->isPaintOverlayActive() ) + mpCurrentSlide->enablePaintOverlay(); + maEventMultiplexer.notifyUserPaintColor( *maUserPaintColor ); } else @@ -1627,10 +1626,11 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // disable user paint maUserPaintColor.reset(); maEventMultiplexer.notifyUserPaintDisabled(); + if( mpCurrentSlide ) + mpCurrentSlide->disablePaintOverlay(); } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + resetCursor(); return true; } @@ -1649,15 +1649,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseAllInk.reset( nEraseAllInk ); maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk ); } - else - { - // disable user paint - maEraseAllInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1677,9 +1668,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEventMultiplexer.notifySwitchPenMode(); } } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1699,8 +1687,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) } } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1719,15 +1705,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseInk.reset( nEraseInk ); maEventMultiplexer.notifyEraseInkWidth( *maEraseInk ); } - else - { - // disable user paint - maEraseInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1741,17 +1718,10 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) { OSL_ENSURE( mbMouseVisible,"setProperty(): User paint overrides invisible mouse" ); // enable user paint stroke width - maUserPaintStrokeWidth.reset( nWidth ); - maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth ); + maUserPaintStrokeWidth = nWidth; + maEventMultiplexer.notifyUserPaintStrokeWidth( maUserPaintStrokeWidth ); } - else - { - // disable user paint stroke width - maUserPaintStrokeWidth.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + return true; } @@ -2214,6 +2184,8 @@ void SlideShowImpl::notifySlideTransitionEnded( bool bPaintSlide ) "notifySlideTransitionEnded(): Invalid current slide" ); if (mpCurrentSlide) { + mpCurrentSlide->update_settings( !!maUserPaintColor, maUserPaintColor ? *maUserPaintColor : RGBColor(), maUserPaintStrokeWidth ); + // first init show, to give the animations // the chance to register SlideStartEvents const bool bBackgroundLayerRendered( !bPaintSlide ); diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx index 9f4e6b8f5055..d457d8e16f88 100644 --- a/slideshow/source/inc/slide.hxx +++ b/slideshow/source/inc/slide.hxx @@ -121,9 +121,14 @@ namespace slideshow ///Draw the slide Polygons virtual void drawPolygons() const = 0; - ///Check if slide is already active + ///Check if paint overlay is already active virtual bool isPaintOverlayActive() const = 0; + virtual void enablePaintOverlay() = 0; + virtual void disablePaintOverlay() = 0; + + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0; + // Slide bitmaps // ------------------------------------------------------------------- diff --git a/slideshow/util/makefile.pmk b/slideshow/util/makefile.pmk index 53724522d5e8..765b5249e5a4 100644 --- a/slideshow/util/makefile.pmk +++ b/slideshow/util/makefile.pmk @@ -35,7 +35,7 @@ CDEFS += -DBOOST_SP_ENABLE_DEBUG_HOOKS .IF "$(COM)"=="MSC" # disable inlining for MSVC -CFLAGS += -Ob0 +#CFLAGS += -Ob0 .ENDIF .ENDIF # "$(debug)"!="" || "$(DEBUG)"!="" |