summaryrefslogtreecommitdiffstats
path: root/filters/kword/rtf/import/rtfimport.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:32:11 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:32:11 -0600
commit94844816550ad672ccfcdc25659c625546239998 (patch)
treee35fc60fd736c645d59f6408af032774ad8023d3 /filters/kword/rtf/import/rtfimport.cpp
parent2a811c38c74c03648ecf857e566c44483cbad706 (diff)
downloadkoffice-94844816550ad672ccfcdc25659c625546239998.tar.gz
koffice-94844816550ad672ccfcdc25659c625546239998.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'filters/kword/rtf/import/rtfimport.cpp')
-rw-r--r--filters/kword/rtf/import/rtfimport.cpp250
1 files changed, 125 insertions, 125 deletions
diff --git a/filters/kword/rtf/import/rtfimport.cpp b/filters/kword/rtf/import/rtfimport.cpp
index 94fad6970..eb8c467de 100644
--- a/filters/kword/rtf/import/rtfimport.cpp
+++ b/filters/kword/rtf/import/rtfimport.cpp
@@ -98,7 +98,7 @@ static RTFProperty propertyTable[] =
MEMBER( 0L, "b", setToggleProperty, state.format.bold, 0 ),
// \bin is handled in the tokenizer
MEMBER( "@colortbl", "blue", setNumericProperty, blue, 0 ),
- MEMBER( 0L, "box", setEnumProperty, state.tqlayout.border, 0 ),
+ MEMBER( 0L, "box", setEnumProperty, state.layout.border, 0 ),
PROP( 0L, "brdrb", selectLayoutBorder, 0L, 3 ),
PROP( 0L, "brdrcf", setBorderColor, 0L, 0 ),
PROP( 0L, "brdrdash", setBorderStyle, 0L, RTFBorder::Dashes ),
@@ -148,7 +148,7 @@ static RTFProperty propertyTable[] =
MEMBER( "@rtf", "facingp", setFlagProperty, facingPages, true ),
PROP( 0L, "fcharset", setCharset, 0L, 0 ), // Not needed with TQt
PROP( "@fonttbl", "fdecor", setFontStyleHint, 0L, TQFont::Decorative ),
- MEMBER( 0L, "fi", setNumericProperty, state.tqlayout.firstIndent, 0 ),
+ MEMBER( 0L, "fi", setNumericProperty, state.layout.firstIndent, 0 ),
PROP( "@fonttbl", "fmodern", setFontStyleHint, 0L, TQFont::TypeWriter ),
PROP( "@fonttbl", "fnil", setFontStyleHint, 0L, TQFont::AnyStyle ),
MEMBER( 0L, "footery", setNumericProperty, state.section.footerMargin, 0 ),
@@ -162,13 +162,13 @@ static RTFProperty propertyTable[] =
MEMBER( "@colortbl", "green", setNumericProperty, green, 0 ),
MEMBER( 0L, "headery", setNumericProperty, state.section.headerMargin, 0 ),
MEMBER( 0L, "i", setToggleProperty, state.format.italic, 0 ),
- MEMBER( 0L, "intbl", setFlagProperty, state.tqlayout.inTable, true ),
+ MEMBER( 0L, "intbl", setFlagProperty, state.layout.inTable, true ),
PROP( "@pict", "jpegblip", setPictureType, 0L, RTFPicture::JPEG ),
- MEMBER( 0L, "keep", setFlagProperty, state.tqlayout.keep, true ),
- MEMBER( 0L, "keepn", setFlagProperty, state.tqlayout.keepNext, true ),
+ MEMBER( 0L, "keep", setFlagProperty, state.layout.keep, true ),
+ MEMBER( 0L, "keepn", setFlagProperty, state.layout.keepNext, true ),
MEMBER( "@rtf", "landscape", setFlagProperty, landscape, true ),
PROP( 0L, "ldblquote", insertSymbol, 0L, 0x201c ),
- MEMBER( 0L, "li", setNumericProperty, state.tqlayout.leftIndent, 0 ),
+ MEMBER( 0L, "li", setNumericProperty, state.layout.leftIndent, 0 ),
PROP( 0L, "line", insertSymbol, 0L, 0x000a ),
PROP( 0L, "lquote", insertSymbol, 0L, 0x2018 ),
PROP( 0L, "ltrmark", insertSymbol, 0L, 0x200e ),
@@ -180,14 +180,14 @@ static RTFProperty propertyTable[] =
MEMBER( "@rtf", "margt", setNumericProperty, topMargin, 0 ),
MEMBER( 0L, "nosupersub", setEnumProperty, state.format.vertAlign, RTFFormat::Normal ),
PROP( "Text", "page", insertPageBreak, 0L, 0 ),
- MEMBER( 0L, "pagebb", setFlagProperty, state.tqlayout.pageBB, true ),
+ MEMBER( 0L, "pagebb", setFlagProperty, state.layout.pageBB, true ),
MEMBER( "@rtf", "paperh", setNumericProperty, paperHeight, 0 ),
MEMBER( "@rtf", "paperw", setNumericProperty, paperWidth, 0 ),
PROP( "Text", "par", insertParagraph, 0L, 0 ),
PROP( 0L, "pard", setParagraphDefaults, 0L, 0 ),
PROP( 0L, "pc", setPcCodepage, 0L, 0 ),
PROP( 0L, "pca", setPcaCodepage, 0L, 0 ),
- MEMBER( 0L, "pgbrk", setToggleProperty, state.tqlayout.pageBA, true ),
+ MEMBER( 0L, "pgbrk", setToggleProperty, state.layout.pageBA, true ),
MEMBER( "@pict", "piccropb", setNumericProperty, picture.cropBottom, 0 ),
MEMBER( "@pict", "piccropl", setNumericProperty, picture.cropLeft, 0 ),
MEMBER( "@pict", "piccropr", setNumericProperty, picture.cropRight, 0 ),
@@ -202,25 +202,25 @@ static RTFProperty propertyTable[] =
PROP( 0L, "plain", setPlainFormatting, 0L, 0 ),
PROP( "@pict", "pmmetafile", setPictureType, 0L, RTFPicture::WMF ),
PROP( "@pict", "pngblip", setPictureType, 0L, RTFPicture::PNG ),
- MEMBER( 0L, "qc", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Centered ),
- MEMBER( 0L, "qj", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Justified ),
- MEMBER( 0L, "ql", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Left ),
+ MEMBER( 0L, "qc", setEnumProperty, state.layout.alignment, RTFLayout::Centered ),
+ MEMBER( 0L, "qj", setEnumProperty, state.layout.alignment, RTFLayout::Justified ),
+ MEMBER( 0L, "ql", setEnumProperty, state.layout.alignment, RTFLayout::Left ),
PROP( 0L, "qmspace", insertSymbol, 0L, 0x2004 ),
- MEMBER( 0L, "qr", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Right ),
+ MEMBER( 0L, "qr", setEnumProperty, state.layout.alignment, RTFLayout::Right ),
PROP( 0L, "rdblquote", insertSymbol, 0L, 0x201d ),
MEMBER( "@colortbl", "red", setNumericProperty, red, 0 ),
- MEMBER( 0L, "ri", setNumericProperty, state.tqlayout.rightIndent, 0 ),
+ MEMBER( 0L, "ri", setNumericProperty, state.layout.rightIndent, 0 ),
PROP( "Text", "row", insertTableRow, 0L, 0 ),
PROP( 0L, "rquote", insertSymbol, 0L, 0x2019 ),
PROP( 0L, "rtlmark", insertSymbol, 0L, 0x200f ),
- MEMBER( 0L, "s", setNumericProperty, state.tqlayout.style, 0 ),
- MEMBER( 0L, "sa", setNumericProperty, state.tqlayout.spaceAfter, 0 ),
- MEMBER( 0L, "sb", setNumericProperty, state.tqlayout.spaceBefore, 0 ),
+ MEMBER( 0L, "s", setNumericProperty, state.layout.style, 0 ),
+ MEMBER( 0L, "sa", setNumericProperty, state.layout.spaceAfter, 0 ),
+ MEMBER( 0L, "sb", setNumericProperty, state.layout.spaceBefore, 0 ),
MEMBER( 0L, "scaps", setToggleProperty, state.format.smallCaps, 0 ),
PROP( "Text", "sect", insertPageBreak, 0L, 0 ),
PROP( 0L, "sectd", setSectionDefaults, 0L, 0 ),
- MEMBER( 0L, "sl", setNumericProperty, state.tqlayout.spaceBetween, 0 ),
- MEMBER( 0L, "slmult", setToggleProperty, state.tqlayout.spaceBetweenMultiple, 0 ),
+ MEMBER( 0L, "sl", setNumericProperty, state.layout.spaceBetween, 0 ),
+ MEMBER( 0L, "slmult", setToggleProperty, state.layout.spaceBetweenMultiple, 0 ),
MEMBER( "@stylesheet", "snext", setNumericProperty, style.next, 0 ),
MEMBER( 0L, "strike", setToggleProperty, state.format.strike, 0 ),
MEMBER( 0L, "striked", setToggleProperty, state.format.striked, 0 ),
@@ -228,18 +228,18 @@ static RTFProperty propertyTable[] =
MEMBER( 0L, "super", setEnumProperty, state.format.vertAlign, RTFFormat::SuperScript ),
PROP( 0L, "tab", insertSymbol, 0L, 0x0009 ),
MEMBER( 0L, "titlepg", setFlagProperty, state.section.titlePage, true ),
- MEMBER( 0L, "tldot", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Dots ),
- MEMBER( 0L, "tlhyph", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Hyphens ),
- MEMBER( 0L, "tlth", setEnumProperty, state.tqlayout.tab.leader, RTFTab::ThickLine ),
- MEMBER( 0L, "tlul", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Underline ),
- MEMBER( 0L, "tqc", setEnumProperty, state.tqlayout.tab.type, RTFTab::Centered ),
- MEMBER( 0L, "tqdec", setEnumProperty, state.tqlayout.tab.type, RTFTab::Decimal ),
- MEMBER( 0L, "tqr", setEnumProperty, state.tqlayout.tab.type, RTFTab::FlushRight ),
+ MEMBER( 0L, "tldot", setEnumProperty, state.layout.tab.leader, RTFTab::Dots ),
+ MEMBER( 0L, "tlhyph", setEnumProperty, state.layout.tab.leader, RTFTab::Hyphens ),
+ MEMBER( 0L, "tlth", setEnumProperty, state.layout.tab.leader, RTFTab::ThickLine ),
+ MEMBER( 0L, "tlul", setEnumProperty, state.layout.tab.leader, RTFTab::Underline ),
+ MEMBER( 0L, "tqc", setEnumProperty, state.layout.tab.type, RTFTab::Centered ),
+ MEMBER( 0L, "tqdec", setEnumProperty, state.layout.tab.type, RTFTab::Decimal ),
+ MEMBER( 0L, "tqr", setEnumProperty, state.layout.tab.type, RTFTab::FlushRight ),
MEMBER( 0L, "trleft", setNumericProperty, state.tableRow.left, 0 ),
MEMBER( 0L, "trowd", setTableRowDefaults, state.tableRow, 0 ),
- MEMBER( 0L, "trqc", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Centered ),
- MEMBER( 0L, "trql", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Left ),
- MEMBER( 0L, "trqr", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Right ),
+ MEMBER( 0L, "trqc", setEnumProperty, state.tableRow.alignment, RTFLayout::Centered ),
+ MEMBER( 0L, "trql", setEnumProperty, state.tableRow.alignment, RTFLayout::Left ),
+ MEMBER( 0L, "trqr", setEnumProperty, state.tableRow.alignment, RTFLayout::Right ),
MEMBER( 0L, "trrh", setNumericProperty, state.tableRow.height, 0 ),
PROP( 0L, "tx", insertTabDef, 0L, 0 ),
MEMBER( 0L, "u", insertUnicodeSymbol, state.format.uc, 0 ),
@@ -309,7 +309,7 @@ RTFImport::RTFImport( KoFilter *, const char *, const TQStringList& )
fnnum=0;
}
-KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQCString& to )
+KoFilter::ConversionStatus RTFImport::convert( const TQCString& from, const TQCString& to )
{
// This filter only supports RTF to KWord conversion
if ((from != "text/rtf") || (to != "application/x-kword"))
@@ -384,7 +384,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
if ( !m_batch )
{
force = ( KMessageBox::warningYesNo( 0L,
- i18n("The RTF (Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ),
+ i18n("The RTF (Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ),
i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes );
}
if ( !force )
@@ -403,7 +403,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
if ( !m_batch )
{
force = ( KMessageBox::warningYesNo( 0L,
- i18n("The PWD (PocketWord's Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ),
+ i18n("The PWD (PocketWord's Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ),
i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes );
}
if ( !force )
@@ -422,7 +422,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
if ( !m_batch )
{
force = ( KMessageBox::warningYesNo( 0L,
- i18n("The URTF (\"Unicode Rich Text Format\") document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ),
+ i18n("The URTF (\"Unicode Rich Text Format\") document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ),
i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes );
}
if ( !force )
@@ -439,7 +439,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
if ( !m_batch )
{
KMessageBox::error( 0L,
- i18n("The RTF document cannot be loaded, as it has an unexpected first keyword: \\%1.").tqarg( token.text ),
+ i18n("The RTF document cannot be loaded, as it has an unexpected first keyword: \\%1.").arg( token.text ),
i18n("KWord's RTF Import Filter"), 0 );
}
return KoFilter::WrongFormat;
@@ -731,7 +731,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
// Search for 'following' style
for (TQValueList<RTFStyle>::ConstIterator it2=styleSheet.begin();it2!=endStyleSheet;++it2)
{
- if ((*it2).tqlayout.style == (*it).next)
+ if ((*it2).layout.style == (*it).next)
{
mainDoc.addNode( "FOLLOWING" );
mainDoc.setAttribute( "name", CheckAndEscapeXmlText( (*it2).name ));
@@ -739,7 +739,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
break;
}
}
- addLayout( mainDoc, (*it).name, (*it).tqlayout, false );
+ addLayout( mainDoc, (*it).name, (*it).layout, false );
addFormat( mainDoc, kwFormat, 0L );
mainDoc.closeNode( "STYLE" );
}
@@ -793,7 +793,7 @@ KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQ
for (TQMap<TQString,int>::ConstIterator it=debugUnknownKeywords.begin();
it!=debugUnknownKeywords.end();it++)
- kdDebug(30515) << "Unknown keyword: " << TQString( "%1" ).tqarg( it.data(), 4 ) << " * " << it.key() << endl;
+ kdDebug(30515) << "Unknown keyword: " << TQString( "%1" ).arg( it.data(), 4 ) << " * " << it.key() << endl;
return KoFilter::OK;
}
@@ -911,7 +911,7 @@ void RTFImport::setEnumProperty( RTFProperty *property )
void RTFImport::setFontStyleHint( RTFProperty* property )
{
- font.tqstyleHint = TQFont::StyleHint( property->value );
+ font.styleHint = TQFont::StyleHint( property->value );
}
void RTFImport::setPictureType( RTFProperty* property )
@@ -933,15 +933,15 @@ void RTFImport::setUnderlineProperty( RTFProperty* property )
void RTFImport::setBorderStyle( RTFProperty *property )
{
- if (state.tqlayout.border)
+ if (state.layout.border)
{
- state.tqlayout.border->style = static_cast <RTFBorder::BorderStyle> ( property->value );
+ state.layout.border->style = static_cast <RTFBorder::BorderStyle> ( property->value );
}
else
{
for (uint i=0; i < 4; i++)
{
- state.tqlayout.borders[i].style = static_cast <RTFBorder::BorderStyle> ( property->value );
+ state.layout.borders[i].style = static_cast <RTFBorder::BorderStyle> ( property->value );
}
}
}
@@ -949,30 +949,30 @@ void RTFImport::setBorderStyle( RTFProperty *property )
void RTFImport::setBorderProperty( RTFProperty *property )
{
//kdDebug() << "setBorderProperty: " << endl;
- if (state.tqlayout.border)
+ if (state.layout.border)
{
- state.tqlayout.border->width = token.value;
+ state.layout.border->width = token.value;
}
else
{
for (uint i=0; i < 4; i++)
{
- state.tqlayout.borders[i].width = token.value;
+ state.layout.borders[i].width = token.value;
}
}
}
void RTFImport::setBorderColor( RTFProperty * )
{
- if (state.tqlayout.border)
+ if (state.layout.border)
{
- state.tqlayout.border->color = token.value;
+ state.layout.border->color = token.value;
}
else
{
for (uint i=0; i < 4; i++)
{
- state.tqlayout.borders[i].color = token.value;
+ state.layout.borders[i].color = token.value;
}
}
}
@@ -1008,34 +1008,34 @@ void RTFImport::setPlainFormatting( RTFProperty * )
void RTFImport::setParagraphDefaults( RTFProperty * )
{
- RTFLayout &tqlayout = state.tqlayout;
+ RTFLayout &layout = state.layout;
- tqlayout.tablist.clear();
- tqlayout.tab.type = RTFTab::Left;
- tqlayout.tab.leader = RTFTab::None;
+ layout.tablist.clear();
+ layout.tab.type = RTFTab::Left;
+ layout.tab.leader = RTFTab::None;
for (uint i=0; i < 4; i++)
{
- RTFBorder &border = tqlayout.borders[i];
+ RTFBorder &border = layout.borders[i];
border.color = -1;
border.width = 0;
border.style = RTFBorder::None;
}
- tqlayout.firstIndent = 0;
- tqlayout.leftIndent = 0;
- tqlayout.rightIndent = 0;
- tqlayout.spaceBefore = 0;
- tqlayout.spaceAfter = 0;
- tqlayout.spaceBetween = 0;
- tqlayout.spaceBetweenMultiple = false;
- tqlayout.style = 0;
- tqlayout.tqalignment = RTFLayout::Left;
- tqlayout.border = 0L;
- tqlayout.inTable = false;
- tqlayout.keep = false;
- tqlayout.keepNext = false;
- tqlayout.pageBB = false;
- tqlayout.pageBA = false;
+ layout.firstIndent = 0;
+ layout.leftIndent = 0;
+ layout.rightIndent = 0;
+ layout.spaceBefore = 0;
+ layout.spaceAfter = 0;
+ layout.spaceBetween = 0;
+ layout.spaceBetweenMultiple = false;
+ layout.style = 0;
+ layout.alignment = RTFLayout::Left;
+ layout.border = 0L;
+ layout.inTable = false;
+ layout.keep = false;
+ layout.keepNext = false;
+ layout.pageBB = false;
+ layout.pageBA = false;
}
void RTFImport::setSectionDefaults( RTFProperty * )
@@ -1054,7 +1054,7 @@ void RTFImport::setTableRowDefaults( RTFProperty * )
tableRow.height = 0;
tableRow.left = 0;
- tableRow.tqalignment = RTFLayout::Left;
+ tableRow.alignment = RTFLayout::Left;
tableRow.cells.clear();
tableCell.bgcolor = -1;
@@ -1069,17 +1069,17 @@ void RTFImport::setTableRowDefaults( RTFProperty * )
void RTFImport::selectLayoutBorder( RTFProperty * property )
{
- state.tqlayout.border = & state.tqlayout.borders [ property->value ];
+ state.layout.border = & state.layout.borders [ property->value ];
}
void RTFImport::selectLayoutBorderFromCell( RTFProperty * property )
{
- state.tqlayout.border = & state.tableCell.borders [ property->value ];
+ state.layout.border = & state.tableCell.borders [ property->value ];
}
void RTFImport::insertParagraph( RTFProperty * )
{
- if (state.tqlayout.inTable)
+ if (state.layout.inTable)
{
if (textState->table == 0)
{
@@ -1110,10 +1110,10 @@ void RTFImport::insertPageBreak( RTFProperty * )
void RTFImport::insertTableCell( RTFProperty * )
{
//{{
- bool b = state.tqlayout.inTable;
- state.tqlayout.inTable = true;
+ bool b = state.layout.inTable;
+ state.layout.inTable = true;
insertParagraph();
- state.tqlayout.inTable = b;
+ state.layout.inTable = b;
//}}
textState->frameSets << textState->cell.toString();
textState->cell.clear( 3 );
@@ -1130,14 +1130,14 @@ void RTFImport::insertTableRow( RTFProperty * )
{
char buf[64];
sprintf( buf, "Table %d", textState->table );
- RTFLayout::Alignment align = row.tqalignment;
+ RTFLayout::Alignment align = row.alignment;
// Store the current state on the stack
stateStack.push( state );
resetState();
- state.tqlayout.tqalignment = align; // table tqalignment
+ state.layout.alignment = align; // table alignment
- // Add anchor for new table (default tqlayout)
+ // Add anchor for new table (default layout)
addAnchor( buf );
addParagraph( textState->node, false );
@@ -1202,9 +1202,9 @@ void RTFImport::insertCellDef( RTFProperty * )
void RTFImport::insertTabDef( RTFProperty * )
{
- RTFTab tab = state.tqlayout.tab;
+ RTFTab tab = state.layout.tab;
tab.position = token.value;
- state.tqlayout.tablist.push( tab );
+ state.layout.tablist.push( tab );
tab.type = RTFTab::Left;
tab.leader = RTFTab::None;
}
@@ -1321,7 +1321,7 @@ void RTFImport::parseFontTable( RTFProperty * )
if (token.type == RTFTokenizer::OpenGroup)
{
font.name = TQString();
- font.tqstyleHint = TQFont::AnyStyle;
+ font.styleHint = TQFont::AnyStyle;
font.fixedPitch = 0;
}
else if (token.type == RTFTokenizer::PlainText)
@@ -1344,7 +1344,7 @@ void RTFImport::parseFontTable( RTFProperty * )
// Use TQt to look up the closest matching installed font
TQFont qFont( font.name );
qFont.setFixedPitch( (font.fixedPitch == 1) );
- qFont.setStyleHint( font.tqstyleHint );
+ qFont.setStyleHint( font.styleHint );
for(;!qFont.exactMatch();)
{
int space=font.name.findRev(' ', font.name.length());
@@ -1362,7 +1362,7 @@ void RTFImport::parseFontTable( RTFProperty * )
else
fontTable.insert( state.format.font, newFontName );
font.name.truncate( 0 );
- font.tqstyleHint = TQFont::AnyStyle;
+ font.styleHint = TQFont::AnyStyle;
font.fixedPitch = 0;
}
}
@@ -1386,8 +1386,8 @@ void RTFImport::parseStyleSheet( RTFProperty * )
*strchr( token.text, ';' ) = 0; // ### TODO: is this allowed with multi-byte Asian characters?
style.name += textCodec->toUnicode( token.text );
style.format = state.format;
- style.tqlayout = state.tqlayout;
- style.next = (style.next == -1) ? style.tqlayout.style : style.next;
+ style.layout = state.layout;
+ style.next = (style.next == -1) ? style.layout.style : style.next;
styleSheet << style;
style.name.truncate( 0 );
style.next = -1;
@@ -1538,8 +1538,8 @@ void RTFImport::parsePicture( RTFProperty * )
// Add anchor to rich text destination
addAnchor( frameName );
- // It is safe, as we call tqcurrentDateTime only once for each picture
- const TQDateTime dt(TQDateTime::tqcurrentDateTime());
+ // It is safe, as we call currentDateTime only once for each picture
+ const TQDateTime dt(TQDateTime::currentDateTime());
// Add pixmap or clipart (key)
pictures.addKey( dt, idStr, pictName );
@@ -1614,7 +1614,7 @@ void RTFImport::addImportedPicture( const TQString& rawFileName )
// Add anchor to rich text destination
addAnchor( frameName );
- // It is safe, as we call tqcurrentDateTime only once for each picture
+ // It is safe, as we call currentDateTime only once for each picture
const TQDateTime dt( pic.getKey().lastModified() );
// Add picture key
@@ -2055,7 +2055,7 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma
int vertAlign0 = ~vertAlign;
int fontSize0 = ~fontSize;
- // Adjust vertical tqalignment and font size if (\dn, \up) are used
+ // Adjust vertical alignment and font size if (\dn, \up) are used
if (format.fmt.vertAlign == RTFFormat::Normal && format.fmt.baseline)
{
if (format.fmt.baseline < 0)
@@ -2261,40 +2261,40 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma
node.closeNode( "FORMAT" );
}
-void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout &tqlayout, bool frameBreak )
+void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout &layout, bool frameBreak )
{
- // Style name and tqalignment
+ // Style name and alignment
node.addNode( "NAME" );
node.setAttribute( "value", CheckAndEscapeXmlText(name) );
node.closeNode( "NAME" );
node.addNode( "FLOW" );
- node.setAttribute( "align", alignN[tqlayout.tqalignment] );
+ node.setAttribute( "align", alignN[layout.alignment] );
node.closeNode( "FLOW" );
// Indents
- if (tqlayout.firstIndent || tqlayout.leftIndent || tqlayout.rightIndent)
+ if (layout.firstIndent || layout.leftIndent || layout.rightIndent)
{
node.addNode( "INDENTS" );
- if (tqlayout.firstIndent)
- node.setAttribute( "first", .05*tqlayout.firstIndent );
- if (tqlayout.leftIndent)
- node.setAttribute( "left", .05*tqlayout.leftIndent );
- if (tqlayout.rightIndent)
- node.setAttribute( "right", .05*tqlayout.rightIndent );
+ if (layout.firstIndent)
+ node.setAttribute( "first", .05*layout.firstIndent );
+ if (layout.leftIndent)
+ node.setAttribute( "left", .05*layout.leftIndent );
+ if (layout.rightIndent)
+ node.setAttribute( "right", .05*layout.rightIndent );
node.closeNode( "INDENTS" );
}
// Offets
- if (tqlayout.spaceBefore || tqlayout.spaceAfter)
+ if (layout.spaceBefore || layout.spaceAfter)
{
node.addNode( "OFFSETS" );
- if (tqlayout.spaceBefore)
- node.setAttribute( "before", .05*tqlayout.spaceBefore );
- if (tqlayout.spaceAfter)
- node.setAttribute( "after", .05*tqlayout.spaceAfter );
+ if (layout.spaceBefore)
+ node.setAttribute( "before", .05*layout.spaceBefore );
+ if (layout.spaceAfter)
+ node.setAttribute( "after", .05*layout.spaceAfter );
node.closeNode( "OFFSETS" );
}
@@ -2304,10 +2304,10 @@ void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout
TQString lineSpacingType;
TQString lineSpacingValue;
- if ( tqlayout.spaceBetweenMultiple )
+ if ( layout.spaceBetweenMultiple )
{
// Note: 240 is a sort of magic value for one line (Once upon a time, it meant 12pt for a single line)
- switch (tqlayout.spaceBetween )
+ switch (layout.spaceBetween )
{
case 240:
{
@@ -2326,10 +2326,10 @@ void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout
}
default:
{
- if ( tqlayout.spaceBetween > 0 )
+ if ( layout.spaceBetween > 0 )
{
lineSpacingType = "multiple";
- lineSpacingValue.setNum( tqlayout.spaceBetween / 240.0 );
+ lineSpacingValue.setNum( layout.spaceBetween / 240.0 );
}
break;
}
@@ -2337,16 +2337,16 @@ void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout
}
else
{
- if (tqlayout.spaceBetween > 0)
+ if (layout.spaceBetween > 0)
{
lineSpacingType = "atleast";
- lineSpacingValue.setNum( 0.05*tqlayout.spaceBetween );
+ lineSpacingValue.setNum( 0.05*layout.spaceBetween );
}
- if (tqlayout.spaceBetween < 0)
+ if (layout.spaceBetween < 0)
{
// negative linespace means "exact"
lineSpacingType = "fixed" ;
- lineSpacingValue.setNum( -0.05*tqlayout.spaceBetween );
+ lineSpacingValue.setNum( -0.05*layout.spaceBetween );
}
}
@@ -2359,20 +2359,20 @@ void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout
node.closeNode( "LINESPACING" );
}
- if (tqlayout.keep || tqlayout.pageBB || tqlayout.pageBA || frameBreak || tqlayout.keepNext)
+ if (layout.keep || layout.pageBB || layout.pageBA || frameBreak || layout.keepNext)
{
node.addNode( "PAGEBREAKING" );
- node.setAttribute( "linesTogether", boolN[tqlayout.keep] );
- node.setAttribute( "hardFrameBreak", boolN[tqlayout.pageBB] );
- node.setAttribute( "hardFrameBreakAfter", boolN[tqlayout.pageBA || frameBreak] );
- node.setAttribute( "keepWithNext", boolN[tqlayout.keepNext] );
+ node.setAttribute( "linesTogether", boolN[layout.keep] );
+ node.setAttribute( "hardFrameBreak", boolN[layout.pageBB] );
+ node.setAttribute( "hardFrameBreakAfter", boolN[layout.pageBA || frameBreak] );
+ node.setAttribute( "keepWithNext", boolN[layout.keepNext] );
node.closeNode( "PAGEBREAKING" );
}
// Paragraph borders
for (uint i=0; i < 4; i++)
{
- const RTFBorder &border = tqlayout.borders[i];
+ const RTFBorder &border = layout.borders[i];
if (border.style != RTFBorder::None || border.width > 0)
{
@@ -2386,21 +2386,21 @@ void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout
}
// Add automatic tab stop for hanging indent
- if (tqlayout.firstIndent < 0 && tqlayout.leftIndent > 0)
+ if (layout.firstIndent < 0 && layout.leftIndent > 0)
{
node.addNode( "TABULATOR" );
node.setAttribute( "type", 0 );
- node.setAttribute( "ptpos", .05*tqlayout.leftIndent );
+ node.setAttribute( "ptpos", .05*layout.leftIndent );
node.closeNode( "TABULATOR" );
}
// Tabulators
- if (!tqlayout.tablist.isEmpty())
+ if (!layout.tablist.isEmpty())
{
// ### TODO: use ConstIterator
- for (uint i=0; i < tqlayout.tablist.count(); i++)
+ for (uint i=0; i < layout.tablist.count(); i++)
{
- const RTFTab &tab = tqlayout.tablist[i];
+ const RTFTab &tab = layout.tablist[i];
int l = (int)tab.leader;
node.addNode( "TABULATOR" );
node.setAttribute( "type", tab.type );
@@ -2422,12 +2422,12 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak )
// Search for style in style sheet
TQString name;
const RTFFormat* format = &state.format;
- const int styleNum = state.tqlayout.style;
+ const int styleNum = state.layout.style;
const TQValueList<RTFStyle>::ConstIterator endStyleSheet = styleSheet.end();
for ( TQValueList<RTFStyle>::ConstIterator it=styleSheet.begin(); it!=endStyleSheet; ++it )
{
- if ( (*it).tqlayout.style == styleNum )
+ if ( (*it).layout.style == styleNum )
{
if ( textState->length > 0 )
{
@@ -2468,9 +2468,9 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak )
node.closeNode( "FORMATS" );
}
- // Write out tqlayout and format
+ // Write out layout and format
node.addNode( "LAYOUT" );
- addLayout( node, name, state.tqlayout, frameBreak );
+ addLayout( node, name, state.layout, frameBreak );
addFormat( node, kwFormat, 0L );
node.closeNode( "LAYOUT" );
node.closeNode( "PARAGRAPH" );