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

Stephan Bergmann sbergman at redhat.com
Mon Aug 18 09:18:34 PDT 2014


 cui/source/tabpages/tpshadow.cxx                      |    6 +++---
 filter/source/msfilter/msdffimp.cxx                   |    4 ++--
 include/svx/sdshcitm.hxx                              |   11 +++--------
 sc/source/filter/excel/xiescher.cxx                   |    2 +-
 sd/source/core/drawdoc4.cxx                           |    8 ++++----
 sd/source/core/stlpool.cxx                            |    2 +-
 svx/source/sdr/attribute/sdrformtextattribute.cxx     |    2 +-
 svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx |    2 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx    |    2 +-
 svx/source/svdraw/svdattr.cxx                         |    2 +-
 svx/source/svdraw/svdoashp.cxx                        |    2 +-
 sw/source/filter/ww8/ww8graf.cxx                      |    2 +-
 12 files changed, 20 insertions(+), 25 deletions(-)

New commits:
commit 759f5d24b09dda2bcd41274f0b9cd9222180c194
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 18 18:18:08 2014 +0200

    Consistency around XColorItem in svx/sdshcitm.hxx
    
    ...similar to what has been done for svx/sdtmfitm.hxx in
    6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
    68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
    
    Change-Id: I7ecf827a0713efaecb4b0eb49f9f8c06f8c59091

diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 643e80f..30b7dc7 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -323,9 +323,9 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
         if( nPos != LISTBOX_ENTRY_NOTFOUND &&
             m_pLbShadowColor->IsValueChangedFromSaved() )
         {
-            SdrShadowColorItem aItem(m_pLbShadowColor->GetSelectEntryColor());
+            XColorItem aItem(makeSdrShadowColorItem(m_pLbShadowColor->GetSelectEntryColor()));
             pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWCOLOR );
-            if ( !pOld || !( *(const SdrShadowColorItem*)pOld == aItem ) )
+            if ( !pOld || !( *(const XColorItem*)pOld == aItem ) )
             {
                 rAttrs->Put( aItem );
                 bModified = true;
@@ -426,7 +426,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
 
         if( rAttrs->GetItemState( SDRATTR_SHADOWCOLOR ) != SFX_ITEM_DONTCARE )
         {
-            m_pLbShadowColor->SelectEntry( ( ( const SdrShadowColorItem& ) rAttrs->Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
+            m_pLbShadowColor->SelectEntry( ( ( const XColorItem& ) rAttrs->Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
         }
         else
             m_pLbShadowColor->SetNoSelection();
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 22825bc..4764533 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2539,11 +2539,11 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
     if ( IsProperty( DFF_Prop_fillColor ) )
         rSet.Put( XFillColorItem( OUString(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ) ) );
     if ( IsProperty( DFF_Prop_shadowColor ) )
-        rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
+        rSet.Put( makeSdrShadowColorItem( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
     else
     {
         //The default value for this property is 0x00808080
-        rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
+        rSet.Put( makeSdrShadowColorItem( rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
     }
     if ( IsProperty( DFF_Prop_shadowOpacity ) )
         rSet.Put( makeSdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
diff --git a/include/svx/sdshcitm.hxx b/include/svx/sdshcitm.hxx
index 63ea604..01c4741 100644
--- a/include/svx/sdshcitm.hxx
+++ b/include/svx/sdshcitm.hxx
@@ -22,14 +22,9 @@
 #include <svx/xcolit.hxx>
 #include <svx/svddef.hxx>
 
-class SdrShadowColorItem: public XColorItem
-{
-public:
-    SdrShadowColorItem(const Color& rTheColor)
-        : XColorItem(SDRATTR_SHADOWCOLOR, rTheColor)
-    {
-    }
-};
+inline XColorItem makeSdrShadowColorItem(const Color& rTheColor) {
+    return XColorItem(SDRATTR_SHADOWCOLOR, rTheColor);
+}
 
 #endif
 
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 858c154..c463097 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -771,7 +771,7 @@ void XclImpDrawObjBase::ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrame
         rSdrObj.SetMergedItem( makeSdrShadowItem( true ) );
         rSdrObj.SetMergedItem( makeSdrShadowXDistItem( 35 ) );
         rSdrObj.SetMergedItem( makeSdrShadowYDistItem( 35 ) );
-        rSdrObj.SetMergedItem( SdrShadowColorItem( GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
+        rSdrObj.SetMergedItem( makeSdrShadowColorItem( GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
     }
 }
 
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index c138922..b5ab78d 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -176,7 +176,7 @@ void SdDrawDocument::CreateLayoutTemplates()
 
                     // Shadow attributes (Drawing Engine)
     rISet.Put(makeSdrShadowItem(false));
-    rISet.Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
+    rISet.Put(makeSdrShadowColorItem(RGB_Color(COL_GRAY)));
     rISet.Put(makeSdrShadowXDistItem(200));         // 3 mm Shadow distance
     rISet.Put(makeSdrShadowYDistItem(200));
 
@@ -284,7 +284,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet = &pSheet->GetItemSet();
 
     pISet->Put(makeSdrShadowItem(true));
-    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
+    pISet->Put(makeSdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(makeSdrShadowXDistItem(200));        // 3 mm shadow distance
     pISet->Put(makeSdrShadowYDistItem(200));
 
@@ -383,7 +383,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet->Put(XFillColorItem(OUString(), RGB_Color(COL_CYAN)));
 
     pISet->Put(makeSdrShadowItem(true));
-    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
+    pISet->Put(makeSdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(makeSdrShadowXDistItem(200));        // 2 mm shadow distance
     pISet->Put(makeSdrShadowYDistItem(200));
 
@@ -407,7 +407,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     pISet->Put(XFillColorItem(OUString(), aOrange4));
 
     pISet->Put(makeSdrShadowItem(true));
-    pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
+    pISet->Put(makeSdrShadowColorItem(RGB_Color(COL_GRAY)));
     pISet->Put(makeSdrShadowXDistItem(200));        // 2 mm shadow distance
     pISet->Put(makeSdrShadowYDistItem(200));
 
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 3fbfecf..7cde782 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -487,7 +487,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool
         pSheet->SetParent( OUString() );
         SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
         rBackgroundObjectsSet.Put(makeSdrShadowItem(false));
-        rBackgroundObjectsSet.Put(SdrShadowColorItem(Color(COL_GRAY)));
+        rBackgroundObjectsSet.Put(makeSdrShadowColorItem(Color(COL_GRAY)));
         rBackgroundObjectsSet.Put(makeSdrShadowXDistItem(200)); // 3 mm shadow distance
         rBackgroundObjectsSet.Put(makeSdrShadowYDistItem(200));
         // #i16874# enable kerning by default but only for new documents
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 3b384c2..7fd8fe9 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -99,7 +99,7 @@ namespace
 
         if(bShadow)
         {
-            const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+            const Color aShadowColor(((XColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
             aColorAttribute = aShadowColor.getBColor();
         }
         else
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 58ff939..e5c84ed 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -108,7 +108,7 @@ namespace sdr
             {
                 // for SC, the caption object may have a specialized shadow. The usual object shadow is off
                 // and a specialized shadow gets created here (see old paint)
-                const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
+                const XColorItem& rShadColItem = (XColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
                 const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
                 const Color aShadowColor(rShadColItem.GetColorValue());
                 const drawing::FillStyle eShadowStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 914d06a..47019b7 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -370,7 +370,7 @@ namespace drawinglayer
                     const basegfx::B2DVector aOffset(
                         (double)((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue(),
                         (double)((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
-                    const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+                    const Color aColor(((XColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
 
                     return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
                 }
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 24e77e7..a738e25 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -129,7 +129,7 @@ SdrItemPool::SdrItemPool(
 
     // init own PoolDefaults
     mppLocalPoolDefaults[SDRATTR_SHADOW            -SDRATTR_START]=new SdrOnOffItem(SDRATTR_SHADOW, false);
-    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(aNullCol);
+    mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new XColorItem(SDRATTR_SHADOWCOLOR, aNullCol);
     mppLocalPoolDefaults[SDRATTR_SHADOWXDIST       -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWXDIST, 0);
     mppLocalPoolDefaults[SDRATTR_SHADOWYDIST       -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWYDIST, 0);
     mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index e2e9917..687ed35 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -213,7 +213,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
         // create a shadow representing object
         const sal_Int32 nXDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
         const sal_Int32 nYDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
-        const ::Color aShadowColor(((SdrShadowColorItem&)(rOriginalSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+        const ::Color aShadowColor(((XColorItem&)(rOriginalSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
         const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
         pRetval = rOriginal.Clone();
         DBG_ASSERT(pRetval, "ImpCreateShadowObjectClone: Could not clone object (!)");
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index bbaf439..1abac07 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1698,7 +1698,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
     {
         SvxShadowItem aShadow( RES_SHADOW );
 
-        const Color aShdColor = static_cast< SdrShadowColorItem const & >(
+        const Color aShdColor = static_cast< XColorItem const & >(
             rOldSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue();
         const sal_Int32 nShdDistX = WW8ITEMVALUE(rOldSet, SDRATTR_SHADOWXDIST,
             SdrMetricItem);


More information about the Libreoffice-commits mailing list