summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoVariable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoVariable.cpp')
-rw-r--r--lib/kotext/KoVariable.cpp768
1 files changed, 384 insertions, 384 deletions
diff --git a/lib/kotext/KoVariable.cpp b/lib/kotext/KoVariable.cpp
index d110f02c..2e5663af 100644
--- a/lib/kotext/KoVariable.cpp
+++ b/lib/kotext/KoVariable.cpp
@@ -46,11 +46,11 @@
#include <kcalendarsystem.h>
#include <kaboutdata.h>
-#include <qstringlist.h>
-#include <qcombobox.h>
-#include <qvaluelist.h>
-#include <qdom.h>
-#include <qradiobutton.h>
+#include <tqstringlist.h>
+#include <tqcombobox.h>
+#include <tqvaluelist.h>
+#include <tqdom.h>
+#include <tqradiobutton.h>
#include "IsoDuration.h"
@@ -61,9 +61,9 @@ public:
{
m_lastPrintingDate.setTime_t(0); // Default is 1970-01-01 midnight locale time
}
- QDateTime m_lastPrintingDate;
- QDateTime m_creationDate;
- QDateTime m_modificationDate;
+ TQDateTime m_lastPrintingDate;
+ TQDateTime m_creationDate;
+ TQDateTime m_modificationDate;
};
@@ -83,32 +83,32 @@ KoVariableSettings::~KoVariableSettings()
d = 0;
}
-QDateTime KoVariableSettings::lastPrintingDate() const
+TQDateTime KoVariableSettings::lastPrintingDate() const
{
return d->m_lastPrintingDate;
}
-void KoVariableSettings::setLastPrintingDate( const QDateTime & _date)
+void KoVariableSettings::setLastPrintingDate( const TQDateTime & _date)
{
d->m_lastPrintingDate = _date;
}
-QDateTime KoVariableSettings::creationDate() const
+TQDateTime KoVariableSettings::creationDate() const
{
return d->m_creationDate;
}
-void KoVariableSettings::setCreationDate( const QDateTime & _date )
+void KoVariableSettings::setCreationDate( const TQDateTime & _date )
{
d->m_creationDate = _date;
}
-QDateTime KoVariableSettings::modificationDate() const
+TQDateTime KoVariableSettings::modificationDate() const
{
return d->m_modificationDate;
}
-void KoVariableSettings::setModificationDate( const QDateTime & _date)
+void KoVariableSettings::setModificationDate( const TQDateTime & _date)
{
d->m_modificationDate = _date;
}
@@ -123,7 +123,7 @@ void KoVariableSettings::saveOasis( KoXmlWriter &settingsWriter ) const
settingsWriter.addConfigItem( "displayfieldcode", m_displayFieldCode);
// m_startingPageNumber isn't saved to OASIS. Applications must use either
// style:page-number in the first parag of a page (see KoTextParag), or
- // style:first-page-number in style:page-layout, for spreadsheets etc.
+ // style:first-page-number in style:page-tqlayout, for spreadsheets etc.
if ( d->m_lastPrintingDate.isValid())
settingsWriter.addConfigItem("lastPrintingDate", d->m_lastPrintingDate.toString(Qt::ISODate));
@@ -146,29 +146,29 @@ void KoVariableSettings::loadOasis(const KoOasisSettings&settingsDoc)
m_displayComment = configurationSettings.parseConfigItemBool( "displaycomment", true );
m_displayFieldCode = configurationSettings.parseConfigItemBool( "displayfieldcode", false );
- QString str = configurationSettings.parseConfigItemString( "lastPrintingDate" );
+ TQString str = configurationSettings.parseConfigItemString( "lastPrintingDate" );
if ( !str.isEmpty() )
- d->m_lastPrintingDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_lastPrintingDate = TQDateTime::fromString( str, Qt::ISODate );
else
d->m_lastPrintingDate.setTime_t(0); // 1970-01-01 00:00:00.000 locale time
str = configurationSettings.parseConfigItemString( "creationDate" );
if ( !str.isEmpty() ) {
- d->m_creationDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_creationDate = TQDateTime::fromString( str, Qt::ISODate );
}
str = configurationSettings.parseConfigItemString( "modificationDate" );
if ( !str.isEmpty() )
- d->m_modificationDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_modificationDate = TQDateTime::fromString( str, Qt::ISODate );
// m_startingPageNumber isn't loaded from OASIS here. KWTextParag::loadOasis does it.
}
}
-void KoVariableSettings::save( QDomElement &parentElem )
+void KoVariableSettings::save( TQDomElement &tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "VARIABLESETTINGS" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "VARIABLESETTINGS" );
+ tqparentElem.appendChild( elem );
if(m_startingPageNumber!=1)
{
elem.setAttribute( "startingPageNumber", m_startingPageNumber );
@@ -188,9 +188,9 @@ void KoVariableSettings::save( QDomElement &parentElem )
elem.setAttribute("modificationDate", d->m_modificationDate.toString(Qt::ISODate));
}
-void KoVariableSettings::load( QDomElement &elem )
+void KoVariableSettings::load( TQDomElement &elem )
{
- QDomElement e = elem.namedItem( "VARIABLESETTINGS" ).toElement();
+ TQDomElement e = elem.namedItem( "VARIABLESETTINGS" ).toElement();
if (!e.isNull())
{
if(e.hasAttribute("startingPageNumber"))
@@ -205,16 +205,16 @@ void KoVariableSettings::load( QDomElement &elem )
m_displayFieldCode=(bool)e.attribute("displayfieldcode").toInt();
if (e.hasAttribute("lastPrintingDate"))
- d->m_lastPrintingDate = QDateTime::fromString( e.attribute( "lastPrintingDate" ), Qt::ISODate );
+ d->m_lastPrintingDate = TQDateTime::fromString( e.attribute( "lastPrintingDate" ), Qt::ISODate );
else
d->m_lastPrintingDate.setTime_t(0); // 1970-01-01 00:00:00.000 locale time
if (e.hasAttribute("creationDate")) {
- d->m_creationDate = QDateTime::fromString( e.attribute( "creationDate" ), Qt::ISODate );
+ d->m_creationDate = TQDateTime::fromString( e.attribute( "creationDate" ), Qt::ISODate );
}
if (e.hasAttribute("modificationDate"))
- d->m_modificationDate = QDateTime::fromString( e.attribute( "modificationDate" ), Qt::ISODate );
+ d->m_modificationDate = TQDateTime::fromString( e.attribute( "modificationDate" ), Qt::ISODate );
}
}
@@ -222,15 +222,15 @@ KoVariableDateFormat::KoVariableDateFormat() : KoVariableFormat()
{
}
-QString KoVariableDateFormat::convert( const QVariant& data ) const
+TQString KoVariableDateFormat::convert( const TQVariant& data ) const
{
- if ( data.type() != QVariant::Date && data.type() != QVariant::DateTime )
+ if ( data.type() != TQVariant::Date && data.type() != TQVariant::DateTime )
{
kdWarning(32500)<<" Error in KoVariableDateFormat::convert. Value is a "
<< data.typeName() << "(" << data.type() << ")" << endl;
// dateTime will be invalid, then set to 1970-01-01
}
- QDateTime dateTime ( data.toDateTime() );
+ TQDateTime dateTime ( data.toDateTime() );
if ( !dateTime.isValid() )
return i18n("No date set"); // e.g. old KWord documents
@@ -243,39 +243,39 @@ QString KoVariableDateFormat::convert( const QVariant& data ) const
else if ( m_strFormat.lower() == "localedatetimeshort" )
return KGlobal::locale()->formatDateTime( dateTime, true );
- QString tmp ( dateTime.toString(m_strFormat) );
+ TQString tmp ( dateTime.toString(m_strFormat) );
const int month = dateTime.date().month();
- tmp.replace("PPPP", KGlobal::locale()->calendar()->monthNamePossessive(month, false)); //long possessive month name
- tmp.replace("PPP", KGlobal::locale()->calendar()->monthNamePossessive(month, true)); //short possessive month name
+ tmp.tqreplace("PPPP", KGlobal::locale()->calendar()->monthNamePossessive(month, false)); //long possessive month name
+ tmp.tqreplace("PPP", KGlobal::locale()->calendar()->monthNamePossessive(month, true)); //short possessive month name
return tmp;
}
-QCString KoVariableDateFormat::key() const
+TQCString KoVariableDateFormat::key() const
{
return getKey( m_strFormat );
}
-QCString KoVariableDateFormat::getKey( const QString& props ) const
+TQCString KoVariableDateFormat::getKey( const TQString& props ) const
{
- return QCString("DATE") + props.utf8();
+ return TQCString("DATE") + props.utf8();
}
-void KoVariableDateFormat::load( const QCString &key )
+void KoVariableDateFormat::load( const TQCString &key )
{
- QCString params( key.mid( 4 ) ); // skip "DATE"
+ TQCString params( key.mid( 4 ) ); // skip "DATE"
if ( !params.isEmpty() )
{
if (params[0] == '1' || params[0] == '0') // old m_bShort crap
params = params.mid(1); // skip it
- m_strFormat = QString::fromUtf8( params );
+ m_strFormat = TQString::fromUtf8( params );
}
}
// Used by KoVariableFormatCollection::popupActionList(), to apply all formats
// to the current data, in the popup menu.
-QStringList KoVariableDateFormat::staticFormatPropsList()
+TQStringList KoVariableDateFormat::staticFormatPropsList()
{
- QStringList listDateFormat;
+ TQStringList listDateFormat;
listDateFormat<<"locale";
listDateFormat<<"localeshort";
listDateFormat<<"localedatetime";
@@ -301,9 +301,9 @@ QStringList KoVariableDateFormat::staticFormatPropsList()
// Used by dateformatwidget_impl
// TODO: shouldn't it apply the formats to the value, like the popupmenu does?
-QStringList KoVariableDateFormat::staticTranslatedFormatPropsList()
+TQStringList KoVariableDateFormat::staticTranslatedFormatPropsList()
{
- QStringList listDateFormat;
+ TQStringList listDateFormat;
listDateFormat<<i18n("Locale date format");
listDateFormat<<i18n("Short locale date format");
listDateFormat<<i18n("Locale date & time format");
@@ -333,20 +333,20 @@ KoVariableTimeFormat::KoVariableTimeFormat() : KoVariableFormat()
{
}
-void KoVariableTimeFormat::load( const QCString &key )
+void KoVariableTimeFormat::load( const TQCString &key )
{
- QCString params( key.mid( 4 ) );
+ TQCString params( key.mid( 4 ) );
if ( !params.isEmpty() )
- m_strFormat = QString::fromUtf8(params);
+ m_strFormat = TQString::fromUtf8(params);
}
-QString KoVariableTimeFormat::convert( const QVariant & time ) const
+TQString KoVariableTimeFormat::convert( const TQVariant & time ) const
{
- if ( time.type() != QVariant::Time )
+ if ( time.type() != TQVariant::Time )
{
kdDebug(32500)<<" Error in KoVariableTimeFormat::convert. Value is a "
<< time.typeName() << "(" << time.type() << ")" << endl;
- return QString::null;
+ return TQString();
}
if( m_strFormat.lower() == "locale" || m_strFormat.isEmpty() )
@@ -354,21 +354,21 @@ QString KoVariableTimeFormat::convert( const QVariant & time ) const
return time.toTime().toString(m_strFormat);
}
-QCString KoVariableTimeFormat::key() const
+TQCString KoVariableTimeFormat::key() const
{
return getKey( m_strFormat );
}
-QCString KoVariableTimeFormat::getKey( const QString& props ) const
+TQCString KoVariableTimeFormat::getKey( const TQString& props ) const
{
- return QCString("TIME") + props.utf8();
+ return TQCString("TIME") + props.utf8();
}
// Used by KoVariableFormatCollection::popupActionList(), to apply all formats
// to the current data, in the popup menu.
-QStringList KoVariableTimeFormat::staticFormatPropsList()
+TQStringList KoVariableTimeFormat::staticFormatPropsList()
{
- QStringList listTimeFormat;
+ TQStringList listTimeFormat;
listTimeFormat<<"locale";
listTimeFormat<<"hh:mm";
listTimeFormat<<"hh:mm:ss";
@@ -379,9 +379,9 @@ QStringList KoVariableTimeFormat::staticFormatPropsList()
}
// Used by timeformatwidget_impl
-QStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
+TQStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
{
- QStringList listTimeFormat;
+ TQStringList listTimeFormat;
listTimeFormat<<i18n("Locale format");
listTimeFormat<<"hh:mm";
listTimeFormat<<"hh:mm:ss";
@@ -393,49 +393,49 @@ QStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
////
-QString KoVariableStringFormat::convert( const QVariant & string ) const
+TQString KoVariableStringFormat::convert( const TQVariant & string ) const
{
- if ( string.type() != QVariant::String )
+ if ( string.type() != TQVariant::String )
{
kdDebug(32500)<<" Error in KoVariableStringFormat::convert. Value is a " << string.typeName() << endl;
- return QString::null;
+ return TQString();
}
return string.toString();
}
-QCString KoVariableStringFormat::key() const
+TQCString KoVariableStringFormat::key() const
{
- return getKey( QString::null );
+ return getKey( TQString() );
// TODO prefix & suffix
}
-QCString KoVariableStringFormat::getKey( const QString& props ) const
+TQCString KoVariableStringFormat::getKey( const TQString& props ) const
{
- return QCString("STRING") + props.utf8();
+ return TQCString("STRING") + props.utf8();
}
////
-QString KoVariableNumberFormat::convert( const QVariant &value ) const
+TQString KoVariableNumberFormat::convert( const TQVariant &value ) const
{
- if ( value.type() != QVariant::Int )
+ if ( value.type() != TQVariant::Int )
{
kdDebug(32500)<<" Error in KoVariableNumberFormat::convert. Value is a " << value.typeName() << endl;
- return QString::null;
+ return TQString();
}
- return QString::number( value.toInt() );
+ return TQString::number( value.toInt() );
}
-QCString KoVariableNumberFormat::key() const
+TQCString KoVariableNumberFormat::key() const
{
- return getKey(QString::null);
+ return getKey(TQString());
}
-QCString KoVariableNumberFormat::getKey( const QString& props ) const
+TQCString KoVariableNumberFormat::getKey( const TQString& props ) const
{
- return QCString("NUMB") + props.utf8();
+ return TQCString("NUMB") + props.utf8();
}
////
@@ -445,7 +445,7 @@ KoVariableFormatCollection::KoVariableFormatCollection()
m_dict.setAutoDelete( true );
}
-KoVariableFormat * KoVariableFormatCollection::format( const QCString &key )
+KoVariableFormat * KoVariableFormatCollection::format( const TQCString &key )
{
KoVariableFormat *f = m_dict[ key.data() ];
if (f)
@@ -454,12 +454,12 @@ KoVariableFormat * KoVariableFormatCollection::format( const QCString &key )
return createFormat( key );
}
-KoVariableFormat * KoVariableFormatCollection::createFormat( const QCString &key )
+KoVariableFormat * KoVariableFormatCollection::createFormat( const TQCString &key )
{
kdDebug(32500) << "KoVariableFormatCollection: creating format for key=" << key << endl;
KoVariableFormat * format = 0L;
// The first 4 chars identify the class
- QCString type = key.left(4);
+ TQCString type = key.left(4);
if ( type == "DATE" )
format = new KoVariableDateFormat();
else if ( type == "TIME" )
@@ -508,13 +508,13 @@ void KoVariableCollection::registerVariable( KoVariable *var )
void KoVariableCollection::unregisterVariable( KoVariable *var )
{
- variables.take( variables.findRef( var ) );
+ variables.take( variables.tqfindRef( var ) );
}
-QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
+TQValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
{
- QValueList<KoVariable *> modifiedVariables;
- QPtrListIterator<KoVariable> it( variables );
+ TQValueList<KoVariable *> modifiedVariables;
+ TQPtrListIterator<KoVariable> it( variables );
for ( ; it.current() ; ++it )
{
KoVariable* variable = it.current();
@@ -522,7 +522,7 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
continue;
if ( variable->type() == type || type == VT_ALL )
{
- QVariant oldValue = variable->varValue();
+ TQVariant oldValue = variable->varValue();
variable->recalc();
if(variable->height == 0)
variable->resize();
@@ -532,7 +532,7 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
if ( parag )
{
//kdDebug(32500) << "KoDoc::recalcVariables -> invalidating parag " << parag->paragId() << endl;
- parag->invalidate( 0 );
+ parag->tqinvalidate( 0 );
parag->setChanged( true );
}
}
@@ -541,27 +541,27 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
// TODO pass list of textdocuments as argument
// Or even better, call emitRepaintChanged on all modified textobjects
if( !modifiedVariables.isEmpty() )
- emit repaintVariable();
+ emit tqrepaintVariable();
#endif
return modifiedVariables;
}
-void KoVariableCollection::setVariableValue( const QString &name, const QString &value )
+void KoVariableCollection::setVariableValue( const TQString &name, const TQString &value )
{
varValues[ name ] = value;
}
-QString KoVariableCollection::getVariableValue( const QString &name ) const
+TQString KoVariableCollection::getVariableValue( const TQString &name ) const
{
- if ( !varValues.contains( name ) )
+ if ( !varValues.tqcontains( name ) )
return i18n( "No value" );
return varValues[ name ];
}
-bool KoVariableCollection::customVariableExist(const QString &varname) const
+bool KoVariableCollection::customVariableExist(const TQString &varname) const
{
- return varValues.contains( varname );
+ return varValues.tqcontains( varname );
}
void KoVariableCollection::setVariableSelected(KoVariable * var)
@@ -569,22 +569,22 @@ void KoVariableCollection::setVariableSelected(KoVariable * var)
m_varSelected=var;
}
-// TODO change to QValueList<KAction *>, but only once plugActionList takes that
-QPtrList<KAction> KoVariableCollection::popupActionList() const
+// TODO change to TQValueList<KAction *>, but only once plugActionList takes that
+TQPtrList<KAction> KoVariableCollection::popupActionList() const
{
- QPtrList<KAction> listAction;
+ TQPtrList<KAction> listAction;
// Insert list of actions that change the subtype
- const QStringList subTypeList = m_varSelected->subTypeList();
+ const TQStringList subTypeList = m_varSelected->subTypeList();
kdDebug() << k_funcinfo << "current subtype=" << m_varSelected->subType() << endl;
- QStringList::ConstIterator it = subTypeList.begin();
+ TQStringList::ConstIterator it = subTypeList.begin();
for ( int i = 0; it != subTypeList.end() ; ++it, ++i )
{
if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
{
// We store the subtype number as the action name
- QCString name; name.setNum(i);
+ TQCString name; name.setNum(i);
KToggleAction * act = new KToggleAction( *it, KShortcut(), 0, name );
- connect( act, SIGNAL(activated()), this, SLOT(slotChangeSubType()) );
+ connect( act, TQT_SIGNAL(activated()), this, TQT_SLOT(slotChangeSubType()) );
if ( i == m_varSelected->subType() )
act->setChecked( true );
//m_subTextMap.insert( act, i );
@@ -593,9 +593,9 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
}
// Insert list of actions that change the format properties
KoVariableFormat* format = m_varSelected->variableFormat();
- QString currentFormat = format->formatProperties();
+ TQString currentFormat = format->formatProperties();
- const QStringList list = format->formatPropsList();
+ const TQStringList list = format->formatPropsList();
it = list.begin();
for ( int i = 0; it != list.end() ; ++it, ++i )
{
@@ -605,10 +605,10 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
{
format->setFormatProperties( *it ); // temporary change
- QString text = format->convert( m_varSelected->varValue() );
+ TQString text = format->convert( m_varSelected->varValue() );
// We store the raw format as the action name
KToggleAction * act = new KToggleAction(text, KShortcut(), 0, (*it).utf8());
- connect( act, SIGNAL(activated()), this, SLOT(slotChangeFormat()) );
+ connect( act, TQT_SIGNAL(activated()), this, TQT_SLOT(slotChangeFormat()) );
if ( (*it) == currentFormat )
act->setChecked( true );
listAction.append( act );
@@ -623,7 +623,7 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
void KoVariableCollection::slotChangeSubType()
{
KAction * act = (KAction *)(sender());
- int menuNumber = QCString(act->name()).toInt();
+ int menuNumber = TQCString(act->name()).toInt();
int newSubType = m_varSelected->variableSubType(menuNumber);
kdDebug(32500) << "slotChangeSubType: menuNumber=" << menuNumber << " newSubType=" << newSubType << endl;
if ( m_varSelected->subType() != newSubType )
@@ -638,8 +638,8 @@ void KoVariableCollection::slotChangeSubType()
void KoVariableCollection::slotChangeFormat()
{
KAction * act = (KAction *)(sender());
- QString newFormat = QString::fromUtf8(act->name());
- QString oldFormat = m_varSelected->variableFormat()->formatProperties();
+ TQString newFormat = TQString::fromUtf8(act->name());
+ TQString oldFormat = m_varSelected->variableFormat()->formatProperties();
if (oldFormat != newFormat )
{
KCommand *cmd=new KoChangeVariableFormatProperties(
@@ -652,8 +652,8 @@ void KoVariableCollection::slotChangeFormat()
KoVariable * KoVariableCollection::createVariable( int type, short int subtype, KoVariableFormatCollection * coll, KoVariableFormat *varFormat,KoTextDocument *textdoc, KoDocument * doc, int _correct, bool _forceDefaultFormat, bool /*loadFootNote*/ )
{
Q_ASSERT( coll == m_formatCollection ); // why do we need a parameter ?!?
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
if ( varFormat == 0L )
{
// Get the default format for this variable (this method is only called in the interactive case, not when loading)
@@ -665,7 +665,7 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
varFormat = coll->format( KoDateVariable::defaultFormat() );
else
{
- QCString result = KoDateVariable::formatStr(_correct);
+ TQCString result = KoDateVariable::formatStr(_correct);
if ( result.isNull() )//we cancel insert variable
return 0L;
varFormat = coll->format( result );
@@ -679,7 +679,7 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
varFormat = coll->format( KoTimeVariable::defaultFormat() );
else
{
- QCString result = KoTimeVariable::formatStr(_correct);
+ TQCString result = KoTimeVariable::formatStr(_correct);
if ( result.isNull() )//we cancel insert variable
return 0L;
varFormat = coll->format( result );
@@ -727,16 +727,16 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
var = new KoFieldVariable( textdoc, subtype, varFormat,this,doc );
break;
case VT_CUSTOM:
- var = new KoCustomVariable( textdoc, QString::null, varFormat, this);
+ var = new KoCustomVariable( textdoc, TQString(), varFormat, this);
break;
case VT_MAILMERGE:
- var = new KoMailMergeVariable( textdoc, QString::null, varFormat ,this);
+ var = new KoMailMergeVariable( textdoc, TQString(), varFormat ,this);
break;
case VT_LINK:
- var = new KoLinkVariable( textdoc,QString::null, QString::null, varFormat ,this);
+ var = new KoLinkVariable( textdoc,TQString(), TQString(), varFormat ,this);
break;
case VT_NOTE:
- var = new KoNoteVariable( textdoc, QString::null, varFormat ,this);
+ var = new KoNoteVariable( textdoc, TQString(), varFormat ,this);
break;
}
Q_ASSERT( var );
@@ -744,20 +744,20 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
}
-KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context )
+KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context )
{
- const QString localName( tag.localName() );
+ const TQString localName( tag.localName() );
const bool isTextNS = tag.namespaceURI() == KoXmlNS::text;
- QString key;
+ TQString key;
int type = -1;
if ( isTextNS )
{
if ( localName.endsWith( "date" ) || localName.endsWith( "time" ) )
{
- QString dataStyleName = tag.attributeNS( KoXmlNS::style, "data-style-name", QString::null );
- QString dateFormat = "locale";
+ TQString dataStyleName = tag.attributeNS( KoXmlNS::style, "data-style-name", TQString() );
+ TQString dateFormat = "locale";
const KoOasisStyles::DataFormatsMap& map = context.oasisStyles().dataFormats();
- KoOasisStyles::DataFormatsMap::const_iterator it = map.find( dataStyleName );
+ KoOasisStyles::DataFormatsMap::const_iterator it = map.tqfind( dataStyleName );
if ( it != map.end() )
dateFormat = (*it).formatStr;
@@ -835,7 +835,7 @@ KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const
return loadOasisFieldCreateVariable( textdoc, tag, context, key, type );
}
-KoVariable* KoVariableCollection::loadOasisFieldCreateVariable( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context, const QString &key, int type )
+KoVariable* KoVariableCollection::loadOasisFieldCreateVariable( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context, const TQString &key, int type )
{
KoVariableFormat * varFormat = key.isEmpty() ? 0 : m_formatCollection->format( key.latin1() );
// If varFormat is 0 (no key specified), the default format will be used.
@@ -865,9 +865,9 @@ KoVariable::~KoVariable()
//delete d;
}
-QStringList KoVariable::subTypeList()
+TQStringList KoVariable::subTypeList()
{
- return QStringList();
+ return TQStringList();
}
void KoVariable::resize()
@@ -875,15 +875,15 @@ void KoVariable::resize()
if ( m_deleted )
return;
KoTextFormat *fmt = format();
- QFontMetrics fm = fmt->refFontMetrics();
- QString txt = text();
+ TQFontMetrics fm = fmt->refFontMetrics();
+ TQString txt = text();
width = 0;
// size at 100%
for ( int i = 0 ; i < (int)txt.length() ; ++i )
width += fm.width( txt[i] ); // was fm.charWidth(txt,i), but see drawCustomItemHelper...
// zoom to LU
- width = qRound( KoTextZoomHandler::ptToLayoutUnitPt( width ) );
+ width = tqRound( KoTextZoomHandler::ptToLayoutUnitPt( width ) );
height = fmt->height();
m_ascent = fmt->ascent();
//kdDebug(32500) << "KoVariable::resize text=" << txt << " width=" << width << " height=" << height << " ascent=" << m_ascent << endl;
@@ -896,21 +896,21 @@ void KoVariable::recalcAndRepaint()
if ( parag )
{
//kdDebug(32500) << "KoVariable::recalcAndRepaint -> invalidating parag " << parag->paragId() << endl;
- parag->invalidate( 0 );
+ parag->tqinvalidate( 0 );
parag->setChanged( true );
}
textDocument()->emitRepaintChanged();
}
-QString KoVariable::fieldCode()
+TQString KoVariable::fieldCode()
{
return i18n("Variable");
}
-QString KoVariable::text(bool realValue)
+TQString KoVariable::text(bool realValue)
{
KoTextFormat *fmt = format();
- QString str;
+ TQString str;
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
str = fieldCode();
else
@@ -919,15 +919,15 @@ QString KoVariable::text(bool realValue)
return fmt->displayedString( str);
}
-void KoVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
KoTextFormat * fmt = format();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
- QFont font( fmt->screenFont( zh ) );
+ TQFont font( fmt->screenFont( zh ) );
drawCustomItemHelper( p, x, y, wpix, hpix, ascentpix, cg, selected, offset, fmt, font, fmt->color(), drawingShadow );
}
-void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const QColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const QFont& font, QColor textColor, bool drawingShadow )
+void KoVariable::drawCustomItemHelper( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const TQColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const TQFont& font, TQColor textColor, bool drawingShadow )
{
// Important: the y value already includes the difference between the parag baseline
// and the char's own baseline (ascent) (see paintDefault in korichtext.cpp)
@@ -946,26 +946,26 @@ void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int
}
else if ( selected )
{
- textColor = cg.color( QColorGroup::HighlightedText );
- p->setPen( QPen( textColor ) );
- p->fillRect( x, y, wpix, hpix, cg.color( QColorGroup::Highlight ) );
+ textColor = cg.color( TQColorGroup::HighlightedText );
+ p->setPen( TQPen( textColor ) );
+ p->fillRect( x, y, wpix, hpix, cg.color( TQColorGroup::Highlight ) );
}
else if ( textDocument() && textDocument()->drawFormattingChars()
- && p->device()->devType() != QInternal::Printer )
+ && p->device()->devType() != TQInternal::Printer )
{
- textColor = cg.color( QColorGroup::Highlight );
- p->setPen( QPen ( textColor, 0, Qt::DotLine ) );
+ textColor = cg.color( TQColorGroup::Highlight );
+ p->setPen( TQPen ( textColor, 0, TQt::DotLine ) );
p->drawRect( x, y, wpix, hpix );
}
else {
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( p );
- p->setPen( QPen( textColor ) );
+ p->setPen( TQPen( textColor ) );
}
p->setFont( font ); // already done by KoTextCustomItem::draw but someone might
// change the font passed to drawCustomItemHelper (e.g. KoLinkVariable)
- QString str = text();
+ TQString str = text();
KoTextParag::drawFontEffects( p, fmt, zh, font, textColor, x, ascentpix, wpix, y, hpix, str[0] );
int posY = y + ascentpix + offset;
if ( fmt->vAlign() == KoTextFormat::AlignSubScript )
@@ -978,49 +978,49 @@ void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int
//p->drawText( x, posY, str );
// We can't just drawText, it wouldn't use the same kerning as the one
// that resize() planned for [which is zoom-independent].
- // We need to do the layout using layout units instead, so for simplicity
+ // We need to do the tqlayout using tqlayout units instead, so for simplicity
// I just draw every char individually (whereas KoTextFormatter/KoTextParag
// detect runs of text that can be drawn together)
const int len = str.length();
int xLU = zh->pixelToLayoutUnitX( x );
- QFontMetrics fm = fmt->refFontMetrics();
+ TQFontMetrics fm = fmt->refFontMetrics();
for ( int i = 0; i < len; ++i )
{
- const QChar ch = str[i];
- p->drawText( x, posY, ch );
- // Do like KoTextFormatter: do the layout in layout units.
+ const TQChar ch = str[i];
+ p->drawText( x, posY, TQString(ch) );
+ // Do like KoTextFormatter: do the tqlayout in tqlayout units.
xLU += KoTextZoomHandler::ptToLayoutUnitPt( fm.width( ch ) );
- // And then compute the X position in pixels from the layout unit X.
- x = zh->layoutUnitToPixelX( xLU );
+ // And then compute the X position in pixels from the tqlayout unit X.
+ x = zh->tqlayoutUnitToPixelX( xLU );
}
p->restore();
}
-void KoVariable::save( QDomElement &parentElem )
+void KoVariable::save( TQDomElement &tqparentElem )
{
//kdDebug(32500) << "KoVariable::save" << endl;
- QDomElement variableElem = parentElem.ownerDocument().createElement( "VARIABLE" );
- parentElem.appendChild( variableElem );
- QDomElement typeElem = parentElem.ownerDocument().createElement( "TYPE" );
+ TQDomElement variableElem = tqparentElem.ownerDocument().createElement( "VARIABLE" );
+ tqparentElem.appendChild( variableElem );
+ TQDomElement typeElem = tqparentElem.ownerDocument().createElement( "TYPE" );
variableElem.appendChild( typeElem );
typeElem.setAttribute( "type", static_cast<int>( type() ) );
//// Of course, saving the key is ugly. We'll drop this when
//// switching to the OO format.
- typeElem.setAttribute( "key", m_varFormat->key() );
+ typeElem.setAttribute( "key", m_varFormat->key().data() );
typeElem.setAttribute( "text", text(true) );
if ( correctValue() != 0)
typeElem.setAttribute( "correct", correctValue() );
saveVariable( variableElem );
}
-void KoVariable::load( QDomElement & )
+void KoVariable::load( TQDomElement & )
{
}
-void KoVariable::loadOasis( const QDomElement &/*elem*/, KoOasisContext& /*context*/ )
+void KoVariable::loadOasis( const TQDomElement &/*elem*/, KoOasisContext& /*context*/ )
{
// nothing to do here, reimplemented in subclasses (make it pure virtual?)
}
@@ -1044,11 +1044,11 @@ void KoVariable::setVariableFormat( KoVariableFormat *_varFormat )
} \
}
-QString KoVariable::convertKlocaleToQDateTimeFormat( const QString & _format )
+TQString KoVariable::convertKlocaleToTQDateTimeFormat( const TQString & _format )
{
- QString newFormat;
- QString format( _format );
- QString text;
+ TQString newFormat;
+ TQString format( _format );
+ TQString text;
do
{
if ( format.startsWith( "%Y" ) )
@@ -1176,7 +1176,7 @@ KoDateVariable::KoDateVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoDateVariable::fieldCode()
+TQString KoDateVariable::fieldCode()
{
if ( m_subtype == VST_DATE_FIX )
return i18n("Date (Fixed)");
@@ -1195,7 +1195,7 @@ QString KoDateVariable::fieldCode()
void KoDateVariable::resize()
{
KoTextFormat * fmt = format();
- QString oldLanguage;
+ TQString oldLanguage;
if ( !fmt->language().isEmpty())
{
oldLanguage=KGlobal::locale()->language();
@@ -1211,7 +1211,7 @@ void KoDateVariable::resize()
void KoDateVariable::recalc()
{
if ( m_subtype == VST_DATE_CURRENT )
- m_varValue = QDateTime::currentDateTime().addDays(m_correctDate);
+ m_varValue = TQDateTime(TQDateTime::tqcurrentDateTime().addDays(m_correctDate));
else if ( m_subtype == VST_DATE_LAST_PRINTING )
m_varValue = m_varColl->variableSetting()->lastPrintingDate();
else if ( m_subtype == VST_DATE_CREATE_FILE )
@@ -1222,17 +1222,17 @@ void KoDateVariable::recalc()
{
// Only if never set before (i.e. upon insertion)
if ( m_varValue.isNull() )
- m_varValue = QDateTime::currentDateTime().addDays(m_correctDate);
+ m_varValue = TQDateTime(TQDateTime::tqcurrentDateTime().addDays(m_correctDate));
}
resize();
}
-void KoDateVariable::saveVariable( QDomElement& varElem )
+void KoDateVariable::saveVariable( TQDomElement& varElem )
{
- QDomElement elem = varElem.ownerDocument().createElement( "DATE" );
+ TQDomElement elem = varElem.ownerDocument().createElement( "DATE" );
varElem.appendChild( elem );
- QDate date = m_varValue.toDate(); // works with Date and DateTime
+ TQDate date = m_varValue.toDate(); // works with Date and DateTime
date = date.addDays( -m_correctDate );//remove correctDate value otherwise value stored is bad
elem.setAttribute( "year", date.year() );
elem.setAttribute( "month", date.month() );
@@ -1240,20 +1240,20 @@ void KoDateVariable::saveVariable( QDomElement& varElem )
elem.setAttribute( "fix", m_subtype == VST_DATE_FIX ); // for compat
elem.setAttribute( "correct", m_correctDate);
elem.setAttribute( "subtype", m_subtype);
- if ( m_varValue.type() == QVariant::DateTime )
+ if ( m_varValue.type() == TQVariant::DateTime )
{
- QTime time = m_varValue.toTime();
+ TQTime time = m_varValue.toTime();
elem.setAttribute( "hour", time.hour() );
elem.setAttribute( "minute", time.minute() );
elem.setAttribute( "second", time.second() );
}
}
-void KoDateVariable::load( QDomElement& elem )
+void KoDateVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "DATE" ).toElement();
+ TQDomElement e = elem.namedItem( "DATE" ).toElement();
if (!e.isNull())
{
const bool fix = e.attribute("fix").toInt() == 1;
@@ -1268,13 +1268,13 @@ void KoDateVariable::load( QDomElement& elem )
const int min = e.attribute("minute").toInt();
const int s = e.attribute("second").toInt();
const int ms = e.attribute("msecond").toInt();
- QDate date( y, month, d );
+ TQDate date( y, month, d );
date = date.addDays( m_correctDate );
- const QTime time( h, min, s, ms );
+ const TQTime time( h, min, s, ms );
if (time.isValid())
- m_varValue = QVariant ( QDateTime( date, time ) );
+ m_varValue = TQVariant ( TQDateTime( date, time ) );
else
- m_varValue = QVariant( date );
+ m_varValue = TQVariant( date );
}
//old date variable format
m_subtype = fix ? VST_DATE_FIX : VST_DATE_CURRENT;
@@ -1306,7 +1306,7 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.startElement( "text:modification-date" );
break;
}
- QString value( m_varFormat->formatProperties() );
+ TQString value( m_varFormat->formatProperties() );
bool klocaleFormat = false;
if ( value.lower() == "locale" ||
value.isEmpty() ||
@@ -1319,9 +1319,9 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
else if ( value.lower() == "localeshort" )
value = KGlobal::locale()->dateFormatShort();
else if ( value.lower() == "localedatetime" )
- value = QString( "%1 %2" ).arg( KGlobal::locale()->dateFormat() ).arg( KGlobal::locale()->timeFormat() );
+ value = TQString( "%1 %2" ).tqarg( KGlobal::locale()->dateFormat() ).tqarg( KGlobal::locale()->timeFormat() );
else if ( value.lower() == "localedatetimeshort" )
- value = QString( "%1 %2" ).arg( KGlobal::locale()->dateFormatShort() ).arg( KGlobal::locale()->timeFormat() );
+ value = TQString( "%1 %2" ).tqarg( KGlobal::locale()->dateFormatShort() ).tqarg( KGlobal::locale()->timeFormat() );
klocaleFormat = true;
}
writer.addAttribute( "style:data-style-name", KoOasisStyles::saveOasisDateStyle(context.mainStyles(), value, klocaleFormat ) );
@@ -1331,22 +1331,22 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.endElement();
}
-void KoDateVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoDateVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "date" ) // current (or fixed) date
{
// Standard form of the date is in text:date-value. Example: 2004-01-21T10:57:05
- const QString dateValue = elem.attributeNS( KoXmlNS::text, "date-value", QString::null);
- QDateTime dt;
- if ( !dateValue.isEmpty() ) // avoid QDate warning
- dt = QDate::fromString(dateValue, Qt::ISODate);
+ const TQString dateValue = elem.attributeNS( KoXmlNS::text, "date-value", TQString());
+ TQDateTime dt;
+ if ( !dateValue.isEmpty() ) // avoid TQDate warning
+ dt = TQDate::fromString(dateValue, Qt::ISODate);
- bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", QString::null)=="true");
+ bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", TQString())=="true");
if (!dt.isValid())
fixed = false; // OOo docs say so: not valid = current datetime
if ( fixed )
- m_varValue = QVariant( dt );
+ m_varValue = TQVariant( dt );
m_subtype = fixed ? VST_DATE_FIX : VST_DATE_CURRENT;
}
// For all those the value of the date will be retrieved from meta.xml
@@ -1356,14 +1356,14 @@ void KoDateVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*conte
m_subtype = VST_DATE_CREATE_FILE;
else if ( localName.startsWith( "modification" ) )
m_subtype = VST_DATE_MODIFY_FILE;
- const QString adjustStr = elem.attributeNS( KoXmlNS::text, "date-adjust", QString::null );
+ const TQString adjustStr = elem.attributeNS( KoXmlNS::text, "date-adjust", TQString() );
if ( !adjustStr.isEmpty() )
m_correctDate = ISODurationToDays( adjustStr );
}
-QStringList KoDateVariable::actionTexts()
+TQStringList KoDateVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Current Date (fixed)" );
lst << i18n( "Current Date (variable)" );
lst << i18n( "Date of Last Printing" );
@@ -1372,20 +1372,20 @@ QStringList KoDateVariable::actionTexts()
return lst;
}
-QStringList KoDateVariable::subTypeList()
+TQStringList KoDateVariable::subTypeList()
{
return KoDateVariable::actionTexts();
}
-QCString KoDateVariable::defaultFormat()
+TQCString KoDateVariable::defaultFormat()
{
- return QCString("DATE") + "locale";
+ return TQCString("DATE") + "locale";
}
-QCString KoDateVariable::formatStr(int & correct)
+TQCString KoDateVariable::formatStr(int & correct)
{
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
KDialogBase* dialog=new KDialogBase(0, 0, true, i18n("Date Format"), KDialogBase::Ok|KDialogBase::Cancel);
DateFormatWidget* widget=new DateFormatWidget(dialog);
int count=0;
@@ -1397,12 +1397,12 @@ QCString KoDateVariable::formatStr(int & correct)
const int noe=config->readNumEntry("Number Of Entries", 5);
for(int i=0;i<noe;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
- const QString tmpString(config->readEntry("Last Used"+num));
+ const TQString tmpString(config->readEntry("Last Used"+num));
if(tmpString.startsWith("locale"))
continue;
- else if(stringList.contains(tmpString))
+ else if(stringList.tqcontains(tmpString))
continue;
else if(!tmpString.isEmpty())
{
@@ -1418,12 +1418,12 @@ QCString KoDateVariable::formatStr(int & correct)
widget->combo1->insertStringList(stringList);
}
if(false) { // ### TODO: select the last used item
- QComboBox *combo= widget->combo1;
+ TQComboBox *combo= widget->combo1;
combo->setCurrentItem(combo->count() -1);
widget->updateLabel();
}
- if(dialog->exec()==QDialog::Accepted)
+ if(dialog->exec()==TQDialog::Accepted)
{
string = widget->resultString().utf8();
correct = widget->correctValue();
@@ -1438,13 +1438,13 @@ QCString KoDateVariable::formatStr(int & correct)
stringList.prepend(string);
for(int i=0;i<=count;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
config->writeEntry("Last Used"+num, stringList[i]);
}
config->sync();
delete dialog;
- return QCString("DATE") + string;
+ return TQCString("DATE") + string;
}
/******************************************************************/
@@ -1455,7 +1455,7 @@ KoTimeVariable::KoTimeVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoTimeVariable::fieldCode()
+TQString KoTimeVariable::fieldCode()
{
return (m_subtype == VST_TIME_FIX)?i18n("Time (Fixed)"):i18n("Time");
}
@@ -1466,7 +1466,7 @@ void KoTimeVariable::resize()
KoTextFormat * fmt = format();
if ( !fmt->language().isEmpty() )
{
- QString oldLanguage = KGlobal::locale()->language();
+ TQString oldLanguage = KGlobal::locale()->language();
bool changeLanguage = KGlobal::locale()->setLanguage( fmt->language() );
KoVariable::resize();
if ( changeLanguage )
@@ -1479,23 +1479,23 @@ void KoTimeVariable::resize()
void KoTimeVariable::recalc()
{
if ( m_subtype == VST_TIME_CURRENT )
- m_varValue = QVariant( QTime::currentTime().addSecs(60*m_correctTime));
+ m_varValue = TQVariant( TQTime(TQTime::currentTime().addSecs(60*m_correctTime)));
else
{
// Only if never set before (i.e. upon insertion)
if ( m_varValue.toTime().isNull() )
- m_varValue = QVariant( QTime::currentTime().addSecs(60*m_correctTime));
+ m_varValue = TQVariant( TQTime(TQTime::currentTime().addSecs(60*m_correctTime)));
}
resize();
}
-void KoTimeVariable::saveVariable( QDomElement& parentElem )
+void KoTimeVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "TIME" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "TIME" );
+ tqparentElem.appendChild( elem );
- QTime time = m_varValue.toTime();
+ TQTime time = m_varValue.toTime();
time = time.addSecs(-60*m_correctTime);
elem.setAttribute( "hour", time.hour() );
elem.setAttribute( "minute", time.minute() );
@@ -1505,11 +1505,11 @@ void KoTimeVariable::saveVariable( QDomElement& parentElem )
elem.setAttribute( "correct", m_correctTime );
}
-void KoTimeVariable::load( QDomElement& elem )
+void KoTimeVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "TIME" ).toElement();
+ TQDomElement e = elem.namedItem( "TIME" ).toElement();
if (!e.isNull())
{
int h = e.attribute("hour").toInt();
@@ -1522,10 +1522,10 @@ void KoTimeVariable::load( QDomElement& elem )
bool fix = static_cast<bool>( e.attribute("fix").toInt() );
if ( fix )
{
- QTime time;
+ TQTime time;
time.setHMS( h, m, s, ms );
time = time.addSecs( 60*m_correctTime );
- m_varValue = QVariant( time);
+ m_varValue = TQVariant( time);
}
m_subtype = fix ? VST_TIME_FIX : VST_TIME_CURRENT;
@@ -1533,22 +1533,22 @@ void KoTimeVariable::load( QDomElement& elem )
}
}
-void KoTimeVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoTimeVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
Q_ASSERT( localName == "time" ); // caller checked for it
if ( localName == "time" ) // current (or fixed) time
{
- // Use QDateTime to work around a possible problem of QTime::fromString in Qt 3.2.2
- QDateTime dt(QDateTime::fromString(elem.attributeNS( KoXmlNS::text, "time-value", QString::null), Qt::ISODate));
+ // Use TQDateTime to work around a possible problem of TQTime::fromString in TQt 3.2.2
+ TQDateTime dt(TQDateTime::fromString(elem.attributeNS( KoXmlNS::text, "time-value", TQString()), Qt::ISODate));
- bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", QString::null)=="true");
+ bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", TQString())=="true");
if (!dt.isValid())
fixed = false; // OOo docs say so: not valid = current datetime
if ( fixed )
- m_varValue = QVariant( dt.time() );
+ m_varValue = TQVariant( dt.time() );
m_subtype = fixed ? VST_TIME_FIX : VST_TIME_CURRENT;
- QString adjustStr = elem.attributeNS( KoXmlNS::text, "time-adjust", QString::null );
+ TQString adjustStr = elem.attributeNS( KoXmlNS::text, "time-adjust", TQString() );
if ( !adjustStr.isEmpty() )
m_correctTime = ISODurationToMinutes( adjustStr );
}
@@ -1566,7 +1566,7 @@ void KoTimeVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.addAttribute( "text:time-value", m_varValue.toTime().toString( Qt::ISODate ) );
}
- QString value( m_varFormat->formatProperties() );
+ TQString value( m_varFormat->formatProperties() );
bool klocaleFormat = false;
if ( value.lower() == "locale" )
{
@@ -1581,23 +1581,23 @@ void KoTimeVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
}
-QStringList KoTimeVariable::actionTexts()
+TQStringList KoTimeVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Current Time (fixed)" );
lst << i18n( "Current Time (variable)" );
return lst;
}
-QStringList KoTimeVariable::subTypeList()
+TQStringList KoTimeVariable::subTypeList()
{
return KoTimeVariable::actionTexts();
}
-QCString KoTimeVariable::formatStr(int & _correct)
+TQCString KoTimeVariable::formatStr(int & _correct)
{
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
KDialogBase* dialog=new KDialogBase(0, 0, true, i18n("Time Format"), KDialogBase::Ok|KDialogBase::Cancel);
TimeFormatWidget* widget=new TimeFormatWidget(dialog);
dialog->setMainWidget(widget);
@@ -1609,12 +1609,12 @@ QCString KoTimeVariable::formatStr(int & _correct)
const int noe=config->readNumEntry("Number Of Entries", 5);
for(int i=0;i<noe;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
- QString tmpString(config->readEntry("Last Used"+num));
+ TQString tmpString(config->readEntry("Last Used"+num));
if(tmpString.startsWith("locale"))
continue;
- else if(stringList.contains(tmpString))
+ else if(stringList.tqcontains(tmpString))
continue;
else if(!tmpString.isEmpty())
{
@@ -1630,10 +1630,10 @@ QCString KoTimeVariable::formatStr(int & _correct)
}
if(false) // ### TODO: select the last used item
{
- QComboBox *combo= widget->combo1;
+ TQComboBox *combo= widget->combo1;
combo->setCurrentItem(combo->count() -1);
}
- if(dialog->exec()==QDialog::Accepted)
+ if(dialog->exec()==TQDialog::Accepted)
{
string = widget->resultString().utf8();
_correct = widget->correctValue();
@@ -1648,36 +1648,36 @@ QCString KoTimeVariable::formatStr(int & _correct)
stringList.prepend(string);
for(int i=0;i<=count;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
config->writeEntry("Last Used"+num, stringList[i]);
}
config->sync();
delete dialog;
- return QCString("TIME"+string );
+ return TQCString("TIME"+string );
}
-QCString KoTimeVariable::defaultFormat()
+TQCString KoTimeVariable::defaultFormat()
{
- return QCString(QCString("TIME")+QCString("locale") );
+ return TQCString(TQCString("TIME")+TQCString("locale") );
}
/******************************************************************/
/* Class: KoCustomVariable */
/******************************************************************/
-KoCustomVariable::KoCustomVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl )
+KoCustomVariable::KoCustomVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
{
- m_varValue = QVariant( name );
+ m_varValue = TQVariant( name );
}
-QString KoCustomVariable::fieldCode()
+TQString KoCustomVariable::fieldCode()
{
return i18n("Custom Variable");
}
-QString KoCustomVariable::text(bool realValue)
+TQString KoCustomVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -1687,28 +1687,28 @@ QString KoCustomVariable::text(bool realValue)
-void KoCustomVariable::saveVariable( QDomElement& parentElem )
+void KoCustomVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "CUSTOM" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "CUSTOM" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "name", m_varValue.toString() );
elem.setAttribute( "value", value() );
}
-void KoCustomVariable::load( QDomElement& elem )
+void KoCustomVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "CUSTOM" ).toElement();
+ TQDomElement e = elem.namedItem( "CUSTOM" ).toElement();
if (!e.isNull())
{
- m_varValue = QVariant (e.attribute( "name" ));
+ m_varValue = TQVariant (e.attribute( "name" ));
setValue( e.attribute( "value" ) );
}
}
-void KoCustomVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoCustomVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
// We treat all those the same. For OO/OpenDocument the difference is that
// - user-field-get is related to text:user-field-decls in <body>
// - variable-set is related to variable-decls (defined in <body>);
@@ -1717,7 +1717,7 @@ void KoCustomVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*con
if ( localName == "variable-set"
|| localName == "user-defined"
|| localName == "user-field-get" ) {
- m_varValue = elem.attributeNS( KoXmlNS::text, "name", QString::null );
+ m_varValue = elem.attributeNS( KoXmlNS::text, "name", TQString() );
setValue( elem.text() );
}
}
@@ -1731,19 +1731,19 @@ void KoCustomVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*contex
writer.endElement();
}
-QString KoCustomVariable::value() const
+TQString KoCustomVariable::value() const
{
return m_varColl->getVariableValue( m_varValue.toString() );
}
-void KoCustomVariable::setValue( const QString &v )
+void KoCustomVariable::setValue( const TQString &v )
{
m_varColl->setVariableValue( m_varValue.toString(), v );
}
-QStringList KoCustomVariable::actionTexts()
+TQStringList KoCustomVariable::actionTexts()
{
- return QStringList( i18n( "Custom..." ) );
+ return TQStringList( i18n( "Custom..." ) );
}
void KoCustomVariable::recalc()
@@ -1754,18 +1754,18 @@ void KoCustomVariable::recalc()
/******************************************************************/
/* Class: KoMailMergeVariable */
/******************************************************************/
-KoMailMergeVariable::KoMailMergeVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoMailMergeVariable::KoMailMergeVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat, _varColl )
{
- m_varValue = QVariant ( name );
+ m_varValue = TQVariant ( name );
}
-QString KoMailMergeVariable::fieldCode()
+TQString KoMailMergeVariable::fieldCode()
{
return i18n("Mail Merge");
}
-void KoMailMergeVariable::loadOasis( const QDomElement &/*elem*/, KoOasisContext& /*context*/ )
+void KoMailMergeVariable::loadOasis( const TQDomElement &/*elem*/, KoOasisContext& /*context*/ )
{
// TODO
}
@@ -1777,38 +1777,38 @@ void KoMailMergeVariable::saveOasis( KoXmlWriter& /*writer*/, KoSavingContext& /
-void KoMailMergeVariable::saveVariable( QDomElement& parentElem )
+void KoMailMergeVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "MAILMERGE" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "MAILMERGE" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "name", m_varValue.toString() );
}
-void KoMailMergeVariable::load( QDomElement& elem )
+void KoMailMergeVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "MAILMERGE" ).toElement();
+ TQDomElement e = elem.namedItem( "MAILMERGE" ).toElement();
if (!e.isNull())
- m_varValue = QVariant( e.attribute( "name" ) );
+ m_varValue = TQVariant( e.attribute( "name" ) );
}
-QString KoMailMergeVariable::value() const
+TQString KoMailMergeVariable::value() const
{
- return QString();//m_doc->getMailMergeDataBase()->getValue( m_name );
+ return TQString();//m_doc->getMailMergeDataBase()->getValue( m_name );
}
-QString KoMailMergeVariable::text(bool /*realValue*/)
+TQString KoMailMergeVariable::text(bool /*realValue*/)
{
// ## should use a format maybe
- QString v = value();
+ TQString v = value();
if ( v == name() )
return "<" + v + ">";
return v;
}
-QStringList KoMailMergeVariable::actionTexts()
+TQStringList KoMailMergeVariable::actionTexts()
{
- return QStringList( i18n( "&Mail Merge..." ) );
+ return TQStringList( i18n( "&Mail Merge..." ) );
}
/******************************************************************/
@@ -1819,7 +1819,7 @@ KoPageVariable::KoPageVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoPageVariable::fieldCode()
+TQString KoPageVariable::fieldCode()
{
if ( m_subtype == VST_PGNUM_CURRENT )
return i18n("Page Current Num");
@@ -1837,10 +1837,10 @@ QString KoPageVariable::fieldCode()
}
-void KoPageVariable::saveVariable( QDomElement& parentElem )
+void KoPageVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement pgNumElem = parentElem.ownerDocument().createElement( "PGNUM" );
- parentElem.appendChild( pgNumElem );
+ TQDomElement pgNumElem = tqparentElem.ownerDocument().createElement( "PGNUM" );
+ tqparentElem.appendChild( pgNumElem );
pgNumElem.setAttribute( "subtype", m_subtype );
if ( m_subtype != VST_CURRENT_SECTION )
pgNumElem.setAttribute( "value", m_varValue.toInt() );
@@ -1848,18 +1848,18 @@ void KoPageVariable::saveVariable( QDomElement& parentElem )
pgNumElem.setAttribute( "value", m_varValue.toString() );
}
-void KoPageVariable::load( QDomElement& elem )
+void KoPageVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement pgNumElem = elem.namedItem( "PGNUM" ).toElement();
+ TQDomElement pgNumElem = elem.namedItem( "PGNUM" ).toElement();
if (!pgNumElem.isNull())
{
m_subtype = pgNumElem.attribute("subtype").toInt();
// ### This could use the format...
if ( m_subtype != VST_CURRENT_SECTION )
- m_varValue = QVariant(pgNumElem.attribute("value").toInt());
+ m_varValue = TQVariant(pgNumElem.attribute("value").toInt());
else
- m_varValue = QVariant(pgNumElem.attribute("value"));
+ m_varValue = TQVariant(pgNumElem.attribute("value"));
}
}
@@ -1905,28 +1905,28 @@ void KoPageVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
}
}
-void KoPageVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoPageVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "page-number" )
{
m_subtype = VST_PGNUM_CURRENT;
if ( elem.hasAttributeNS( KoXmlNS::text, "select-page") )
{
- const QString select = elem.attributeNS( KoXmlNS::text, "select-page", QString::null);
+ const TQString select = elem.attributeNS( KoXmlNS::text, "select-page", TQString());
if (select == "previous")
m_subtype = VST_PGNUM_PREVIOUS;
else if (select == "next")
m_subtype = VST_PGNUM_NEXT;
}
// Missing: fixed, page adjustment, formatting style
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "chapter" )
{
m_subtype = VST_CURRENT_SECTION;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
// text:display attribute can be name, number (i.e. with prefix/suffix),
// number-and-name, plain-number-and-name, plain-number
// TODO: a special format class for this, so that it can be easily switched using the RMB
@@ -1934,13 +1934,13 @@ void KoPageVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*conte
else if ( localName == "page-count" )
{
m_subtype = VST_PGNUM_TOTAL;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
}
}
-QStringList KoPageVariable::actionTexts()
+TQStringList KoPageVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Page Number" );
lst << i18n( "Number of Pages" );
lst << i18n( "Section Title" );
@@ -1949,7 +1949,7 @@ QStringList KoPageVariable::actionTexts()
return lst;
}
-QStringList KoPageVariable::subTypeList()
+TQStringList KoPageVariable::subTypeList()
{
return KoPageVariable::actionTexts();
}
@@ -1970,7 +1970,7 @@ KoFieldVariable::KoFieldVariable( KoTextDocument *textdoc, short int subtype, Ko
{
}
-QString KoFieldVariable::fieldCode()
+TQString KoFieldVariable::fieldCode()
{
switch( m_subtype ) {
case VST_FILENAME:
@@ -2037,7 +2037,7 @@ QString KoFieldVariable::fieldCode()
return i18n("Field");
}
-QString KoFieldVariable::text(bool realValue)
+TQString KoFieldVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -2046,34 +2046,34 @@ QString KoFieldVariable::text(bool realValue)
} // use a format when they are customizable
-void KoFieldVariable::saveVariable( QDomElement& parentElem )
+void KoFieldVariable::saveVariable( TQDomElement& tqparentElem )
{
//kdDebug(32500) << "KoFieldVariable::saveVariable" << endl;
- QDomElement elem = parentElem.ownerDocument().createElement( "FIELD" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "FIELD" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "subtype", m_subtype );
elem.setAttribute( "value", m_varValue.toString() );
}
-void KoFieldVariable::load( QDomElement& elem )
+void KoFieldVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "FIELD" ).toElement();
+ TQDomElement e = elem.namedItem( "FIELD" ).toElement();
if (!e.isNull())
{
m_subtype = e.attribute( "subtype" ).toInt();
if ( m_subtype == VST_NONE )
kdWarning() << "Field subtype of -1 found in the file !" << endl;
- m_varValue = QVariant( e.attribute( "value" ) );
+ m_varValue = TQVariant( e.attribute( "value" ) );
} else
kdWarning() << "FIELD element not found !" << endl;
}
-void KoFieldVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoFieldVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "file-name" ) {
- const QString display = elem.attributeNS( KoXmlNS::text, "display", QString::null );
+ const TQString display = elem.attributeNS( KoXmlNS::text, "display", TQString() );
if (display == "path")
m_subtype = VST_DIRECTORYNAME;
else if (display == "name")
@@ -2125,7 +2125,7 @@ void KoFieldVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*cont
else if ( localName == "sender-email" )
m_subtype = VST_EMAIL;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
}
void KoFieldVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*/ ) const
@@ -2208,7 +2208,7 @@ void KoFieldVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context
void KoFieldVariable::recalc()
{
- QString value;
+ TQString value;
switch( m_subtype ) {
case VST_NONE:
kdWarning() << "KoFieldVariable::recalc() called with m_subtype = VST_NONE !" << endl;
@@ -2224,8 +2224,8 @@ void KoFieldVariable::recalc()
break;
case VST_FILENAMEWITHOUTEXTENSION:
{
- QString file=m_doc->url().fileName();
- int pos=file.findRev(".");
+ TQString file=m_doc->url().fileName();
+ int pos=file.tqfindRev(".");
if(pos !=-1)
value=file.mid(0,pos);
else
@@ -2311,15 +2311,15 @@ void KoFieldVariable::recalc()
if (value.isEmpty()) // still empty? give up
value = i18n("<None>");
- m_varValue = QVariant( value );
+ m_varValue = TQVariant( value );
resize();
}
-QStringList KoFieldVariable::actionTexts()
+TQStringList KoFieldVariable::actionTexts()
{
// NOTE: if you change here, also change fieldSubType()
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Author Name" );
lst << i18n( "Title" );
lst << i18n( "Initials" );
@@ -2407,7 +2407,7 @@ KoFieldVariable::FieldSubType KoFieldVariable::fieldSubType(short int menuNumber
return v;
}
-QStringList KoFieldVariable::subTypeList()
+TQStringList KoFieldVariable::subTypeList()
{
return KoFieldVariable::actionTexts();
}
@@ -2415,23 +2415,23 @@ QStringList KoFieldVariable::subTypeList()
/******************************************************************/
/* Class: KoLinkVariable */
/******************************************************************/
-KoLinkVariable::KoLinkVariable( KoTextDocument *textdoc, const QString & _linkName, const QString & _ulr,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoLinkVariable::KoLinkVariable( KoTextDocument *textdoc, const TQString & _linkName, const TQString & _ulr,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
,m_url(_ulr)
{
- m_varValue = QVariant( _linkName );
+ m_varValue = TQVariant( _linkName );
}
-QString KoLinkVariable::fieldCode()
+TQString KoLinkVariable::fieldCode()
{
return i18n("Link");
}
-void KoLinkVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoLinkVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
if ( elem.localName() == "a" && elem.namespaceURI() == KoXmlNS::text ) {
- m_url = elem.attributeNS( KoXmlNS::xlink, "href", QString::null);
- m_varValue = QVariant(elem.text());
+ m_url = elem.attributeNS( KoXmlNS::xlink, "href", TQString());
+ m_varValue = TQVariant(elem.text());
}
}
@@ -2447,7 +2447,7 @@ void KoLinkVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
}
-QString KoLinkVariable::text(bool realValue)
+TQString KoLinkVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -2455,21 +2455,21 @@ QString KoLinkVariable::text(bool realValue)
return value();
}
-void KoLinkVariable::saveVariable( QDomElement& parentElem )
+void KoLinkVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement linkElem = parentElem.ownerDocument().createElement( "LINK" );
- parentElem.appendChild( linkElem );
+ TQDomElement linkElem = tqparentElem.ownerDocument().createElement( "LINK" );
+ tqparentElem.appendChild( linkElem );
linkElem.setAttribute( "linkName", m_varValue.toString() );
linkElem.setAttribute( "hrefName", m_url );
}
-void KoLinkVariable::load( QDomElement& elem )
+void KoLinkVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement linkElem = elem.namedItem( "LINK" ).toElement();
+ TQDomElement linkElem = elem.namedItem( "LINK" ).toElement();
if (!linkElem.isNull())
{
- m_varValue = QVariant(linkElem.attribute("linkName"));
+ m_varValue = TQVariant(linkElem.attribute("linkName"));
m_url = linkElem.attribute("hrefName");
}
}
@@ -2479,22 +2479,22 @@ void KoLinkVariable::recalc()
resize();
}
-QStringList KoLinkVariable::actionTexts()
+TQStringList KoLinkVariable::actionTexts()
{
- return QStringList( i18n( "Link..." ) );
+ return TQStringList( i18n( "Link..." ) );
}
-void KoLinkVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoLinkVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
KoTextFormat * fmt = format();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
bool displayLink = m_varColl->variableSetting()->displayLink();
- QFont font( fmt->screenFont( zh ) );
+ TQFont font( fmt->screenFont( zh ) );
if ( m_varColl->variableSetting()->underlineLink() )
font.setUnderline( true );
- QColor textColor = displayLink ? cg.color( QColorGroup::Link ) : fmt->color();
+ TQColor textColor = displayLink ? cg.color( TQColorGroup::Link ) : fmt->color();
drawCustomItemHelper( p, x, y, wpix, hpix, ascentpix, cg, selected, offset, fmt, font, textColor, drawingShadow );
}
@@ -2503,42 +2503,42 @@ void KoLinkVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
/******************************************************************/
/* Class: KoNoteVariable */
/******************************************************************/
-KoNoteVariable::KoNoteVariable( KoTextDocument *textdoc, const QString & _note,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoNoteVariable::KoNoteVariable( KoTextDocument *textdoc, const TQString & _note,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
- , m_createdNoteDate( QDate::currentDate() )
+ , m_createdNoteDate( TQDate::tqcurrentDate() )
{
- m_varValue = QVariant( _note );
+ m_varValue = TQVariant( _note );
}
-QString KoNoteVariable::fieldCode()
+TQString KoNoteVariable::fieldCode()
{
return i18n("Note");
}
-QString KoNoteVariable::createdNote() const
+TQString KoNoteVariable::createdNote() const
{
return KGlobal::locale()->formatDate( m_createdNoteDate, false );
}
-void KoNoteVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoNoteVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName = elem.localName();
- QString note;
+ const TQString localName = elem.localName();
+ TQString note;
if ( localName == "annotation" && elem.namespaceURI() == KoXmlNS::office )
{
- QDomElement date = KoDom::namedItemNS( elem, KoXmlNS::dc, "date" );
- m_createdNoteDate = QDate::fromString( date.text(), Qt::ISODate );
- QDomNode text = KoDom::namedItemNS( elem, KoXmlNS::text, "p" );
+ TQDomElement date = KoDom::namedItemNS( elem, KoXmlNS::dc, "date" );
+ m_createdNoteDate = TQDate::fromString( date.text(), Qt::ISODate );
+ TQDomNode text = KoDom::namedItemNS( elem, KoXmlNS::text, "p" );
for ( ; !text.isNull(); text = text.nextSibling() )
{
if ( text.isElement() )
{
- QDomElement t = text.toElement();
+ TQDomElement t = text.toElement();
note += t.text() + "\n";
}
}
}
- m_varValue = QVariant( note );
+ m_varValue = TQVariant( note );
}
void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*/ ) const
@@ -2548,8 +2548,8 @@ void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
writer.startElement( "dc:date" );
writer.addTextNode( m_createdNoteDate.toString(Qt::ISODate) );
writer.endElement();
- QStringList text = QStringList::split( "\n", m_varValue.toString() );
- for ( QStringList::Iterator it = text.begin(); it != text.end(); ++it ) {
+ TQStringList text = TQStringList::split( "\n", m_varValue.toString() );
+ for ( TQStringList::Iterator it = text.begin(); it != text.end(); ++it ) {
writer.startElement( "text:p" );
writer.addTextNode( *it );
writer.endElement();
@@ -2557,20 +2557,20 @@ void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
writer.endElement();
}
-void KoNoteVariable::saveVariable( QDomElement& parentElem )
+void KoNoteVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement linkElem = parentElem.ownerDocument().createElement( "NOTE" );
- parentElem.appendChild( linkElem );
+ TQDomElement linkElem = tqparentElem.ownerDocument().createElement( "NOTE" );
+ tqparentElem.appendChild( linkElem );
linkElem.setAttribute( "note", m_varValue.toString() );
}
-void KoNoteVariable::load( QDomElement& elem )
+void KoNoteVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement linkElem = elem.namedItem( "NOTE" ).toElement();
+ TQDomElement linkElem = elem.namedItem( "NOTE" ).toElement();
if (!linkElem.isNull())
{
- m_varValue = QVariant(linkElem.attribute("note"));
+ m_varValue = TQVariant(linkElem.attribute("note"));
}
}
@@ -2579,12 +2579,12 @@ void KoNoteVariable::recalc()
resize();
}
-QStringList KoNoteVariable::actionTexts()
+TQStringList KoNoteVariable::actionTexts()
{
- return QStringList( i18n( "Note..." ) );
+ return TQStringList( i18n( "Note..." ) );
}
-QString KoNoteVariable::text(bool realValue)
+TQString KoNoteVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayComment() &&
m_varColl->variableSetting()->displayFieldCode()&&!realValue)
@@ -2592,11 +2592,11 @@ QString KoNoteVariable::text(bool realValue)
else
//for a note return just a "space" we can look at
//note when we "right button"
- return QString(" ");
+ return TQString(" ");
}
-void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoNoteVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
if ( !m_varColl->variableSetting()->displayComment())
return;
@@ -2605,19 +2605,19 @@ void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
//kdDebug(32500) << "KoNoteVariable::drawCustomItem index=" << index() << " x=" << x << " y=" << y << endl;
p->save();
- p->setPen( QPen( fmt->color() ) );
+ p->setPen( TQPen( fmt->color() ) );
if ( fmt->textBackgroundColor().isValid() )
p->fillRect( x, y, wpix, hpix, fmt->textBackgroundColor() );
if ( selected )
{
- p->setPen( QPen( cg.color( QColorGroup::HighlightedText ) ) );
- p->fillRect( x, y, wpix, hpix, cg.color( QColorGroup::Highlight ) );
+ p->setPen( TQPen( cg.color( TQColorGroup::HighlightedText ) ) );
+ p->fillRect( x, y, wpix, hpix, cg.color( TQColorGroup::Highlight ) );
}
- else if ( textDocument() && p->device()->devType() != QInternal::Printer
+ else if ( textDocument() && p->device()->devType() != TQInternal::Printer
&& !textDocument()->dontDrawingNoteVariable())
{
- p->fillRect( x, y, wpix, hpix, Qt::yellow);
- p->setPen( QPen( cg.color( QColorGroup::Highlight ), 0, Qt::DotLine ) );
+ p->fillRect( x, y, wpix, hpix, TQt::yellow);
+ p->setPen( TQPen( cg.color( TQColorGroup::Highlight ), 0, TQt::DotLine ) );
p->drawRect( x, y, wpix, hpix );
}
//call it for use drawCustomItemHelper just for draw font effect
@@ -2626,14 +2626,14 @@ void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
p->restore();
}
-void KoPageVariable::setSectionTitle( const QString& _title )
+void KoPageVariable::setSectionTitle( const TQString& _title )
{
- QString title( _title );
+ TQString title( _title );
if ( title.isEmpty() )
{
title = i18n("<No title>");
}
- m_varValue = QVariant( title );
+ m_varValue = TQVariant( title );
}
@@ -2654,9 +2654,9 @@ KoStatisticVariable::KoStatisticVariable( KoTextDocument *textdoc,
}
-QStringList KoStatisticVariable::actionTexts()
+TQStringList KoStatisticVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Number of Words" );
lst << i18n( "Number of Sentences" );
lst << i18n( "Number of Lines" );
@@ -2681,27 +2681,27 @@ void KoStatisticVariable::setVariableSubType( short int subtype )
}
-QStringList KoStatisticVariable::subTypeList()
+TQStringList KoStatisticVariable::subTypeList()
{
return KoStatisticVariable::actionTexts();
}
-void KoStatisticVariable::saveVariable( QDomElement& varElem )
+void KoStatisticVariable::saveVariable( TQDomElement& varElem )
{
- QDomElement elem = varElem.ownerDocument().createElement( "STATISTIC" );
+ TQDomElement elem = varElem.ownerDocument().createElement( "STATISTIC" );
varElem.appendChild( elem );
- elem.setAttribute( "type", QString::number(m_subtype) );
- elem.setAttribute( "value", QString::number(m_varValue.toInt()) );
+ elem.setAttribute( "type", TQString::number(m_subtype) );
+ elem.setAttribute( "value", TQString::number(m_varValue.toInt()) );
}
-void KoStatisticVariable::load( QDomElement &elem )
+void KoStatisticVariable::load( TQDomElement &elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "STATISTIC" ).toElement();
+ TQDomElement e = elem.namedItem( "STATISTIC" ).toElement();
if ( !e.isNull() ) {
// FIXME: Error handling.
m_subtype = e.attribute( "type" ).toInt();
@@ -2710,58 +2710,58 @@ void KoStatisticVariable::load( QDomElement &elem )
}
-void KoStatisticVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoStatisticVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "object-count" )
{
m_subtype = VST_STATISTIC_NB_EMBEDDED;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "table-count" )
{
m_subtype = VST_STATISTIC_NB_TABLE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "picture-count" )
{
m_subtype = VST_STATISTIC_NB_PICTURE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "word-count" )
{
m_subtype = VST_STATISTIC_NB_WORD;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "character-count" )
{
m_subtype = VST_STATISTIC_NB_CHARACTERE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "frame-count" )
{
m_subtype = VST_STATISTIC_NB_FRAME;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "line-count" )
{
m_subtype = VST_STATISTIC_NB_LINES;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "sentence-count" )
{
m_subtype = VST_STATISTIC_NB_SENTENCE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "non-whitespace-character-count" )
{
m_subtype = VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "syllable-count" )
{
m_subtype = VST_STATISTIC_NB_SYLLABLE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
//TODO other copy
}
@@ -2772,63 +2772,63 @@ void KoStatisticVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*con
{
case VST_STATISTIC_NB_EMBEDDED:
writer.startElement( "text:object-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_TABLE:
writer.startElement( "text:table-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_PICTURE:
writer.startElement( "text:picture-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_FRAME:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:frame-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_WORD:
writer.startElement( "text:word-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_SENTENCE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:sentence-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_CHARACTERE:
writer.startElement( "text:character-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_LINES:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:line-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:non-whitespace-character-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_SYLLABLE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:syllable-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
}
}
-QString KoStatisticVariable::fieldCode()
+TQString KoStatisticVariable::fieldCode()
{
if ( m_subtype == VST_STATISTIC_NB_FRAME )
{