[Libreoffice-commits] core.git: cui/source filter/source include/svx svx/source
Stephan Bergmann
sbergman at redhat.com
Mon Aug 18 08:38:43 PDT 2014
cui/source/tabpages/tparea.cxx | 4 ++--
cui/source/tabpages/tpshadow.cxx | 6 +++---
filter/source/msfilter/msdffimp.cxx | 2 +-
include/svx/sdshtitm.hxx | 11 +++--------
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 +-
9 files changed, 14 insertions(+), 19 deletions(-)
New commits:
commit 69dd9c669a4021b5202dad7030bc4738145de661
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Aug 18 17:37:31 2014 +0200
Consistency around SdrPercentItem in svx/sdshtitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
Change-Id: I4e98c362f811c19f03766d0c78f10c795d3ac79d
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 818613d..2177903 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -323,7 +323,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
if(m_pMtrTransparent->IsValueChangedFromSaved() || !bLinearActive)
{
XFillTransparenceItem aItem(nPos);
- SdrShadowTransparenceItem aShadowItem(nPos);
+ SdrPercentItem aShadowItem(makeSdrShadowTransparenceItem(nPos));
const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLTRANSPARENCE);
if(!pOld || !(*(const XFillTransparenceItem*)pOld == aItem) || !bLinearActive)
{
@@ -393,7 +393,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
{
XFillTransparenceItem aItem(0);
- SdrShadowTransparenceItem aShadowItem(0);
+ SdrPercentItem aShadowItem(makeSdrShadowTransparenceItem(0));
rAttrs->Put(aItem);
rAttrs->Put(aShadowItem);
bModified = true;
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 43eeabf..643e80f 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -336,9 +336,9 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
if( m_pMtrTransparent->IsValueChangedFromSaved() )
{
- SdrShadowTransparenceItem aItem( nVal );
+ SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWTRANSPARENCE );
- if ( !pOld || !( *(const SdrShadowTransparenceItem*)pOld == aItem ) )
+ if ( !pOld || !( *(const SdrPercentItem*)pOld == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -433,7 +433,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
if( rAttrs->GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nTransp = ( ( const SdrShadowTransparenceItem& ) rAttrs->Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
+ sal_uInt16 nTransp = ( ( const SdrPercentItem& ) rAttrs->Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
m_pMtrTransparent->SetValue( nTransp );
}
else
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index b6bf96d..22825bc 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2546,7 +2546,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
}
if ( IsProperty( DFF_Prop_shadowOpacity ) )
- rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
+ rSet.Put( makeSdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
if ( IsProperty( DFF_Prop_shadowOffsetX ) )
{
sal_Int32 nVal = static_cast< sal_Int32 >( GetPropertyValue( DFF_Prop_shadowOffsetX ) );
diff --git a/include/svx/sdshtitm.hxx b/include/svx/sdshtitm.hxx
index 607f3bc..e103507 100644
--- a/include/svx/sdshtitm.hxx
+++ b/include/svx/sdshtitm.hxx
@@ -22,14 +22,9 @@
#include <svx/sdprcitm.hxx>
#include <svx/svddef.hxx>
-/**
- * class SdrShadowTransparenceItem
- */
-class SdrShadowTransparenceItem: public SdrPercentItem {
-public:
- SdrShadowTransparenceItem(sal_uInt16 nTransp=0): SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE,nTransp) {}
- SdrShadowTransparenceItem(SvStream& rIn) : SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE,rIn) {}
-};
+inline SdrPercentItem makeSdrShadowTransparenceItem(sal_uInt16 nTransp) {
+ return SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, nTransp);
+}
#endif
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 1b10633..3b384c2 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -83,7 +83,7 @@ namespace
if(bShadow)
{
- nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
+ nRetval = (sal_uInt8)((((SdrPercentItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
}
else
{
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 6aeb714..58ff939 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -109,7 +109,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 sal_uInt16 nShadowTransparence(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ 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 3b8074b..914d06a 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -339,7 +339,7 @@ namespace drawinglayer
if(bShadow)
{
- sal_uInt16 nTransparence(((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ sal_uInt16 nTransparence(((SdrPercentItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
if(nTransparence > 100)
{
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 9f148ad..24e77e7 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -132,7 +132,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(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 SdrShadowTransparenceItem;
+ mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
mppLocalPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
mppLocalPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 8e4f093..e2e9917 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -214,7 +214,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
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 sal_uInt16 nShadowTransparence(((SdrShadowTransparenceItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
pRetval = rOriginal.Clone();
DBG_ASSERT(pRetval, "ImpCreateShadowObjectClone: Could not clone object (!)");
More information about the Libreoffice-commits
mailing list