summaryrefslogtreecommitdiffstats
path: root/kspread/kspread_style_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/kspread_style_manager.cc')
-rw-r--r--kspread/kspread_style_manager.cc102
1 files changed, 51 insertions, 51 deletions
diff --git a/kspread/kspread_style_manager.cc b/kspread/kspread_style_manager.cc
index 7a68c02a..8c4d86f5 100644
--- a/kspread/kspread_style_manager.cc
+++ b/kspread/kspread_style_manager.cc
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qdom.h>
-#include <qstringlist.h>
+#include <tqdom.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <klocale.h>
@@ -79,7 +79,7 @@ void StyleManager::loadOasisStyleTemplate( KoOasisStyles& oasisStyles )
m_oasisStyles.clear();
// loading default style first
- const QDomElement* defaultStyle = oasisStyles.defaultStyle( "table-cell" );
+ const TQDomElement* defaultStyle = oasisStyles.defaultStyle( "table-cell" );
if ( defaultStyle )
{
kdDebug() << "StyleManager: Loading default cell style" << endl;
@@ -96,21 +96,21 @@ void StyleManager::loadOasisStyleTemplate( KoOasisStyles& oasisStyles )
uint nStyles = oasisStyles.userStyles().count();
for (unsigned int item = 0; item < nStyles; item++) {
- QDomElement styleElem = oasisStyles.userStyles()[item];
+ TQDomElement styleElem = oasisStyles.userStyles()[item];
// assume the name assigned by the application
- const QString oasisName = styleElem.attributeNS( KoXmlNS::style, "name", QString::null );
+ const TQString oasisName = styleElem.attributeNS( KoXmlNS::style, "name", TQString() );
// then replace by user-visible one (if any)
- const QString name = styleElem.attributeNS( KoXmlNS::style, "display-name", oasisName );
+ const TQString name = styleElem.attributeNS( KoXmlNS::style, "display-name", oasisName );
kdDebug() << " StyleManager: Loading common cell style: " << oasisName << " (display name: " << name << ")" << endl;
if ( !name.isEmpty() )
{
CustomStyle * style = 0;
- if ( styleElem.hasAttributeNS( KoXmlNS::style, "parent-style-name" ) )
- // The style's parent name will be set in Style::loadOasis(..).
- // After all styles are loaded the pointer to the parent is set.
+ if ( styleElem.hasAttributeNS( KoXmlNS::style, "tqparent-style-name" ) )
+ // The style's tqparent name will be set in Style::loadOasis(..).
+ // After all styles are loaded the pointer to the tqparent is set.
style = new CustomStyle( name, 0 );
else
style = new CustomStyle( name, m_defaultStyle );
@@ -124,7 +124,7 @@ void StyleManager::loadOasisStyleTemplate( KoOasisStyles& oasisStyles )
}
}
- // set the parent pointers after we loaded all styles
+ // set the tqparent pointers after we loaded all styles
Styles::iterator iter = m_styles.begin();
Styles::iterator end = m_styles.end();
while ( iter != end )
@@ -132,17 +132,17 @@ void StyleManager::loadOasisStyleTemplate( KoOasisStyles& oasisStyles )
CustomStyle * styleData = iter.data();
if ( styleData->name() != "Default" )
- if ( !styleData->parent() && !styleData->parentName().isNull() )
- styleData->setParent( m_oasisStyles[ styleData->parentName() ] );
+ if ( !styleData->tqparent() && !styleData->tqparentName().isNull() )
+ styleData->setParent( m_oasisStyles[ styleData->tqparentName() ] );
++iter;
}
}
-QDomElement StyleManager::save( QDomDocument & doc )
+TQDomElement StyleManager::save( TQDomDocument & doc )
{
kdDebug() << "Saving styles" << endl;
- QDomElement styles = doc.createElement( "styles" );
+ TQDomElement styles = doc.createElement( "styles" );
kdDebug() << "Saving default style" << endl;
m_defaultStyle->save( doc, styles );
@@ -164,12 +164,12 @@ QDomElement StyleManager::save( QDomDocument & doc )
return styles;
}
-bool StyleManager::loadXML( QDomElement const & styles )
+bool StyleManager::loadXML( TQDomElement const & styles )
{
- QDomElement e = styles.firstChild().toElement();
+ TQDomElement e = styles.firstChild().toElement();
while ( !e.isNull() )
{
- QString name;
+ TQString name;
if ( e.hasAttribute( "name" ) )
name = e.attribute( "name" );
@@ -182,7 +182,7 @@ bool StyleManager::loadXML( QDomElement const & styles )
else if ( !name.isNull() )
{
CustomStyle * style = 0;
- if ( e.hasAttribute( "parent" ) && e.attribute( "parent" ) == "Default" )
+ if ( e.hasAttribute( "tqparent" ) && e.attribute( "tqparent" ) == "Default" )
style = new CustomStyle( name, m_defaultStyle );
else
style = new CustomStyle( name, 0 );
@@ -209,8 +209,8 @@ bool StyleManager::loadXML( QDomElement const & styles )
{
CustomStyle * styleData = iter.data();
- if ( !styleData->parent() && !styleData->parentName().isNull() )
- styleData->setParent( m_styles[ styleData->parentName() ] );
+ if ( !styleData->tqparent() && !styleData->tqparentName().isNull() )
+ styleData->setParent( m_styles[ styleData->tqparentName() ] );
++iter;
}
@@ -224,7 +224,7 @@ bool StyleManager::loadXML( QDomElement const & styles )
void StyleManager::createBuiltinStyles()
{
CustomStyle * header1 = new CustomStyle( i18n( "Header" ), m_defaultStyle );
- QFont f( header1->font() );
+ TQFont f( header1->font() );
f.setItalic( true );
f.setPointSize( f.pointSize() + 2 );
f.setBold( true );
@@ -233,18 +233,18 @@ void StyleManager::createBuiltinStyles()
m_styles[ header1->name() ] = header1;
CustomStyle * header2 = new CustomStyle( i18n( "Header1" ), header1 );
- QColor color( "#F0F0FF" );
+ TQColor color( "#F0F0FF" );
header2->changeBgColor( color );
- QPen pen( Qt::black, 1, Qt::SolidLine );
+ TQPen pen( TQt::black, 1, TQt::SolidLine );
header2->changeBottomBorderPen( pen );
header2->setType( Style::BUILTIN );
m_styles[ header2->name() ] = header2;
}
-CustomStyle * StyleManager::style( QString const & name ) const
+CustomStyle * StyleManager::style( TQString const & name ) const
{
- Styles::const_iterator iter( m_styles.find( name ) );
+ Styles::const_iterator iter( m_styles.tqfind( name ) );
if ( iter != m_styles.end() )
return iter.data();
@@ -257,20 +257,20 @@ CustomStyle * StyleManager::style( QString const & name ) const
void StyleManager::takeStyle( CustomStyle * style )
{
- CustomStyle * parent = style->parent();
+ CustomStyle * tqparent = style->tqparent();
Styles::iterator iter = m_styles.begin();
Styles::iterator end = m_styles.end();
while ( iter != end )
{
- if ( iter.data()->parent() == style )
- iter.data()->setParent( parent );
+ if ( iter.data()->tqparent() == style )
+ iter.data()->setParent( tqparent );
++iter;
}
- Styles::iterator i( m_styles.find( style->name() ) );
+ Styles::iterator i( m_styles.tqfind( style->name() ) );
if ( i != m_styles.end() )
{
@@ -279,18 +279,18 @@ void StyleManager::takeStyle( CustomStyle * style )
}
}
-bool StyleManager::checkCircle( QString const & name, QString const & parent )
+bool StyleManager::checkCircle( TQString const & name, TQString const & tqparent )
{
- CustomStyle * s = style( parent );
- if ( !s || s->parent() == 0 )
+ CustomStyle * s = style( tqparent );
+ if ( !s || s->tqparent() == 0 )
return true;
- if ( s->parentName() == name )
+ if ( s->tqparentName() == name )
return false;
else
- return checkCircle( name, s->parentName() );
+ return checkCircle( name, s->tqparentName() );
}
-bool StyleManager::validateStyleName( QString const & name, CustomStyle * style )
+bool StyleManager::validateStyleName( TQString const & name, CustomStyle * style )
{
if ( m_defaultStyle->name() == name || name == "Default" )
return false;
@@ -309,20 +309,20 @@ bool StyleManager::validateStyleName( QString const & name, CustomStyle * style
return true;
}
-void StyleManager::changeName( QString const & oldName, QString const & newName )
+void StyleManager::changeName( TQString const & oldName, TQString const & newName )
{
Styles::iterator iter = m_styles.begin();
Styles::iterator end = m_styles.end();
while ( iter != end )
{
- if ( iter.data()->parentName() == oldName )
+ if ( iter.data()->tqparentName() == oldName )
iter.data()->refreshParentName();
++iter;
}
- iter = m_styles.find( oldName );
+ iter = m_styles.tqfind( oldName );
if ( iter != end )
{
CustomStyle * s = iter.data();
@@ -331,9 +331,9 @@ void StyleManager::changeName( QString const & oldName, QString const & newName
}
}
-QStringList StyleManager::styleNames() const
+TQStringList StyleManager::styleNames() const
{
- QStringList list;
+ TQStringList list;
list.push_back( i18n("Default") );
@@ -350,27 +350,27 @@ QStringList StyleManager::styleNames() const
return list;
}
-QDict<Style> StyleManager::loadOasisAutoStyles( KoOasisStyles& oasisStyles )
+TQDict<Style> StyleManager::loadOasisAutoStyles( KoOasisStyles& oasisStyles )
{
- QDictIterator<QDomElement> it( oasisStyles.styles("table-cell") );
- QDict<Style> autoStyles;
+ TQDictIterator<TQDomElement> it( oasisStyles.styles("table-cell") );
+ TQDict<Style> autoStyles;
for (;it.current();++it)
{
if ( it.current()->hasAttributeNS( KoXmlNS::style , "name" ) )
{
- QString name = it.current()->attributeNS( KoXmlNS::style , "name" , QString::null );
+ TQString name = it.current()->attributeNS( KoXmlNS::style , "name" , TQString() );
kdDebug() << "StyleManager: Preloading automatic cell style: " << name << endl;
autoStyles.insert( name , new Style());
autoStyles[name]->loadOasisStyle( oasisStyles , *(it.current()) );
- if ( it.current()->hasAttributeNS( KoXmlNS::style, "parent-style-name" ) )
+ if ( it.current()->hasAttributeNS( KoXmlNS::style, "tqparent-style-name" ) )
{
- QString parentStyleName = it.current()->attributeNS( KoXmlNS::style, "parent-style-name", QString::null );
- if ( m_oasisStyles.contains( parentStyleName ) )
+ TQString tqparentStyleName = it.current()->attributeNS( KoXmlNS::style, "tqparent-style-name", TQString() );
+ if ( m_oasisStyles.tqcontains( tqparentStyleName ) )
{
- autoStyles[name]->setParent( m_oasisStyles[parentStyleName] );
+ autoStyles[name]->setParent( m_oasisStyles[tqparentStyleName] );
}
- kdDebug() << "\t parent-style-name:" << parentStyleName << endl;
+ kdDebug() << "\t tqparent-style-name:" << tqparentStyleName << endl;
}
else
{
@@ -381,9 +381,9 @@ QDict<Style> StyleManager::loadOasisAutoStyles( KoOasisStyles& oasisStyles )
return autoStyles;
}
-void StyleManager::releaseUnusedAutoStyles( QDict<Style> autoStyles )
+void StyleManager::releaseUnusedAutoStyles( TQDict<Style> autoStyles )
{
- QDictIterator<Style> styleIt( autoStyles );
+ TQDictIterator<Style> styleIt( autoStyles );
for (;styleIt.current();++styleIt)
{
Style* style = styleIt.current();