diff options
Diffstat (limited to 'lib/kotext/KoParagStyle.cpp')
-rw-r--r-- | lib/kotext/KoParagStyle.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lib/kotext/KoParagStyle.cpp b/lib/kotext/KoParagStyle.cpp index 18ffc7f9..e3bf15e9 100644 --- a/lib/kotext/KoParagStyle.cpp +++ b/lib/kotext/KoParagStyle.cpp @@ -27,9 +27,9 @@ #include <kdebug.h> #include <klocale.h> -#include <qdom.h> +#include <tqdom.h> -KoCharStyle::KoCharStyle( const QString & name ) +KoCharStyle::KoCharStyle( const TQString & name ) : KoUserStyle( name ) { } @@ -46,7 +46,7 @@ KoTextFormat & KoCharStyle::format() /////////////////////////// -KoParagStyle::KoParagStyle( const QString & name ) +KoParagStyle::KoParagStyle( const TQString & name ) : KoCharStyle( name ) { m_followingStyle = this; @@ -86,32 +86,32 @@ void KoParagStyle::setFollowingStyle( KoParagStyle *fst ) m_followingStyle = fst; } -void KoParagStyle::saveStyle( QDomElement & parentElem ) +void KoParagStyle::saveStyle( TQDomElement & tqparentElem ) { - m_paragLayout.saveParagLayout( parentElem, m_paragLayout.alignment ); + m_paragLayout.saveParagLayout( tqparentElem, m_paragLayout.tqalignment ); if ( followingStyle() ) { - QDomElement element = parentElem.ownerDocument().createElement( "FOLLOWING" ); - parentElem.appendChild( element ); + TQDomElement element = tqparentElem.ownerDocument().createElement( "FOLLOWING" ); + tqparentElem.appendChild( element ); element.setAttribute( "name", followingStyle()->displayName() ); } - // TODO save parent style, and inherited flags. + // TODO save tqparent style, and inherited flags. - parentElem.setAttribute( "outline", m_bOutline ? "true" : "false" ); + tqparentElem.setAttribute( "outline", m_bOutline ? "true" : "false" ); } -void KoParagStyle::loadStyle( QDomElement & parentElem, int docVersion ) +void KoParagStyle::loadStyle( TQDomElement & tqparentElem, int docVersion ) { - KoParagLayout layout; - KoParagLayout::loadParagLayout( layout, parentElem, docVersion ); + KoParagLayout tqlayout; + KoParagLayout::loadParagLayout( tqlayout, tqparentElem, docVersion ); // This way, KoTextParag::setParagLayout also sets the style pointer, to this style - layout.style = this; - m_paragLayout = layout; + tqlayout.style = this; + m_paragLayout = tqlayout; // Load name - QDomElement nameElem = parentElem.namedItem("NAME").toElement(); + TQDomElement nameElem = tqparentElem.namedItem("NAME").toElement(); if ( !nameElem.isNull() ) { m_name = nameElem.attribute("value"); m_displayName = i18n( "Style name", m_name.utf8() ); @@ -120,14 +120,14 @@ void KoParagStyle::loadStyle( QDomElement & parentElem, int docVersion ) // The followingStyle stuff has to be done after loading all styles. - m_bOutline = parentElem.attribute( "outline" ) == "true"; + m_bOutline = tqparentElem.attribute( "outline" ) == "true"; } -void KoParagStyle::loadStyle( QDomElement & styleElem, KoOasisContext& context ) +void KoParagStyle::loadStyle( 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; @@ -137,16 +137,16 @@ void KoParagStyle::loadStyle( QDomElement & styleElem, KoOasisContext& context ) m_bOutline = styleElem.hasAttributeNS( KoXmlNS::style, "default-outline-level" ); context.styleStack().save(); - context.addStyles( &styleElem, "paragraph" ); // Load all parents - only because we don't support inheritance. - KoParagLayout layout; - KoParagLayout::loadOasisParagLayout( layout, context ); + context.addStyles( &styleElem, "paragraph" ); // Load all tqparents - only because we don't support inheritance. + KoParagLayout tqlayout; + KoParagLayout::loadOasisParagLayout( tqlayout, context ); // loadOasisParagLayout doesn't load the counter. It's modelled differently for parags and for styles. int level = 0; bool listOK = false; - const QString listStyleName = styleElem.attributeNS( KoXmlNS::style, "list-style-name", QString::null ); + const TQString listStyleName = styleElem.attributeNS( KoXmlNS::style, "list-style-name", TQString() ); if ( m_bOutline ) { - level = styleElem.attributeNS( KoXmlNS::style, "default-outline-level", QString::null ).toInt(); // 1-based + level = styleElem.attributeNS( KoXmlNS::style, "default-outline-level", TQString() ).toInt(); // 1-based listOK = context.pushOutlineListLevelStyle( level ); // allow overriding the outline numbering, see http://lists.oasis-open.org/archives/office/200310/msg00033.html if ( !listStyleName.isEmpty() ) @@ -169,27 +169,27 @@ void KoParagStyle::loadStyle( QDomElement & styleElem, KoOasisContext& context ) listOK = context.pushListLevelStyle( listStyleName, level ); } if ( listOK ) { - const QDomElement listStyle = context.listStyleStack().currentListStyle(); + const TQDomElement listStyle = context.listStyleStack().currentListStyle(); // The tag is either text:list-level-style-number or text:list-level-style-bullet const bool ordered = listStyle.localName() == "list-level-style-number"; - Q_ASSERT( !layout.counter ); - layout.counter = new KoParagCounter; - layout.counter->loadOasis( context, -1, ordered, m_bOutline, level, true ); + Q_ASSERT( !tqlayout.counter ); + tqlayout.counter = new KoParagCounter; + tqlayout.counter->loadOasis( context, -1, ordered, m_bOutline, level, true ); context.listStyleStack().pop(); } // This way, KoTextParag::setParagLayout also sets the style pointer, to this style - layout.style = this; - m_paragLayout = layout; + tqlayout.style = this; + m_paragLayout = tqlayout; m_format.load( context ); context.styleStack().restore(); } -QString KoParagStyle::saveStyle( KoGenStyles& genStyles, int styleType, const QString& parentStyleName, KoSavingContext& context ) const +TQString KoParagStyle::saveStyle( KoGenStyles& genStyles, int styleType, const TQString& tqparentStyleName, KoSavingContext& context ) const { - KoGenStyle gs( styleType, "paragraph", parentStyleName ); + KoGenStyle gs( styleType, "paragraph", tqparentStyleName ); gs.addAttribute( "style:display-name", m_displayName ); if ( m_paragLayout.counter ) { @@ -207,9 +207,9 @@ QString KoParagStyle::saveStyle( KoGenStyles& genStyles, int styleType, const QS // This display-name will probably look nicer in OO, but this also means // no re-use possible between list styles... listStyle.addAttribute( "style:display-name", - i18n( "Numbering Style for %1" ).arg( m_displayName ) ); + i18n( "Numbering Style for %1" ).tqarg( m_displayName ) ); - QString autoListStyleName = genStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering ); + TQString autoListStyleName = genStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering ); gs.addAttribute( "style:list-style-name", autoListStyleName ); } } @@ -220,8 +220,8 @@ QString KoParagStyle::saveStyle( KoGenStyles& genStyles, int styleType, const QS // try to preserve existing internal name, if it looks adequate (no spaces) // ## TODO: check XML-Schemacs NCName conformity - bool nameIsConform = !m_name.isEmpty() && m_name.find( ' ' ) == -1; - QString newName; + bool nameIsConform = !m_name.isEmpty() && m_name.tqfind( ' ' ) == -1; + TQString newName; if ( nameIsConform ) newName = genStyles.lookup( gs, m_name, KoGenStyles::DontForceNumbering ); else @@ -245,7 +245,7 @@ void KoParagStyle::propagateChanges( int paragLayoutFlag, int /*formatFlag*/ ) if ( !m_parentStyle ) return; if ( !(paragLayoutFlag & KoParagLayout::Alignment) ) - m_paragLayout.alignment = m_parentStyle->paragLayout().alignment; + m_paragLayout.tqalignment = m_parentStyle->paragLayout().tqalignment; if ( !(paragLayoutFlag & KoParagLayout::Margins) ) for ( int i = 0 ; i < 5 ; ++i ) m_paragLayout.margins[i] = m_parentStyle->paragLayout().margins[i]; @@ -269,9 +269,9 @@ void KoParagStyle::propagateChanges( int paragLayoutFlag, int /*formatFlag*/ ) #if 0 if ( paragLayoutFlag == KoParagLayout::All ) { - setDirection( static_cast<QChar::Direction>(layout.direction) ); + setDirection( static_cast<TQChar::Direction>(tqlayout.direction) ); // Don't call applyStyle from here, it would overwrite any paragraph-specific settings - setStyle( layout.style ); + setStyle( tqlayout.style ); } #endif // TODO a flag for the "is outline" bool? Otherwise we have no way to inherit |