[Libreoffice-commits] core.git: chart2/source cui/source filter/source include/svl include/svx sc/source sd/source svx/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Nov 20 08:43:48 UTC 2017


 chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx |    6 
 chart2/source/controller/main/DrawCommandDispatch.cxx                    |    2 
 cui/source/tabpages/tparea.cxx                                           |    2 
 cui/source/tabpages/tpbitmap.cxx                                         |   20 -
 cui/source/tabpages/tpcolor.cxx                                          |    2 
 cui/source/tabpages/tpgradnt.cxx                                         |    2 
 cui/source/tabpages/tphatch.cxx                                          |   10 
 cui/source/tabpages/tpline.cxx                                           |   26 -
 cui/source/tabpages/tplnedef.cxx                                         |    2 
 cui/source/tabpages/tppattern.cxx                                        |    2 
 cui/source/tabpages/tpshadow.cxx                                         |   16 -
 cui/source/tabpages/tptrans.cxx                                          |   14 
 filter/source/msfilter/escherex.cxx                                      |    4 
 filter/source/msfilter/svdfppt.cxx                                       |   20 -
 include/svl/typedwhich.hxx                                               |    2 
 include/svx/xdef.hxx                                                     |  148 ++++++----
 sc/source/core/tool/detfunc.cxx                                          |   12 
 sc/source/filter/excel/xeescher.cxx                                      |    4 
 sc/source/ui/drawfunc/fuconrec.cxx                                       |    2 
 sd/source/filter/ppt/pptin.cxx                                           |    4 
 sd/source/ui/dlg/morphdlg.cxx                                            |    8 
 sd/source/ui/func/fuconrec.cxx                                           |    2 
 sd/source/ui/func/fuconstr.cxx                                           |    2 
 sd/source/ui/func/fumorph.cxx                                            |   26 -
 sd/source/ui/func/fupage.cxx                                             |   12 
 sd/source/ui/func/fusel.cxx                                              |    2 
 sd/source/ui/unoidl/unopage.cxx                                          |    4 
 sd/source/ui/view/drviews7.cxx                                           |   22 -
 sd/source/ui/view/drviews9.cxx                                           |   14 
 sd/source/ui/view/drviewsi.cxx                                           |    4 
 sd/source/ui/view/sdview.cxx                                             |    4 
 sd/source/ui/view/sdview2.cxx                                            |    2 
 sd/source/ui/view/sdview3.cxx                                            |    4 
 svx/source/customshapes/EnhancedCustomShape2d.cxx                        |   30 +-
 svx/source/customshapes/EnhancedCustomShape3d.cxx                        |   23 -
 svx/source/engine3d/float3d.cxx                                          |    4 
 svx/source/engine3d/view3d.cxx                                           |   20 -
 svx/source/sdr/attribute/sdrformtextattribute.cxx                        |   38 +-
 svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx                    |    4 
 svx/source/sdr/primitive2d/sdrattributecreator.cxx                       |   72 ++--
 svx/source/sdr/primitive3d/sdrattributecreator3d.cxx                     |    2 
 svx/source/sdr/properties/properties.cxx                                 |    2 
 svx/source/svdraw/sdrmasterpagedescriptor.cxx                            |    2 
 svx/source/svdraw/svdcrtv.cxx                                            |    4 
 svx/source/svdraw/svdedtv.cxx                                            |    2 
 svx/source/svdraw/svdedtv1.cxx                                           |    8 
 svx/source/svdraw/svdedtv2.cxx                                           |    4 
 svx/source/svdraw/svdetc.cxx                                             |   14 
 svx/source/svdraw/svdhdl.cxx                                             |    4 
 svx/source/svdraw/svdmrkv.cxx                                            |    9 
 svx/source/svdraw/svdoashp.cxx                                           |   10 
 svx/source/svdraw/svdoattr.cxx                                           |    4 
 svx/source/svdraw/svdobj.cxx                                             |    8 
 svx/source/svdraw/svdocirc.cxx                                           |   14 
 svx/source/svdraw/svdomeas.cxx                                           |   18 -
 svx/source/svdraw/svdotext.cxx                                           |    4 
 svx/source/svdraw/svdotextdecomposition.cxx                              |    6 
 svx/source/svdraw/svdpage.cxx                                            |    2 
 svx/source/tbxctrls/colrctrl.cxx                                         |    2 
 svx/source/toolbars/extrusionbar.cxx                                     |    2 
 svx/source/unodraw/unobrushitemhelper.cxx                                |   20 -
 svx/source/unodraw/unopool.cxx                                           |    4 
 svx/source/unodraw/unoprov.cxx                                           |    4 
 svx/source/unodraw/unoshape.cxx                                          |    8 
 svx/source/xoutdev/xattr.cxx                                             |   24 -
 svx/source/xoutdev/xexch.cxx                                             |    2 
 sw/source/core/frmedt/feshview.cxx                                       |    2 
 sw/source/core/layout/paintfrm.cxx                                       |    4 
 sw/source/core/unocore/unoframe.cxx                                      |    4 
 sw/source/core/unocore/unoparagraph.cxx                                  |    4 
 sw/source/core/unocore/unostyle.cxx                                      |   20 -
 sw/source/filter/html/htmldrawwriter.cxx                                 |    4 
 sw/source/filter/ww8/rtfexport.cxx                                       |    2 
 sw/source/filter/ww8/ww8graf.cxx                                         |    9 
 sw/source/uibase/app/docstyle.cxx                                        |    4 
 sw/source/uibase/shells/langhelper.cxx                                   |    6 
 sw/source/uibase/uiview/viewtab.cxx                                      |   14 
 77 files changed, 442 insertions(+), 411 deletions(-)

New commits:
commit 0f0049d77a0ee6ae936922213c7290d0bc4fee29
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Nov 16 16:16:22 2017 +0200

    TypedWhichId for XATTR* constants
    
    Change-Id: Ie9d637d701b77a549de3b00956f9c74ee8bd08c1
    Reviewed-on: https://gerrit.libreoffice.org/44830
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
index 8847c3aaf50b..f6e3e7a16bd5 100644
--- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
@@ -426,8 +426,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
             if( lcl_supportsFillProperties( m_GraphicObjectType ))
             {
                 const OUString aModePropName("FillBitmapMode");
-                bool bStretched = static_cast< const XFillBmpStretchItem & >(
-                    rItemSet.Get( XATTR_FILLBMP_STRETCH )).GetValue();
+                bool bStretched = rItemSet.Get( XATTR_FILLBMP_STRETCH ).GetValue();
                 drawing::BitmapMode aMode =
                     (bStretched ? drawing::BitmapMode_STRETCH : drawing::BitmapMode_NO_REPEAT);
 
@@ -444,8 +443,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
             if( lcl_supportsFillProperties( m_GraphicObjectType ))
             {
                 const OUString aModePropName("FillBitmapMode");
-                bool bTiled = static_cast< const XFillBmpTileItem & >(
-                    rItemSet.Get( XATTR_FILLBMP_TILE )).GetValue();
+                bool bTiled = rItemSet.Get( XATTR_FILLBMP_TILE ).GetValue();
                 drawing::BitmapMode aMode =
                     (bTiled ? drawing::BitmapMode_REPEAT : drawing::BitmapMode_NO_REPEAT);
 
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index c460d856b692..fcbccefcaa97 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -197,7 +197,7 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
             long nWidth = 300; // (1/100th mm)
             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/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 6f19bc50e4bb..aa45639d1e14 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -199,7 +199,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
         }
         case drawing::FillStyle_HATCH:
         {
-            m_rXFSet.Put( static_cast<const XFillHatchItem&>( rSet.Get(XATTR_FILLHATCH) ) );
+            m_rXFSet.Put( rSet.Get(XATTR_FILLHATCH) );
             SelectFillTypeHdl_Impl( m_pBtnHatch );
             break;
         }
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 192297547949..00897f4848b9 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -179,7 +179,7 @@ void SvxBitmapTabPage::Construct()
 
 void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet )
 {
-    XFillBitmapItem aItem( static_cast<const XFillBitmapItem&>(rSet.Get(XATTR_FILLBITMAP)) );
+    XFillBitmapItem aItem( rSet.Get(XATTR_FILLBITMAP) );
 
     sal_Int32 nPos = SearchBitmapList( aItem.GetName() );
     if ( nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -298,7 +298,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
     double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectHeight), mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
     m_fObjectHeight = fTmpHeight;
 
-    XFillBitmapItem aItem( static_cast<const XFillBitmapItem&>(rAttrs->Get(XATTR_FILLBITMAP)) );
+    XFillBitmapItem aItem( rAttrs->Get(XATTR_FILLBITMAP) );
 
     if(!aItem.isPattern())
     {
@@ -323,7 +323,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if(rAttrs->GetItemState( XATTR_FILLBMP_TILE ) != SfxItemState::DONTCARE)
     {
-        if( static_cast<const XFillBmpTileItem&>( rAttrs->Get( XATTR_FILLBMP_TILE ) ).GetValue() )
+        if( rAttrs->Get( XATTR_FILLBMP_TILE ).GetValue() )
         {
             m_pBitmapStyleLB->SelectEntryPos(static_cast<sal_Int32>(TILED));
         }
@@ -331,7 +331,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( m_pBitmapStyleLB->GetSelectedEntryPos() == 0 && rAttrs->GetItemState( XATTR_FILLBMP_STRETCH ) != SfxItemState::DONTCARE)
     {
-        if( static_cast<const XFillBmpStretchItem&>( rAttrs->Get( XATTR_FILLBMP_STRETCH ) ).GetValue() )
+        if( rAttrs->Get( XATTR_FILLBMP_STRETCH ).GetValue() )
         {
             m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(STRETCHED) );
         }
@@ -355,7 +355,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if(rAttrs->GetItemState( XATTR_FILLBMP_SIZEY ) != SfxItemState::DONTCARE)
     {
-        nHeight = static_cast<const XFillBmpSizeYItem&>( rAttrs->Get( XATTR_FILLBMP_SIZEY ) ).GetValue();
+        nHeight = rAttrs->Get( XATTR_FILLBMP_SIZEY ).GetValue();
         if(nHeight == 0)
             nHeight = rBitmapSize.Height();
         else if(nHeight < 0)
@@ -402,13 +402,13 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( rAttrs->GetItemState( XATTR_FILLBMP_POS ) != SfxItemState::DONTCARE )
     {
-        RectPoint eValue = static_cast<const XFillBmpPosItem&>( rAttrs->Get( XATTR_FILLBMP_POS ) ).GetValue();
+        RectPoint eValue = rAttrs->Get( XATTR_FILLBMP_POS ).GetValue();
         m_pPositionLB->SelectEntryPos( static_cast< sal_Int32 >(eValue) );
     }
 
     if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SfxItemState::DONTCARE )
     {
-        sal_Int32 nValue = static_cast<const XFillBmpPosOffsetXItem&>( rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ) ).GetValue();
+        sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ).GetValue();
         m_pPositionOffX->SetValue( nValue );
     }
     else
@@ -416,7 +416,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SfxItemState::DONTCARE )
     {
-        sal_Int32 nValue = static_cast<const XFillBmpPosOffsetYItem&>( rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ) ).GetValue();
+        sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ).GetValue();
         m_pPositionOffY->SetValue( nValue );
     }
     else
@@ -424,7 +424,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SfxItemState::DONTCARE)
     {
-        sal_Int32 nValue = static_cast<const XFillBmpTileOffsetXItem&>( rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ) ).GetValue();
+        sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ).GetValue();
         if(nValue > 0)
         {
             m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(ROW));
@@ -434,7 +434,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETY ) != SfxItemState::DONTCARE )
     {
-        sal_Int32 nValue = static_cast<const XFillBmpTileOffsetYItem&>( rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ) ).GetValue();
+        sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ).GetValue();
         if(nValue > 0)
         {
             m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(COLUMN));
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 8b43dd6830bc..185f28fcfcc4 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -292,7 +292,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
 
     if ( nState >= SfxItemState::DEFAULT )
     {
-        XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rSet->Get( XATTR_FILLCOLOR )) );
+        XFillColorItem aColorItem( rSet->Get( XATTR_FILLCOLOR ) );
         aPreviousColor = aColorItem.GetColorValue();
         aNewColor = aColorItem.GetColorValue();
     }
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 36a05915a6e5..86cb408c1a01 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -201,7 +201,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet )
         else
             aString += aURL.getBase();
 
-        sal_Int32 nPos = SearchGradientList( static_cast<const XFillGradientItem&>( rSet.Get(XATTR_FILLGRADIENT) ).GetName() );
+        sal_Int32 nPos = SearchGradientList( rSet.Get(XATTR_FILLGRADIENT).GetName() );
         if ( nPos != LISTBOX_ENTRY_NOTFOUND )
         {
             sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( nPos ) );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index bcab052260aa..922418d8c358 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -188,7 +188,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
         else
             aString += aURL.getBase();
 
-        sal_Int32 nPos = SearchHatchList( static_cast<const XFillHatchItem&>( rSet.Get(XATTR_FILLHATCH) ).GetName() );
+        sal_Int32 nPos = SearchHatchList( rSet.Get(XATTR_FILLHATCH).GetName() );
         if( nPos != LISTBOX_ENTRY_NOTFOUND )
         {
             sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( nPos ) );
@@ -198,13 +198,13 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
         ChangeHatchHdl_Impl();
     }
 
-    XFillBackgroundItem aBckItem( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)));
+    XFillBackgroundItem aBckItem( rSet.Get(XATTR_FILLBACKGROUND));
     m_rXFSet.Put( aBckItem );
 
     if(aBckItem.GetValue())
     {
         m_pCbBackgroundColor->SetState(TRISTATE_TRUE);
-        XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rSet.Get(XATTR_FILLCOLOR)) );
+        XFillColorItem aColorItem( rSet.Get(XATTR_FILLCOLOR) );
         Color aColor(aColorItem.GetColorValue());
         m_pLbBackgroundColor->Enable();
         m_pLbBackgroundColor->SelectEntry(aColor);
@@ -282,14 +282,14 @@ void SvxHatchTabPage::Reset( const SfxItemSet* rSet )
 {
     ChangeHatchHdl_Impl();
 
-    XFillBackgroundItem aBckItem( static_cast<const XFillBackgroundItem&>(rSet->Get(XATTR_FILLBACKGROUND)) );
+    XFillBackgroundItem aBckItem( rSet->Get(XATTR_FILLBACKGROUND) );
     if(aBckItem.GetValue())
         m_pCbBackgroundColor->SetState(TRISTATE_TRUE);
     else
         m_pCbBackgroundColor->SetState(TRISTATE_FALSE);
     m_rXFSet.Put( aBckItem );
 
-    XFillColorItem aColItem( static_cast<const XFillColorItem&>(rSet->Get(XATTR_FILLCOLOR)) );
+    XFillColorItem aColItem( rSet->Get(XATTR_FILLCOLOR) );
     m_pLbBackgroundColor->SelectEntry(aColItem.GetColorValue());
     m_rXFSet.Put( aColItem );
 
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 7c238dfeeba6..c2da4dcca633 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -1209,7 +1209,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
 
     if( rAttrs->GetItemState( XATTR_LINESTYLE ) != SfxItemState::DONTCARE )
     {
-        eXLS = (drawing::LineStyle) static_cast<const XLineStyleItem&>( rAttrs->Get( XATTR_LINESTYLE ) ).GetValue();
+        eXLS = (drawing::LineStyle) rAttrs->Get( XATTR_LINESTYLE ).GetValue();
 
         switch( eXLS )
         {
@@ -1222,7 +1222,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
 
             case drawing::LineStyle_DASH:
                 m_pLbLineStyle->SetNoSelection();
-                m_pLbLineStyle->SelectEntry( static_cast<const XLineDashItem&>( rAttrs->Get( XATTR_LINEDASH ) ).GetName() );
+                m_pLbLineStyle->SelectEntry( rAttrs->Get( XATTR_LINEDASH ).GetName() );
                 break;
 
             default:
@@ -1237,7 +1237,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     // Line strength
     if( rAttrs->GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
     {
-        SetMetricValue( *m_pMtrLineWidth, static_cast<const XLineWidthItem&>( rAttrs->Get( XATTR_LINEWIDTH ) ).GetValue(), m_ePoolUnit );
+        SetMetricValue( *m_pMtrLineWidth, rAttrs->Get( XATTR_LINEWIDTH ).GetValue(), m_ePoolUnit );
     }
     else
         m_pMtrLineWidth->SetText( "" );
@@ -1247,7 +1247,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
 
     if ( rAttrs->GetItemState( XATTR_LINECOLOR ) != SfxItemState::DONTCARE )
     {
-        Color aCol = static_cast<const XLineColorItem&>( rAttrs->Get( XATTR_LINECOLOR ) ).GetColorValue();
+        Color aCol = rAttrs->Get( XATTR_LINECOLOR ).GetColorValue();
         m_pLbColor->SelectEntry( aCol );
     }
 
@@ -1260,7 +1260,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     {
         // #86265# select entry using list and polygon, not string
         bool bSelected(false);
-        const basegfx::B2DPolyPolygon& rItemPolygon = static_cast<const XLineStartItem&>(rAttrs->Get(XATTR_LINESTART)).GetLineStartValue();
+        const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINESTART).GetLineStartValue();
 
         for(long a(0);!bSelected &&  a < m_pLineEndList->Count(); a++)
         {
@@ -1292,7 +1292,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     {
         // #86265# select entry using list and polygon, not string
         bool bSelected(false);
-        const basegfx::B2DPolyPolygon& rItemPolygon = static_cast<const XLineEndItem&>(rAttrs->Get(XATTR_LINEEND)).GetLineEndValue();
+        const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINEEND).GetLineEndValue();
 
         for(long a(0);!bSelected &&  a < m_pLineEndList->Count(); a++)
         {
@@ -1323,7 +1323,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     else if( rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) != SfxItemState::DONTCARE )
     {
         SetMetricValue( *m_pMtrStartWidth,
-                        static_cast<const XLineStartWidthItem&>( rAttrs->Get( XATTR_LINESTARTWIDTH ) ).GetValue(),
+                        rAttrs->Get( XATTR_LINESTARTWIDTH ).GetValue(),
                         m_ePoolUnit );
     }
     else
@@ -1337,7 +1337,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     else if( rAttrs->GetItemState( XATTR_LINEENDWIDTH ) != SfxItemState::DONTCARE )
     {
         SetMetricValue( *m_pMtrEndWidth,
-                        static_cast<const XLineEndWidthItem&>( rAttrs->Get( XATTR_LINEENDWIDTH ) ).GetValue(),
+                        rAttrs->Get( XATTR_LINEENDWIDTH ).GetValue(),
                         m_ePoolUnit );
     }
     else
@@ -1352,7 +1352,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     {
         m_pTsbCenterStart->EnableTriState( false );
 
-        if( static_cast<const XLineStartCenterItem&>( rAttrs->Get( XATTR_LINESTARTCENTER ) ).GetValue() )
+        if( rAttrs->Get( XATTR_LINESTARTCENTER ).GetValue() )
             m_pTsbCenterStart->SetState( TRISTATE_TRUE );
         else
             m_pTsbCenterStart->SetState( TRISTATE_FALSE );
@@ -1371,7 +1371,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     {
         m_pTsbCenterEnd->EnableTriState( false );
 
-        if( static_cast<const XLineEndCenterItem&>( rAttrs->Get( XATTR_LINEENDCENTER ) ).GetValue() )
+        if( rAttrs->Get( XATTR_LINEENDCENTER ).GetValue() )
             m_pTsbCenterEnd->SetState( TRISTATE_TRUE );
         else
             m_pTsbCenterEnd->SetState( TRISTATE_FALSE );
@@ -1384,7 +1384,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     // Transparency
     if( rAttrs->GetItemState( XATTR_LINETRANSPARENCE ) != SfxItemState::DONTCARE )
     {
-        sal_uInt16 nTransp = static_cast<const XLineTransparenceItem&>( rAttrs->Get( XATTR_LINETRANSPARENCE ) ).GetValue();
+        sal_uInt16 nTransp = rAttrs->Get( XATTR_LINETRANSPARENCE ).GetValue();
         m_pMtrTransparent->SetValue( nTransp );
         ChangeTransparentHdl_Impl( *m_pMtrTransparent );
     }
@@ -1414,7 +1414,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     }
     else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINEJOINT))
     {
-        const css::drawing::LineJoint eLineJoint = static_cast<const XLineJointItem&>(rAttrs->Get(XATTR_LINEJOINT)).GetValue();
+        const css::drawing::LineJoint eLineJoint = rAttrs->Get(XATTR_LINEJOINT).GetValue();
 
         switch(eLineJoint)
         {
@@ -1439,7 +1439,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     }
     else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINECAP))
     {
-        const css::drawing::LineCap eLineCap(static_cast<const XLineCapItem&>(rAttrs->Get(XATTR_LINECAP)).GetValue());
+        const css::drawing::LineCap eLineCap(rAttrs->Get(XATTR_LINECAP).GetValue());
 
         switch(eLineCap)
         {
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 70f8bc9fd7af..dd2936a3acae 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -310,7 +310,7 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs )
 
             case drawing::LineStyle_DASH:
             {
-                const XLineDashItem& rDashItem = static_cast<const XLineDashItem&>( rAttrs->Get( XATTR_LINEDASH ) );
+                const XLineDashItem& rDashItem = rAttrs->Get( XATTR_LINEDASH );
                 aDash = rDashItem.GetDashValue();
 
                 m_pLbLineStyles->SetNoSelection();
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 618858fdbf0b..c974cc605c97 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -187,7 +187,7 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet )
         else
             aString += aURL.getBase();
 
-        sal_Int32 nPos = SearchPatternList( static_cast<const XFillBitmapItem&>( rSet.Get(XATTR_FILLBITMAP)).GetName() );
+        sal_Int32 nPos = SearchPatternList( rSet.Get(XATTR_FILLBITMAP).GetName() );
         if( nPos != LISTBOX_ENTRY_NOTFOUND )
         {
             sal_uInt16 nId = m_pPatternLB->GetItemId( static_cast<size_t>( nPos ) );
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index a9b0880f4dde..c77b4375d307 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -99,27 +99,21 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
             case drawing::FillStyle_SOLID:
                 if( SfxItemState::DONTCARE != m_rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )
                 {
-                    XFillColorItem aColorItem( static_cast<const XFillColorItem&>(
-                                        m_rOutAttrs.Get( XATTR_FILLCOLOR ) ) );
-                    m_rXFSet.Put( aColorItem );
+                    m_rXFSet.Put( m_rOutAttrs.Get( XATTR_FILLCOLOR ) );
                 }
             break;
 
             case drawing::FillStyle_GRADIENT:
                 if( SfxItemState::DONTCARE != m_rOutAttrs.GetItemState( XATTR_FILLGRADIENT ) )
                 {
-                    XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(
-                                            m_rOutAttrs.Get( XATTR_FILLGRADIENT ) ) );
-                    m_rXFSet.Put( aGradientItem );
+                    m_rXFSet.Put( m_rOutAttrs.Get( XATTR_FILLGRADIENT ) );
                 }
             break;
 
             case drawing::FillStyle_HATCH:
                 if( SfxItemState::DONTCARE != m_rOutAttrs.GetItemState( XATTR_FILLHATCH ) )
                 {
-                    XFillHatchItem aHatchItem( static_cast<const XFillHatchItem& >(
-                                    m_rOutAttrs.Get( XATTR_FILLHATCH ) ) );
-                    m_rXFSet.Put( aHatchItem );
+                    m_rXFSet.Put( m_rOutAttrs.Get( XATTR_FILLHATCH ) );
                 }
             break;
 
@@ -127,9 +121,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
             {
                 if( SfxItemState::DONTCARE != m_rOutAttrs.GetItemState( XATTR_FILLBITMAP ) )
                 {
-                    XFillBitmapItem aBitmapItem( static_cast<const XFillBitmapItem& >(
-                                        m_rOutAttrs.Get( XATTR_FILLBITMAP ) ) );
-                    m_rXFSet.Put( aBitmapItem );
+                    m_rXFSet.Put( m_rOutAttrs.Get( XATTR_FILLBITMAP ) );
                 }
             }
             break;
diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx
index 04944de8b95b..4e54d74cc28a 100644
--- a/cui/source/tabpages/tptrans.cxx
+++ b/cui/source/tabpages/tptrans.cxx
@@ -507,17 +507,17 @@ bool SvxTransparenceTabPage::InitPreview ( const SfxItemSet& rSet )
     }
 
     // Get fillstyle for preview
-    rXFSet.Put ( static_cast<const XFillStyleItem&>(     rSet.Get(XATTR_FILLSTYLE)) );
-    rXFSet.Put ( static_cast<const XFillColorItem&>(     rSet.Get(XATTR_FILLCOLOR)) );
-    rXFSet.Put ( static_cast<const XFillGradientItem&>(  rSet.Get(XATTR_FILLGRADIENT)) );
-    rXFSet.Put ( static_cast<const XFillHatchItem&>(     rSet.Get(XATTR_FILLHATCH)) );
-    rXFSet.Put ( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)) );
-    rXFSet.Put ( static_cast<const XFillBitmapItem&>(    rSet.Get(XATTR_FILLBITMAP)) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLSTYLE) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLCOLOR) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLGRADIENT) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLHATCH) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLBACKGROUND) );
+    rXFSet.Put ( rSet.Get(XATTR_FILLBITMAP) );
 
     m_pCtlXRectPreview->SetAttributes( aXFillAttr.GetItemSet() );
     m_pCtlBitmapPreview->SetAttributes( aXFillAttr.GetItemSet() );
 
-    bBitmap = static_cast<const XFillStyleItem&>( rSet.Get(XATTR_FILLSTYLE) ).GetValue() == drawing::FillStyle_BITMAP;
+    bBitmap = rSet.Get(XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_BITMAP;
 
     // show the right preview window
     if ( bBitmap )
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 79624155282e..d404bf3b1df4 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -553,7 +553,7 @@ void    EscherPropertyContainer::CreateFillProperties(
             SfxItemSet aAttr( pObj->GetMergedItemSet() );
             // tranparency with gradient. Means the third setting in transparency page is set
             bool bTransparentGradient =  ( aAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET ) &&
-                static_cast<const XFillFloatTransparenceItem&>( aAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled();
+                aAttr.Get( XATTR_FILLFLOATTRANSPARENCE ).IsEnabled();
             CreateFillProperties(  rXPropSet, bEdge, bTransparentGradient );
         }
     }
@@ -851,7 +851,7 @@ bool EscherPropertyContainer::GetLineArrow( const bool bLineStart,
             if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, sLineName ) )
             {
                 OUString        aArrowStartName = *o3tl::doAccess<OUString>(aAny);
-                sal_Int16       nWhich = bLineStart ? XATTR_LINESTART : XATTR_LINEEND;
+                sal_uInt16      nWhich = bLineStart ? sal_uInt16(XATTR_LINESTART) : sal_uInt16(XATTR_LINEEND);
 
                 OUString aApiName = SvxUnogetApiNameForItem(nWhich, aArrowStartName);
                 bool bIsMapped = true;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index c8a34061a990..27e0de3d2962 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -7412,14 +7412,14 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
         {//vertical writing
             xPropSet->setPropertyValue(  "TextWritingMode" , Any( css::text::WritingMode_TB_RL ) );
         }
-        drawing::FillStyle eFillStyle(static_cast<const XFillStyleItem&>(pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue());
+        drawing::FillStyle eFillStyle(pObj->GetMergedItem( XATTR_FILLSTYLE ).GetValue());
         css::drawing::FillStyle eFS( css::drawing::FillStyle_NONE );
         switch( eFillStyle )
         {
             case drawing::FillStyle_SOLID :
                 {
                     eFS = css::drawing::FillStyle_SOLID;
-                    Color aFillColor( static_cast<const XFillColorItem&>(pObj->GetMergedItem( XATTR_FILLCOLOR )).GetColorValue() );
+                    Color aFillColor( pObj->GetMergedItem( XATTR_FILLCOLOR ).GetColorValue() );
                     sal_Int32 nFillColor( aFillColor.GetColor() );
                     xPropSet->setPropertyValue( "FillColor", Any( nFillColor ) );
                 }
@@ -7427,7 +7427,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
             case drawing::FillStyle_GRADIENT :
                 {
                     eFS = css::drawing::FillStyle_GRADIENT;
-                    XGradient aXGradient(static_cast<const XFillGradientItem&>(pObj->GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
+                    XGradient aXGradient(pObj->GetMergedItem(XATTR_FILLGRADIENT).GetGradientValue());
 
                     css::awt::Gradient aGradient;
                     aGradient.Style = (awt::GradientStyle) aXGradient.GetGradientStyle();
@@ -7451,7 +7451,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
                 {
                     eFS = css::drawing::FillStyle_BITMAP;
 
-                    const XFillBitmapItem aXFillBitmapItem(static_cast<const XFillBitmapItem&>(pObj->GetMergedItem( XATTR_FILLBITMAP )));
+                    const XFillBitmapItem aXFillBitmapItem(pObj->GetMergedItem( XATTR_FILLBITMAP ));
                     OUString aURL( UNO_NAME_GRAPHOBJ_URLPREFIX);
                     aURL += OStringToOUString(
                         aXFillBitmapItem.GetGraphicObject().GetUniqueID(),
@@ -7459,8 +7459,8 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
 
                     xPropSet->setPropertyValue("FillBitmapURL", Any( aURL ) );
 
-                    const XFillBmpStretchItem aStretchItem(static_cast<const XFillBmpStretchItem&>(pObj->GetMergedItem( XATTR_FILLBMP_STRETCH )));
-                    const XFillBmpTileItem aTileItem(static_cast<const XFillBmpTileItem&>(pObj->GetMergedItem( XATTR_FILLBMP_TILE )));
+                    const XFillBmpStretchItem aStretchItem(pObj->GetMergedItem( XATTR_FILLBMP_STRETCH ));
+                    const XFillBmpTileItem aTileItem(pObj->GetMergedItem( XATTR_FILLBMP_TILE ));
                     if( aTileItem.GetValue() )
                         xPropSet->setPropertyValue( "FillBitmapMode", Any( css::drawing::BitmapMode_REPEAT ) );
                     else if( aStretchItem.GetValue() )
@@ -7478,7 +7478,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
         xPropSet->setPropertyValue( "FillStyle", Any( eFS ) );
         if ( eFillStyle != drawing::FillStyle_NONE )
         {
-            sal_Int16 nFillTransparence( static_cast<const XFillTransparenceItem&>(pObj->GetMergedItem( XATTR_FILLTRANSPARENCE ) ).GetValue() );
+            sal_Int16 nFillTransparence( pObj->GetMergedItem( XATTR_FILLTRANSPARENCE ).GetValue() );
             xPropSet->setPropertyValue( "FillTransparence", Any( nFillTransparence ) );
         }
     }
@@ -7491,17 +7491,17 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable > const
 {
     try
     {
-        drawing::LineStyle eLineStyle(static_cast<const XLineStyleItem&>(pLine->GetMergedItem( XATTR_LINESTYLE )).GetValue());
+        drawing::LineStyle eLineStyle(pLine->GetMergedItem( XATTR_LINESTYLE ).GetValue());
         css::table::BorderLine2 aBorderLine;
         switch( eLineStyle )
         {
             case drawing::LineStyle_DASH :
             case drawing::LineStyle_SOLID :
                 {
-                    Color aLineColor( static_cast<const XLineColorItem&>(pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() );
+                    Color aLineColor( pLine->GetMergedItem( XATTR_LINECOLOR ).GetColorValue() );
                     aBorderLine.Color = aLineColor.GetColor();
                     // Avoid width = 0, the min value should be 1.
-                    sal_Int32 nLineWidth = std::max(sal_Int32(1), static_cast<const XLineWidthItem&>(pLine->GetMergedItem(XATTR_LINEWIDTH)) .GetValue() / 4);
+                    sal_Int32 nLineWidth = std::max(sal_Int32(1), pLine->GetMergedItem(XATTR_LINEWIDTH) .GetValue() / 4);
                     aBorderLine.LineWidth = static_cast< sal_Int16 >( nLineWidth );
                     aBorderLine.LineStyle = eLineStyle == drawing::LineStyle_SOLID ? table::BorderLineStyle::SOLID : table::BorderLineStyle::DASHED;
                 }
diff --git a/include/svl/typedwhich.hxx b/include/svl/typedwhich.hxx
index 2c2141250d02..cb22d48ebdc3 100644
--- a/include/svl/typedwhich.hxx
+++ b/include/svl/typedwhich.hxx
@@ -19,7 +19,7 @@
 template <class T> class TypedWhichId final
 {
 public:
-    constexpr TypedWhichId(sal_uInt16 nWhich)
+    explicit constexpr TypedWhichId(sal_uInt16 nWhich)
         : mnWhich(nWhich)
     {
     }
diff --git a/include/svx/xdef.hxx b/include/svx/xdef.hxx
index 7fd5dbab0096..af2aba56d2ac 100644
--- a/include/svx/xdef.hxx
+++ b/include/svx/xdef.hxx
@@ -21,6 +21,8 @@
 #define INCLUDED_SVX_XDEF_HXX
 
 
+#include <svl/typedwhich.hxx>
+
 /*************************************************************************
 |*
 |* Adding an attribute: Copy line, above which you want to add something,
@@ -28,65 +30,113 @@
 |*
 \************************************************************************/
 
+class SfxMetricItem;
+class XFillAttrSetItem;
+class XFillBackgroundItem;
+class XFillBitmapItem;
+class XFillBmpPosItem;
+class XFillBmpPosOffsetXItem;
+class XFillBmpPosOffsetYItem;
+class XFillBmpSizeLogItem;
+class XFillBmpSizeYItem;
+class XFillBmpStretchItem;
+class XFillBmpTileItem;
+class XFillBmpTileOffsetXItem;
+class XFillBmpTileOffsetYItem;
+class XFillColorItem;
+class XFillFloatTransparenceItem;
+class XFillGradientItem;
+class XFillHatchItem;
+class XFillStyleItem;
+class XFillTransparenceItem;
+class XFormTextAdjustItem;
+class XFormTextDistanceItem;
+class XFormTextHideFormItem;
+class XFormTextMirrorItem;
+class XFormTextOutlineItem;
+class XFormTextShadowColorItem;
+class XFormTextShadowItem;
+class XFormTextShadowTranspItem;
+class XFormTextShadowXValItem;
+class XFormTextShadowYValItem;
+class XFormTextStartItem;
+class XFormTextStyleItem;
+class XGradientStepCountItem;
+class XLineAttrSetItem;
+class XLineCapItem;
+class XLineColorItem;
+class XLineDashItem;
+class XLineEndCenterItem;
+class XLineEndItem;
+class XLineEndWidthItem;
+class XLineJointItem;
+class XLineStartCenterItem;
+class XLineStartItem;
+class XLineStartWidthItem;
+class XLineStyleItem;
+class XLineTransparenceItem;
+class XLineWidthItem;
+class XSecondaryFillColorItem;
+
 #define COL_DEFAULT_SHAPE_FILLING 0x729fcf
 #define COL_DEFAULT_SHAPE_STROKE  0x3465a4
 
 #define XATTR_START             1000
 
 #define XATTR_LINE_FIRST        XATTR_START                     /* V3: 1000  V2: 1000 */
-#define XATTR_LINESTYLE         XATTR_LINE_FIRST
-#define XATTR_LINEDASH          (XATTR_LINE_FIRST + 1)          /* V3: 1001  V2: 1001 */
-#define XATTR_LINEWIDTH         (XATTR_LINE_FIRST + 2)          /* V3: 1002  V2: 1002 */
-#define XATTR_LINECOLOR         (XATTR_LINE_FIRST + 3)          /* V3: 1003  V2: 1003 */
-#define XATTR_LINESTART         (XATTR_LINE_FIRST + 4)          /* V3: 1004  V2: 1004 */
-#define XATTR_LINEEND           (XATTR_LINE_FIRST + 5)          /* V3: 1005  V2: 1005 */
-#define XATTR_LINESTARTWIDTH    (XATTR_LINE_FIRST + 6)          /* V3: 1006  V2: 1006 */
-#define XATTR_LINEENDWIDTH      (XATTR_LINE_FIRST + 7)          /* V3: 1007  V2: 1007 */
-#define XATTR_LINESTARTCENTER   (XATTR_LINE_FIRST + 8)          /* V3: 1008  V2: 1008 */
-#define XATTR_LINEENDCENTER     (XATTR_LINE_FIRST + 9)          /* V3: 1009  V2: 1009 */
-#define XATTR_LINETRANSPARENCE  (XATTR_LINE_FIRST + 10)         /* V3: 1010  V2: 1010 */
-#define XATTR_LINEJOINT         (XATTR_LINE_FIRST + 11)         /* V3: 1011  V2: 1011 */
-#define XATTR_LINECAP           (XATTR_LINE_FIRST + 12)         /* V3: 1012 */
+#define XATTR_LINESTYLE         TypedWhichId<XLineStyleItem>(XATTR_LINE_FIRST)
+#define XATTR_LINEDASH          TypedWhichId<XLineDashItem>(XATTR_LINE_FIRST + 1)          /* V3: 1001  V2: 1001 */
+#define XATTR_LINEWIDTH         TypedWhichId<XLineWidthItem>(XATTR_LINE_FIRST + 2)          /* V3: 1002  V2: 1002 */
+#define XATTR_LINECOLOR         TypedWhichId<XLineColorItem>(XATTR_LINE_FIRST + 3)          /* V3: 1003  V2: 1003 */
+#define XATTR_LINESTART         TypedWhichId<XLineStartItem>(XATTR_LINE_FIRST + 4)          /* V3: 1004  V2: 1004 */
+#define XATTR_LINEEND           TypedWhichId<XLineEndItem>(XATTR_LINE_FIRST + 5)          /* V3: 1005  V2: 1005 */
+#define XATTR_LINESTARTWIDTH    TypedWhichId<XLineStartWidthItem>(XATTR_LINE_FIRST + 6)          /* V3: 1006  V2: 1006 */
+#define XATTR_LINEENDWIDTH      TypedWhichId<XLineEndWidthItem>(XATTR_LINE_FIRST + 7)          /* V3: 1007  V2: 1007 */
+#define XATTR_LINESTARTCENTER   TypedWhichId<XLineStartCenterItem>(XATTR_LINE_FIRST + 8)          /* V3: 1008  V2: 1008 */
+#define XATTR_LINEENDCENTER     TypedWhichId<XLineEndCenterItem>(XATTR_LINE_FIRST + 9)          /* V3: 1009  V2: 1009 */
+#define XATTR_LINETRANSPARENCE  TypedWhichId<XLineTransparenceItem>(XATTR_LINE_FIRST + 10)         /* V3: 1010  V2: 1010 */
+#define XATTR_LINEJOINT         TypedWhichId<XLineJointItem>(XATTR_LINE_FIRST + 11)         /* V3: 1011  V2: 1011 */
+#define XATTR_LINECAP           TypedWhichId<XLineCapItem>(XATTR_LINE_FIRST + 12)         /* V3: 1012 */
 #define XATTR_LINE_LAST         XATTR_LINECAP
-#define XATTRSET_LINE           (XATTR_LINE_LAST + 1)           /* V3: 1017  V2: 1017 */
+#define XATTRSET_LINE           TypedWhichId<XLineAttrSetItem>(XATTR_LINE_LAST + 1)           /* V3: 1017  V2: 1017 */
 
-#define XATTR_FILL_FIRST            (XATTRSET_LINE + 1)         /* V3: 1018  V2: 1018 */
-#define XATTR_FILLSTYLE             XATTR_FILL_FIRST
-#define XATTR_FILLCOLOR             (XATTR_FILL_FIRST + 1)      /* V3: 1019  V2: 1019 */
-#define XATTR_FILLGRADIENT          (XATTR_FILL_FIRST + 2)      /* V3: 1020  V2: 1020 */
-#define XATTR_FILLHATCH             (XATTR_FILL_FIRST + 3)      /* V3: 1021  V2: 1021 */
-#define XATTR_FILLBITMAP            (XATTR_FILL_FIRST + 4)      /* V3: 1022  V2: 1022 */
-#define XATTR_FILLTRANSPARENCE      (XATTR_FILL_FIRST + 5)      /* V3: 1023  V2: 1023 */
-#define XATTR_GRADIENTSTEPCOUNT     (XATTR_FILL_FIRST + 6)      /* V3: 1024  V2: 1024 */
-#define XATTR_FILLBMP_TILE          (XATTR_FILL_FIRST + 7)      /* V3: 1025  V2: 1025 */
-#define XATTR_FILLBMP_POS           (XATTR_FILL_FIRST + 8)      /* V3: 1026  V2: 1026 */
-#define XATTR_FILLBMP_SIZEX         (XATTR_FILL_FIRST + 9)      /* V3: 1027  V2: 1027 */
-#define XATTR_FILLBMP_SIZEY         (XATTR_FILL_FIRST + 10)     /* V3: 1028  V2: 1028 */
-#define XATTR_FILLFLOATTRANSPARENCE (XATTR_FILL_FIRST + 11)     /* V3: 1029  V2: 1029 */
-#define XATTR_SECONDARYFILLCOLOR    (XATTR_FILL_FIRST + 12)     /* V3: 1030 */
-#define XATTR_FILLBMP_SIZELOG       (XATTR_FILL_FIRST + 13)     /* V3: 1031 */
-#define XATTR_FILLBMP_TILEOFFSETX   (XATTR_FILL_FIRST + 14)     /* V3: 1032 */
-#define XATTR_FILLBMP_TILEOFFSETY   (XATTR_FILL_FIRST + 15)     /* V3: 1033 */
-#define XATTR_FILLBMP_STRETCH       (XATTR_FILL_FIRST + 16)     /* V3: 1034 */
-#define XATTR_FILLBMP_POSOFFSETX    (XATTR_FILL_FIRST + 17)     /* V3: 1041 */
-#define XATTR_FILLBMP_POSOFFSETY    (XATTR_FILL_FIRST + 18)     /* V3: 1042 */
-#define XATTR_FILLBACKGROUND        (XATTR_FILL_FIRST + 19)     /* V3: 1043 */
-#define XATTR_FILL_LAST             XATTR_FILLBACKGROUND
-#define XATTRSET_FILL           (XATTR_FILL_LAST + 1)           /* V3: 1047  V2: 1030 */
+#define XATTR_FILL_FIRST            sal_uInt16(XATTRSET_LINE + 1)         /* V3: 1018  V2: 1018 */
+#define XATTR_FILLSTYLE             TypedWhichId<XFillStyleItem>(XATTR_FILL_FIRST)
+#define XATTR_FILLCOLOR             TypedWhichId<XFillColorItem>(XATTR_FILL_FIRST + 1)      /* V3: 1019  V2: 1019 */
+#define XATTR_FILLGRADIENT          TypedWhichId<XFillGradientItem>(XATTR_FILL_FIRST + 2)      /* V3: 1020  V2: 1020 */
+#define XATTR_FILLHATCH             TypedWhichId<XFillHatchItem>(XATTR_FILL_FIRST + 3)      /* V3: 1021  V2: 1021 */
+#define XATTR_FILLBITMAP            TypedWhichId<XFillBitmapItem>(XATTR_FILL_FIRST + 4)      /* V3: 1022  V2: 1022 */
+#define XATTR_FILLTRANSPARENCE      TypedWhichId<XFillTransparenceItem>(XATTR_FILL_FIRST + 5)      /* V3: 1023  V2: 1023 */
+#define XATTR_GRADIENTSTEPCOUNT     TypedWhichId<XGradientStepCountItem>(XATTR_FILL_FIRST + 6)      /* V3: 1024  V2: 1024 */
+#define XATTR_FILLBMP_TILE          TypedWhichId<XFillBmpTileItem>(XATTR_FILL_FIRST + 7)      /* V3: 1025  V2: 1025 */
+#define XATTR_FILLBMP_POS           TypedWhichId<XFillBmpPosItem>(XATTR_FILL_FIRST + 8)      /* V3: 1026  V2: 1026 */
+#define XATTR_FILLBMP_SIZEX         TypedWhichId<SfxMetricItem>(XATTR_FILL_FIRST + 9)      /* V3: 1027  V2: 1027 */
+#define XATTR_FILLBMP_SIZEY         TypedWhichId<XFillBmpSizeYItem>(XATTR_FILL_FIRST + 10)     /* V3: 1028  V2: 1028 */
+#define XATTR_FILLFLOATTRANSPARENCE TypedWhichId<XFillFloatTransparenceItem>(XATTR_FILL_FIRST + 11)     /* V3: 1029  V2: 1029 */
+#define XATTR_SECONDARYFILLCOLOR    TypedWhichId<XSecondaryFillColorItem>(XATTR_FILL_FIRST + 12)     /* V3: 1030 */
+#define XATTR_FILLBMP_SIZELOG       TypedWhichId<XFillBmpSizeLogItem>(XATTR_FILL_FIRST + 13)     /* V3: 1031 */
+#define XATTR_FILLBMP_TILEOFFSETX   TypedWhichId<XFillBmpTileOffsetXItem>(XATTR_FILL_FIRST + 14)     /* V3: 1032 */
+#define XATTR_FILLBMP_TILEOFFSETY   TypedWhichId<XFillBmpTileOffsetYItem>(XATTR_FILL_FIRST + 15)     /* V3: 1033 */
+#define XATTR_FILLBMP_STRETCH       TypedWhichId<XFillBmpStretchItem>(XATTR_FILL_FIRST + 16)     /* V3: 1034 */
+#define XATTR_FILLBMP_POSOFFSETX    TypedWhichId<XFillBmpPosOffsetXItem>(XATTR_FILL_FIRST + 17)     /* V3: 1041 */
+#define XATTR_FILLBMP_POSOFFSETY    TypedWhichId<XFillBmpPosOffsetYItem>(XATTR_FILL_FIRST + 18)     /* V3: 1042 */
+#define XATTR_FILLBACKGROUND        TypedWhichId<XFillBackgroundItem>(XATTR_FILL_FIRST + 19)     /* V3: 1043 */
+#define XATTR_FILL_LAST             sal_uInt16(XATTR_FILLBACKGROUND)
+#define XATTRSET_FILL               TypedWhichId<XFillAttrSetItem>(XATTR_FILL_LAST + 1)           /* V3: 1047  V2: 1030 */
 
 #define XATTR_TEXT_FIRST        (XATTRSET_FILL + 1)
-#define XATTR_FORMTXTSTYLE      XATTR_TEXT_FIRST                /* V3: 1048  V2: 1031 */
-#define XATTR_FORMTXTADJUST     (XATTR_TEXT_FIRST + 1)          /* V3: 1049  V2: 1032 */
-#define XATTR_FORMTXTDISTANCE   (XATTR_TEXT_FIRST + 2)          /* V3: 1050  V2: 1033 */
-#define XATTR_FORMTXTSTART      (XATTR_TEXT_FIRST + 3)          /* V3: 1051  V2: 1034 */
-#define XATTR_FORMTXTMIRROR     (XATTR_TEXT_FIRST + 4)          /* V3: 1052  V2: 1035 */
-#define XATTR_FORMTXTOUTLINE    (XATTR_TEXT_FIRST + 5)          /* V3: 1053  V2: 1036 */
-#define XATTR_FORMTXTSHADOW     (XATTR_TEXT_FIRST + 6)          /* V3: 1054  V2: 1037 */
-#define XATTR_FORMTXTSHDWCOLOR  (XATTR_TEXT_FIRST + 7)          /* V3: 1055  V2: 1038 */
-#define XATTR_FORMTXTSHDWXVAL   (XATTR_TEXT_FIRST + 8)          /* V3: 1056  V2: 1039 */
-#define XATTR_FORMTXTSHDWYVAL   (XATTR_TEXT_FIRST + 9)          /* V3: 1057  V2: 1040 */
-#define XATTR_FORMTXTHIDEFORM   (XATTR_TEXT_FIRST + 10)         /* V3: 1059  V2: 1042 */
-#define XATTR_FORMTXTSHDWTRANSP (XATTR_TEXT_FIRST + 11)         /* V3: 1060  V2: 1043 */
+#define XATTR_FORMTXTSTYLE      TypedWhichId<XFormTextStyleItem>(XATTR_TEXT_FIRST)                /* V3: 1048  V2: 1031 */
+#define XATTR_FORMTXTADJUST     TypedWhichId<XFormTextAdjustItem>(XATTR_TEXT_FIRST + 1)          /* V3: 1049  V2: 1032 */
+#define XATTR_FORMTXTDISTANCE   TypedWhichId<XFormTextDistanceItem>(XATTR_TEXT_FIRST + 2)          /* V3: 1050  V2: 1033 */
+#define XATTR_FORMTXTSTART      TypedWhichId<XFormTextStartItem>(XATTR_TEXT_FIRST + 3)          /* V3: 1051  V2: 1034 */
+#define XATTR_FORMTXTMIRROR     TypedWhichId<XFormTextMirrorItem>(XATTR_TEXT_FIRST + 4)          /* V3: 1052  V2: 1035 */
+#define XATTR_FORMTXTOUTLINE    TypedWhichId<XFormTextOutlineItem>(XATTR_TEXT_FIRST + 5)          /* V3: 1053  V2: 1036 */
+#define XATTR_FORMTXTSHADOW     TypedWhichId<XFormTextShadowItem>(XATTR_TEXT_FIRST + 6)          /* V3: 1054  V2: 1037 */
+#define XATTR_FORMTXTSHDWCOLOR  TypedWhichId<XFormTextShadowColorItem>(XATTR_TEXT_FIRST + 7)          /* V3: 1055  V2: 1038 */
+#define XATTR_FORMTXTSHDWXVAL   TypedWhichId<XFormTextShadowXValItem>(XATTR_TEXT_FIRST + 8)          /* V3: 1056  V2: 1039 */
+#define XATTR_FORMTXTSHDWYVAL   TypedWhichId<XFormTextShadowYValItem>(XATTR_TEXT_FIRST + 9)          /* V3: 1057  V2: 1040 */
+#define XATTR_FORMTXTHIDEFORM   TypedWhichId<XFormTextHideFormItem>(XATTR_TEXT_FIRST + 10)         /* V3: 1059  V2: 1042 */
+#define XATTR_FORMTXTSHDWTRANSP TypedWhichId<XFormTextShadowTranspItem>(XATTR_TEXT_FIRST + 11)         /* V3: 1060  V2: 1043 */
 #define XATTR_TEXT_LAST         XATTR_FORMTXTSHDWTRANSP
 
 #define XATTR_END               XATTR_TEXT_LAST
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 92f347e1d07f..e8170d41284a 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -130,7 +130,7 @@ static bool lcl_HasThickLine( const SdrObject& rObj )
 {
     // thin lines get width 0 -> everything greater 0 is a thick line
 
-    return static_cast<const XLineWidthItem&>(rObj.GetMergedItem(XATTR_LINEWIDTH)).GetValue() > 0;
+    return rObj.GetMergedItem(XATTR_LINEWIDTH).GetValue() > 0;
 }
 
 ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
@@ -401,9 +401,9 @@ bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
             const SfxItemSet& rSet = pObject->GetMergedItemSet();
 
             bool bObjStartAlien =
-                lcl_IsOtherTab( static_cast<const XLineStartItem&>(rSet.Get(XATTR_LINESTART)).GetLineStartValue() );
+                lcl_IsOtherTab( rSet.Get(XATTR_LINESTART).GetLineStartValue() );
             bool bObjEndAlien =
-                lcl_IsOtherTab( static_cast<const XLineEndItem&>(rSet.Get(XATTR_LINEEND)).GetLineEndValue() );
+                lcl_IsOtherTab( rSet.Get(XATTR_LINEEND).GetLineEndValue() );
 
             bool bStartHit = bStartAlien ? bObjStartAlien :
                                 ( !bObjStartAlien && aStartRect.IsInside(pObject->GetPoint(0)) );
@@ -427,9 +427,9 @@ bool ScDetectiveFunc::IsNonAlienArrow( const SdrObject* pObject )
         const SfxItemSet& rSet = pObject->GetMergedItemSet();
 
         bool bObjStartAlien =
-            lcl_IsOtherTab( static_cast<const XLineStartItem&>(rSet.Get(XATTR_LINESTART)).GetLineStartValue() );
+            lcl_IsOtherTab( rSet.Get(XATTR_LINESTART).GetLineStartValue() );
         bool bObjEndAlien =
-            lcl_IsOtherTab( static_cast<const XLineEndItem&>(rSet.Get(XATTR_LINEEND)).GetLineEndValue() );
+            lcl_IsOtherTab( rSet.Get(XATTR_LINEEND).GetLineEndValue() );
 
         return !bObjStartAlien && !bObjEndAlien;
     }
@@ -1580,7 +1580,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject,
                     FindFrameForObject( pObject, rSource );     // modifies rSource
                 }
 
-                ColorData nObjColor = static_cast<const XLineColorItem&>(pObject->GetMergedItem(XATTR_LINECOLOR)).GetColorValue().GetColor();
+                ColorData nObjColor = pObject->GetMergedItem(XATTR_LINECOLOR).GetColorValue().GetColor();
                 if ( nObjColor == GetErrorColor() && nObjColor != GetArrowColor() )
                     rRedLine = true;
             }
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 0082e1c0e0b3..fcd3d102659b 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1209,8 +1209,8 @@ XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos,
                     mbLocked    = pCaption->IsMoveProtect() || pCaption->IsResizeProtect();
 
                     // AutoFill style would change if Postit.cxx object creation values are changed
-                    OUString aCol(GETITEM(aItemSet, XFillColorItem , XATTR_FILLCOLOR).GetValue());
-                    mbAutoFill  = aCol.isEmpty() && (GETITEM(aItemSet, XFillStyleItem, XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_SOLID);
+                    OUString aCol(aItemSet.Get(XATTR_FILLCOLOR).GetValue());
+                    mbAutoFill  = aCol.isEmpty() && (aItemSet.Get(XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_SOLID);
                     mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab()));
                     mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab()));
                 }
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 671f81d9acaf..d3ae4c990850 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -270,7 +270,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal
         // 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/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() );
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index ca42063e3096..e39e85e7fa05 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -702,8 +702,8 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
     nXRef               ( 0x80000000 ),
     nYRef               ( 0x80000000 ),
     nColorData          ( 0 ),
-    bFilled             ( static_cast<const XFillStyleItem&>(pAObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue() != drawing::FillStyle_NONE ),
-    bStroked            ( static_cast<const XLineStyleItem&>(pAObj->GetMergedItem( XATTR_LINESTYLE )).GetValue() != drawing::LineStyle_NONE ),
+    bFilled             ( pAObj->GetMergedItem( XATTR_FILLSTYLE ).GetValue() != drawing::FillStyle_NONE ),
+    bStroked            ( pAObj->GetMergedItem( XATTR_LINESTYLE ).GetValue() != drawing::LineStyle_NONE ),
     bFlipH              ( false ),
     bFlipV              ( false )
 {
@@ -1388,14 +1388,14 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex
 void EnhancedCustomShape2d::SwapStartAndEndArrow( SdrObject* pObj ) //#108274
 {
     XLineStartItem       aLineStart;
-    aLineStart.SetLineStartValue(static_cast<const XLineEndItem&>(pObj->GetMergedItem( XATTR_LINEEND )).GetLineEndValue());
-    XLineStartWidthItem  aLineStartWidth(static_cast<const XLineEndWidthItem&>(pObj->GetMergedItem( XATTR_LINEENDWIDTH )).GetValue());
-    XLineStartCenterItem aLineStartCenter(static_cast<const XLineEndCenterItem&>(pObj->GetMergedItem( XATTR_LINEENDCENTER )).GetValue());
+    aLineStart.SetLineStartValue(pObj->GetMergedItem( XATTR_LINEEND ).GetLineEndValue());
+    XLineStartWidthItem  aLineStartWidth(pObj->GetMergedItem( XATTR_LINEENDWIDTH ).GetValue());
+    XLineStartCenterItem aLineStartCenter(pObj->GetMergedItem( XATTR_LINEENDCENTER ).GetValue());
 
     XLineEndItem         aLineEnd;
-    aLineEnd.SetLineEndValue(static_cast<const XLineStartItem&>(pObj->GetMergedItem( XATTR_LINESTART )).GetLineStartValue());
-    XLineEndWidthItem    aLineEndWidth(static_cast<const XLineStartWidthItem&>(pObj->GetMergedItem( XATTR_LINESTARTWIDTH )).GetValue());
-    XLineEndCenterItem   aLineEndCenter(static_cast<const XLineStartCenterItem&>(pObj->GetMergedItem( XATTR_LINESTARTCENTER )).GetValue());
+    aLineEnd.SetLineEndValue(pObj->GetMergedItem( XATTR_LINESTART ).GetLineStartValue());
+    XLineEndWidthItem    aLineEndWidth(pObj->GetMergedItem( XATTR_LINESTARTWIDTH ).GetValue());
+    XLineEndCenterItem   aLineEndCenter(pObj->GetMergedItem( XATTR_LINESTARTCENTER ).GetValue());
 
     pObj->SetMergedItem( aLineStart );
     pObj->SetMergedItem( aLineStartWidth );
@@ -2147,7 +2147,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC
 {
     if ( !rObj.IsLine() )
     {
-        const drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+        const drawing::FillStyle eFillStyle = rObj.GetMergedItem(XATTR_FILLSTYLE).GetValue();
         switch( eFillStyle )
         {
             default:
@@ -2157,7 +2157,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC
                 if ( nColorCount || rObj.GetBrightness() != 0.0 )
                 {
                     aFillColor = GetColorData(
-                        static_cast<const XFillColorItem&>(rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(),
+                        rCustomShapeSet.Get( XATTR_FILLCOLOR ).GetColorValue(),
                         std::min(nColorIndex, nColorCount-1), rObj.GetBrightness() );
                     rObj.SetMergedItem( XFillColorItem( "", aFillColor ) );
                 }
@@ -2165,7 +2165,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC
             }
             case drawing::FillStyle_GRADIENT:
             {
-                XGradient aXGradient(static_cast<const XFillGradientItem&>(rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
+                XGradient aXGradient(rObj.GetMergedItem(XATTR_FILLGRADIENT).GetGradientValue());
                 if ( nColorCount || rObj.GetBrightness() != 0.0 )
                 {
                     aXGradient.SetStartColor(
@@ -2183,7 +2183,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC
             }
             case drawing::FillStyle_HATCH:
             {
-                XHatch aXHatch(static_cast<const XFillHatchItem&>(rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue());
+                XHatch aXHatch(rObj.GetMergedItem(XATTR_FILLHATCH).GetHatchValue());
                 if ( nColorCount || rObj.GetBrightness() != 0.0 )
                 {
                     aXHatch.SetColor(
@@ -2199,7 +2199,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC
             {
                 if ( nColorCount || rObj.GetBrightness() != 0.0 )
                 {
-                    Bitmap aBitmap(static_cast<const XFillBitmapItem&>(rObj.GetMergedItem(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap());
+                    Bitmap aBitmap(rObj.GetMergedItem(XATTR_FILLBITMAP).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap());
 
                     aBitmap.Adjust(
                         static_cast< short > ( GetLuminanceChange(
@@ -2251,8 +2251,8 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly )
 
             for(SdrPathObj* pObj : vObjectList)
             {
-                const drawing::LineStyle eLineStyle =static_cast<const XLineStyleItem&>(pObj->GetMergedItem(XATTR_LINESTYLE)).GetValue();
-                const drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+                const drawing::LineStyle eLineStyle = pObj->GetMergedItem(XATTR_LINESTYLE).GetValue();
+                const drawing::FillStyle eFillStyle = pObj->GetMergedItem(XATTR_FILLSTYLE).GetValue();
 
                 // #i40600# if bLineGeometryNeededOnly is set, linestyle does not matter
                 if( !bLineGeometryNeededOnly && ( drawing::LineStyle_NONE == eLineStyle ) && ( drawing::FillStyle_NONE == eFillStyle ) )
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 9a048049c370..bbc9ad4f7320 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -57,7 +57,6 @@
 #include <svx/xlntrit.hxx>
 #include <svx/xfltrit.hxx>
 
-#define ITEMVALUE(ItemSet,Id,Cast)  (static_cast<const Cast&>((ItemSet).Get(Id))).GetValue()
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
 
@@ -331,7 +330,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
         drawing::ShadeMode eShadeMode( GetShadeMode( rGeometryItem, drawing::ShadeMode_FLAT ) );
         bool bUseExtrusionColor = GetBool( rGeometryItem, "Color", false );
 
-        drawing::FillStyle eFillStyle( ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem ) );
+        drawing::FillStyle eFillStyle( aSet.Get(XATTR_FILLSTYLE).GetValue() );
         pScene->GetProperties().SetObjectItem( Svx3DShadeModeItem( 0 ) );
         aSet.Put( makeSvx3DPercentDiagonalItem( 0 ) );
         aSet.Put( Svx3DTextureModeItem( 1 ) );
@@ -371,8 +370,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
         while( aIter.IsMore() )
         {
             const SdrObject* pNext = aIter.Next();
-            bool bIsPlaceholderObject = (static_cast<const XFillStyleItem&>(pNext->GetMergedItem( XATTR_FILLSTYLE )).GetValue() == drawing::FillStyle_NONE )
-                                        && (static_cast<const XLineStyleItem&>(pNext->GetMergedItem( XATTR_LINESTYLE )).GetValue() == drawing::LineStyle_NONE );
+            bool bIsPlaceholderObject = (pNext->GetMergedItem( XATTR_FILLSTYLE ).GetValue() == drawing::FillStyle_NONE )
+                                        && (pNext->GetMergedItem( XATTR_LINESTYLE ).GetValue() == drawing::LineStyle_NONE );
             basegfx::B2DPolyPolygon aPolyPoly;
             SfxItemSet aLocalSet(aSet);
             drawing::FillStyle aLocalFillStyle(eFillStyle);
@@ -388,7 +387,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                 // invisible (all this 'hidden' logic should be migrated to primitives).
                 if(!bMultipleSubObjects)
                 {
-                    const drawing::FillStyle eStyle(static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue());
+                    const drawing::FillStyle eStyle(rSet.Get(XATTR_FILLSTYLE).GetValue());
 
                     if(drawing::FillStyle_NONE == eStyle)
                     {
@@ -435,9 +434,9 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                                 // switch from line to fill, copy line attr to fill attr (color, transparence)
                                 aLocalSet.Put(XLineWidthItem(0));
                                 aLocalSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
-                                aLocalSet.Put(XFillColorItem(OUString(), static_cast<const XLineColorItem&>(aLocalSet.Get(XATTR_LINECOLOR)).GetColorValue()));
+                                aLocalSet.Put(XFillColorItem(OUString(), aLocalSet.Get(XATTR_LINECOLOR).GetColorValue()));
                                 aLocalSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
-                                aLocalSet.Put(XFillTransparenceItem(static_cast<const XLineTransparenceItem&>(aLocalSet.Get(XATTR_LINETRANSPARENCE)).GetValue()));
+                                aLocalSet.Put(XFillTransparenceItem(aLocalSet.Get(XATTR_LINETRANSPARENCE).GetValue()));
                                 aLocalFillStyle = drawing::FillStyle_SOLID;
                             }
                         }
@@ -486,10 +485,10 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                 else if ( bUseTwoFillStyles )
                 {
                     BitmapEx aFillBmp;
-                    bool bFillBmpTile = static_cast<const XFillBmpTileItem&>(p3DObj->GetMergedItem( XATTR_FILLBMP_TILE )).GetValue();
+                    bool bFillBmpTile = p3DObj->GetMergedItem( XATTR_FILLBMP_TILE ).GetValue();
                     if ( bFillBmpTile )
                     {
-                        const XFillBitmapItem& rBmpItm = static_cast<const XFillBitmapItem&>(p3DObj->GetMergedItem(XATTR_FILLBITMAP));
+                        const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP);
                         aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
 
                         // #i122777# old adaption of FillStyle bitmap size to 5-times the original size; this is not needed
@@ -511,7 +510,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                     {
                         if ( aSnapRect != aBoundRect && aSnapRect.GetWidth() > 0 && aSnapRect.GetHeight() > 0)
                         {
-                            const XFillBitmapItem& rBmpItm = static_cast<const XFillBitmapItem&>(p3DObj->GetMergedItem(XATTR_FILLBITMAP));
+                            const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP);
                             aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
                             Size aBmpSize( aFillBmp.GetSizePixel() );
                             double fXScale = (double)aBoundRect.GetWidth() / (double)aSnapRect.GetWidth();
@@ -531,7 +530,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                     p3DObj->NbcSetLayer( pShape2d->GetLayer() );
                     p3DObj->SetMergedItemSet( aLocalSet );
                     if ( bUseExtrusionColor )
-                        p3DObj->SetMergedItem( XFillColorItem( "", static_cast<const XSecondaryFillColorItem&>(pCustomShape->GetMergedItem( XATTR_SECONDARYFILLCOLOR )).GetColorValue() ) );
+                        p3DObj->SetMergedItem( XFillColorItem( "", pCustomShape->GetMergedItem( XATTR_SECONDARYFILLCOLOR ).GetColorValue() ) );
                     p3DObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
                     p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) );
                     p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) );
@@ -554,7 +553,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
                 }
                 else if ( aLocalFillStyle == drawing::FillStyle_NONE )
                 {
-                    const XLineColorItem& rLineColor = static_cast<const XLineColorItem&>(p3DObj->GetMergedItem( XATTR_LINECOLOR ));
+                    const XLineColorItem& rLineColor = p3DObj->GetMergedItem( XATTR_LINECOLOR );
                     p3DObj->SetMergedItem( XFillColorItem( "", rLineColor.GetColorValue() ) );
                     p3DObj->SetMergedItem( makeSvx3DDoubleSidedItem( true ) );
                     p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) );
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 9a4834847dbe..3a8289d23538 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -567,7 +567,7 @@ void Svx3DWin::Update( SfxItemSet const & rAttrs )
     eState = rAttrs.GetItemState(XATTR_FILLSTYLE);
     if(eState != SfxItemState::DONTCARE)
     {
-        drawing::FillStyle eXFS = (drawing::FillStyle)static_cast<const XFillStyleItem&>(rAttrs.Get(XATTR_FILLSTYLE)).GetValue();
+        drawing::FillStyle eXFS = (drawing::FillStyle)rAttrs.Get(XATTR_FILLSTYLE).GetValue();
         bBitmap = (eXFS == drawing::FillStyle_BITMAP || eXFS == drawing::FillStyle_GRADIENT || eXFS == drawing::FillStyle_HATCH);
     }
 
@@ -1492,7 +1492,7 @@ void Svx3DWin::Update( SfxItemSet const & rAttrs )
     eState = rAttrs.GetItemState(XATTR_FILLCOLOR);
     if( eState != SfxItemState::DONTCARE )
     {
-        aColor = static_cast<const XFillColorItem&>(rAttrs.Get(XATTR_FILLCOLOR)).GetColorValue();
+        aColor = rAttrs.Get(XATTR_FILLCOLOR).GetColorValue();
         SvxColorListBox* pLb = m_pLbMatColor;
         if( aColor != pLb->GetSelectEntryColor() )
         {
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 8c63c38f2923..2403e9b4431b 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -68,8 +68,6 @@
 
 using namespace com::sun::star;
 
-#define ITEMVALUE(ItemSet,Id,Cast)  (static_cast<const Cast&>((ItemSet).Get(Id))).GetValue()
-
 
 // Migrate Marking
 
@@ -677,9 +675,9 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj)
     if(dynamic_cast<const SdrPathObj*>( pObj) !=  nullptr)
     {
         const SfxItemSet& rSet = pObj->GetMergedItemSet();
-        sal_Int32 nLineWidth = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue();
-        drawing::LineStyle eLineStyle = (drawing::LineStyle)static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue();
-        drawing::FillStyle eFillStyle = ITEMVALUE(rSet, XATTR_FILLSTYLE, XFillStyleItem);
+        sal_Int32 nLineWidth = rSet.Get(XATTR_LINEWIDTH).GetValue();
+        drawing::LineStyle eLineStyle = (drawing::LineStyle)rSet.Get(XATTR_LINESTYLE).GetValue();
+        drawing::FillStyle eFillStyle = rSet.Get(XATTR_FILLSTYLE).GetValue();
 
         if(static_cast<SdrPathObj*>(pObj)->IsClosed()
             && eLineStyle == drawing::LineStyle_SOLID
@@ -710,7 +708,7 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, boo
         // Get Itemset of the original object
         SfxItemSet aSet(pObj->GetMergedItemSet());
 
-        drawing::FillStyle eFillStyle = ITEMVALUE(aSet, XATTR_FILLSTYLE, XFillStyleItem);
+        drawing::FillStyle eFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue();
 
         // line style turned off
         aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
@@ -730,7 +728,7 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, boo
 
             // Fill color must be the color line, because the object was
             // previously just a line
-            Color aColorLine = static_cast<const XLineColorItem&>(aSet.Get(XATTR_LINECOLOR)).GetColorValue();
+            Color aColorLine = aSet.Get(XATTR_LINECOLOR).GetColorValue();
             aSet.Put(XFillColorItem(OUString(), aColorLine));
         }
 
@@ -1054,8 +1052,8 @@ void E3dView::DoDepthArrange(E3dScene const * pScene, double fDepth)
                 const basegfx::B2DPolyPolygon aExtrudePoly(
                     basegfx::utils::prepareForPolygonOperation(pExtrudeObj->GetExtrudePolygon()));
                 const SfxItemSet& rLocalSet = pExtrudeObj->GetMergedItemSet();
-                const drawing::FillStyle eLocalFillStyle = ITEMVALUE(rLocalSet, XATTR_FILLSTYLE, XFillStyleItem);
-                const Color aLocalColor = static_cast<const XFillColorItem&>(rLocalSet.Get(XATTR_FILLCOLOR)).GetColorValue();
+                const drawing::FillStyle eLocalFillStyle = rLocalSet.Get(XATTR_FILLSTYLE).GetValue();
+                const Color aLocalColor = rLocalSet.Get(XATTR_FILLCOLOR).GetColorValue();
 
                 // sort in ExtrudeObj
                 if(pLayer)
@@ -1080,13 +1078,13 @@ void E3dView::DoDepthArrange(E3dScene const * pScene, double fDepth)
                             // second criteria: is another fillstyle or color used?
                             const SfxItemSet& rCompareSet = pAct->mpObj->GetMergedItemSet();
 
-                            drawing::FillStyle eCompareFillStyle = ITEMVALUE(rCompareSet, XATTR_FILLSTYLE, XFillStyleItem);
+                            drawing::FillStyle eCompareFillStyle = rCompareSet.Get(XATTR_FILLSTYLE).GetValue();
 
                             if(eLocalFillStyle == eCompareFillStyle)
                             {
                                 if(eLocalFillStyle == drawing::FillStyle_SOLID)
                                 {
-                                    Color aCompareColor = static_cast<const XFillColorItem&>(rCompareSet.Get(XATTR_FILLCOLOR)).GetColorValue();
+                                    Color aCompareColor = rCompareSet.Get(XATTR_FILLCOLOR).GetColorValue();
 
                                     if(aCompareColor == aLocalColor)
                                     {
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 4118b3cdad90..110aadbd0cdd 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -86,7 +86,7 @@ namespace
         }
         else
         {
-            nRetval = (sal_uInt8)((static_cast<const XLineTransparenceItem&>(rSet.Get(XATTR_LINETRANSPARENCE)).GetValue() * 255) / 100);
+            nRetval = (sal_uInt8)((rSet.Get(XATTR_LINETRANSPARENCE).GetValue() * 255) / 100);
         }
 
         return nRetval;
@@ -103,13 +103,13 @@ namespace
         }
         else
         {
-            const Color aLineColor(static_cast<const XLineColorItem&>(rSet.Get(XATTR_LINECOLOR)).GetColorValue());
+            const Color aLineColor(rSet.Get(XATTR_LINECOLOR).GetColorValue());
             aColorAttribute = aLineColor.getBColor();
         }
 
-        const sal_uInt32 nLineWidth = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue();
-        const css::drawing::LineJoint eLineJoint = static_cast<const XLineJointItem&>(rSet.Get(XATTR_LINEJOINT)).GetValue();
-        const css::drawing::LineCap eLineCap = static_cast<const XLineCapItem&>(rSet.Get(XATTR_LINECAP)).GetValue();
+        const sal_uInt32 nLineWidth = rSet.Get(XATTR_LINEWIDTH).GetValue();
+        const css::drawing::LineJoint eLineJoint = rSet.Get(XATTR_LINEJOINT).GetValue();
+        const css::drawing::LineCap eLineCap = rSet.Get(XATTR_LINECAP).GetValue();
 
         return drawinglayer::attribute::LineAttribute(
             aColorAttribute,
@@ -120,17 +120,17 @@ namespace
 
     drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet)
     {
-        const css::drawing::LineStyle eLineStyle = static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue();
+        const css::drawing::LineStyle eLineStyle = rSet.Get(XATTR_LINESTYLE).GetValue();
         double fFullDotDashLen(0.0);
         ::std::vector< double > aDotDashArray;
 
         if(css::drawing::LineStyle_DASH == eLineStyle)
         {
-            const XDash& rDash = static_cast<const XLineDashItem&>(rSet.Get(XATTR_LINEDASH)).GetDashValue();
+            const XDash& rDash = rSet.Get(XATTR_LINEDASH).GetDashValue();
 
             if(rDash.GetDots() || rDash.GetDashes())
             {
-                const sal_uInt32 nLineWidth = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue();
+                const sal_uInt32 nLineWidth = rSet.Get(XATTR_LINEWIDTH).GetValue();
                 fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth);
             }
         }
@@ -167,19 +167,19 @@ namespace drawinglayer
             bool                                    mbFormTextOutline : 1;  // show contour of objects
 
             explicit ImpSdrFormTextAttribute(const SfxItemSet& rSet)
-            :   mnFormTextDistance(static_cast<const XFormTextDistanceItem&>(rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
-                mnFormTextStart(static_cast<const XFormTextStartItem&>(rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
-                mnFormTextShdwXVal(static_cast<const XFormTextShadowXValItem&>(rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
-                mnFormTextShdwYVal(static_cast<const XFormTextShadowYValItem&>(rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
-                mnFormTextShdwTransp(static_cast<const XFormTextShadowTranspItem&>(rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
-                meFormTextStyle(static_cast<const XFormTextStyleItem&>(rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
-                meFormTextAdjust(static_cast<const XFormTextAdjustItem&>(rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
-                meFormTextShadow(static_cast<const XFormTextShadowItem&>(rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
-                maFormTextShdwColor(static_cast<const XFormTextShadowColorItem&>(rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
+            :   mnFormTextDistance(rSet.Get(XATTR_FORMTXTDISTANCE).GetValue()),
+                mnFormTextStart(rSet.Get(XATTR_FORMTXTSTART).GetValue()),
+                mnFormTextShdwXVal(rSet.Get(XATTR_FORMTXTSHDWXVAL).GetValue()),
+                mnFormTextShdwYVal(rSet.Get(XATTR_FORMTXTSHDWYVAL).GetValue()),
+                mnFormTextShdwTransp(rSet.Get(XATTR_FORMTXTSHDWTRANSP).GetValue()),
+                meFormTextStyle(rSet.Get(XATTR_FORMTXTSTYLE).GetValue()),
+                meFormTextAdjust(rSet.Get(XATTR_FORMTXTADJUST).GetValue()),
+                meFormTextShadow(rSet.Get(XATTR_FORMTXTSHADOW).GetValue()),
+                maFormTextShdwColor(rSet.Get(XATTR_FORMTXTSHDWCOLOR).GetColorValue()),
                 maOutline(),
                 maShadowOutline(),
-                mbFormTextMirror(static_cast<const XFormTextMirrorItem&>(rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
-                mbFormTextOutline(static_cast<const XFormTextOutlineItem&>(rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
+                mbFormTextMirror(rSet.Get(XATTR_FORMTXTMIRROR).GetValue()),
+                mbFormTextOutline(rSet.Get(XATTR_FORMTXTOUTLINE).GetValue())
             {
                 if(getFormTextOutline())
                 {
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index e9345ffcb808..413d4abd0785 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -111,7 +111,7 @@ namespace sdr
                 const XColorItem& rShadColItem = static_cast<const XColorItem&>(rItemSet.Get(SDRATTR_SHADOWCOLOR));
                 const sal_uInt16 nShadowTransparence(static_cast<const SdrPercentItem&>(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue());
                 const Color aShadowColor(rShadColItem.GetColorValue());
-                const drawing::FillStyle eShadowStyle = static_cast<const XFillStyleItem&>(rItemSet.Get(XATTR_FILLSTYLE)).GetValue();
+                const drawing::FillStyle eShadowStyle = rItemSet.Get(XATTR_FILLSTYLE).GetValue();
 
                 // Create own ItemSet and modify as needed
                 // Always hide lines for special calc shadow
@@ -121,7 +121,7 @@ namespace sdr
                 if(drawing::FillStyle_HATCH == eShadowStyle)
                 {
                     // #41666# Hatch color is set hard to shadow color
-                    XHatch aHatch = static_cast<const XFillHatchItem&>(rItemSet.Get(XATTR_FILLHATCH)).GetHatchValue();
+                    XHatch aHatch = rItemSet.Get(XATTR_FILLHATCH).GetHatchValue();
                     aHatch.SetColor(aShadowColor);
                     aSet.Put(XFillHatchItem(OUString(),aHatch));
                 }
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index e68d05fb673e..799b525493df 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -47,6 +47,11 @@
 #include <svx/sdsxyitm.hxx>
 #include <svx/sdshcitm.hxx>
 #include <svx/sdshtitm.hxx>
+#include <svx/xflbmsxy.hxx>
+#include <svx/xflbtoxy.hxx>
+#include <svx/xflboxy.hxx>
+#include <svx/xflbmtit.hxx>
+#include <svx/xflbstit.hxx>
 #include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
 #include <basegfx/polygon/b2dlinegeometry.hxx>
 #include <svx/svdotext.hxx>
@@ -64,6 +69,7 @@
 #include <svx/sdtfchim.hxx>
 #include <svx/svdoutl.hxx>
 #include <svx/svdmodel.hxx>
+#include <svx/xflbmsli.hxx>
 #include <editeng/editstat.hxx>
 #include <drawinglayer/attribute/fillhatchattribute.hxx>
 #include <drawinglayer/attribute/fillgradientattribute.hxx>
@@ -215,11 +221,11 @@ namespace drawinglayer
     {
         attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet& rSet)
         {
-            const css::drawing::LineStyle eStyle(static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue());
+            const css::drawing::LineStyle eStyle(rSet.Get(XATTR_LINESTYLE).GetValue());
 
             if(drawing::LineStyle_NONE != eStyle)
             {
-                sal_uInt16 nTransparence(static_cast<const XLineTransparenceItem&>(rSet.Get(XATTR_LINETRANSPARENCE)).GetValue());
+                sal_uInt16 nTransparence(rSet.Get(XATTR_LINETRANSPARENCE).GetValue());
 
                 if(nTransparence > 100)
                 {
@@ -228,16 +234,16 @@ namespace drawinglayer
 
                 if(100 != nTransparence)
                 {
-                    const sal_uInt32 nWidth(static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue());
-                    const Color aColor(static_cast<const XLineColorItem&>(rSet.Get(XATTR_LINECOLOR)).GetColorValue());

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list