diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-16 16:16:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-20 09:43:25 +0100 |
commit | 0f0049d77a0ee6ae936922213c7290d0bc4fee29 (patch) | |
tree | 21ec8c68606453166de7557afa394054907d9c85 /sd/source/ui/func | |
parent | 21e85d591f344958c3ebee9422ba15dbd931f2cc (diff) |
TypedWhichId for XATTR* constants
Change-Id: Ie9d637d701b77a549de3b00956f9c74ee8bd08c1
Reviewed-on: https://gerrit.libreoffice.org/44830
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/fuconrec.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuconstr.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fumorph.cxx | 26 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/func/fusel.cxx | 2 |
5 files changed, 18 insertions, 26 deletions
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index e10b37b53c0e..e46293693ae6 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -586,7 +586,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj // determine line width and calculate with it the line end width if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE ) { - long nValue = static_cast<const XLineWidthItem&>( aSet.Get( XATTR_LINEWIDTH ) ).GetValue(); + long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue(); if( nValue > 0 ) nWidth = nValue * 3; } diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index 5c72bc6463d2..dc005c0e968d 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -327,7 +327,7 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj, // applying style sheet for background objects pObj->SetStyleSheet(pSheet, false); SfxItemSet& rSet = pSheet->GetItemSet(); - const XFillStyleItem& rFillStyle = static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)); + const XFillStyleItem& rFillStyle = rSet.Get(XATTR_FILLSTYLE); if ( bForceFillStyle ) { if (rFillStyle.GetValue() == drawing::FillStyle_NONE) diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 95714ad45553..94523658c2e7 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -50,8 +50,6 @@ using namespace com::sun::star; namespace sd { -#define ITEMVALUE( ItemSet, Id, Cast ) ( static_cast<const Cast&>( (ItemSet).Get( (Id) ) ).GetValue() ) - FuMorph::FuMorph ( ViewShell* pViewSh, ::sd::Window* pWin, @@ -354,10 +352,10 @@ void FuMorph::ImpInsertPolygons( aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); - const drawing::LineStyle eLineStyle1 = ITEMVALUE( aSet1, XATTR_LINESTYLE, XLineStyleItem ); - const drawing::LineStyle eLineStyle2 = ITEMVALUE( aSet2, XATTR_LINESTYLE, XLineStyleItem ); - const drawing::FillStyle eFillStyle1 = ITEMVALUE( aSet1, XATTR_FILLSTYLE, XFillStyleItem ); - const drawing::FillStyle eFillStyle2 = ITEMVALUE( aSet2, XATTR_FILLSTYLE, XFillStyleItem ); + const drawing::LineStyle eLineStyle1 = aSet1.Get(XATTR_LINESTYLE).GetValue(); + const drawing::LineStyle eLineStyle2 = aSet2.Get(XATTR_LINESTYLE).GetValue(); + const drawing::FillStyle eFillStyle1 = aSet1.Get(XATTR_FILLSTYLE).GetValue(); + const drawing::FillStyle eFillStyle2 = aSet2.Get(XATTR_FILLSTYLE).GetValue(); if ( bAttributeFade ) { @@ -365,13 +363,11 @@ void FuMorph::ImpInsertPolygons( { bLineWidth = bLineColor = true; - aStartLineCol = static_cast< XLineColorItem const & >( - aSet1.Get(XATTR_LINECOLOR)).GetColorValue(); - aEndLineCol = static_cast< XLineColorItem const & >( - aSet2.Get(XATTR_LINECOLOR)).GetColorValue(); + aStartLineCol = aSet1.Get(XATTR_LINECOLOR).GetColorValue(); + aEndLineCol = aSet2.Get(XATTR_LINECOLOR).GetColorValue(); - nStartLineWidth = ITEMVALUE( aSet1, XATTR_LINEWIDTH, XLineWidthItem ); - nEndLineWidth = ITEMVALUE( aSet2, XATTR_LINEWIDTH, XLineWidthItem ); + nStartLineWidth = aSet1.Get(XATTR_LINEWIDTH).GetValue(); + nEndLineWidth = aSet2.Get(XATTR_LINEWIDTH).GetValue(); } else if ( ( eLineStyle1 == drawing::LineStyle_NONE ) && ( eLineStyle2 == drawing::LineStyle_NONE ) ) bIgnoreLine = true; @@ -379,10 +375,8 @@ void FuMorph::ImpInsertPolygons( if ( ( eFillStyle1 == drawing::FillStyle_SOLID ) && ( eFillStyle2 == drawing::FillStyle_SOLID ) ) { bFillColor = true; - aStartFillCol = static_cast< XFillColorItem const & >( - aSet1.Get(XATTR_FILLCOLOR)).GetColorValue(); - aEndFillCol = static_cast< XFillColorItem const & >( - aSet2.Get(XATTR_FILLCOLOR)).GetColorValue(); + aStartFillCol = aSet1.Get(XATTR_FILLCOLOR).GetColorValue(); + aEndFillCol = aSet2.Get(XATTR_FILLCOLOR).GetColorValue(); } else if ( ( eFillStyle1 == drawing::FillStyle_NONE ) && ( eFillStyle2 == drawing::FillStyle_NONE ) ) bIgnoreFill = true; diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index fa14378f2da0..040701cfc286 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -180,7 +180,7 @@ void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool b // Only this page, get attributes for background fill const SfxItemSet& rBackgroundAttributes = pPage->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE != rBackgroundAttributes.Get(XATTR_FILLSTYLE).GetValue()) { // page attributes are used, take them rMergedAttr.Put(rBackgroundAttributes); @@ -188,7 +188,7 @@ void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool b else { if(pStyleSheet - && drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) + && drawing::FillStyle_NONE != pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE).GetValue()) { // if the page has no fill style, use the settings from the // background stylesheet (if used) @@ -294,12 +294,10 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) const sal_uInt16 nId = GetSlotID(); if (nId == SID_SAVE_BACKGROUND) { - const XFillStyleItem& rStyleItem = - static_cast<const XFillStyleItem&>(aMergedAttr.Get(XATTR_FILLSTYLE)); + const XFillStyleItem& rStyleItem = aMergedAttr.Get(XATTR_FILLSTYLE); if (drawing::FillStyle_BITMAP == (drawing::FillStyle)rStyleItem.GetValue()) { - const XFillBitmapItem& rBitmap = - static_cast<const XFillBitmapItem&>(aMergedAttr.Get(XATTR_FILLBITMAP)); + const XFillBitmapItem& rBitmap = aMergedAttr.Get(XATTR_FILLBITMAP); const GraphicObject& rGraphicObj = rBitmap.GetGraphicObject(); GraphicHelper::ExportGraphic(pParent, rGraphicObj.GetGraphic(), ""); } @@ -441,7 +439,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) SdPage *pPage = mpDoc->GetSdPage(i, ePageKind); const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE != rFillAttributes.Get(XATTR_FILLSTYLE).GetValue()) { SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); pUndoGroup->AddAction(pBackgroundObjUndoAction); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index cf8c8d8d4571..33998e04180e 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1200,7 +1200,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) aSet.Put(pObj->GetMergedItemSet()); - const XFillStyleItem& rFillStyle = static_cast<const XFillStyleItem&>( aSet.Get(XATTR_FILLSTYLE) ); + const XFillStyleItem& rFillStyle = aSet.Get(XATTR_FILLSTYLE); bFilled = rFillStyle.GetValue() != drawing::FillStyle_NONE; } |