[Libreoffice-commits] core.git: include/svl svl/source sw/source
Stephan Bergmann
sbergman at redhat.com
Wed Jan 22 09:20:23 PST 2014
include/svl/itemset.hxx | 9 +++------
svl/source/items/itemset.cxx | 19 +++----------------
sw/source/core/attr/format.cxx | 2 +-
sw/source/core/attr/swatrset.cxx | 2 +-
sw/source/core/docnode/node.cxx | 6 +++---
5 files changed, 11 insertions(+), 27 deletions(-)
New commits:
commit 0d5c8dff302c26cd916824434873e3286959435a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Jan 22 18:16:01 2014 +0100
Clean up SfxItemSet::Put
* Make inherited overloads visible via "using" in SfxAllItemSet.
* The overload with SfxItemSet argument:
** need not be virtual (verified by temporarily marking it SAL_FINAL);
** should apparently return bool.
Change-Id: I5c57ec3d757d3d32a3e23be12964e7ebb81e6211
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index 5c05647..a471069 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -127,8 +127,8 @@ public:
virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
const SfxPoolItem* Put( const SfxPoolItem& rItem )
{ return Put(rItem, rItem.Which()); }
- virtual int Put( const SfxItemSet&,
- sal_Bool bInvalidAsDefault = sal_True );
+ bool Put( const SfxItemSet&,
+ bool bInvalidAsDefault = true );
void PutExtended( const SfxItemSet&,
SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN,
SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN );
@@ -181,10 +181,7 @@ public:
virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const;
virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
- const SfxPoolItem* Put( const SfxPoolItem& rItem )
- { return Put(rItem, rItem.Which()); }
- virtual int Put( const SfxItemSet&,
- sal_Bool bInvalidAsDefault = sal_True );
+ using SfxItemSet::Put;
};
#endif // INCLUDED_SVL_ITEMSET_HXX
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index bc27dd1..b305121 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -630,7 +630,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
// -----------------------------------------------------------------------
-int SfxItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
+bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
bool bRet = false;
@@ -658,7 +658,7 @@ int SfxItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
pPtr += 2;
}
}
- return int(bRet);
+ return bRet;
}
// -----------------------------------------------------------------------
@@ -922,7 +922,7 @@ bool SfxItemSet::Set
}
}
else
- bRet = Put(rSet, sal_False);
+ bRet = Put(rSet, false);
return bRet;
}
@@ -2005,19 +2005,6 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi
}
// -----------------------------------------------------------------------
-
-
-/* Diese Methode wird forwarded, damit sie nicht durch die anderen
- Put-Methoden dieser SubClass gehided wird.
-*/
-
-int SfxAllItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
-{
- //? pruefen, ob Which-Ranges erweitert werden
- return SfxItemSet::Put( rSet, bInvalidAsDefault );
-}
-
-// -----------------------------------------------------------------------
// Item disablen, wenn durch ein VoidItem mit dem Which-Wert 0 ausgedrueckt
void SfxItemSet::DisableItem(sal_uInt16 nWhich)
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 025faf7..277957f2 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -447,7 +447,7 @@ bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
( RES_GRFFMTCOLL == nFmtWhich ||
RES_TXTFMTCOLL == nFmtWhich ) ) )
{
- if( ( bRet = (0 != aSet.Put( rSet ))) )
+ if( ( bRet = aSet.Put( rSet )) )
aSet.SetModifyAtAttr( this );
// #i71574#
if ( nFmtWhich == RES_TXTFMTCOLL )
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 9f41cd6..083cd2a 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -127,7 +127,7 @@ bool SwAttrSet::Put_BC( const SfxItemSet& rSet,
{
pNewSet = pNew;
pOldSet = pOld;
- bool nRet = 0 != SfxItemSet::Put( rSet );
+ bool nRet = SfxItemSet::Put( rSet );
pOldSet = pNewSet = 0;
return nRet;
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index e2f6eca..e0710b3 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -139,7 +139,7 @@ const SfxPoolItem* Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
return pRet;
}
-int Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNode,
+bool Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNode,
const SfxItemSet& rSet )
{
SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet );
@@ -152,7 +152,7 @@ int Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNo
pStyleNames->Put( aNewSet );
}
- const int nRet = aNewSet.Put( rSet );
+ const bool nRet = aNewSet.Put( rSet );
// #i76273# Robust
if ( pStyleNames )
@@ -1437,7 +1437,7 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet )
SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) ) )
{
// Some special treatment for Attributes
- bRet = 0 != AttrSetHandleHelper::Put( mpAttrSet, *this, rSet );
+ bRet = AttrSetHandleHelper::Put( mpAttrSet, *this, rSet );
}
else
{
More information about the Libreoffice-commits
mailing list