diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kugar/lib/mspecialobject.cpp | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kugar/lib/mspecialobject.cpp')
-rw-r--r-- | kugar/lib/mspecialobject.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/kugar/lib/mspecialobject.cpp b/kugar/lib/mspecialobject.cpp new file mode 100644 index 000000000..c06830fd0 --- /dev/null +++ b/kugar/lib/mspecialobject.cpp @@ -0,0 +1,86 @@ +/*************************************************************************** + mspecialobject.cpp - Kugar report special field object + ------------------- + begin : Mon Aug 23 1999 + copyright : (C) 1999 by Mutiny Bay Software + email : info@mutinybaysoftware.com +***************************************************************************/ + +#include "mspecialobject.h" +#include "mutil.h" + +namespace Kugar +{ + +/** Constructor */ +MSpecialObject::MSpecialObject() : MLabelObject() +{ + // Set the defaults + type = MSpecialObject::Date; + format = MUtil::MDY_SLASH; +} + +/** Copy constructor */ +MSpecialObject::MSpecialObject( const MSpecialObject& mSpecialObject ) : MLabelObject( ( MLabelObject & ) mSpecialObject ) +{ + copy( &mSpecialObject ); +} + +/** Assignment operator */ +MSpecialObject MSpecialObject::operator=( const MSpecialObject& mSpecialObject ) +{ + if ( &mSpecialObject == this ) + return * this; + + // Copy the derived class's data + copy( &mSpecialObject ); + + // Copy the base class's data + ( ( MLabelObject & ) * this ) = mSpecialObject; + + return *this; +} + +/** Destructor */ +MSpecialObject::~MSpecialObject() +{} + +/** Sets the field's data string with a date */ +void MSpecialObject::setText( QDate d ) +{ + text = MUtil::formatDate( d, format ); +} + +/** Sets the field's data string with a page number */ +void MSpecialObject::setText( int page ) +{ + text.setNum( page ); +} + +/** Sets the field's data type */ +void MSpecialObject::setType( int t ) +{ + type = t; +} + +/** Gets the field's type */ +int MSpecialObject::getType() +{ + return type; +} + +/** Sets the field's date formatting */ +void MSpecialObject::setDateFormat( int f ) +{ + format = f; +} + +/** Copies member data from one object to another. + Used by the copy constructor and assignment operator */ +void MSpecialObject::copy( const MSpecialObject* mSpecialObject ) +{ + // Copy the fields's data type and format + type = mSpecialObject->type; +} + +} |