summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/KoGenStyles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficecore/KoGenStyles.cpp')
-rw-r--r--lib/kofficecore/KoGenStyles.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/kofficecore/KoGenStyles.cpp b/lib/kofficecore/KoGenStyles.cpp
index 0ee2e730..68b8477a 100644
--- a/lib/kofficecore/KoGenStyles.cpp
+++ b/lib/kofficecore/KoGenStyles.cpp
@@ -35,29 +35,29 @@ TQString KoGenStyles::lookup( const KoGenStyle& style, const TQString& name, int
if ( it == m_styleMap.end() ) {
// Not found, try if this style is in fact equal to its tqparent (the find above
// wouldn't have found it, due to m_parentName being set).
- if ( !style.tqparentName().isEmpty() ) {
+ if ( !style.parentName().isEmpty() ) {
KoGenStyle testStyle( style );
- const KoGenStyle* tqparentStyle = this->style( style.tqparentName() ); // ## linear search
- if( !tqparentStyle ) {
- kdDebug(30003) << "KoGenStyles::lookup(" << name << "): tqparent style '" << style.tqparentName() << "' not found in collection" << endl;
+ const KoGenStyle* parentStyle = this->style( style.parentName() ); // ## linear search
+ if( !parentStyle ) {
+ kdDebug(30003) << "KoGenStyles::lookup(" << name << "): tqparent style '" << style.parentName() << "' not found in collection" << endl;
} else {
- if ( testStyle.m_familyName != tqparentStyle->m_familyName )
+ if ( testStyle.m_familyName != parentStyle->m_familyName )
{
- kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") tqparent style '" << style.tqparentName() << "' has a different family: " << tqparentStyle->m_familyName << endl;
+ kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") tqparent style '" << style.parentName() << "' has a different family: " << parentStyle->m_familyName << endl;
}
- testStyle.m_parentName = tqparentStyle->m_parentName;
+ testStyle.m_parentName = parentStyle->m_parentName;
// Exclude the type from the comparison. It's ok for an auto style
// to have a user style as tqparent; they can still be identical
- testStyle.m_type = tqparentStyle->m_type;
+ testStyle.m_type = parentStyle->m_type;
// Also it's ok to not have the display name of the tqparent style
// in the auto style
- TQMap<TQString, TQString>::const_iterator it = tqparentStyle->m_attributes.tqfind( "style:display-name" );
- if ( it != tqparentStyle->m_attributes.end() )
+ TQMap<TQString, TQString>::const_iterator it = parentStyle->m_attributes.tqfind( "style:display-name" );
+ if ( it != parentStyle->m_attributes.end() )
testStyle.addAttribute( "style:display-name", *it );
- if ( *tqparentStyle == testStyle )
- return style.tqparentName();
+ if ( *parentStyle == testStyle )
+ return style.parentName();
}
}
@@ -173,8 +173,8 @@ static int compareMap( const TQMap<TQString, TQString>& map1, const TQMap<TQStri
KoGenStyle::KoGenStyle( int type, const char* familyName,
- const TQString& tqparentName )
- : m_type( type ), m_familyName( familyName ), m_parentName( tqparentName ),
+ const TQString& parentName )
+ : m_type( type ), m_familyName( familyName ), m_parentName( parentName ),
m_autoStyleInStylesDotXml( false ), m_defaultStyle( false )
{
}
@@ -184,14 +184,14 @@ KoGenStyle::~KoGenStyle()
}
void KoGenStyle::writeStyleProperties( KoXmlWriter* writer, PropertyType i,
- const char* elementName, const KoGenStyle* tqparentStyle ) const
+ const char* elementName, const KoGenStyle* parentStyle ) const
{
if ( !m_properties[i].isEmpty() ) {
writer->startElement( elementName );
TQMap<TQString, TQString>::const_iterator it = m_properties[i].begin();
const TQMap<TQString, TQString>::const_iterator end = m_properties[i].end();
for ( ; it != end; ++it ) {
- if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() )
+ if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() )
writer->addAttribute( it.key().utf8(), it.data().utf8() );
}
writer->endElement();
@@ -202,19 +202,19 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha
{
//kdDebug(30003) << "writing out style " << name << " display-name=" << m_attributes["style:display-name"] << " family=" << m_familyName << endl;
writer->startElement( elementName );
- const KoGenStyle* tqparentStyle = 0;
+ const KoGenStyle* parentStyle = 0;
if ( !m_defaultStyle ) {
if ( !drawElement )
writer->addAttribute( "style:name", name );
else
writer->addAttribute( "draw:name", name );
if ( !m_parentName.isEmpty() ) {
- tqparentStyle = styles.style( m_parentName );
- if ( tqparentStyle && m_familyName.isEmpty() ) {
+ parentStyle = styles.style( m_parentName );
+ if ( parentStyle && m_familyName.isEmpty() ) {
// get family from tqparent style, just in case
// Note: this is saving code, don't convert to attributeNS!
const_cast<KoGenStyle *>( this )->
- m_familyName = tqparentStyle->attribute( "style:family" ).latin1();
+ m_familyName = parentStyle->attribute( "style:family" ).latin1();
//kdDebug(30003) << "Got familyname " << m_familyName << " from tqparent" << endl;
}
writer->addAttribute( "style:tqparent-style-name", m_parentName );
@@ -234,9 +234,9 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha
#if 0 // #ifndef NDEBUG
kdDebug() << "style: " << name << endl;
printDebug();
- if ( tqparentStyle ) {
+ if ( parentStyle ) {
kdDebug() << " tqparent: " << m_parentName << endl;
- tqparentStyle->printDebug();
+ parentStyle->printDebug();
}
#endif
@@ -247,8 +247,8 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha
TQMap<TQString, TQString>::const_iterator it = m_attributes.begin();
for ( ; it != m_attributes.end(); ++it ) {
bool writeit = true;
- if ( tqparentStyle && it.key() != "style:family" // always write the family out
- && tqparentStyle->attribute( it.key() ) == it.data() )
+ if ( parentStyle && it.key() != "style:family" // always write the family out
+ && parentStyle->attribute( it.key() ) == it.data() )
writeit = false;
if ( writeit )
writer->addAttribute( it.key().utf8(), it.data().utf8() );
@@ -261,27 +261,27 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha
writer->startElement( propertiesElementName ); // e.g. paragraph-properties
it = m_properties[i].begin();
for ( ; it != m_properties[i].end(); ++it ) {
- if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() )
+ if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() )
writer->addAttribute( it.key().utf8(), it.data().utf8() );
}
i = KoGenStyle::ChildElement;
it = m_properties[i].begin();
for ( ; it != m_properties[i].end(); ++it ) {
- if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) {
+ if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) {
writer->addCompleteElement( it.data().utf8() );
}
}
if ( createPropertiesTag )
writer->endElement();
}
- writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", tqparentStyle );
- writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", tqparentStyle );
- writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", tqparentStyle );
+ writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", parentStyle );
+ writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", parentStyle );
+ writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", parentStyle );
// And now the style maps
for ( uint i = 0; i < m_maps.count(); ++i ) {
bool writeit = true;
- if ( tqparentStyle && compareMap( m_maps[i], tqparentStyle->m_maps[i] ) == 0 )
+ if ( parentStyle && compareMap( m_maps[i], parentStyle->m_maps[i] ) == 0 )
writeit = false;
if ( writeit ) {
writer->startElement( "style:map" );