diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-11 09:08:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-11 09:08:55 +0000 |
commit | ef0323b0fa935e445ac9c809117812ed88ba59de (patch) | |
tree | 2b7b84dff28f7f010ac0850a516f181f2096fef2 /svx | |
parent | f4785d5754c687212650f3e4980a3f3435257f14 (diff) |
using the other ctor can shrink this code
Change-Id: Ied607a78c9aaec3cb0ee9dc0e2938c69a62d031e
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 02f067cf2a89..29cd95ce2ed0 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1437,11 +1437,8 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, return false; const XBitmapEntry* pEntry = pBitmapList->GetBitmap(nPos); - XFillBitmapItem aBmpItem; - aBmpItem.SetWhich( XATTR_FILLBITMAP ); - aBmpItem.SetName( rName ); - aBmpItem.SetGraphicObject(pEntry->GetGraphicObject()); - rSet.Put( aBmpItem ); + XFillBitmapItem aBmpItem(rName, pEntry->GetGraphicObject()); + rSet.Put(aBmpItem); break; } case XATTR_FILLGRADIENT: @@ -1456,10 +1453,7 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, return false; const XGradientEntry* pEntry = pGradientList->GetGradient(nPos); - XFillGradientItem aGrdItem; - aGrdItem.SetWhich( XATTR_FILLGRADIENT ); - aGrdItem.SetName( rName ); - aGrdItem.SetGradientValue( pEntry->GetGradient() ); + XFillGradientItem aGrdItem(rName, pEntry->GetGradient()); rSet.Put( aGrdItem ); break; } @@ -1475,10 +1469,7 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, return false; const XHatchEntry* pEntry = pHatchList->GetHatch( nPos ); - XFillHatchItem aHatchItem; - aHatchItem.SetWhich( XATTR_FILLHATCH ); - aHatchItem.SetName( rName ); - aHatchItem.SetHatchValue( pEntry->GetHatch() ); + XFillHatchItem aHatchItem(rName, pEntry->GetHatch()); rSet.Put( aHatchItem ); break; } @@ -1497,18 +1488,12 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos); if( XATTR_LINEEND == nWID ) { - XLineEndItem aLEItem; - aLEItem.SetWhich( XATTR_LINEEND ); - aLEItem.SetName( rName ); - aLEItem.SetLineEndValue( pEntry->GetLineEnd() ); + XLineEndItem aLEItem(rName, pEntry->GetLineEnd()); rSet.Put( aLEItem ); } else { - XLineStartItem aLSItem; - aLSItem.SetWhich( XATTR_LINESTART ); - aLSItem.SetName( rName ); - aLSItem.SetLineStartValue( pEntry->GetLineEnd() ); + XLineStartItem aLSItem(rName, pEntry->GetLineEnd()); rSet.Put( aLSItem ); } @@ -1526,10 +1511,7 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, return false; const XDashEntry* pEntry = pDashList->GetDash(nPos); - XLineDashItem aDashItem; - aDashItem.SetWhich( XATTR_LINEDASH ); - aDashItem.SetName( rName ); - aDashItem.SetDashValue( pEntry->GetDash() ); + XLineDashItem aDashItem(rName, pEntry->GetDash()); rSet.Put( aDashItem ); break; } |