Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 22793 → Rev 22794

/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);
bool isNull(void) const;
 
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)
bool ScGuardedPtr<T>::isNull(void) const
{
if (data)
return (data->pointer == 0);
/trunk/Scribus/scribus/undoobject.cpp
66,7 → 66,7
return m_id;
}
 
QString UndoObject::getUName()
QString UndoObject::getUName() const
{
return m_uname;
}
76,7 → 76,7
m_uname = newUName;
}
 
QPixmap* UndoObject::getUPixmap()
QPixmap* UndoObject::getUPixmap() const
{
return m_upixmap;
}
86,7 → 86,14
m_upixmap = newUPixmap;
}
 
const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr()
const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr() const
{
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();
virtual QString getUName() const;
 
/**
* @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();
virtual QPixmap* getUPixmap() const;
 
/**
* @brief Set the pixmap for this object.
107,9 → 107,14
/**
* @brief Returns a guarded pointer
*/
const ScGuardedPtr<UndoObject>& undoObjectPtr();
const ScGuardedPtr<UndoObject>& undoObjectPtr() const;
 
/**
* @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
119,6 → 124,7
* @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;