summaryrefslogtreecommitdiffstats
path: root/kword/KWFrameStyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kword/KWFrameStyle.cpp')
-rw-r--r--kword/KWFrameStyle.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/kword/KWFrameStyle.cpp b/kword/KWFrameStyle.cpp
index 5889bc62..44b83c56 100644
--- a/kword/KWFrameStyle.cpp
+++ b/kword/KWFrameStyle.cpp
@@ -29,17 +29,17 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qdom.h>
+#include <tqdom.h>
KWFrameStyleCollection::KWFrameStyleCollection()
- : KoUserStyleCollection( QString::fromLatin1( "frame" ) )
+ : KoUserStyleCollection( TQString::tqfromLatin1( "frame" ) )
{
}
void KWFrameStyleCollection::saveOasis( KoGenStyles& mainStyles, KoSavingContext& savingContext ) const
{
if ( !isDefault() ) {
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt )
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt )
{
KWFrameStyle* style = static_cast<KWFrameStyle *>( *styleIt );
style->saveOasis( mainStyles, savingContext );
@@ -49,14 +49,14 @@ void KWFrameStyleCollection::saveOasis( KoGenStyles& mainStyles, KoSavingContext
int KWFrameStyleCollection::loadOasisStyles( KoOasisContext& context )
{
- QValueVector<QDomElement> userStyles = context.oasisStyles().userStyles();
+ TQValueVector<TQDomElement> userStyles = context.oasisStyles().userStyles();
bool defaultStyleDeleted = false;
int stylesLoaded = 0;
for (unsigned int item = 0; item < userStyles.count(); item++) {
- QDomElement styleElem = userStyles[item];
+ TQDomElement styleElem = userStyles[item];
Q_ASSERT( !styleElem.isNull() );
- if ( styleElem.attributeNS( KoXmlNS::style, "family", QString::null ) != "graphic" )
+ if ( styleElem.attributeNS( KoXmlNS::style, "family", TQString() ) != "graphic" )
continue;
if ( !defaultStyleDeleted ) {
@@ -67,7 +67,7 @@ int KWFrameStyleCollection::loadOasisStyles( KoOasisContext& context )
defaultStyleDeleted = true;
}
- KWFrameStyle *sty = new KWFrameStyle( QString::null );
+ KWFrameStyle *sty = new KWFrameStyle( TQString() );
// Load the style
sty->loadOasis( styleElem, context );
// Style created, now let's try to add it
@@ -83,13 +83,13 @@ int KWFrameStyleCollection::loadOasisStyles( KoOasisContext& context )
/* Class: KWFrameStyle */
/******************************************************************/
-KWFrameStyle::KWFrameStyle( const QString & name )
+KWFrameStyle::KWFrameStyle( const TQString & name )
: KoUserStyle( name )
{
- m_backgroundColor.setColor( Qt::white );
+ m_backgroundColor.setColor( TQt::white );
}
-KWFrameStyle::KWFrameStyle( const QString & name, KWFrame * frame )
+KWFrameStyle::KWFrameStyle( const TQString & name, KWFrame * frame )
: KoUserStyle( name )
{
m_backgroundColor = frame->backgroundColor();
@@ -99,52 +99,52 @@ KWFrameStyle::KWFrameStyle( const QString & name, KWFrame * frame )
m_borderBottom = frame->bottomBorder();
}
-KWFrameStyle::KWFrameStyle( QDomElement & parentElem, int /*docVersion=2*/ )
- : KoUserStyle( QString::null )
+KWFrameStyle::KWFrameStyle( TQDomElement & tqparentElem, int /*docVersion=2*/ )
+ : KoUserStyle( TQString() )
{
- QDomElement element = parentElem.namedItem( "NAME" ).toElement();
+ TQDomElement element = tqparentElem.namedItem( "NAME" ).toElement();
if ( ( !element.isNull() ) && ( element.hasAttribute("value") ) ) {
m_name = element.attribute( "value" );
m_displayName = i18n( "Style name", m_name.utf8() );
} else
kdWarning() << "No NAME tag in frame style!" << endl;
- element = parentElem.namedItem( "LEFTBORDER" ).toElement();
+ element = tqparentElem.namedItem( "LEFTBORDER" ).toElement();
if ( !element.isNull() )
m_borderLeft = KoBorder::loadBorder( element );
else
m_borderLeft.setPenWidth( 0 );
- element = parentElem.namedItem( "RIGHTBORDER" ).toElement();
+ element = tqparentElem.namedItem( "RIGHTBORDER" ).toElement();
if ( !element.isNull() )
m_borderRight = KoBorder::loadBorder( element );
else
m_borderRight.setPenWidth( 0 );
- element = parentElem.namedItem( "TOPBORDER" ).toElement();
+ element = tqparentElem.namedItem( "TOPBORDER" ).toElement();
if ( !element.isNull() )
m_borderTop = KoBorder::loadBorder( element );
else
m_borderTop.setPenWidth( 0 );
- element = parentElem.namedItem( "BOTTOMBORDER" ).toElement();
+ element = tqparentElem.namedItem( "BOTTOMBORDER" ).toElement();
if ( !element.isNull() )
m_borderBottom = KoBorder::loadBorder( element );
else
m_borderBottom.setPenWidth( 0 );
- QColor c("white");
- if ( parentElem.hasAttribute("red") )
+ TQColor c("white");
+ if ( tqparentElem.hasAttribute("red") )
c.setRgb(
- KWDocument::getAttribute( parentElem, "red", 0 ),
- KWDocument::getAttribute( parentElem, "green", 0 ),
- KWDocument::getAttribute( parentElem, "blue", 0 ) );
+ KWDocument::getAttribute( tqparentElem, "red", 0 ),
+ KWDocument::getAttribute( tqparentElem, "green", 0 ),
+ KWDocument::getAttribute( tqparentElem, "blue", 0 ) );
- m_backgroundColor = QBrush( c );
+ m_backgroundColor = TQBrush( c );
}
KWFrameStyle::KWFrameStyle( const KWFrameStyle &rhs )
- : KoUserStyle( QString::null )
+ : KoUserStyle( TQString() )
{
operator=( rhs );
}
@@ -174,49 +174,49 @@ int KWFrameStyle::compare( const KWFrameStyle & frameStyle ) const
}
-void KWFrameStyle::saveFrameStyle( QDomElement & parentElem )
+void KWFrameStyle::saveFrameStyle( TQDomElement & tqparentElem )
{
- QDomDocument doc = parentElem.ownerDocument();
- QDomElement element = doc.createElement( "NAME" );
- parentElem.appendChild( element );
+ TQDomDocument doc = tqparentElem.ownerDocument();
+ TQDomElement element = doc.createElement( "NAME" );
+ tqparentElem.appendChild( element );
element.setAttribute( "value", displayName() );
if ( m_borderLeft.width() > 0 )
{
element = doc.createElement( "LEFTBORDER" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
m_borderLeft.save( element );
}
if ( m_borderRight.width() > 0 )
{
element = doc.createElement( "RIGHTBORDER" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
m_borderRight.save( element );
}
if ( m_borderTop.width() > 0 )
{
element = doc.createElement( "TOPBORDER" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
m_borderTop.save( element );
}
if ( m_borderBottom.width() > 0 )
{
element = doc.createElement( "BOTTOMBORDER" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
m_borderBottom.save( element );
}
if(m_backgroundColor.color().isValid())
{
- parentElem.setAttribute( "red", m_backgroundColor.color().red() );
- parentElem.setAttribute( "green", m_backgroundColor.color().green() );
- parentElem.setAttribute( "blue", m_backgroundColor.color().blue() );
+ tqparentElem.setAttribute( "red", m_backgroundColor.color().red() );
+ tqparentElem.setAttribute( "green", m_backgroundColor.color().green() );
+ tqparentElem.setAttribute( "blue", m_backgroundColor.color().blue() );
}
}
-KWFrameStyle *KWFrameStyle::loadStyle( QDomElement & parentElem, int docVersion )
+KWFrameStyle *KWFrameStyle::loadStyle( TQDomElement & tqparentElem, int docVersion )
{
- return new KWFrameStyle( parentElem, docVersion );
+ return new KWFrameStyle( tqparentElem, docVersion );
}
void KWFrameStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& savingContext ) const
@@ -242,15 +242,15 @@ void KWFrameStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& savingCo
}
// Background (taken from KWFrame::saveBorderProperties)
- if ( m_backgroundColor.style() == Qt::NoBrush )
+ if ( m_backgroundColor.style() == TQt::NoBrush )
frameStyle.addProperty( "fo:background-color", "transparent" );
else if ( m_backgroundColor.color().isValid() )
frameStyle.addProperty( "fo:background-color", m_backgroundColor.color().name() );
// try to preserve existing internal name, if it looks adequate (no spaces)
// ## TODO: check XML-Schemacs NCName conformity
- const bool nameIsConform = !m_name.isEmpty() && m_name.find( ' ' ) == -1;
- QString newName = m_name;
+ const bool nameIsConform = !m_name.isEmpty() && m_name.tqfind( ' ' ) == -1;
+ TQString newName = m_name;
if ( nameIsConform )
newName = mainStyles.lookup( frameStyle, m_name, KoGenStyles::DontForceNumbering );
else
@@ -258,11 +258,11 @@ void KWFrameStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& savingCo
const_cast<KWFrameStyle*>( this )->m_name = newName;
}
-void KWFrameStyle::loadOasis( QDomElement & styleElem, KoOasisContext& context )
+void KWFrameStyle::loadOasis( TQDomElement & styleElem, KoOasisContext& context )
{
// Load name
- m_name = styleElem.attributeNS( KoXmlNS::style, "name", QString::null );
- m_displayName = styleElem.attributeNS( KoXmlNS::style, "display-name", QString::null );
+ m_name = styleElem.attributeNS( KoXmlNS::style, "name", TQString() );
+ m_displayName = styleElem.attributeNS( KoXmlNS::style, "display-name", TQString() );
if ( m_displayName.isEmpty() )
m_displayName = m_name;
@@ -270,14 +270,14 @@ void KWFrameStyle::loadOasis( QDomElement & styleElem, KoOasisContext& context )
styleStack.setTypeProperties( "graphic" );
styleStack.save();
- context.addStyles( &styleElem, "graphic" ); // Load all parents - only because we don't support inheritance.
+ context.addStyles( &styleElem, "graphic" ); // Load all tqparents - only because we don't support inheritance.
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "background-color" ) ) {
- QString color = styleStack.attributeNS( KoXmlNS::fo, "background-color" );
+ TQString color = styleStack.attributeNS( KoXmlNS::fo, "background-color" );
if ( color == "transparent" )
- m_backgroundColor = QBrush( QColor(), Qt::NoBrush );
+ m_backgroundColor = TQBrush( TQColor(), TQt::NoBrush );
else
- m_backgroundColor = QBrush( QColor( color ) /*, brush style is a dead feature, ignored */ );
+ m_backgroundColor = TQBrush( TQColor( color ) /*, brush style is a dead feature, ignored */ );
}
m_borderLeft.loadFoBorder( styleStack.attributeNS( KoXmlNS::fo, "border", "left") );