Kaydet (Commit) 35c17477 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Merge EditAttrib into EditCharAttrib.

This separation makes no sense.
üst 58e562e7
......@@ -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* )
......
......@@ -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; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment