/trunk/Scribus/scribus/undoobject.cpp |
---|
66,7 → 66,7 |
return m_id; |
} |
QString UndoObject::getUName() const |
QString UndoObject::getUName() |
{ |
return m_uname; |
} |
76,7 → 76,7 |
m_uname = newUName; |
} |
QPixmap* UndoObject::getUPixmap() const |
QPixmap* UndoObject::getUPixmap() |
{ |
return m_upixmap; |
} |
86,14 → 86,7 |
m_upixmap = newUPixmap; |
} |
const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr() const |
const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr() |
{ |
return m_objectPtr; |
} |
int UndoObject::undoStateCount() const |
{ |
if (m_objectPtr.refCount() > 1) |
return m_objectPtr.refCount() - 1; |
return 0; |
} |
/trunk/Scribus/scribus/undoobject.h |
---|
78,7 → 78,7 |
* @brief Returns the name of the UndoObject. |
* @return the name of the UndoObject |
*/ |
virtual QString getUName() const; |
virtual QString getUName(); |
/** |
* @brief Set the name of the UndoObject |
90,7 → 90,7 |
* @brief Returns the pixmap connected to this object. |
* @return pixmap connected to this object |
*/ |
virtual QPixmap* getUPixmap() const; |
virtual QPixmap* getUPixmap(); |
/** |
* @brief Set the pixmap for this object. |
107,14 → 107,9 |
/** |
* @brief Returns a guarded pointer |
*/ |
const ScGuardedPtr<UndoObject>& undoObjectPtr() const; |
const ScGuardedPtr<UndoObject>& undoObjectPtr(); |
/** |
* @brief Check if current object is owned by some undo state |
*/ |
int undoStateCount() const; |
/** |
* @brief Method used when an undo/redo is requested. |
* |
* UndoObject must know how to handle the UndoState object given as a |
124,7 → 119,6 |
* @param isUndo If true undo is wanted else if false redo. |
*/ |
virtual void restore(UndoState* state, bool isUndo) = 0; |
private: |
/** @brief id number to be used with the next UndoObject */ |
static ulong m_nextId; |
/trunk/Scribus/scribus/scguardedptr.h |
---|
41,7 → 41,7 |
bool operator==( const ScGuardedPtr<T> &p ) const { return (T*)(*this) == (T*) p;} |
bool operator!= ( const ScGuardedPtr<T>& p ) const { return !( *this == p ); } |
bool isNull(void) const; |
bool isNull(void); |
T* operator->() const { return (T*)(data ? data->pointer : 0); } |
T& operator*() const { return *((T*)(data ? data->pointer : 0)); } |
107,7 → 107,7 |
}; |
template<typename T> |
bool ScGuardedPtr<T>::isNull(void) const |
bool ScGuardedPtr<T>::isNull(void) |
{ |
if (data) |
return (data->pointer == 0); |