summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-08-15 23:12:54 +0200
committerMichael Stahl <mstahl@redhat.com>2013-08-16 11:23:28 +0200
commit69f686774cfeb803fdd63ed1ef07ff70550930de (patch)
tree3b45125258a2d6ebfc41782a317378e8f3457f67 /include/svl
parent35223e5f19dc1f4e59c3694e98103444c82082b8 (diff)
SfxBoolItem: cut out the middle man
CntBoolItem adds no value at all. Change-Id: I41a22fc11cca270e792f2a2f81e3638b54dc1d24
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/cenumitm.hxx48
-rw-r--r--include/svl/eitem.hxx61
2 files changed, 50 insertions, 59 deletions
diff --git a/include/svl/cenumitm.hxx b/include/svl/cenumitm.hxx
index 35024c3a6d44..dc61d30db179 100644
--- a/include/svl/cenumitm.hxx
+++ b/include/svl/cenumitm.hxx
@@ -117,54 +117,6 @@ inline void CntEnumItem::SetValue(sal_uInt16 nTheValue)
m_nValue = nTheValue;
}
-//============================================================================
-DBG_NAMEEX(CntBoolItem)
-
-class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem
-{
- sal_Bool m_bValue;
-
-public:
- TYPEINFO();
-
- explicit CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False):
- SfxPoolItem(which), m_bValue(bTheValue) {}
-
- CntBoolItem(sal_uInt16 nWhich, SvStream & rStream);
-
- CntBoolItem(const CntBoolItem & rItem):
- SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {}
-
- virtual int operator ==(const SfxPoolItem & rItem) const;
-
- using SfxPoolItem::Compare;
- virtual int Compare(const SfxPoolItem & rWith) const;
-
- virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
- SfxMapUnit, SfxMapUnit,
- OUString & rText,
- const IntlWrapper * = 0)
- const;
-
- virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const;
-
- virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0);
-
- virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
-
- virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
-
- virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
-
- virtual sal_uInt16 GetValueCount() const;
-
- virtual OUString GetValueTextByVal(sal_Bool bTheValue) const;
-
- sal_Bool GetValue() const { return m_bValue; }
-
- void SetValue(sal_Bool bTheValue) { m_bValue = bTheValue; }
-};
-
#endif // _SVTOOLS_CENUMITM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx
index c9c5e389132f..e035c618f0c5 100644
--- a/include/svl/eitem.hxx
+++ b/include/svl/eitem.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _SFXENUMITEM_HXX
-#define _SFXENUMITEM_HXX
+#ifndef SFXENUMITEM_HXX
+#define SFXENUMITEM_HXX
#include "svl/svldllapi.h"
#include <svl/cenumitm.hxx>
@@ -39,24 +39,63 @@ public:
};
//============================================================================
-class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem
+
+class SVL_DLLPUBLIC SfxBoolItem
+ : public SfxPoolItem
{
+ bool m_bValue;
+
public:
TYPEINFO();
- explicit SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False):
- CntBoolItem(which, bValue) {}
+ explicit SfxBoolItem(sal_uInt16 const nWhich = 0, bool const bValue = false)
+ : SfxPoolItem(nWhich)
+ , m_bValue(bValue)
+ { }
+
+ SfxBoolItem(SfxBoolItem const& rItem)
+ : SfxPoolItem(rItem)
+ , m_bValue(rItem.m_bValue)
+ { }
+
+ SfxBoolItem(sal_uInt16 nWhich, SvStream & rStream);
+
+ bool GetValue() const { return m_bValue; }
+
+ void SetValue(bool const bTheValue) { m_bValue = bTheValue; }
+
+ // SfxPoolItem
+ virtual int operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
+
+ using SfxPoolItem::Compare;
+ virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
+
+ virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ OUString & rText,
+ const IntlWrapper * = 0)
+ const SAL_OVERRIDE;
+
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0)
+ const SAL_OVERRIDE;
+
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0)
+ SAL_OVERRIDE;
- SfxBoolItem(sal_uInt16 which, SvStream & rStream):
- CntBoolItem(which, rStream) {}
virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
- { return new SfxBoolItem(Which(), rStream); }
+ SAL_OVERRIDE;
+
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
+
+ virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
+
+ virtual sal_uInt16 GetValueCount() const;
+
+ virtual OUString GetValueTextByVal(sal_Bool bTheValue) const;
- virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
- { return new SfxBoolItem(*this); }
};
-#endif // _SFXENUMITEM_HXX
+#endif // SFXENUMITEM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */