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 | |
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')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/morphdlg.cxx | 8 | ||||
-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 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/view/drviews9.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsi.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 4 |
14 files changed, 50 insertions, 60 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 3614a9668408..8fe7ceb1b98a 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2638,8 +2638,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi { const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet(); - drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rObjItemSet.Get(XATTR_FILLSTYLE)).GetValue(); - drawing::LineStyle eLineStyle = static_cast<const XLineStyleItem&>(rObjItemSet.Get(XATTR_LINESTYLE)).GetValue(); + drawing::FillStyle eFillStyle = rObjItemSet.Get(XATTR_FILLSTYLE).GetValue(); + drawing::LineStyle eLineStyle = rObjItemSet.Get(XATTR_LINESTYLE).GetValue(); if ( ( eFillStyle == drawing::FillStyle_NONE ) && ( eLineStyle == drawing::LineStyle_NONE ) ) bDontAnimateInvisibleShape = true; diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index 69174d372454..15c8f5cd11c1 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -52,10 +52,10 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObjec aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); - const drawing::LineStyle eLineStyle1 = static_cast<const XLineStyleItem&>( aSet1.Get( XATTR_LINESTYLE ) ).GetValue(); - const drawing::LineStyle eLineStyle2 = static_cast<const XLineStyleItem&>( aSet2.Get( XATTR_LINESTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle1 = static_cast<const XFillStyleItem&>( aSet1.Get( XATTR_FILLSTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle2 = static_cast<const XFillStyleItem&>( aSet2.Get( XATTR_FILLSTYLE ) ).GetValue(); + 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 ( ( ( eLineStyle1 == drawing::LineStyle_NONE ) || ( eLineStyle2 == drawing::LineStyle_NONE ) ) && ( ( eFillStyle1 != drawing::FillStyle_SOLID ) || ( eFillStyle2 != drawing::FillStyle_SOLID ) ) ) 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; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 60a6e7bb07ca..10f25204c810 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2556,7 +2556,7 @@ void SdDrawPage::getBackground( Any& rValue ) throw() { const SfxItemSet& rFillAttributes = GetPage()->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == rFillAttributes.Get(XATTR_FILLSTYLE).GetValue()) { // no fill set (switched off by drawing::FillStyle_NONE), clear rValue to represent this rValue.clear(); @@ -2969,7 +2969,7 @@ void SdMasterPage::getBackground( Any& rValue ) // should NOT happen and is an error const SfxItemSet& rFallbackItemSet(SvxFmDrawPage::mpPage->getSdrPageProperties().GetItemSet()); - if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(rFallbackItemSet.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == rFallbackItemSet.Get(XATTR_FILLSTYLE).GetValue()) { rValue <<= Reference< beans::XPropertySet >( new SdUnoPageBackground(GetModel()->GetDoc(), &rFallbackItemSet)); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index c91aa9edf0e0..f7cdadca4563 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1586,7 +1586,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) SfxItemSet aMergedAttr(GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND); MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EditMode::MasterPage, aMergedAttr); - if (drawing::FillStyle_BITMAP == static_cast<const XFillStyleItem&>(aMergedAttr.Get(XATTR_FILLSTYLE)).GetValue()) + if (drawing::FillStyle_BITMAP == aMergedAttr.Get(XATTR_FILLSTYLE).GetValue()) { bDisableSaveBackground = false; } @@ -1696,7 +1696,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) rSet.Put(aPageItem); const SfxItemSet &rPageAttr = pPage->getSdrPageProperties().GetItemSet(); - drawing::FillStyle eXFS = (drawing::FillStyle) static_cast<const XFillStyleItem*>( rPageAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue(); + drawing::FillStyle eXFS = (drawing::FillStyle) rPageAttr.GetItem( XATTR_FILLSTYLE )->GetValue(); XFillStyleItem aFillStyleItem( eXFS ); aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE ); rSet.Put(aFillStyleItem); @@ -1705,7 +1705,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) { case drawing::FillStyle_SOLID: { - Color aColor = static_cast<const XFillColorItem*>( rPageAttr.GetItem( XATTR_FILLCOLOR ) )->GetColorValue(); + Color aColor = rPageAttr.GetItem( XATTR_FILLCOLOR )->GetColorValue(); XFillColorItem aFillColorItem( OUString(), aColor ); aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR ); rSet.Put( aFillColorItem ); @@ -1714,7 +1714,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) case drawing::FillStyle_GRADIENT: { - const XFillGradientItem *pGradient = static_cast<const XFillGradientItem*>( rPageAttr.GetItem( XATTR_FILLGRADIENT ) ); + const XFillGradientItem *pGradient = rPageAttr.GetItem( XATTR_FILLGRADIENT ); XFillGradientItem aFillGradientItem( pGradient->GetName(), pGradient->GetGradientValue(), SID_ATTR_PAGE_GRADIENT ); rSet.Put( aFillGradientItem ); } @@ -1722,7 +1722,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) case drawing::FillStyle_HATCH: { - const XFillHatchItem *pFillHatchItem( static_cast<const XFillHatchItem*>( rPageAttr.GetItem( XATTR_FILLHATCH ) ) ); + const XFillHatchItem *pFillHatchItem( rPageAttr.GetItem( XATTR_FILLHATCH ) ); XFillHatchItem aFillHatchItem( pFillHatchItem->GetName(), pFillHatchItem->GetHatchValue()); aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH ); rSet.Put( aFillHatchItem ); @@ -1731,7 +1731,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) case drawing::FillStyle_BITMAP: { - const XFillBitmapItem *pFillBitmapItem = static_cast<const XFillBitmapItem*>( rPageAttr.GetItem( XATTR_FILLBITMAP ) ); + const XFillBitmapItem *pFillBitmapItem = rPageAttr.GetItem( XATTR_FILLBITMAP ); XFillBitmapItem aFillBitmapItem( pFillBitmapItem->GetName(), pFillBitmapItem->GetGraphicObject() ); aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP ); rSet.Put( aFillBitmapItem ); @@ -1769,7 +1769,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) { case SID_ATTR_PAGE_FILLSTYLE: { - XFillStyleItem aFSItem( static_cast<const XFillStyleItem&>(pArgs->Get( XATTR_FILLSTYLE )) ); + XFillStyleItem aFSItem( pArgs->Get( XATTR_FILLSTYLE ) ); drawing::FillStyle eXFS = aFSItem.GetValue(); if ( eXFS == drawing::FillStyle_NONE ) @@ -1779,7 +1779,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) case SID_ATTR_PAGE_COLOR: { - XFillColorItem aColorItem( static_cast<const XFillColorItem&>(pArgs->Get( XATTR_FILLCOLOR )) ); + XFillColorItem aColorItem( pArgs->Get( XATTR_FILLCOLOR ) ); rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_SOLID ) ); rPageProperties.PutItem( aColorItem ); } @@ -1787,7 +1787,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) case SID_ATTR_PAGE_GRADIENT: { - XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(pArgs->Get( XATTR_FILLGRADIENT )) ); + XFillGradientItem aGradientItem( pArgs->Get( XATTR_FILLGRADIENT ) ); // MigrateItemSet guarantees unique gradient names SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} ); @@ -1801,7 +1801,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) case SID_ATTR_PAGE_HATCH: { - XFillHatchItem aHatchItem( static_cast<const XFillHatchItem&>(pArgs->Get( XATTR_FILLHATCH )) ); + XFillHatchItem aHatchItem( pArgs->Get( XATTR_FILLHATCH ) ); rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_HATCH ) ); rPageProperties.PutItem( aHatchItem ); } @@ -1809,7 +1809,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) case SID_ATTR_PAGE_BITMAP: { - XFillBitmapItem aBitmapItem( static_cast<const XFillBitmapItem&>(pArgs->Get( XATTR_FILLBITMAP )) ); + XFillBitmapItem aBitmapItem( pArgs->Get( XATTR_FILLBITMAP ) ); rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_BITMAP ) ); rPageProperties.PutItem( aBitmapItem ); } diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index c691d4ef0b12..c3a55f55f031 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -812,7 +812,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { case SID_GETFILLSTYLE : { - const XFillStyleItem &rFillStyleItem = static_cast<const XFillStyleItem &>(aAttr.Get (XATTR_FILLSTYLE)); + const XFillStyleItem &rFillStyleItem = aAttr.Get (XATTR_FILLSTYLE); rSet.Put (SfxUInt32Item (nWhich, (long) rFillStyleItem.GetValue ())); break; @@ -820,7 +820,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case SID_GETLINESTYLE : { - const XLineStyleItem &rLineStyleItem = static_cast<const XLineStyleItem &>( aAttr.Get (XATTR_LINESTYLE) ); + const XLineStyleItem &rLineStyleItem = aAttr.Get (XATTR_LINESTYLE); rSet.Put (SfxUInt32Item (nWhich, (long) rLineStyleItem.GetValue ())); break; @@ -828,7 +828,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case SID_GETLINEWIDTH : { - const XLineWidthItem &rLineWidthItem = static_cast<const XLineWidthItem &>( aAttr.Get (XATTR_LINEWIDTH) ); + const XLineWidthItem &rLineWidthItem = aAttr.Get (XATTR_LINEWIDTH); rSet.Put (SfxUInt32Item (nWhich, (long) rLineWidthItem.GetValue ())); break; @@ -845,7 +845,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { case 1 : { - const XLineColorItem &rLineColorItem = static_cast<const XLineColorItem &>( aAttr.Get (XATTR_LINECOLOR) ); + const XLineColorItem &rLineColorItem = aAttr.Get (XATTR_LINECOLOR); aColor = rLineColorItem.GetColorValue (); break; @@ -853,7 +853,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 2 : { - const XFillColorItem &rFillColorItem = static_cast<const XFillColorItem &>( aAttr.Get (XATTR_FILLCOLOR) ); + const XFillColorItem &rFillColorItem = aAttr.Get (XATTR_FILLCOLOR); aColor = rFillColorItem.GetColorValue (); break; @@ -862,7 +862,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 3 : case 4 : { - const XFillGradientItem &rFillGradientItem = static_cast<const XFillGradientItem &>( aAttr.Get (XATTR_FILLGRADIENT) ); + const XFillGradientItem &rFillGradientItem = aAttr.Get (XATTR_FILLGRADIENT); const XGradient &rGradient = rFillGradientItem.GetGradientValue (); aColor = (rWhatKind.GetValue () == 3) @@ -873,7 +873,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 5: { - const XFillHatchItem &rFillHatchItem = static_cast<const XFillHatchItem &>( aAttr.Get (XATTR_FILLHATCH) ); + const XFillHatchItem &rFillHatchItem = aAttr.Get (XATTR_FILLHATCH); const XHatch &rHatch = rFillHatchItem.GetHatchValue (); aColor = rHatch.GetColor (); diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx index 78007e4e3649..0212473ddffb 100644 --- a/sd/source/ui/view/drviewsi.cxx +++ b/sd/source/ui/view/drviewsi.cxx @@ -51,8 +51,6 @@ using namespace ::com::sun::star; namespace sd { -#define ITEMVALUE(ItemSet,Id,Cast) static_cast<const Cast&>((ItemSet).Get(Id)).GetValue() - /** * Handle SfxRequests for EffekteWindow */ @@ -144,7 +142,7 @@ void DrawViewShell::AssignFrom3DWindow() // Determine if a FILL attribute is set. // If not, hard set a fill attribute - drawing::FillStyle eFillStyle = ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem ); + drawing::FillStyle eFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue(); if(eFillStyle == drawing::FillStyle_NONE) aSet.Put(XFillStyleItem (drawing::FillStyle_SOLID)); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 24cde44a6dd8..a850126f0891 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -991,8 +991,8 @@ bool View::IsMorphingAllowed() const aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); - const drawing::FillStyle eFillStyle1 = static_cast<const XFillStyleItem&>( aSet1.Get( XATTR_FILLSTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle2 = static_cast<const XFillStyleItem&>( aSet2.Get( XATTR_FILLSTYLE ) ).GetValue(); + const drawing::FillStyle eFillStyle1 = aSet1.Get( XATTR_FILLSTYLE ).GetValue(); + const drawing::FillStyle eFillStyle2 = aSet2.Get( XATTR_FILLSTYLE ).GetValue(); if( ( eFillStyle1 == drawing::FillStyle_NONE || eFillStyle1 == drawing::FillStyle_SOLID ) && ( eFillStyle2 == drawing::FillStyle_NONE || eFillStyle2 == drawing::FillStyle_SOLID ) ) diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 9b029ec9ed09..4df02ee52385 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -680,7 +680,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) ); ReadXFillExchangeData( *xStm, aFillData ); - const Color aColor( static_cast<const XFillColorItem&>( aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() ); + const Color aColor( aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ).GetColorValue() ); static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, true ); nRet = nDropAction; } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 00a6456edc8c..24e22a0f0dc5 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1334,11 +1334,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, XFillAttrSetItem* pSetItem = aFillData.GetXFillAttrSetItem(); SfxItemSet rSet = pSetItem->GetItemSet(); - drawing::FillStyle eFill = static_cast<const XFillStyleItem&>( rSet.Get( XATTR_FILLSTYLE ) ).GetValue(); + drawing::FillStyle eFill = rSet.Get( XATTR_FILLSTYLE ).GetValue(); if( eFill == drawing::FillStyle_SOLID || eFill == drawing::FillStyle_NONE ) { - const XFillColorItem& rColItem = static_cast<const XFillColorItem&>( rSet.Get( XATTR_FILLCOLOR ) ); + const XFillColorItem& rColItem = rSet.Get( XATTR_FILLCOLOR ); Color aColor( rColItem.GetColorValue() ); OUString aName( rColItem.GetName() ); SfxItemSet aSet( mrDoc.GetPool() ); |