summaryrefslogtreecommitdiffstats
path: root/kspread/functions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/functions.cc')
-rw-r--r--kspread/functions.cc90
1 files changed, 45 insertions, 45 deletions
diff --git a/kspread/functions.cc b/kspread/functions.cc
index 1f53c01e..0cc0dd98 100644
--- a/kspread/functions.cc
+++ b/kspread/functions.cc
@@ -22,10 +22,10 @@
#include "functions.h"
#include "valuecalc.h"
-#include <qdict.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qvaluevector.h>
+#include <tqdict.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqvaluevector.h>
#include <kdebug.h>
#include <klocale.h>
@@ -40,7 +40,7 @@ namespace KSpread
class Function::Private
{
public:
- QString name;
+ TQString name;
FunctionPtr ptr;
int paramMin, paramMax;
bool acceptArray;
@@ -50,8 +50,8 @@ public:
class FunctionRepository::Private
{
public:
- QDict<Function> functions;
- QDict<FunctionDescription> funcs;
+ TQDict<Function> functions;
+ TQDict<FunctionDescription> funcs;
};
} // namespace KSpread
@@ -59,7 +59,7 @@ public:
using namespace KSpread;
-Function::Function( const QString& name, FunctionPtr ptr )
+Function::Function( const TQString& name, FunctionPtr ptr )
{
d = new Private;
d->name = name;
@@ -75,7 +75,7 @@ Function::~Function()
delete d;
}
-QString Function::name() const
+TQString Function::name() const
{
return d->name;
}
@@ -207,11 +207,11 @@ FunctionRepository* FunctionRepository::self()
kdDebug() << "Functions registered, loading descriptions" << endl;
// find all XML description files
- QStringList files = Factory::global()->dirs()->findAllResources
+ TQStringList files = Factory::global()->dirs()->findAllResources
("extensions", "*.xml", TRUE);
// load desc/help from XML file
- for( QStringList::Iterator it = files.begin(); it != files.end(); ++it )
+ for( TQStringList::Iterator it = files.begin(); it != files.end(); ++it )
s_self->loadFile (*it);
kdDebug() << "All ok, repository ready" << endl;
@@ -240,22 +240,22 @@ void FunctionRepository::add( Function* function )
d->functions.insert( function->name().upper(), function );
}
-Function *FunctionRepository::function (const QString& name)
+Function *FunctionRepository::function (const TQString& name)
{
- return d->functions.find (name.upper());
+ return d->functions.tqfind (name.upper());
}
-FunctionDescription *FunctionRepository::functionInfo (const QString& name)
+FunctionDescription *FunctionRepository::functionInfo (const TQString& name)
{
- return d->funcs.find (name.upper());
+ return d->funcs.tqfind (name.upper());
}
// returns names of function in certain group
-QStringList FunctionRepository::functionNames( const QString& group )
+TQStringList FunctionRepository::functionNames( const TQString& group )
{
- QStringList lst;
+ TQStringList lst;
- QDictIterator<FunctionDescription> it (d->funcs);
+ TQDictIterator<FunctionDescription> it (d->funcs);
for(; it.current(); ++it) {
if (group.isNull() || (it.current()->group() == group))
lst.append (it.current()->name());
@@ -265,41 +265,41 @@ QStringList FunctionRepository::functionNames( const QString& group )
return lst;
}
-void FunctionRepository::loadFile (const QString& filename)
+void FunctionRepository::loadFile (const TQString& filename)
{
- QFile file (filename);
+ TQFile file (filename);
if (!file.open (IO_ReadOnly))
return;
- QDomDocument doc;
+ TQDomDocument doc;
doc.setContent( &file );
file.close();
- QString group = "";
+ TQString group = "";
- QDomNode n = doc.documentElement().firstChild();
+ TQDomNode n = doc.documentElement().firstChild();
for (; !n.isNull(); n = n.nextSibling())
{
if (!n.isElement())
continue;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if (e.tagName() == "Group")
{
group = i18n (e.namedItem ("GroupName").toElement().text().utf8());
m_groups.append( group );
m_groups.sort();
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
for (; !n2.isNull(); n2 = n2.nextSibling())
{
if (!n2.isElement())
continue;
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
if (e2.tagName() == "Function")
{
FunctionDescription* desc = new FunctionDescription( e2 );
desc->setGroup (group);
- if (d->functions.find (desc->name()))
+ if (d->functions.tqfind (desc->name()))
d->funcs.insert (desc->name(), desc);
}
}
@@ -310,7 +310,7 @@ void FunctionRepository::loadFile (const QString& filename)
// ------------------------------------------------------------
-static ParameterType toType( const QString& type )
+static ParameterType toType( const TQString& type )
{
if ( type == "Boolean" )
return KSpread_Boolean;
@@ -324,7 +324,7 @@ static ParameterType toType( const QString& type )
return KSpread_Float;
}
-static QString toString (ParameterType type, bool range = FALSE)
+static TQString toString (ParameterType type, bool range = FALSE)
{
if ( !range )
{
@@ -357,7 +357,7 @@ static QString toString (ParameterType type, bool range = FALSE)
}
}
- return QString::null;
+ return TQString();
}
FunctionParameter::FunctionParameter()
@@ -373,16 +373,16 @@ FunctionParameter::FunctionParameter (const FunctionParameter& param)
m_range = param.m_range;
}
-FunctionParameter::FunctionParameter (const QDomElement& element)
+FunctionParameter::FunctionParameter (const TQDomElement& element)
{
m_type = KSpread_Float;
m_range = FALSE;
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
for( ; !n.isNull(); n = n.nextSibling() )
if ( n.isElement() )
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( e.tagName() == "Comment" )
m_help = i18n( e.text().utf8() );
else if ( e.tagName() == "Type" )
@@ -402,14 +402,14 @@ FunctionDescription::FunctionDescription()
m_type = KSpread_Float;
}
-FunctionDescription::FunctionDescription (const QDomElement& element)
+FunctionDescription::FunctionDescription (const TQDomElement& element)
{
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
for( ; !n.isNull(); n = n.nextSibling() )
{
if (!n.isElement())
continue;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( e.tagName() == "Name" )
m_name = e.text();
else if ( e.tagName() == "Type" )
@@ -418,12 +418,12 @@ FunctionDescription::FunctionDescription (const QDomElement& element)
m_params.append (FunctionParameter (e));
else if ( e.tagName() == "Help" )
{
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
for( ; !n2.isNull(); n2 = n2.nextSibling() )
{
if (!n2.isElement())
continue;
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
if ( e2.tagName() == "Text" )
m_help.append ( i18n( e2.text().utf8() ) );
else if ( e2.tagName() == "Syntax" )
@@ -447,16 +447,16 @@ FunctionDescription::FunctionDescription( const FunctionDescription& desc )
m_type = desc.m_type;
}
-QString FunctionDescription::toQML() const
+TQString FunctionDescription::toTQML() const
{
- QString text( "<qt><h1>" );
+ TQString text( "<qt><h1>" );
text += name();
text += "</h1>";
if( !m_help.isEmpty() )
{
text += i18n("<p>");
- QStringList::ConstIterator it = m_help.begin();
+ TQStringList::ConstIterator it = m_help.begin();
for( ; it != m_help.end(); ++it )
{
text += *it;
@@ -472,7 +472,7 @@ QString FunctionDescription::toQML() const
if ( !m_syntax.isEmpty() )
{
text += i18n("<h2>Syntax</h2><ul>");
- QStringList::ConstIterator it = m_syntax.begin();
+ TQStringList::ConstIterator it = m_syntax.begin();
for( ; it != m_syntax.end(); ++it )
{
text += "<li>";
@@ -484,7 +484,7 @@ QString FunctionDescription::toQML() const
if ( !m_params.isEmpty() )
{
text += i18n("<h2>Parameters</h2><ul>");
- QValueList<FunctionParameter>::ConstIterator it = m_params.begin();
+ TQValueList<FunctionParameter>::ConstIterator it = m_params.begin();
for( ; it != m_params.end(); ++it )
{
text += i18n("<li><b>Comment:</b> ");
@@ -498,7 +498,7 @@ QString FunctionDescription::toQML() const
if ( !m_examples.isEmpty() )
{
text += i18n("<h2>Examples</h2><ul>");
- QStringList::ConstIterator it = m_examples.begin();
+ TQStringList::ConstIterator it = m_examples.begin();
for( ; it != m_examples.end(); ++it )
{
text += "<li>";
@@ -510,7 +510,7 @@ QString FunctionDescription::toQML() const
if ( !m_related.isEmpty() )
{
text += i18n("<h2>Related Functions</h2><ul>");
- QStringList::ConstIterator it = m_related.begin();
+ TQStringList::ConstIterator it = m_related.begin();
for( ; it != m_related.end(); ++it )
{
text += "<li>";