diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-03 14:57:39 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-04 15:09:23 -0400 |
commit | 35c17477170e9d10b9f9d7edeaf1da660a718df6 (patch) | |
tree | b58c616d4723bc53821e5e72276701a0f70c20f2 /editeng/source | |
parent | 58e562e730485e860dfe484cdc09c67f1d73dc5a (diff) |
Merge EditAttrib into EditCharAttrib.
This separation makes no sense.
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editattr.cxx | 21 | ||||
-rw-r--r-- | editeng/source/editeng/editattr.hxx | 29 |
2 files changed, 13 insertions, 37 deletions
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 @@ -66,35 +66,14 @@ class SfxVoidItem; #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; } |