From 35c17477170e9d10b9f9d7edeaf1da660a718df6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 Apr 2012 14:57:39 -0400 Subject: Merge EditAttrib into EditCharAttrib. This separation makes no sense. --- editeng/source/editeng/editattr.cxx | 21 +++++++-------------- editeng/source/editeng/editattr.hxx | 29 ++++++----------------------- 2 files changed, 13 insertions(+), 37 deletions(-) (limited to 'editeng') diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 2e79644de923..131f8896be1d 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -58,28 +58,21 @@ DBG_NAME( EE_EditAttrib ) // ------------------------------------------------------------------------- -// class EditAttrib +// class EditCharAttrib // ------------------------------------------------------------------------- -EditAttrib::EditAttrib( const SfxPoolItem& rAttr ) +EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) : + nStart(nS), nEnd(nE), bFeature(false), bEdge(false) { DBG_CTOR( EE_EditAttrib, 0 ); pItem = &rAttr; -} -EditAttrib::~EditAttrib() -{ - DBG_DTOR( EE_EditAttrib, 0 ); + DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" ); + DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" ); } -// ------------------------------------------------------------------------- -// class EditCharAttrib -// ------------------------------------------------------------------------- -EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) : - EditAttrib(rAttr), - nStart(nS), nEnd(nE), bFeature(false), bEdge(false) +EditCharAttrib::~EditCharAttrib() { - DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" ); - DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" ); + DBG_DTOR( EE_EditAttrib, 0 ); } void EditCharAttrib::SetFont( SvxFont&, OutputDevice* ) diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index 45c66d2fa78e..4a0f711f1a94 100644 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -65,36 +65,15 @@ class SfxVoidItem; // => To determine the DefMetric simply use GetMetric(0) #define DEF_METRIC 0 -// ------------------------------------------------------------------------- -// class EditAttrib -// ------------------------------------------------------------------------- -class EditAttrib : private boost::noncopyable -{ -private: - EditAttrib(); - -protected: - const SfxPoolItem* pItem; - - EditAttrib( const SfxPoolItem& rAttr ); - virtual ~EditAttrib(); - -public: - // RemoveFromPool must always be called before the destructor!! - void RemoveFromPool( SfxItemPool& rPool ); - - sal_uInt16 Which() const { return pItem->Which(); } - const SfxPoolItem* GetItem() const { return pItem; } -}; - // ------------------------------------------------------------------------- // class EditCharAttrib // ------------------------------------------------------------------------- // bFeature: Attribute must not expand/shrink, length is always 1 // bEdge: Attribute will not expand, if you want to expand just on the edge -class EditCharAttrib : public EditAttrib +class EditCharAttrib : private boost::noncopyable { protected: + const SfxPoolItem* pItem; sal_uInt16 nStart; sal_uInt16 nEnd; @@ -103,6 +82,10 @@ protected: public: EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); + virtual ~EditCharAttrib(); + + sal_uInt16 Which() const { return pItem->Which(); } + const SfxPoolItem* GetItem() const { return pItem; } sal_uInt16& GetStart() { return nStart; } sal_uInt16& GetEnd() { return nEnd; } -- cgit