summaryrefslogtreecommitdiffstats
path: root/lib/kotext
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext')
-rw-r--r--lib/kotext/DESIGN20
-rw-r--r--lib/kotext/DateFormatWidget.cpp52
-rw-r--r--lib/kotext/DateFormatWidget.h7
-rw-r--r--lib/kotext/IsoDuration.h16
-rw-r--r--lib/kotext/KFontDialog_local.cpp386
-rw-r--r--lib/kotext/KFontDialog_local.h164
-rw-r--r--lib/kotext/KoAutoFormat.cpp524
-rw-r--r--lib/kotext/KoAutoFormat.h129
-rw-r--r--lib/kotext/KoAutoFormatDia.cpp452
-rw-r--r--lib/kotext/KoAutoFormatDia.h77
-rw-r--r--lib/kotext/KoBgSpellCheck.cpp56
-rw-r--r--lib/kotext/KoBgSpellCheck.h11
-rw-r--r--lib/kotext/KoBorder.cpp60
-rw-r--r--lib/kotext/KoBorder.h36
-rw-r--r--lib/kotext/KoChangeCaseDia.cpp30
-rw-r--r--lib/kotext/KoChangeCaseDia.h17
-rw-r--r--lib/kotext/KoCommentDia.cpp36
-rw-r--r--lib/kotext/KoCommentDia.h15
-rw-r--r--lib/kotext/KoCompletionBase.ui64
-rw-r--r--lib/kotext/KoCompletionDia.cpp58
-rw-r--r--lib/kotext/KoCompletionDia.h12
-rw-r--r--lib/kotext/KoComplexText.cpp716
-rw-r--r--lib/kotext/KoComplexText.h100
-rw-r--r--lib/kotext/KoCreateStyleDia.cpp26
-rw-r--r--lib/kotext/KoCreateStyleDia.h15
-rw-r--r--lib/kotext/KoCustomVariablesDia.cpp158
-rw-r--r--lib/kotext/KoCustomVariablesDia.h52
-rw-r--r--lib/kotext/KoDecorationTab.cpp30
-rw-r--r--lib/kotext/KoDecorationTab.h23
-rw-r--r--lib/kotext/KoFontDia.cpp116
-rw-r--r--lib/kotext/KoFontDia.h19
-rw-r--r--lib/kotext/KoFontDiaPreview.cpp142
-rw-r--r--lib/kotext/KoFontDiaPreview.h53
-rw-r--r--lib/kotext/KoFontTab.cpp14
-rw-r--r--lib/kotext/KoFontTab.h13
-rw-r--r--lib/kotext/KoHighlightingTab.cpp36
-rw-r--r--lib/kotext/KoHighlightingTab.h11
-rw-r--r--lib/kotext/KoImportStyleDia.cpp44
-rw-r--r--lib/kotext/KoImportStyleDia.h17
-rw-r--r--lib/kotext/KoLanguageTab.cpp24
-rw-r--r--lib/kotext/KoLanguageTab.h7
-rw-r--r--lib/kotext/KoLayoutTab.cpp18
-rw-r--r--lib/kotext/KoLayoutTab.h7
-rw-r--r--lib/kotext/KoListStyleStack.cpp12
-rw-r--r--lib/kotext/KoListStyleStack.h14
-rw-r--r--lib/kotext/KoOasisContext.cpp28
-rw-r--r--lib/kotext/KoOasisContext.h22
-rw-r--r--lib/kotext/KoParagCounter.cpp238
-rw-r--r--lib/kotext/KoParagCounter.h82
-rw-r--r--lib/kotext/KoParagDecorationTab.ui32
-rw-r--r--lib/kotext/KoParagDia.cpp756
-rw-r--r--lib/kotext/KoParagDia.h212
-rw-r--r--lib/kotext/KoParagDia_p.h66
-rw-r--r--lib/kotext/KoParagLayout.cpp542
-rw-r--r--lib/kotext/KoParagLayout.h54
-rw-r--r--lib/kotext/KoParagStyle.cpp78
-rw-r--r--lib/kotext/KoParagStyle.h24
-rw-r--r--lib/kotext/KoRichText.cpp204
-rw-r--r--lib/kotext/KoRichText.h288
-rw-r--r--lib/kotext/KoSearchDia.cpp298
-rw-r--r--lib/kotext/KoSearchDia.h151
-rw-r--r--lib/kotext/KoSpell.cpp22
-rw-r--r--lib/kotext/KoSpell.h13
-rw-r--r--lib/kotext/KoStyleCollection.cpp56
-rw-r--r--lib/kotext/KoStyleCollection.h18
-rw-r--r--lib/kotext/KoStyleManager.cpp168
-rw-r--r--lib/kotext/KoStyleManager.h84
-rw-r--r--lib/kotext/KoTextBookmark.cpp4
-rw-r--r--lib/kotext/KoTextBookmark.h28
-rw-r--r--lib/kotext/KoTextCommand.cpp50
-rw-r--r--lib/kotext/KoTextCommand.h34
-rw-r--r--lib/kotext/KoTextCustomItem.cpp30
-rw-r--r--lib/kotext/KoTextCustomItem.h22
-rw-r--r--lib/kotext/KoTextDocument.cpp308
-rw-r--r--lib/kotext/KoTextDocument.h147
-rw-r--r--lib/kotext/KoTextFormat.cpp354
-rw-r--r--lib/kotext/KoTextFormat.h178
-rw-r--r--lib/kotext/KoTextFormatter.cpp180
-rw-r--r--lib/kotext/KoTextFormatter.h6
-rw-r--r--lib/kotext/KoTextIterator.cpp42
-rw-r--r--lib/kotext/KoTextIterator.h27
-rw-r--r--lib/kotext/KoTextObject.cpp428
-rw-r--r--lib/kotext/KoTextObject.h147
-rw-r--r--lib/kotext/KoTextParag.cpp680
-rw-r--r--lib/kotext/KoTextParag.h134
-rw-r--r--lib/kotext/KoTextView.cpp240
-rw-r--r--lib/kotext/KoTextView.h75
-rw-r--r--lib/kotext/KoTextViewIface.cc106
-rw-r--r--lib/kotext/KoTextViewIface.h76
-rw-r--r--lib/kotext/KoTextZoomHandler.cpp38
-rw-r--r--lib/kotext/KoTextZoomHandler.h72
-rw-r--r--lib/kotext/KoUserStyle.cpp6
-rw-r--r--lib/kotext/KoUserStyle.h16
-rw-r--r--lib/kotext/KoUserStyleCollection.cpp38
-rw-r--r--lib/kotext/KoUserStyleCollection.h24
-rw-r--r--lib/kotext/KoVariable.cpp768
-rw-r--r--lib/kotext/KoVariable.h351
-rw-r--r--lib/kotext/TimeFormatWidget.cpp52
-rw-r--r--lib/kotext/TimeFormatWidget.h7
-rw-r--r--lib/kotext/kodecorationtabbase.ui24
-rw-r--r--lib/kotext/kofonttabbase.ui4
-rw-r--r--lib/kotext/kohighlightingtabbase.ui14
-rw-r--r--lib/kotext/kohyphen/hyphdicts/hyph_da.dic2
-rw-r--r--lib/kotext/kohyphen/hyphdicts/hyph_es.dic4
-rw-r--r--lib/kotext/kohyphen/hyphdicts/hyph_hu.dic4
-rw-r--r--lib/kotext/kohyphen/hyphdicts/hyph_nl.dic2
-rwxr-xr-xlib/kotext/kohyphen/hyphdicts/hyph_sv.dic2
-rw-r--r--lib/kotext/kohyphen/kohyphen.cpp84
-rw-r--r--lib/kotext/kohyphen/kohyphen.h36
-rw-r--r--lib/kotext/kohyphen/kohyphentest.cpp28
-rw-r--r--lib/kotext/kolanguagetabbase.ui10
-rw-r--r--lib/kotext/kolayouttabbase.ui36
-rw-r--r--lib/kotext/tests/KoUserStyleTester.cpp22
-rw-r--r--lib/kotext/tests/KoUserStyleTester.h1
-rw-r--r--lib/kotext/tests/kobordertest.cpp60
-rw-r--r--lib/kotext/tests/kotextformattertest.cpp10
-rw-r--r--lib/kotext/tests/kovariabletest.cpp10
-rw-r--r--lib/kotext/timedateformatwidget.ui40
118 files changed, 6227 insertions, 6159 deletions
diff --git a/lib/kotext/DESIGN b/lib/kotext/DESIGN
index 12bc2940..dcb08ca7 100644
--- a/lib/kotext/DESIGN
+++ b/lib/kotext/DESIGN
@@ -26,17 +26,17 @@ Zoomed: (aka Normal)
Internal:
The former two were mostly for objects like frames etc, not for text. Text (the individual
- words and characters) are positioned with the layout coordinates. Layout is similar to the
+ words and characters) are positioned with the tqlayout coordinates. Layout is similar to the
Zoomed system, but always uses the same resolution. This resolution is sufficiently high to
- do the layout in integers, and not really lose info.
+ do the tqlayout in integers, and not really lose info.
- This is the high-resolution unit in which the text layout is done,
+ This is the high-resolution unit in which the text tqlayout is done,
currently set to 1440 DPI. Everything known the QRT classes will be in
this coordinate system (including the QTextFormats). When painting, we apply
the current zoom and resolution to find the right font size to use, and we
have to catch up with rounding differences. However the position of the words
- (i.e. layout) is the one determined previously in layout units. KoZoomHandler
- offers methods for converting between layout units and zoom-dependent points
+ (i.e. tqlayout) is the one determined previously in tqlayout units. KoZoomHandler
+ offers methods for converting between tqlayout units and zoom-dependent points
and pixels.
Note that the Internal coordinate system starts at the topleft corner of
@@ -73,25 +73,25 @@ Document (pt values, in double, KoPoint, KoRect.)
|
|--KWTextFrameSet::documentToInternal
V
-Internal coordinates (the coordinates given to QRT - in "layout units")
-Note that there are pixels and pts in the layout unit system too !
+Internal coordinates (the coordinates given to QRT - in "tqlayout units")
+Note that there are pixels and pts in the tqlayout unit system too !
There are conversions between LU points and document points,
but also direct conversions between LU pixels and view pixels.
Font sizes
==========
-A 12pt font will lead to a layout font of ptToLayoutUnit(12)=20*12=240pt -
+A 12pt font will lead to a tqlayout font of ptToLayoutUnit(12)=20*12=240pt -
that's the value stored in the QTextFormat.
However font metrics are calculated from the 100%-zoom-level font (e.g. 12pt for a 12pt font)
and _then_ multiplied by 20, instead of loading a 240pt font for that as we did before.
This is implemented by KoTextFormat::charWidth().
-On screen, at 100%, a layoutUnitToFontSize(240,false)=(240/20)*1.0=20.0pt font size will be used.
+On screen, at 100%, a tqlayoutUnitToFontSize(240,false)=(240/20)*1.0=20.0pt font size will be used.
This does NOT depend on the DPI settings. Qt takes care of pt->pixel conversion for fonts.
When printing... TODO, double-check whether Qt does pt->pixel conversion correctly
-(apparently it didn't, in Qt 2).
+(aptqparently it didn't, in Qt 2).
QFont multiplies by 10 and stores into a 'short'... So for QFont the maximum font size
is 3276, and in KOffice the maximum font size in points is around 163.
diff --git a/lib/kotext/DateFormatWidget.cpp b/lib/kotext/DateFormatWidget.cpp
index 444dc583..bff1f86c 100644
--- a/lib/kotext/DateFormatWidget.cpp
+++ b/lib/kotext/DateFormatWidget.cpp
@@ -1,28 +1,28 @@
#include "timedateformatwidget.h"
#include "DateFormatWidget.h"
#include "DateFormatWidget.moc"
-#include <qdatetime.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqdatetime.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
#include <kglobal.h>
#include <klocale.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <kdebug.h>
#include <knuminput.h>
#include <KoVariable.h>
/*
- * Constructs a DateFormatWidget which is a child of 'parent', with the
+ * Constructs a DateFormatWidget which is a child of 'tqparent', with the
* name 'name' and widget flags set to 'fl'
*/
-DateFormatWidget::DateFormatWidget( QWidget* parent, const char* name, WFlags fl )
- : TimeDateFormatWidgetPrototype( parent, name, fl )
+DateFormatWidget::DateFormatWidget( TQWidget* tqparent, const char* name, WFlags fl )
+ : TimeDateFormatWidgetPrototype( tqparent, name, fl )
{
setCaption( i18n( "DateFormat", "Format of Date Variable" ) );
- QStringList listDateFormat = KoVariableDateFormat::staticTranslatedFormatPropsList();
+ TQStringList listDateFormat = KoVariableDateFormat::staticTranslatedFormatPropsList();
combo1->insertStringList(listDateFormat);
combo2->insertItem( i18n( "Day"));
@@ -52,10 +52,10 @@ DateFormatWidget::DateFormatWidget( QWidget* parent, const char* name, WFlags f
label_correction->setText(i18n("Correct in Days"));
- connect( CheckBox1, SIGNAL(toggled ( bool )),this,SLOT(slotPersonalizeChanged(bool)));
- connect( combo1, SIGNAL(activated ( const QString & )), this, SLOT(slotDefaultValueChanged(const QString &)));
- connect( combo1, SIGNAL(textChanged ( const QString & )), this, SLOT(slotDefaultValueChanged(const QString &)));
- connect( KIntNumInput1, SIGNAL(valueChanged(int)), this, SLOT( slotOffsetChanged(int)));
+ connect( CheckBox1, TQT_SIGNAL(toggled ( bool )),this,TQT_SLOT(slotPersonalizeChanged(bool)));
+ connect( combo1, TQT_SIGNAL(activated ( const TQString & )), this, TQT_SLOT(slotDefaultValueChanged(const TQString &)));
+ connect( combo1, TQT_SIGNAL(textChanged ( const TQString & )), this, TQT_SLOT(slotDefaultValueChanged(const TQString &)));
+ connect( KIntNumInput1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT( slotOffsetChanged(int)));
slotPersonalizeChanged(false);
}
@@ -64,13 +64,13 @@ DateFormatWidget::DateFormatWidget( QWidget* parent, const char* name, WFlags f
*/
DateFormatWidget::~DateFormatWidget()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, TQt does it all for us
}
/*
* public slot
*/
-void DateFormatWidget::slotDefaultValueChanged(const QString & )
+void DateFormatWidget::slotDefaultValueChanged(const TQString & )
{
updateLabel();
}
@@ -91,7 +91,7 @@ void DateFormatWidget::slotPersonalizeChanged(bool b)
void DateFormatWidget::comboActivated()
{
- QString string=combo2->currentText();
+ TQString string=combo2->currentText();
if(string==i18n( "Day"))
combo1->lineEdit()->insert("d");
else if(string==i18n( "Day (2 digits)"))
@@ -147,29 +147,29 @@ void DateFormatWidget::updateLabel()
{
KoVariableDateFormat format;
format.setFormatProperties( resultString() );
- QDateTime ct = QDateTime::currentDateTime().addDays( correctValue() );
+ TQDateTime ct = TQDateTime::tqcurrentDateTime().addDays( correctValue() );
label->setText( format.convert( ct ) );
}
-QString DateFormatWidget::resultString()
+TQString DateFormatWidget::resultString()
{
- const QString lookup(combo1->currentText());
- const QStringList listTranslated( KoVariableDateFormat::staticTranslatedFormatPropsList() );
- const int index = listTranslated.findIndex(lookup);
+ const TQString lookup(combo1->currentText());
+ const TQStringList listTranslated( KoVariableDateFormat::staticTranslatedFormatPropsList() );
+ const int index = listTranslated.tqfindIndex(lookup);
if (index==-1)
return (lookup); // Either costum or non-locale
// We have now a locale format, so we must "translate" it back;
// Lookup untranslated format
- const QStringList listRaw( KoVariableDateFormat::staticFormatPropsList() );
+ const TQStringList listRaw( KoVariableDateFormat::staticFormatPropsList() );
- QStringList::ConstIterator it( listRaw.at(index) );
+ TQStringList::ConstIterator it( listRaw.at(index) );
Q_ASSERT( it != listRaw.end() );
if ( it != listRaw.end() )
return *it;
kdError(32500) << "Internal error: could not find correcponding date format: " << lookup << endl;
- return QString::null; // Something is wrong, give back a default
+ return TQString(); // Something is wrong, give back a default
}
int DateFormatWidget::correctValue()
diff --git a/lib/kotext/DateFormatWidget.h b/lib/kotext/DateFormatWidget.h
index ac30f449..5f006d36 100644
--- a/lib/kotext/DateFormatWidget.h
+++ b/lib/kotext/DateFormatWidget.h
@@ -5,17 +5,18 @@
class DateFormatWidget : public TimeDateFormatWidgetPrototype
{
Q_OBJECT
+ TQ_OBJECT
public:
- DateFormatWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ DateFormatWidget( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
~DateFormatWidget();
- QString resultString();
+ TQString resultString();
int correctValue();
public slots:
void updateLabel();
void comboActivated();
void slotPersonalizeChanged(bool b);
- void slotDefaultValueChanged(const QString & );
+ void slotDefaultValueChanged(const TQString & );
void slotOffsetChanged(int);
};
diff --git a/lib/kotext/IsoDuration.h b/lib/kotext/IsoDuration.h
index dbeef450..6ccb2891 100644
--- a/lib/kotext/IsoDuration.h
+++ b/lib/kotext/IsoDuration.h
@@ -16,38 +16,38 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qstring.h>
+#include <tqstring.h>
/**
* Routines for converting to and from the ISO-8601 duration format
* http://www.w3.org/TR/xmlschema-2/datatypes.html#duration
*
- * This is not the ISO time format supported by Qt (HH:MM:SS),
+ * This is not the ISO time format supported by TQt (HH:MM:SS),
* it's PT1H15M12S for 1:15:12.
*
*/
-static QString minutesToISODuration( int mn )
+static TQString minutesToISODuration( int mn )
{
bool neg = mn < 0;
// PT == period of time - see ISO8601
- QString str = QString::fromLatin1( "PT00H%1M00S" ).arg( QABS( mn ) );
+ TQString str = TQString::tqfromLatin1( "PT00H%1M00S" ).tqarg( TQABS( mn ) );
if ( neg )
str.prepend( '-' );
return str;
}
-static QString daysToISODuration( int days )
+static TQString daysToISODuration( int days )
{
bool neg = days < 0;
// P == period, time is ommitted - see ISO8601
- QString str = QString::fromLatin1( "P%1D" ).arg( QABS( days ) );
+ TQString str = TQString::tqfromLatin1( "P%1D" ).tqarg( TQABS( days ) );
if ( neg )
str.prepend( '-' );
return str;
}
-static int ISODurationToMinutes( const QString& str )
+static int ISODurationToMinutes( const TQString& str )
{
int idx = 0;
const int len = str.length();
@@ -77,7 +77,7 @@ static int ISODurationToMinutes( const QString& str )
return neg ? -minutes : minutes;
}
-static int ISODurationToDays( const QString& str )
+static int ISODurationToDays( const TQString& str )
{
int idx = 0;
const int len = str.length();
diff --git a/lib/kotext/KFontDialog_local.cpp b/lib/kotext/KFontDialog_local.cpp
index aa1df371..d979fc66 100644
--- a/lib/kotext/KFontDialog_local.cpp
+++ b/lib/kotext/KFontDialog_local.cpp
@@ -1,6 +1,6 @@
/*
- Requires the Qt widget libraries, available at no cost at
+ Requires the TQt widget libraries, available at no cost at
http://www.troll.no
Copyright (C) 1996 Bernd Johannes Wuebben <wuebben@kde.org>
@@ -28,18 +28,18 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qfile.h>
-#include <qfont.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qscrollbar.h>
-#include <qstringlist.h>
-#include <qfontdatabase.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqfile.h>
+#include <tqfont.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqscrollbar.h>
+#include <tqstringlist.h>
+#include <tqfontdatabase.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
#include <kapplication.h>
#include <kcharsets.h>
@@ -47,7 +47,7 @@
#include <kdialog.h>
#include <kglobal.h>
#include <kglobalsettings.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <klistbox.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -59,21 +59,21 @@
#include "KFontDialog_local.h"
#include "KFontDialog_local.moc"
-static int minimumListWidth( const QListBox *list )
+static int minimumListWidth( const TQListBox *list )
{
int w=0;
for( uint i=0; i<list->count(); i++ )
{
int itemWidth = list->item(i)->width(list);
- w = QMAX(w,itemWidth);
+ w = TQMAX(w,itemWidth);
}
if( w == 0 ) { w = 40; }
w += list->frameWidth() * 2;
- w += list->verticalScrollBar()->sizeHint().width();
+ w += list->verticalScrollBar()->tqsizeHint().width();
return w;
}
-static int minimumListHeight( const QListBox *list, int numVisibleEntry )
+static int minimumListHeight( const TQListBox *list, int numVisibleEntry )
{
int w = list->count() > 0 ? list->item(0)->height(list) :
list->fontMetrics().lineSpacing();
@@ -87,104 +87,104 @@ class KFontChooser_local::KFontChooser_localPrivate
{
public:
KFontChooser_localPrivate()
- { m_palette.setColor(QPalette::Active, QColorGroup::Text, Qt::black);
- m_palette.setColor(QPalette::Active, QColorGroup::Base, Qt::white); }
- QPalette m_palette;
+ { m_palette.setColor(TQPalette::Active, TQColorGroup::Text, TQt::black);
+ m_palette.setColor(TQPalette::Active, TQColorGroup::Base, TQt::white); }
+ TQPalette m_palette;
};
-KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
- bool onlyFixed, const QStringList &fontList,
+KFontChooser_local::KFontChooser_local(TQWidget *tqparent, const char *name,
+ bool onlyFixed, const TQStringList &fontList,
bool makeFrame, int visibleListSize, bool diff,
- QButton::ToggleState *sizeIsRelativeState )
- : QWidget(parent, name), usingFixed(onlyFixed)
+ TQButton::ToggleState *sizeIsRelativeState )
+ : TQWidget(tqparent, name), usingFixed(onlyFixed)
{
charsetsCombo = 0;
- QString mainWhatsThisText =
+ TQString mainWhatsThisText =
i18n( "Here you can choose the font to be used." );
- QWhatsThis::add( this, mainWhatsThisText );
+ TQWhatsThis::add( this, mainWhatsThisText );
d = new KFontChooser_localPrivate;
- QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() );
int checkBoxGap = KDialog::spacingHint() / 2;
- QWidget *page;
- QGridLayout *gridLayout;
+ TQWidget *page;
+ TQGridLayout *gridLayout;
int row = 0;
if( makeFrame )
{
- page = new QGroupBox( i18n("Requested Font"), this );
+ page = new TQGroupBox( i18n("Requested Font"), this );
topLayout->addWidget(page);
- gridLayout = new QGridLayout( page, 5, 3, KDialog::marginHint(), KDialog::spacingHint() );
+ gridLayout = new TQGridLayout( page, 5, 3, KDialog::marginHint(), KDialog::spacingHint() );
gridLayout->addRowSpacing( 0, fontMetrics().lineSpacing() );
row = 1;
}
else
{
- page = new QWidget( this );
+ page = new TQWidget( this );
topLayout->addWidget(page);
- gridLayout = new QGridLayout( page, 4, 3, 0, KDialog::spacingHint() );
+ gridLayout = new TQGridLayout( page, 4, 3, 0, KDialog::spacingHint() );
}
//
// first, create the labels across the top
//
- QHBoxLayout *familyLayout = new QHBoxLayout();
+ TQHBoxLayout *familyLayout = new TQHBoxLayout();
familyLayout->addSpacing( checkBoxGap );
if (diff) {
- familyCheckbox = new QCheckBox(i18n("Font"), page);
- connect(familyCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- familyLayout->addWidget(familyCheckbox, 0, Qt::AlignLeft);
- QString familyCBToolTipText =
+ familyCheckbox = new TQCheckBox(i18n("Font"), page);
+ connect(familyCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ familyLayout->addWidget(familyCheckbox, 0, TQt::AlignLeft);
+ TQString familyCBToolTipText =
i18n("Change font family?");
- QString familyCBWhatsThisText =
+ TQString familyCBWhatsThisText =
i18n("Enable this checkbox to change the font family settings.");
- QWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
- QToolTip::add( familyCheckbox, familyCBToolTipText );
+ TQWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
+ TQToolTip::add( familyCheckbox, familyCBToolTipText );
familyLabel = 0;
} else {
familyCheckbox = 0;
- familyLabel = new QLabel( i18n("Font:"), page, "familyLabel" );
- familyLayout->addWidget(familyLabel, 1, Qt::AlignLeft);
+ familyLabel = new TQLabel( i18n("Font:"), page, "familyLabel" );
+ familyLayout->addWidget(familyLabel, 1, TQt::AlignLeft);
}
gridLayout->addLayout(familyLayout, row, 0 );
- QHBoxLayout *styleLayout = new QHBoxLayout();
+ TQHBoxLayout *styleLayout = new TQHBoxLayout();
if (diff) {
- styleCheckbox = new QCheckBox(i18n("Font style"), page);
- connect(styleCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- styleLayout->addWidget(styleCheckbox, 0, Qt::AlignLeft);
- QString styleCBToolTipText =
+ styleCheckbox = new TQCheckBox(i18n("Font style"), page);
+ connect(styleCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ styleLayout->addWidget(styleCheckbox, 0, TQt::AlignLeft);
+ TQString styleCBToolTipText =
i18n("Change font style?");
- QString styleCBWhatsThisText =
+ TQString styleCBWhatsThisText =
i18n("Enable this checkbox to change the font style settings.");
- QWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
- QToolTip::add( styleCheckbox, styleCBToolTipText );
+ TQWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
+ TQToolTip::add( styleCheckbox, styleCBToolTipText );
styleLabel = 0;
} else {
styleCheckbox = 0;
- styleLabel = new QLabel( i18n("Font style:"), page, "styleLabel");
- styleLayout->addWidget(styleLabel, 1, Qt::AlignLeft);
+ styleLabel = new TQLabel( i18n("Font style:"), page, "styleLabel");
+ styleLayout->addWidget(styleLabel, 1, TQt::AlignLeft);
}
styleLayout->addSpacing( checkBoxGap );
gridLayout->addLayout(styleLayout, row, 1 );
- QHBoxLayout *sizeLayout = new QHBoxLayout();
+ TQHBoxLayout *sizeLayout = new TQHBoxLayout();
if (diff) {
- sizeCheckbox = new QCheckBox(i18n("Size"),page);
- connect(sizeCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- sizeLayout->addWidget(sizeCheckbox, 0, Qt::AlignLeft);
- QString sizeCBToolTipText =
+ sizeCheckbox = new TQCheckBox(i18n("Size"),page);
+ connect(sizeCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ sizeLayout->addWidget(sizeCheckbox, 0, TQt::AlignLeft);
+ TQString sizeCBToolTipText =
i18n("Change font size?");
- QString sizeCBWhatsThisText =
+ TQString sizeCBWhatsThisText =
i18n("Enable this checkbox to change the font size settings.");
- QWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
- QToolTip::add( sizeCheckbox, sizeCBToolTipText );
+ TQWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
+ TQToolTip::add( sizeCheckbox, sizeCBToolTipText );
sizeLabel = 0;
} else {
sizeCheckbox = 0;
- sizeLabel = new QLabel( i18n("Size:"), page, "sizeLabel");
- sizeLayout->addWidget(sizeLabel, 1, Qt::AlignLeft);
+ sizeLabel = new TQLabel( i18n("Size:"), page, "sizeLabel");
+ sizeLayout->addWidget(sizeLabel, 1, TQt::AlignLeft);
}
sizeLayout->addSpacing( checkBoxGap );
sizeLayout->addSpacing( checkBoxGap ); // prevent label from eating border
@@ -198,12 +198,12 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
familyListBox = new KListBox( page, "familyListBox");
familyListBox->setEnabled( !diff );
gridLayout->addWidget( familyListBox, row, 0 );
- QString fontFamilyWhatsThisText =
+ TQString fontFamilyWhatsThisText =
i18n("Here you can choose the font family to be used." );
- QWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
- QWhatsThis::add(diff?(QWidget *) familyCheckbox:(QWidget *) familyLabel, fontFamilyWhatsThisText );
- connect(familyListBox, SIGNAL(highlighted(const QString &)),
- SLOT(family_chosen_slot(const QString &)));
+ TQWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
+ TQWhatsThis::add(diff?(TQWidget *) familyCheckbox:(TQWidget *) familyLabel, fontFamilyWhatsThisText );
+ connect(familyListBox, TQT_SIGNAL(highlighted(const TQString &)),
+ TQT_SLOT(family_chosen_slot(const TQString &)));
if(!fontList.isEmpty())
{
familyListBox->insertStringList(fontList);
@@ -220,10 +220,10 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
styleListBox = new KListBox( page, "styleListBox");
styleListBox->setEnabled( !diff );
gridLayout->addWidget(styleListBox, row, 1);
- QString fontStyleWhatsThisText =
+ TQString fontStyleWhatsThisText =
i18n("Here you can choose the font style to be used." );
- QWhatsThis::add( styleListBox, fontStyleWhatsThisText );
- QWhatsThis::add(diff?(QWidget *)styleCheckbox:(QWidget *)styleLabel, fontFamilyWhatsThisText );
+ TQWhatsThis::add( styleListBox, fontStyleWhatsThisText );
+ TQWhatsThis::add(diff?(TQWidget *)styleCheckbox:(TQWidget *)styleLabel, fontFamilyWhatsThisText );
styleListBox->insertItem(i18n("Regular"));
styleListBox->insertItem(i18n("Italic"));
styleListBox->insertItem(i18n("Bold"));
@@ -232,8 +232,8 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
styleListBox->setMinimumHeight(
minimumListHeight( styleListBox, visibleListSize ) );
- connect(styleListBox, SIGNAL(highlighted(const QString &)),
- SLOT(style_chosen_slot(const QString &)));
+ connect(styleListBox, TQT_SIGNAL(highlighted(const TQString &)),
+ TQT_SLOT(style_chosen_slot(const TQString &)));
sizeListBox = new KListBox( page, "sizeListBox");
@@ -243,38 +243,38 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
sizeListBox->setEnabled( !diff );
sizeOfFont->setEnabled( !diff );
if( sizeIsRelativeState ) {
- QString sizeIsRelativeCBText =
+ TQString sizeIsRelativeCBText =
i18n("Relative");
- QString sizeIsRelativeCBToolTipText =
+ TQString sizeIsRelativeCBToolTipText =
i18n("Font size<br><i>fixed</i> or <i>relative</i><br>to environment");
- QString sizeIsRelativeCBWhatsThisText =
+ TQString sizeIsRelativeCBWhatsThisText =
i18n("Here you can switch between fixed font size and font size "
"to be calculated dynamically and adjusted to changing "
"environment (e.g. widget dimensions, paper size)." );
- sizeIsRelativeCheckBox = new QCheckBox( sizeIsRelativeCBText,
+ sizeIsRelativeCheckBox = new TQCheckBox( sizeIsRelativeCBText,
page,
"sizeIsRelativeCheckBox" );
sizeIsRelativeCheckBox->setTristate( diff );
- QGridLayout *sizeLayout2 = new QGridLayout( 3,2, KDialog::spacingHint()/2, "sizeLayout2" );
+ TQGridLayout *sizeLayout2 = new TQGridLayout( 3,2, KDialog::spacingHint()/2, "sizeLayout2" );
gridLayout->addLayout(sizeLayout2, row, 2);
sizeLayout2->setColStretch( 1, 1 ); // to prevent text from eating the right border
sizeLayout2->addMultiCellWidget( sizeOfFont, 0, 0, 0, 1);
sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,1);
- sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, Qt::AlignLeft);
- QWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
- QToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
+ sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, TQt::AlignLeft);
+ TQWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
+ TQToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
}
else {
sizeIsRelativeCheckBox = 0L;
- QGridLayout *sizeLayout2 = new QGridLayout( 2,1, KDialog::spacingHint()/2, "sizeLayout2" );
+ TQGridLayout *sizeLayout2 = new TQGridLayout( 2,1, KDialog::spacingHint()/2, "sizeLayout2" );
gridLayout->addLayout(sizeLayout2, row, 2);
sizeLayout2->addWidget( sizeOfFont, 0, 0);
sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,0);
}
- QString fontSizeWhatsThisText =
+ TQString fontSizeWhatsThisText =
i18n("Here you can choose the font size to be used." );
- QWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
- QWhatsThis::add( diff?(QWidget *)sizeCheckbox:(QWidget *)sizeLabel, fontSizeWhatsThisText );
+ TQWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
+ TQWhatsThis::add( diff?(TQWidget *)sizeCheckbox:(TQWidget *)sizeLabel, fontSizeWhatsThisText );
fillSizeList();
sizeListBox->setMinimumWidth( minimumListWidth(sizeListBox) +
@@ -282,48 +282,48 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
sizeListBox->setMinimumHeight(
minimumListHeight( sizeListBox, visibleListSize ) );
- connect( sizeOfFont, SIGNAL( valueChanged(int) ),
- SLOT(size_value_slot(int)));
+ connect( sizeOfFont, TQT_SIGNAL( valueChanged(int) ),
+ TQT_SLOT(size_value_slot(int)));
- connect( sizeListBox, SIGNAL(highlighted(const QString&)),
- SLOT(size_chosen_slot(const QString&)) );
- sizeListBox->setSelected(sizeListBox->findItem(QString::number(10)), true); // default to 10pt.
+ connect( sizeListBox, TQT_SIGNAL(highlighted(const TQString&)),
+ TQT_SLOT(size_chosen_slot(const TQString&)) );
+ sizeListBox->setSelected(sizeListBox->tqfindItem(TQString::number(10)), true); // default to 10pt.
row ++;
row ++;
- sampleEdit = new QLineEdit( page, "sampleEdit");
- QFont tmpFont( KGlobalSettings::generalFont().family(), 64, QFont::Black );
+ sampleEdit = new TQLineEdit( page, "sampleEdit");
+ TQFont tmpFont( KGlobalSettings::generalFont().family(), 64, TQFont::Black );
sampleEdit->setFont(tmpFont);
sampleEdit->setText(i18n("The Quick Brown Fox Jumps Over The Lazy Dog"));
sampleEdit->setMinimumHeight( sampleEdit->fontMetrics().lineSpacing() );
- sampleEdit->setAlignment(Qt::AlignCenter);
+ sampleEdit->tqsetAlignment(TQt::AlignCenter);
gridLayout->addMultiCellWidget(sampleEdit, 4, 4, 0, 2);
- QString sampleEditWhatsThisText =
+ TQString sampleEditWhatsThisText =
i18n("This sample text illustrates the current settings. "
"You may edit it to test special characters." );
- QWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
- connect(this, SIGNAL(fontSelected(const QFont &)),
- SLOT(displaySample(const QFont &)));
+ TQWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
+ connect(this, TQT_SIGNAL(fontSelected(const TQFont &)),
+ TQT_SLOT(displaySample(const TQFont &)));
- QVBoxLayout *vbox;
+ TQVBoxLayout *vbox;
if( makeFrame )
{
- page = new QGroupBox( i18n("Actual Font"), this );
+ page = new TQGroupBox( i18n("Actual Font"), this );
topLayout->addWidget(page);
- vbox = new QVBoxLayout( page, KDialog::spacingHint() );
+ vbox = new TQVBoxLayout( page, KDialog::spacingHint() );
vbox->addSpacing( fontMetrics().lineSpacing() );
}
else
{
- page = new QWidget( this );
+ page = new TQWidget( this );
topLayout->addWidget(page);
- vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n("Actual Font"), page );
+ vbox = new TQVBoxLayout( page, 0, KDialog::spacingHint() );
+ TQLabel *label = new TQLabel( i18n("Actual Font"), page );
vbox->addWidget( label );
}
- xlfdEdit = new QLineEdit( page, "xlfdEdit" );
+ xlfdEdit = new TQLineEdit( page, "xlfdEdit" );
vbox->addWidget( xlfdEdit );
// lets initialize the display if possible
@@ -333,8 +333,8 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
setSizeIsRelative( *sizeIsRelativeState );
KConfig *config = KGlobal::config();
- KConfigGroupSaver saver(config, QString::fromLatin1("General"));
- showXLFDArea(config->readBoolEntry(QString::fromLatin1("fontSelectorShowXLFD"), false));
+ KConfigGroupSaver saver(config, TQString::tqfromLatin1("General"));
+ showXLFDArea(config->readBoolEntry(TQString::tqfromLatin1("fontSelectorShowXLFD"), false));
}
KFontChooser_local::~KFontChooser_local()
@@ -357,57 +357,57 @@ void KFontChooser_local::fillSizeList() {
};
for(int i = 0; c[i]; ++i)
{
- sizeListBox->insertItem(QString::number(c[i]));
+ sizeListBox->insertItem(TQString::number(c[i]));
}
}
-void KFontChooser_local::setColor( const QColor & col )
+void KFontChooser_local::setColor( const TQColor & col )
{
- d->m_palette.setColor( QPalette::Active, QColorGroup::Text, col );
- QPalette pal = sampleEdit->palette();
- pal.setColor( QPalette::Active, QColorGroup::Text, col );
+ d->m_palette.setColor( TQPalette::Active, TQColorGroup::Text, col );
+ TQPalette pal = sampleEdit->palette();
+ pal.setColor( TQPalette::Active, TQColorGroup::Text, col );
sampleEdit->setPalette( pal );
}
-QColor KFontChooser_local::color() const
+TQColor KFontChooser_local::color() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Text );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Text );
}
-void KFontChooser_local::setBackgroundColor( const QColor & col )
+void KFontChooser_local::setBackgroundColor( const TQColor & col )
{
- d->m_palette.setColor( QPalette::Active, QColorGroup::Base, col );
- QPalette pal = sampleEdit->palette();
- pal.setColor( QPalette::Active, QColorGroup::Base, col );
+ d->m_palette.setColor( TQPalette::Active, TQColorGroup::Base, col );
+ TQPalette pal = sampleEdit->palette();
+ pal.setColor( TQPalette::Active, TQColorGroup::Base, col );
sampleEdit->setPalette( pal );
}
-QColor KFontChooser_local::backgroundColor() const
+TQColor KFontChooser_local::backgroundColor() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Base );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Base );
}
-void KFontChooser_local::setSizeIsRelative( QButton::ToggleState relative )
+void KFontChooser_local::setSizeIsRelative( TQButton::ToggleState relative )
{
// check or uncheck or gray out the "relative" checkbox
if( sizeIsRelativeCheckBox ) {
- if( QButton::NoChange == relative )
+ if( TQButton::NoChange == relative )
sizeIsRelativeCheckBox->setNoChange();
else
- sizeIsRelativeCheckBox->setChecked( QButton::On == relative );
+ sizeIsRelativeCheckBox->setChecked( TQButton::On == relative );
}
}
-QButton::ToggleState KFontChooser_local::sizeIsRelative() const
+TQButton::ToggleState KFontChooser_local::sizeIsRelative() const
{
return sizeIsRelativeCheckBox
? sizeIsRelativeCheckBox->state()
- : QButton::NoChange;
+ : TQButton::NoChange;
}
-QSize KFontChooser_local::sizeHint( void ) const
+TQSize KFontChooser_local::tqsizeHint( void ) const
{
- return minimumSizeHint();
+ return tqminimumSizeHint();
}
@@ -428,12 +428,12 @@ void KFontChooser_local::enableColumn( int column, bool state )
}
-void KFontChooser_local::setFont( const QFont& aFont, bool onlyFixed )
+void KFontChooser_local::setFont( const TQFont& aFont, bool onlyFixed )
{
selFont = aFont;
selectedSize=aFont.pointSize();
if (selectedSize == -1)
- selectedSize = QFontInfo(aFont).pointSize();
+ selectedSize = TQFontInfo(aFont).pointSize();
if( onlyFixed != usingFixed)
{
@@ -463,28 +463,28 @@ void KFontChooser_local::toggled_checkbox()
sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
}
-void KFontChooser_local::family_chosen_slot(const QString& family)
+void KFontChooser_local::family_chosen_slot(const TQString& family)
{
- QString currentFamily;
+ TQString currentFamily;
if (family.isEmpty())
currentFamily = familyListBox->currentText();
else
currentFamily = family;
- QFontDatabase dbase;
- QStringList styles = QStringList(dbase.styles(currentFamily));
+ TQFontDatabase dbase;
+ TQStringList styles = TQStringList(dbase.tqstyles(currentFamily));
styleListBox->clear();
currentStyles.clear();
- for ( QStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
- QString style = *it;
- int pos = style.find("Plain");
- if(pos >=0) style = style.replace(pos,5,i18n("Regular"));
- pos = style.find("Normal");
- if(pos >=0) style = style.replace(pos,6,i18n("Regular"));
- pos = style.find("Oblique");
- if(pos >=0) style = style.replace(pos,7,i18n("Italic"));
- if(!styleListBox->findItem(style)) {
+ for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ TQString style = *it;
+ int pos = style.tqfind("Plain");
+ if(pos >=0) style = style.tqreplace(pos,5,i18n("Regular"));
+ pos = style.tqfind("Normal");
+ if(pos >=0) style = style.tqreplace(pos,6,i18n("Regular"));
+ pos = style.tqfind("Oblique");
+ if(pos >=0) style = style.tqreplace(pos,7,i18n("Italic"));
+ if(!styleListBox->tqfindItem(style)) {
styleListBox->insertItem(i18n(style.utf8()));
currentStyles.insert(i18n(style.utf8()), *it);
}
@@ -495,21 +495,21 @@ void KFontChooser_local::family_chosen_slot(const QString& family)
}
styleListBox->blockSignals(true);
- QListBoxItem *item = styleListBox->findItem(selectedStyle);
+ TQListBoxItem *item = styleListBox->tqfindItem(selectedStyle);
if (item)
- styleListBox->setSelected(styleListBox->findItem(selectedStyle), true);
+ styleListBox->setSelected(styleListBox->tqfindItem(selectedStyle), true);
else
styleListBox->setSelected(0, true);
styleListBox->blockSignals(false);
- style_chosen_slot(QString::null);
+ style_chosen_slot(TQString());
if (!family.isEmpty() )
selectedFamily = family;
}
-void KFontChooser_local::size_chosen_slot(const QString& size){
+void KFontChooser_local::size_chosen_slot(const TQString& size){
selectedSize=size.toInt();
sizeOfFont->setValue(selectedSize);
@@ -522,9 +522,9 @@ void KFontChooser_local::size_value_slot(int val) {
emit fontSelected(selFont);
}
-void KFontChooser_local::style_chosen_slot(const QString& style)
+void KFontChooser_local::style_chosen_slot(const TQString& style)
{
- QString currentStyle;
+ TQString currentStyle;
if (style.isEmpty())
currentStyle = styleListBox->currentText();
else
@@ -533,25 +533,25 @@ void KFontChooser_local::style_chosen_slot(const QString& style)
int diff=0; // the difference between the font size requested and what we can show.
sizeListBox->clear();
- QFontDatabase dbase;
+ TQFontDatabase dbase;
if(dbase.isSmoothlyScalable(familyListBox->currentText(), currentStyles[currentStyle])) { // is vector font
//sampleEdit->setPaletteBackgroundPixmap( VectorPixmap ); // TODO
fillSizeList();
} else { // is bitmap font.
//sampleEdit->setPaletteBackgroundPixmap( BitmapPixmap ); // TODO
- QValueList<int> sizes = dbase.smoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
+ TQValueList<int> sizes = dbase.tqsmoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
if(sizes.count() > 0) {
- QValueList<int>::iterator it;
+ TQValueList<int>::iterator it;
diff=1000;
for ( it = sizes.begin(); it != sizes.end(); ++it ) {
if(*it <= selectedSize || diff > *it - selectedSize) diff = selectedSize - *it;
- sizeListBox->insertItem(QString::number(*it));
+ sizeListBox->insertItem(TQString::number(*it));
}
} else // there are times QT does not provide the list..
fillSizeList();
}
sizeListBox->blockSignals(true);
- sizeListBox->setSelected(sizeListBox->findItem(QString::number(selectedSize)), true);
+ sizeListBox->setSelected(sizeListBox->tqfindItem(TQString::number(selectedSize)), true);
sizeListBox->blockSignals(false);
sizeListBox->ensureCurrentVisible();
@@ -562,14 +562,14 @@ void KFontChooser_local::style_chosen_slot(const QString& style)
selectedStyle = style;
}
-void KFontChooser_local::displaySample(const QFont& font)
+void KFontChooser_local::displaySample(const TQFont& font)
{
sampleEdit->setFont(font);
sampleEdit->setCursorPosition(0);
xlfdEdit->setText(font.rawName());
xlfdEdit->setCursorPosition(0);
- //QFontInfo a = QFontInfo(font);
+ //TQFontInfo a = TQFontInfo(font);
//kdDebug() << "font: " << a.family () << ", " << a.pointSize () << endl;
//kdDebug() << " (" << font.toString() << ")\n";
}
@@ -578,12 +578,12 @@ void KFontChooser_local::setupDisplay()
{
// Calling familyListBox->setCurrentItem() causes the value of selFont
// to change, so we save the family, style and size beforehand.
- QString family = selFont.family().lower();
+ TQString family = TQString(selFont.family()).lower();
int style = (selFont.bold() ? 2 : 0) + (selFont.italic() ? 1 : 0);
int size = selFont.pointSize();
if (size == -1)
- size = QFontInfo(selFont).pointSize();
- QString sizeStr = QString::number(size);
+ size = TQFontInfo(selFont).pointSize();
+ TQString sizeStr = TQString::number(size);
int numEntries, i;
@@ -598,9 +598,9 @@ void KFontChooser_local::setupDisplay()
// 1st Fallback
if ( (i == numEntries) )
{
- if (family.contains('['))
+ if (family.tqcontains('['))
{
- family = family.left(family.find('[')).stripWhiteSpace();
+ family = family.left(family.tqfind('[')).stripWhiteSpace();
for (i = 0; i < numEntries; i++) {
if (family == familyListBox->text(i).lower()) {
familyListBox->setCurrentItem(i);
@@ -613,7 +613,7 @@ void KFontChooser_local::setupDisplay()
// 2nd Fallback
if ( (i == numEntries) )
{
- QString fallback = family+" [";
+ TQString fallback = family+" [";
for (i = 0; i < numEntries; i++) {
if (familyListBox->text(i).lower().startsWith(fallback)) {
familyListBox->setCurrentItem(i);
@@ -651,16 +651,16 @@ void KFontChooser_local::setupDisplay()
}
-void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
+void KFontChooser_local::getFontList( TQStringList &list, uint fontListCriteria)
{
- QFontDatabase dbase;
- QStringList lstSys(dbase.families());
+ TQFontDatabase dbase;
+ TQStringList lstSys(dbase.tqfamilies());
// if we have criteria; then check fonts before adding
if (fontListCriteria)
{
- QStringList lstFonts;
- for (QStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
+ TQStringList lstFonts;
+ for (TQStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
{
if ((fontListCriteria & FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it)) continue;
if (((fontListCriteria & (SmoothScalableFonts | ScalableFonts)) == ScalableFonts) &&
@@ -671,7 +671,7 @@ void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
if((fontListCriteria & FixedWidthFonts) > 0) {
// Fallback.. if there are no fixed fonts found, it's probably a
- // bug in the font server or Qt. In this case, just use 'fixed'
+ // bug in the font server or TQt. In this case, just use 'fixed'
if (lstFonts.count() == 0)
lstFonts.append("fixed");
}
@@ -684,7 +684,7 @@ void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
list = lstSys;
}
-void KFontChooser_local::addFont( QStringList &list, const char *xfont )
+void KFontChooser_local::addFont( TQStringList &list, const char *xfont )
{
const char *ptr = strchr( xfont, '-' );
if ( !ptr )
@@ -694,16 +694,16 @@ void KFontChooser_local::addFont( QStringList &list, const char *xfont )
if ( !ptr )
return;
- QString font = QString::fromLatin1(ptr + 1);
+ TQString font = TQString::tqfromLatin1(ptr + 1);
int pos;
- if ( ( pos = font.find( '-' ) ) > 0 ) {
+ if ( ( pos = font.tqfind( '-' ) ) > 0 ) {
font.truncate( pos );
- if ( font.find( QString::fromLatin1("open look"), 0, false ) >= 0 )
+ if ( font.tqfind( TQString::tqfromLatin1("open look"), 0, false ) >= 0 )
return;
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
for ( ; it != list.end(); ++it )
if ( *it == font )
@@ -714,13 +714,13 @@ void KFontChooser_local::addFont( QStringList &list, const char *xfont )
void KFontChooser_local::fillFamilyListBox(bool onlyFixedFonts)
{
- QStringList fontList;
+ TQStringList fontList;
getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
familyListBox->clear();
familyListBox->insertStringList(fontList);
}
-void KFontChooser_local::setFamilyList( QStringList list )
+void KFontChooser_local::setFamilyList( TQStringList list )
{
familyListBox->blockSignals( true );
familyListBox->clear();
@@ -733,21 +733,21 @@ void KFontChooser_local::showXLFDArea(bool show)
{
if( show )
{
- xlfdEdit->parentWidget()->show();
+ xlfdEdit->tqparentWidget()->show();
}
else
{
- xlfdEdit->parentWidget()->hide();
+ xlfdEdit->tqparentWidget()->hide();
}
}
///////////////////////////////////////////////////////////////////////////////
-KFontDialog_local::KFontDialog_local( QWidget *parent, const char* name,
+KFontDialog_local::KFontDialog_local( TQWidget *tqparent, const char* name,
bool onlyFixed, bool modal,
- const QStringList &fontList, bool makeFrame, bool diff,
- QButton::ToggleState *sizeIsRelativeState )
- : KDialogBase( parent, name, modal, i18n("Select Font"), Ok|Cancel, Ok )
+ const TQStringList &fontList, bool makeFrame, bool diff,
+ TQButton::ToggleState *sizeIsRelativeState )
+ : KDialogBase( tqparent, name, modal, i18n("Select Font"), Ok|Cancel, Ok )
{
chooser = new KFontChooser_local( this, "fontChooser",
onlyFixed, fontList, makeFrame, 8,
@@ -756,11 +756,11 @@ KFontDialog_local::KFontDialog_local( QWidget *parent, const char* name,
}
-int KFontDialog_local::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog_local::getFontDiff( TQFont &theFont, int &diffFlags, bool onlyFixed,
+ TQWidget *tqparent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog_local dlg( tqparent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, true, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -775,11 +775,11 @@ int KFontDialog_local::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFix
return result;
}
-int KFontDialog_local::getFont( QFont &theFont, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog_local::getFont( TQFont &theFont, bool onlyFixed,
+ TQWidget *tqparent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog_local dlg( tqparent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -794,13 +794,13 @@ int KFontDialog_local::getFont( QFont &theFont, bool onlyFixed,
}
-int KFontDialog_local::getFontAndText( QFont &theFont, QString &theString,
- bool onlyFixed, QWidget *parent,
+int KFontDialog_local::getFontAndText( TQFont &theFont, TQString &theString,
+ bool onlyFixed, TQWidget *tqparent,
bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font and Text Selector", onlyFixed, true,
- QStringList(), makeFrame, false, sizeIsRelativeState );
+ KFontDialog_local dlg( tqparent, "Font and Text Selector", onlyFixed, true,
+ TQStringList(), makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
int result = dlg.exec();
diff --git a/lib/kotext/KFontDialog_local.h b/lib/kotext/KFontDialog_local.h
index 5dc853dc..bb69cf57 100644
--- a/lib/kotext/KFontDialog_local.h
+++ b/lib/kotext/KFontDialog_local.h
@@ -1,7 +1,7 @@
/*
$Id: kfontdialog.h,v 1.71 2004/10/10 10:27:49 bhards Exp $
- Requires the Qt widget libraries, available at no cost at
+ Requires the TQt widget libraries, available at no cost at
http://www.troll.no
Copyright (C) 1997 Bernd Johannes Wuebben <wuebben@kde.org>
@@ -29,18 +29,18 @@
#ifndef _K_FONT_DIALOG_LOCAL_H_
#define _K_FONT_DIALOG_LOCAL_H_
-#include <qlineedit.h>
-#include <qbutton.h>
+#include <tqlineedit.h>
+#include <tqbutton.h>
#include <kdialogbase.h>
#include <koffice_export.h>
-class QComboBox;
-class QCheckBox;
-class QFont;
-class QGroupBox;
-class QLabel;
-class QStringList;
+class TQComboBox;
+class TQCheckBox;
+class TQFont;
+class TQGroupBox;
+class TQLabel;
+class TQStringList;
class KListBox;
class KIntNumInput;
/**
@@ -54,10 +54,11 @@ class KIntNumInput;
* @author Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org>
* @version $Id: kfontdialog.h,v 1.71 2004/10/10 10:27:49 bhards Exp $
*/
-class KOTEXT_EXPORT KFontChooser_local : public QWidget
+class KOTEXT_EXPORT KFontChooser_local : public TQWidget
{
Q_OBJECT
- Q_PROPERTY( QFont font READ font WRITE setFont )
+ TQ_OBJECT
+ TQ_PROPERTY( TQFont font READ font WRITE setFont )
public:
/**
@@ -81,14 +82,14 @@ public:
* that will be displayed in the dialog.
* <p>Consider the following code snippet;
* \code
- * QStringList list;
+ * TQStringList list;
* KFontChooser_local::getFontList(list,SmoothScalableFonts);
* KFontChooser_local chooseFont = new KFontChooser_local(0, "FontList", false, list);
* \endcode
* <p>
* The above creates a font chooser dialog with only SmoothScaleble fonts.
*
- * @param parent The parent widget.
+ * @param tqparent The tqparent widget.
* @param name The widget name.
* @param onlyFixed Only display fonts which have fixed-width
* character sizes.
@@ -108,11 +109,11 @@ public:
* *sizeIsRelativeState, user choice may be retrieved by
* calling sizeIsRelative().
*/
- KFontChooser_local(QWidget *parent = 0L, const char *name = 0L,
+ KFontChooser_local(TQWidget *tqparent = 0L, const char *name = 0L,
bool onlyFixed = false,
- const QStringList &fontList = QStringList(),
+ const TQStringList &fontList = TQStringList(),
bool makeFrame = true, int visibleListSize=8,
- bool diff = false, QButton::ToggleState *sizeIsRelativeState = 0L );
+ bool diff = false, TQButton::ToggleState *sizeIsRelativeState = 0L );
/**
* Destructs the font chooser.
@@ -139,10 +140,10 @@ public:
* @param onlyFixed Readjust the font list to display only fixed
* width fonts if @p true, or vice-versa.
*/
- void setFont( const QFont &font, bool onlyFixed = false );
+ void setFont( const TQFont &font, bool onlyFixed = false );
/**
- * @return The bitmask corresponding to the attributes the user
+ * @return The bittqmask corresponding to the attributes the user
* wishes to change.
*/
int fontDiffFlags();
@@ -150,29 +151,29 @@ public:
/**
* @return The currently selected font in the chooser.
*/
- QFont font() const { return selFont; }
+ TQFont font() const { return selFont; }
/**
* Sets the color to use in the preview.
*/
- void setColor( const QColor & col );
+ void setColor( const TQColor & col );
/**
* @return The color currently used in the preview (default: the text
* color of the active color group)
*/
- QColor color() const;
+ TQColor color() const;
/**
* Sets the background color to use in the preview.
*/
- void setBackgroundColor( const QColor & col );
+ void setBackgroundColor( const TQColor & col );
/**
* @return The background color currently used in the preview (default:
* the base color of the active colorgroup)
*/
- QColor backgroundColor() const;
+ TQColor backgroundColor() const;
/**
* Sets the state of the checkbox indicating whether the font size
@@ -180,19 +181,19 @@ public:
* NOTE: If parameter sizeIsRelative was not set in the constructor
* of the widget this setting will be ignored.
*/
- void setSizeIsRelative( QButton::ToggleState relative );
+ void setSizeIsRelative( TQButton::ToggleState relative );
/**
* @return Whether the font size is to be interpreted as relative size
- * (default: QButton:Off)
+ * (default: TQButton:Off)
*/
- QButton::ToggleState sizeIsRelative() const;
+ TQButton::ToggleState sizeIsRelative() const;
/**
* @return The current text in the sample text input area.
*/
- QString sampleText() const { return sampleEdit->text(); }
+ TQString sampleText() const { return sampleEdit->text(); }
/**
* Sets the sample text.
@@ -204,7 +205,7 @@ public:
*
* @param text The new sample text. The current will be removed.
*/
- void setSampleText( const QString &text )
+ void setSampleText( const TQString &text )
{
sampleEdit->setText( text );
}
@@ -220,13 +221,13 @@ public:
}
/**
- * Converts a QFont into the corresponding X Logical Font
+ * Converts a TQFont into the corresponding X Logical Font
* Description (XLFD).
*
* @param theFont The font to convert.
* @return A string representing the given font in XLFD format.
*/
- static QString getXLFD( const QFont &theFont )
+ static TQString getXLFD( const TQFont &theFont )
{ return theFont.rawName(); }
/**
@@ -249,7 +250,7 @@ public:
* @param fontListCriteria should contain all the restrictions for font selection as OR-ed values
* @see KFontChooser_local::FontListCriteria for the individual values
*/
- static void getFontList( QStringList &list, uint fontListCriteria);
+ static void getFontList( TQStringList &list, uint fontListCriteria);
/**
*
@@ -257,62 +258,62 @@ public:
*
* @param list The font list.
*/
- void setFamilyList( QStringList list );
+ void setFamilyList( TQStringList list );
/**
* Reimplemented for internal reasons.
*/
- virtual QSize sizeHint( void ) const;
+ virtual TQSize tqsizeHint( void ) const;
signals:
/**
* Emitted whenever the selected font changes.
*/
- void fontSelected( const QFont &font );
+ void fontSelected( const TQFont &font );
private slots:
void toggled_checkbox();
- void family_chosen_slot(const QString&);
- void size_chosen_slot(const QString&);
- void style_chosen_slot(const QString&);
- void displaySample(const QFont &font);
+ void family_chosen_slot(const TQString&);
+ void size_chosen_slot(const TQString&);
+ void style_chosen_slot(const TQString&);
+ void displaySample(const TQFont &font);
void showXLFDArea(bool);
void size_value_slot(int);
private:
void fillFamilyListBox(bool onlyFixedFonts = false);
void fillSizeList();
- // This one must be static since getFontList( QStringList, char*) is so
- static void addFont( QStringList &list, const char *xfont );
+ // This one must be static since getFontList( TQStringList, char*) is so
+ static void addFont( TQStringList &list, const char *xfont );
void setupDisplay();
// pointer to an optinally supplied list of fonts to
// inserted into the fontdialog font-family combo-box
- QStringList fontList;
+ TQStringList fontList;
KIntNumInput *sizeOfFont;
- QLineEdit *sampleEdit;
- QLineEdit *xlfdEdit;
+ TQLineEdit *sampleEdit;
+ TQLineEdit *xlfdEdit;
- QLabel *familyLabel;
- QLabel *styleLabel;
- QCheckBox *familyCheckbox;
- QCheckBox *styleCheckbox;
- QCheckBox *sizeCheckbox;
- QLabel *sizeLabel;
+ TQLabel *familyLabel;
+ TQLabel *styleLabel;
+ TQCheckBox *familyCheckbox;
+ TQCheckBox *styleCheckbox;
+ TQCheckBox *sizeCheckbox;
+ TQLabel *sizeLabel;
KListBox *familyListBox;
KListBox *styleListBox;
KListBox *sizeListBox;
- QComboBox *charsetsCombo; // BIC: remove in KDE4
- QCheckBox *sizeIsRelativeCheckBox;
+ TQComboBox *charsetsCombo; // BIC: remove in KDE4
+ TQCheckBox *sizeIsRelativeCheckBox;
- QFont selFont;
+ TQFont selFont;
- QString selectedFamily;
- QString selectedStyle;
+ TQString selectedFamily;
+ TQString selectedStyle;
int selectedSize;
- QMap<QString, QString> currentStyles;
+ TQMap<TQString, TQString> currentStyles;
bool usingFixed;
@@ -336,7 +337,7 @@ private:
* Example:
*
* \code
- * QFont myFont;
+ * TQFont myFont;
* int result = KFontDialog_local::getFont( myFont );
* if ( result == KFontDialog_local::Accepted )
* ...
@@ -349,12 +350,13 @@ private:
*/
class KOTEXT_EXPORT KFontDialog_local : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructs a font selection dialog.
*
- * @param parent The parent widget of the dialog, if any.
+ * @param tqparent The tqparent widget of the dialog, if any.
* @param name The name of the dialog.
* @param modal Specifies whether the dialog is modal or not.
* @param onlyFixed only display fonts which have fixed-width
@@ -373,11 +375,11 @@ public:
* calling sizeIsRelative().
*
*/
- KFontDialog_local( QWidget *parent = 0L, const char *name = 0,
+ KFontDialog_local( TQWidget *tqparent = 0L, const char *name = 0,
bool onlyFixed = false, bool modal = false,
- const QStringList &fontlist = QStringList(),
+ const TQStringList &fontlist = TQStringList(),
bool makeFrame = true, bool diff = false,
- QButton::ToggleState *sizeIsRelativeState = 0L );
+ TQButton::ToggleState *sizeIsRelativeState = 0L );
/**
* Sets the currently selected font in the dialog.
@@ -386,13 +388,13 @@ public:
* @param onlyFixed readjust the font list to display only fixed
* width fonts if true, or vice-versa
*/
- void setFont( const QFont &font, bool onlyFixed = false )
+ void setFont( const TQFont &font, bool onlyFixed = false )
{ chooser->setFont(font, onlyFixed); }
/**
* @return The currently selected font in the dialog.
*/
- QFont font() const { return chooser->font(); }
+ TQFont font() const { return chooser->font(); }
/**
* Sets the state of the checkbox indicating whether the font size
@@ -400,14 +402,14 @@ public:
* NOTE: If parameter sizeIsRelative was not set in the constructor
* of the dialog this setting will be ignored.
*/
- void setSizeIsRelative( QButton::ToggleState relative )
+ void setSizeIsRelative( TQButton::ToggleState relative )
{ chooser->setSizeIsRelative( relative ); }
/**
* @return Whether the font size is to be interpreted as relative size
* (default: false)
*/
- QButton::ToggleState sizeIsRelative() const
+ TQButton::ToggleState sizeIsRelative() const
{ return chooser->sizeIsRelative(); }
/**
@@ -417,7 +419,7 @@ public:
* @param theFont a reference to the font to write the chosen font
* into.
* @param onlyFixed if true, only select from fixed-width fonts.
- * @param parent Parent widget of the dialog. Specifying a widget different
+ * @param tqparent Parent widget of the dialog. Specifying a widget different
* from 0 (Null) improves centering (looks better).
* @param makeFrame Draws a frame with titles around the contents.
* @param sizeIsRelativeState If not zero the widget will show a
@@ -427,11 +429,11 @@ public:
* *sizeIsRelativeState and user choice will be returned
* therein.
*
- * @return QDialog::result().
+ * @return TQDialog::result().
*/
- static int getFont( QFont &theFont, bool onlyFixed = false,
- QWidget *parent = 0L, bool makeFrame = true,
- QButton::ToggleState *sizeIsRelativeState = 0L );
+ static int getFont( TQFont &theFont, bool onlyFixed = false,
+ TQWidget *tqparent = 0L, bool makeFrame = true,
+ TQButton::ToggleState *sizeIsRelativeState = 0L );
/**
* Creates a modal font difference dialog, lets the user choose a selection
@@ -442,8 +444,8 @@ public:
* @param theFont a reference to the font to write the chosen font
* into.
* @param diffFlags a reference to the int into which the chosen
- * difference selection bitmask should be written.
- * Check the returned bitmask like:
+ * difference selection bittqmask should be written.
+ * Check the returned bittqmask like:
* \code
* if ( diffFlags & KFontChooser_local::FontDiffFamily )
* [...]
@@ -453,7 +455,7 @@ public:
* [...]
* \endcode
* @param onlyFixed if true, only select from fixed-width fonts.
- * @param parent Parent widget of the dialog. Specifying a widget different
+ * @param tqparent Parent widget of the dialog. Specifying a widget different
* from 0 (Null) improves centering (looks better).
* @param makeFrame Draws a frame with titles around the contents.
* @param sizeIsRelativeState If not zero the widget will show a
@@ -463,11 +465,11 @@ public:
* *sizeIsRelativeState and user choice will be returned
* therein.
*
- * @returns QDialog::result().
+ * @returns TQDialog::result().
*/
- static int getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed = false,
- QWidget *parent = 0L, bool makeFrame = true,
- QButton::ToggleState *sizeIsRelativeState = 0L );
+ static int getFontDiff( TQFont &theFont, int &diffFlags, bool onlyFixed = false,
+ TQWidget *tqparent = 0L, bool makeFrame = true,
+ TQButton::ToggleState *sizeIsRelativeState = 0L );
/**
* When you are not only interested in the font selected, but also
@@ -477,7 +479,7 @@ public:
* into.
* @param theString a reference to the example text that was typed.
* @param onlyFixed if true, only select from fixed-width fonts.
- * @param parent Parent widget of the dialog. Specifying a widget different
+ * @param tqparent Parent widget of the dialog. Specifying a widget different
* from 0 (Null) improves centering (looks better).
* @param makeFrame Draws a frame with titles around the contents.
* @param sizeIsRelativeState If not zero the widget will show a
@@ -488,10 +490,10 @@ public:
* therein.
* @return The result of the dialog.
*/
- static int getFontAndText( QFont &theFont, QString &theString,
- bool onlyFixed = false, QWidget *parent = 0L,
+ static int getFontAndText( TQFont &theFont, TQString &theString,
+ bool onlyFixed = false, TQWidget *tqparent = 0L,
bool makeFrame = true,
- QButton::ToggleState *sizeIsRelativeState = 0L );
+ TQButton::ToggleState *sizeIsRelativeState = 0L );
signals:
/**
@@ -499,7 +501,7 @@ signals:
* Connect to this to monitor the font as it is selected if you are
* not running modal.
*/
- void fontSelected( const QFont &font );
+ void fontSelected( const TQFont &font );
protected:
KFontChooser_local *chooser;
diff --git a/lib/kotext/KoAutoFormat.cpp b/lib/kotext/KoAutoFormat.cpp
index 4e0ad7bb..b6529b8f 100644
--- a/lib/kotext/KoAutoFormat.cpp
+++ b/lib/kotext/KoAutoFormat.cpp
@@ -40,43 +40,43 @@
#include <kcompletion.h>
#include <kcalendarsystem.h>
-#include <qfile.h>
-#include <qlabel.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qdom.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqdom.h>
+#include <tqregexp.h>
-KoCompletionBox::KoCompletionBox( QWidget * parent, const char * name, WFlags f)
- : QLabel(parent,name,f)
+KoCompletionBox::KoCompletionBox( TQWidget * tqparent, const char * name, WFlags f)
+ : TQLabel(tqparent,name,f)
{
- setBackgroundColor(QColor("#FFFFE6"));
- setFocusPolicy(QWidget::NoFocus);
- setFrameShape(QFrame::Box);
+ setBackgroundColor(TQColor("#FFFFE6"));
+ setFocusPolicy(TQ_NoFocus);
+ setFrameShape(TQFrame::Box);
}
KoCompletionBox::~KoCompletionBox()
{
}
-void KoCompletionBox::mousePressEvent( QMouseEvent *)
+void KoCompletionBox::mousePressEvent( TQMouseEvent *)
{
hide();
}
-QString& KoCompletionBox::lastWord()
+TQString& KoCompletionBox::lastWord()
{
return m_lastWord;
}
-void KoCompletionBox::setLastWord( QString const &lastword)
+void KoCompletionBox::setLastWord( TQString const &lastword)
{
m_lastWord = lastword;
}
-KoAutoFormatEntry::KoAutoFormatEntry(const QString& replace)
- : m_replace( replace )
+KoAutoFormatEntry::KoAutoFormatEntry(const TQString& tqreplace)
+ : m_tqreplace( tqreplace )
{
m_formatOptions= 0L;
}
@@ -120,7 +120,7 @@ KoAutoFormat::KoAutoFormat( KoDocument *_doc, KoVariableCollection *_varCollecti
: m_doc( _doc ),
m_varCollection(_varCollection),
m_varFormatCollection(_varFormatCollection),
- m_autoFormatLanguage( QString::null),
+ m_autoFormatLanguage( TQString()),
m_configRead( false ),
m_convertUpperCase( false ), m_convertUpperUpper( false ),
m_advancedAutoCorrect( true ),
@@ -234,10 +234,10 @@ KoAutoFormat::~KoAutoFormat()
void KoAutoFormat::updateMaxWords()
{
- QStringList list = m_listCompletion->items();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ TQStringList list = m_listCompletion->items();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
- QString tmp = *it;
+ TQString tmp = *it;
uint maxword = 1;
for (uint i=0; i < (uint)tmp.length(); i++)
@@ -267,7 +267,7 @@ void KoAutoFormat::readConfig(bool force)
KConfigGroupSaver cgs( config, "AutoFormat" );
//when we force don't load format language.
if ( !force)
- m_autoFormatLanguage = config->readEntry("formatLanguage", QString::null);
+ m_autoFormatLanguage = config->readEntry("formatLanguage", TQString());
m_convertUpperCase = config->readBoolEntry( "ConvertUpperCase", false );
m_convertUpperUpper = config->readBoolEntry( "ConvertUpperUpper", false );
@@ -283,8 +283,8 @@ void KoAutoFormat::readConfig(bool force)
m_removeSpaceBeginEndLine = config->readBoolEntry("RemoveSpaceBeginEndLine", true);
m_useBulletStyle = config->readBoolEntry("UseBulletStyle",false);
- QString tmp = config->readEntry( "BulletStyle", "" );
- m_bulletStyle = tmp.isEmpty() ? QChar() : tmp[0];
+ TQString tmp = config->readEntry( "BulletStyle", "" );
+ m_bulletStyle = tmp.isEmpty() ? TQChar() : tmp[0];
m_autoChangeFormat = config->readBoolEntry( "AutoChangeFormat", false );
@@ -293,14 +293,14 @@ void KoAutoFormat::readConfig(bool force)
m_useAutoNumberStyle = config->readBoolEntry( "AutoNumberStyle", false );
- QString beginDoubleQuote = config->readEntry( "TypographicQuotesBegin" );
- QString endDoubleQuote = config->readEntry( "TypographicQuotesEnd" );
+ TQString beginDoubleQuote = config->readEntry( "TypographicQuotesBegin" );
+ TQString endDoubleQuote = config->readEntry( "TypographicQuotesEnd" );
- m_typographicDoubleQuotes.replace = config->readBoolEntry( "TypographicQuotesEnabled", false );
+ m_typographicDoubleQuotes.tqreplace = config->readBoolEntry( "TypographicQuotesEnabled", false );
- QString begin = config->readEntry( "TypographicSimpleQuotesBegin" );
- QString end = config->readEntry( "TypographicSimpleQuotesEnd" );
- m_typographicSimpleQuotes.replace = config->readBoolEntry( "TypographicSimpleQuotesEnabled", false );
+ TQString begin = config->readEntry( "TypographicSimpleQuotesBegin" );
+ TQString end = config->readEntry( "TypographicSimpleQuotesEnd" );
+ m_typographicSimpleQuotes.tqreplace = config->readBoolEntry( "TypographicSimpleQuotesEnabled", false );
m_bAutoSuperScript = config->readBoolEntry( "AutoSuperScript", true );
@@ -335,7 +335,7 @@ void KoAutoFormat::readConfig(bool force)
if( beginDoubleQuote.isEmpty())
{
if( m_typographicDefaultDoubleQuotes.begin.isNull())
- m_typographicDoubleQuotes.begin = QChar('');
+ m_typographicDoubleQuotes.begin = TQChar('�');
else
m_typographicDoubleQuotes.begin = m_typographicDefaultDoubleQuotes.begin;
}
@@ -345,14 +345,14 @@ void KoAutoFormat::readConfig(bool force)
if( endDoubleQuote.isEmpty() )
{
if( m_typographicDefaultDoubleQuotes.end.isNull())
- m_typographicDoubleQuotes.end = QChar('');
+ m_typographicDoubleQuotes.end = TQChar('�');
else
m_typographicDoubleQuotes.end = m_typographicDefaultDoubleQuotes.end;
}
else
m_typographicDoubleQuotes.end = endDoubleQuote[0];
- m_typographicDoubleQuotes.replace = m_typographicDoubleQuotes.replace
+ m_typographicDoubleQuotes.tqreplace = m_typographicDoubleQuotes.tqreplace
&& !m_typographicDoubleQuotes.begin.isNull()
&& !m_typographicDoubleQuotes.end.isNull();
@@ -360,7 +360,7 @@ void KoAutoFormat::readConfig(bool force)
if( begin.isEmpty())
{
if( m_typographicDefaultSimpleQuotes.begin.isNull())
- m_typographicSimpleQuotes.begin = QChar('\'');
+ m_typographicSimpleQuotes.begin = TQChar('\'');
else
m_typographicSimpleQuotes.begin = m_typographicDefaultSimpleQuotes.begin;
}
@@ -370,14 +370,14 @@ void KoAutoFormat::readConfig(bool force)
if( end.isEmpty() )
{
if( m_typographicDefaultSimpleQuotes.end.isNull())
- m_typographicSimpleQuotes.end = QChar('\'');
+ m_typographicSimpleQuotes.end = TQChar('\'');
else
m_typographicSimpleQuotes.end = m_typographicDefaultSimpleQuotes.end;
}
else
m_typographicSimpleQuotes.end = end[0];
- m_typographicSimpleQuotes.replace = m_typographicSimpleQuotes.replace
+ m_typographicSimpleQuotes.tqreplace = m_typographicSimpleQuotes.tqreplace
&& !m_typographicSimpleQuotes.end.isNull()
&& !m_typographicSimpleQuotes.begin.isNull();
@@ -392,10 +392,10 @@ void KoAutoFormat::readAutoCorrectConfig()
{
Q_ASSERT( m_entries.isEmpty() ); // readConfig is only called once...
KLocale klocale(m_doc->instance()->instanceName());
- QString kdelang = klocale.languageList().front();
- kdelang.remove( QRegExp( "@.*" ) );
+ TQString kdelang = klocale.languageList().front();
+ kdelang.remove( TQRegExp( "@.*" ) );
kdDebug(32500) << "KoAutoFormat: m_autoFormatLanguage=" << m_autoFormatLanguage << " kdelang=" << kdelang << endl;
- QString fname;
+ TQString fname;
if ( !m_autoFormatLanguage.isEmpty() )
{
fname = locate( "data", "koffice/autocorrect/" + m_autoFormatLanguage + ".xml", m_doc->instance() );
@@ -404,9 +404,9 @@ void KoAutoFormat::readAutoCorrectConfig()
{
if ( fname.isEmpty() && !kdelang.isEmpty() )
fname = locate( "data", "koffice/autocorrect/" + kdelang + ".xml", m_doc->instance() );
- if ( fname.isEmpty() && kdelang.contains("_") )
+ if ( fname.isEmpty() && kdelang.tqcontains("_") )
{
- kdelang.remove( QRegExp( "_.*" ) );
+ kdelang.remove( TQRegExp( "_.*" ) );
fname = locate( "data", "koffice/autocorrect/" + kdelang + ".xml", m_doc->instance() );
}
if ( fname.isEmpty() )
@@ -414,59 +414,59 @@ void KoAutoFormat::readAutoCorrectConfig()
}
if ( fname.isEmpty() )
return;
- QFile xmlFile(fname);
+ TQFile xmlFile(fname);
if(!xmlFile.open(IO_ReadOnly))
return;
- QDomDocument doc;
+ TQDomDocument doc;
if(!doc.setContent(&xmlFile))
return;
if(doc.doctype().name() != "autocorrection") {
//return;
}
- QDomElement de=doc.documentElement();
+ TQDomElement de=doc.documentElement();
loadAutoCorrection( de );
- QDomElement upper = de.namedItem( "UpperCaseExceptions" ).toElement();
+ TQDomElement upper = de.namedItem( "UpperCaseExceptions" ).toElement();
if(!upper.isNull())
{
- QDomNodeList nl = upper.childNodes();
+ TQDomNodeList nl = upper.childNodes();
for(uint i = 0; i < nl.count(); i++)
{
m_upperCaseExceptions+= nl.item(i).toElement().attribute("exception");
}
}
- QDomElement twoUpper = de.namedItem( "TwoUpperLetterExceptions" ).toElement();
+ TQDomElement twoUpper = de.namedItem( "TwoUpperLetterExceptions" ).toElement();
if(!twoUpper.isNull())
{
- QDomNodeList nl = twoUpper.childNodes();
+ TQDomNodeList nl = twoUpper.childNodes();
for(uint i = 0; i < nl.count(); i++)
{
m_twoUpperLetterException+= nl.item(i).toElement().attribute("exception");
}
}
- QDomElement superScript = de.namedItem( "SuperScript" ).toElement();
+ TQDomElement superScript = de.namedItem( "SuperScript" ).toElement();
if(!superScript.isNull())
{
- QDomNodeList nl = superScript.childNodes();
+ TQDomNodeList nl = superScript.childNodes();
for(uint i = 0; i < nl.count() ; i++) {
//bug in qmap we overwrite = false doesn't work
//so we can't add multiple "othernb"
- m_superScriptEntries.insert( nl.item(i).toElement().attribute("find"), KoAutoFormatEntry(nl.item(i).toElement().attribute("super")),FALSE );
+ m_superScriptEntries.insert( nl.item(i).toElement().attribute("tqfind"), KoAutoFormatEntry(nl.item(i).toElement().attribute("super")),FALSE );
}
}
- QDomElement doubleQuote = de.namedItem( "DoubleQuote" ).toElement();
+ TQDomElement doubleQuote = de.namedItem( "DoubleQuote" ).toElement();
if(!doubleQuote.isNull())
{
- QDomElement childItem = doubleQuote.namedItem("doublequote").toElement();
+ TQDomElement childItem = doubleQuote.namedItem("doublequote").toElement();
if ( !childItem.isNull() )
{
- QString attr = childItem.attribute( "begin" );
+ TQString attr = childItem.attribute( "begin" );
if ( !attr.isEmpty() && attr[0] != 0 )
m_typographicDefaultDoubleQuotes.begin = attr[0];
attr = childItem.attribute( "end" );
@@ -474,13 +474,13 @@ void KoAutoFormat::readAutoCorrectConfig()
m_typographicDefaultDoubleQuotes.end = attr[0];
}
}
- QDomElement simpleQuote = de.namedItem( "SimpleQuote" ).toElement();
+ TQDomElement simpleQuote = de.namedItem( "SimpleQuote" ).toElement();
if(!simpleQuote.isNull())
{
- QDomElement childItem = simpleQuote.namedItem("simplequote").toElement();
+ TQDomElement childItem = simpleQuote.namedItem("simplequote").toElement();
if ( !childItem.isNull() )
{
- QString attr = childItem.attribute( "begin" );
+ TQString attr = childItem.attribute( "begin" );
if ( !attr.isEmpty() && attr[0] != 0 )
m_typographicDefaultSimpleQuotes.begin = attr[0];
attr = childItem.attribute( "end" );
@@ -492,32 +492,32 @@ void KoAutoFormat::readAutoCorrectConfig()
void KoAutoFormat::loadAllLanguagesAutoCorrection()
{
- QString fname = locate( "data", "koffice/autocorrect/all_languages.xml", m_doc->instance() );
+ TQString fname = locate( "data", "koffice/autocorrect/all_languages.xml", m_doc->instance() );
if ( fname.isEmpty() )
return;
- QFile xmlFile( fname );
+ TQFile xmlFile( fname );
if(xmlFile.open(IO_ReadOnly))
{
- QDomDocument doc;
+ TQDomDocument doc;
if(!doc.setContent(&xmlFile)) {
return;
}
if(doc.doctype().name() != "autocorrection") {
//return;
}
- QDomElement de=doc.documentElement();
+ TQDomElement de=doc.documentElement();
loadAutoCorrection( de, true );
xmlFile.close();
}
}
-void KoAutoFormat::loadAutoCorrection( const QDomElement & _de, bool _allLanguages )
+void KoAutoFormat::loadAutoCorrection( const TQDomElement & _de, bool _allLanguages )
{
- QDomElement item = _de.namedItem( "items" ).toElement();
+ TQDomElement item = _de.namedItem( "items" ).toElement();
if(!item.isNull())
{
- QDomNodeList nl = item.childNodes();
+ TQDomNodeList nl = item.childNodes();
m_maxFindLength=nl.count();
for(uint i = 0; i < m_maxFindLength; i++) {
loadEntry( nl.item(i).toElement(), _allLanguages);
@@ -525,9 +525,9 @@ void KoAutoFormat::loadAutoCorrection( const QDomElement & _de, bool _allLanguag
}
}
-void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
+void KoAutoFormat::loadEntry( const TQDomElement &nl, bool _allLanguages)
{
- KoAutoFormatEntry *tmp =new KoAutoFormatEntry(nl.attribute("replace"));
+ KoAutoFormatEntry *tmp =new KoAutoFormatEntry(nl.attribute("tqreplace"));
if ( nl.hasAttribute("FONT"))
{
tmp->createNewEntryContext();
@@ -544,7 +544,7 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::Bold;
- QString value = nl.attribute("BOLD");
+ TQString value = nl.attribute("BOLD");
if ( value.toInt() == 1 )
tmp->formatEntryContext()->m_options |= KoSearchContext::Bold;
}
@@ -552,7 +552,7 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::Italic;
- QString value = nl.attribute("ITALIC");
+ TQString value = nl.attribute("ITALIC");
if ( value.toInt() == 1 )
tmp->formatEntryContext()->m_options |= KoSearchContext::Italic;
}
@@ -560,7 +560,7 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::Underline;
- QString value = nl.attribute("UNDERLINE");
+ TQString value = nl.attribute("UNDERLINE");
if ( value =="single" )
tmp->formatEntryContext()->m_underline = KoTextFormat::U_SIMPLE;
else if ( value =="double" )
@@ -574,7 +574,7 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::StrikeOut;
- QString value = nl.attribute("STRIKEOUT");
+ TQString value = nl.attribute("STRIKEOUT");
if ( value =="single" )
tmp->formatEntryContext()->m_strikeOut = KoTextFormat::S_SIMPLE;
else if ( value =="double" )
@@ -588,7 +588,7 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::VertAlign;
- QString value = nl.attribute("VERTALIGN");
+ TQString value = nl.attribute("VERTALIGN");
tmp->formatEntryContext()->m_vertAlign=static_cast<KoTextFormat::VerticalAlignment>( value.toInt() );
}
@@ -596,20 +596,20 @@ void KoAutoFormat::loadEntry( const QDomElement &nl, bool _allLanguages)
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::Color;
- QColor col( nl.attribute("TEXTCOLOR" ));
+ TQColor col( nl.attribute("TEXTCOLOR" ));
tmp->formatEntryContext()->m_color = col;
}
if ( nl.hasAttribute("TEXTBGCOLOR" ))
{
tmp->createNewEntryContext();
tmp->formatEntryContext()->m_optionsMask |= KoSearchContext::BgColor;
- QColor col( nl.attribute("TEXTBGCOLOR" ));
+ TQColor col( nl.attribute("TEXTBGCOLOR" ));
tmp->formatEntryContext()->m_backGroundColor = col;
}
if ( !_allLanguages )
- m_entries.insert( nl.attribute("find"), tmp );
+ m_entries.insert( nl.attribute("tqfind"), tmp );
else
- m_allLanguages.insert( nl.attribute("find"), tmp );
+ m_allLanguages.insert( nl.attribute("tqfind"), tmp );
}
@@ -626,12 +626,12 @@ void KoAutoFormat::saveConfig()
config->writeEntry( "includeTwoLetterException", m_includeTwoUpperLetterException );
config->writeEntry( "includeAbbreviation", m_includeAbbreviation );
- config->writeEntry( "TypographicQuotesBegin", QString( m_typographicDoubleQuotes.begin ) );
- config->writeEntry( "TypographicQuotesEnd", QString( m_typographicDoubleQuotes.end ) );
- config->writeEntry( "TypographicQuotesEnabled", m_typographicDoubleQuotes.replace );
- config->writeEntry( "TypographicSimpleQuotesBegin", QString( m_typographicSimpleQuotes.begin ) );
- config->writeEntry( "TypographicSimpleQuotesEnd", QString( m_typographicSimpleQuotes.end ) );
- config->writeEntry( "TypographicSimpleQuotesEnabled", m_typographicSimpleQuotes.replace );
+ config->writeEntry( "TypographicQuotesBegin", TQString( m_typographicDoubleQuotes.begin ) );
+ config->writeEntry( "TypographicQuotesEnd", TQString( m_typographicDoubleQuotes.end ) );
+ config->writeEntry( "TypographicQuotesEnabled", m_typographicDoubleQuotes.tqreplace );
+ config->writeEntry( "TypographicSimpleQuotesBegin", TQString( m_typographicSimpleQuotes.begin ) );
+ config->writeEntry( "TypographicSimpleQuotesEnd", TQString( m_typographicSimpleQuotes.end ) );
+ config->writeEntry( "TypographicSimpleQuotesEnabled", m_typographicSimpleQuotes.tqreplace );
config->writeEntry( "AdvancedAutocorrect", m_advancedAutoCorrect );
config->writeEntry( "AutoCorrectionWithFormat", m_bAutoCorrectionWithFormat );
@@ -643,7 +643,7 @@ void KoAutoFormat::saveConfig()
config->writeEntry( "RemoveSpaceBeginEndLine",m_removeSpaceBeginEndLine );
config->writeEntry( "UseBulletStyle", m_useBulletStyle);
- config->writeEntry( "BulletStyle", QString(m_bulletStyle));
+ config->writeEntry( "BulletStyle", TQString(m_bulletStyle));
config->writeEntry( "AutoChangeFormat", m_autoChangeFormat);
@@ -663,28 +663,28 @@ void KoAutoFormat::saveConfig()
config->writeEntry( "CompletionKeyAction", ( int )m_keyCompletionAction );
config->setGroup( "AutoFormatEntries" );
- QDictIterator<KoAutoFormatEntry> it( m_entries );
+ TQDictIterator<KoAutoFormatEntry> it( m_entries );
//refresh m_maxFindLength
m_maxFindLength=0;
- QDomDocument doc("autocorrection");
+ TQDomDocument doc("autocorrection");
- QDomElement begin = doc.createElement( "Word" );
+ TQDomElement begin = doc.createElement( "Word" );
doc.appendChild( begin );
- QDomElement items;
+ TQDomElement items;
items = doc.createElement("items");
- QDomElement data;
+ TQDomElement data;
for ( ; it.current() ; ++it )
{
items.appendChild(saveEntry( it, doc));
- //m_maxFindLength=QMAX(m_maxFindLength,it.currentKey().length());
+ //m_maxFindLength=TQMAX(m_maxFindLength,it.currentKey().length());
}
buildMaxLen();
begin.appendChild(items);
- QDomElement upper;
+ TQDomElement upper;
upper = doc.createElement("UpperCaseExceptions");
- for ( QStringList::Iterator it = m_upperCaseExceptions.begin(); it != m_upperCaseExceptions.end();++it )
+ for ( TQStringList::Iterator it = m_upperCaseExceptions.begin(); it != m_upperCaseExceptions.end();++it )
{
data = doc.createElement("word");
data.setAttribute("exception",(*it) );
@@ -692,10 +692,10 @@ void KoAutoFormat::saveConfig()
}
begin.appendChild(upper);
- QDomElement twoUpper;
+ TQDomElement twoUpper;
twoUpper = doc.createElement("TwoUpperLetterExceptions");
- for ( QStringList::Iterator it = m_twoUpperLetterException.begin(); it != m_twoUpperLetterException.end();++it )
+ for ( TQStringList::Iterator it = m_twoUpperLetterException.begin(); it != m_twoUpperLetterException.end();++it )
{
data = doc.createElement("word");
data.setAttribute("exception",(*it) );
@@ -703,35 +703,35 @@ void KoAutoFormat::saveConfig()
}
begin.appendChild(twoUpper);
- QDomElement super;
+ TQDomElement super;
super = doc.createElement("SuperScript");
KoAutoFormatEntryMap::Iterator it2 = m_superScriptEntries.begin();
for ( ; it2 != m_superScriptEntries.end() ; ++it2 )
{
data = doc.createElement("superscript");
- data.setAttribute("find", it2.key());
- data.setAttribute("super", it2.data().replace());
+ data.setAttribute("tqfind", it2.key());
+ data.setAttribute("super", it2.data().tqreplace());
super.appendChild(data);
}
begin.appendChild(super);
- QDomElement doubleQuote;
+ TQDomElement doubleQuote;
doubleQuote = doc.createElement("DoubleQuote");
data = doc.createElement("doublequote");
- data.setAttribute("begin", QString(m_typographicDefaultDoubleQuotes.begin));
- data.setAttribute("end", QString(m_typographicDefaultDoubleQuotes.end));
+ data.setAttribute("begin", TQString(m_typographicDefaultDoubleQuotes.begin));
+ data.setAttribute("end", TQString(m_typographicDefaultDoubleQuotes.end));
doubleQuote.appendChild(data);
begin.appendChild(doubleQuote);
- QDomElement simpleQuote;
+ TQDomElement simpleQuote;
simpleQuote = doc.createElement("SimpleQuote");
data = doc.createElement("simplequote");
- data.setAttribute("begin", QString(m_typographicDefaultSimpleQuotes.begin));
- data.setAttribute("end", QString(m_typographicDefaultSimpleQuotes.end));
+ data.setAttribute("begin", TQString(m_typographicDefaultSimpleQuotes.begin));
+ data.setAttribute("end", TQString(m_typographicDefaultSimpleQuotes.end));
simpleQuote.appendChild(data);
begin.appendChild(simpleQuote);
- QFile f;
+ TQFile f;
if ( m_autoFormatLanguage.isEmpty())
f.setName(locateLocal("data", "koffice/autocorrect/"+klocale.languageList().front() + ".xml",m_doc->instance()));
else
@@ -740,19 +740,19 @@ void KoAutoFormat::saveConfig()
kdWarning()<<"Error during saving autoformat to " << f.name() << endl;
return;
}
- QTextStream ts(&f);
+ TQTextStream ts(&f);
doc.save(ts, 2);
f.close();
autoFormatIsActive();
config->sync();
}
-QDomElement KoAutoFormat::saveEntry( QDictIterator<KoAutoFormatEntry> _entry, QDomDocument doc)
+TQDomElement KoAutoFormat::saveEntry( TQDictIterator<KoAutoFormatEntry> _entry, TQDomDocument doc)
{
- QDomElement data;
+ TQDomElement data;
data = doc.createElement("item");
- data.setAttribute("find", _entry.currentKey());
- data.setAttribute("replace", _entry.current()->replace());
+ data.setAttribute("tqfind", _entry.currentKey());
+ data.setAttribute("tqreplace", _entry.current()->tqreplace());
if ( _entry.current()->formatEntryContext() )
{
KoSearchContext *tmp = _entry.current()->formatEntryContext();
@@ -847,28 +847,28 @@ QDomElement KoAutoFormat::saveEntry( QDictIterator<KoAutoFormatEntry> _entry, QD
return data;
}
-void KoAutoFormat::addAutoFormatEntry( const QString &key, const QString &replace )
+void KoAutoFormat::addAutoFormatEntry( const TQString &key, const TQString &tqreplace )
{
- KoAutoFormatEntry *findEntry = m_entries.find( key);
+ KoAutoFormatEntry *findEntry = m_entries.tqfind( key);
if ( findEntry )
{
- if ( findEntry->replace().lower() == replace.lower() )
+ if ( findEntry->tqreplace().lower() == tqreplace.lower() )
return;
}
- KoAutoFormatEntry *tmp = new KoAutoFormatEntry( replace );
+ KoAutoFormatEntry *tmp = new KoAutoFormatEntry( tqreplace );
m_entries.insert( key, tmp );
saveConfig();
buildMaxLen();
}
-QString KoAutoFormat::getLastWord(KoTextParag *parag, int const index)
+TQString KoAutoFormat::getLastWord(KoTextParag *parag, int const index)
{
- QString lastWord;
+ TQString lastWord;
KoTextString *s = parag->string();
for ( int i = index - 1; i >= 0; --i )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch.isSpace() || ch.isPunct() )
break;
lastWord.prepend( ch );
@@ -876,14 +876,14 @@ QString KoAutoFormat::getLastWord(KoTextParag *parag, int const index)
return lastWord;
}
-QString KoAutoFormat::getLastWord(const int max_words, KoTextParag *parag, int const index)
+TQString KoAutoFormat::getLastWord(const int max_words, KoTextParag *parag, int const index)
{
- QString lastWord;
+ TQString lastWord;
KoTextString const *s = parag->string();
int words = 0;
for ( int i = index - 1; i >= 0; --i )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch.isSpace() || ch.isPunct() )
{
++words;
@@ -895,13 +895,13 @@ QString KoAutoFormat::getLastWord(const int max_words, KoTextParag *parag, int c
return lastWord;
}
-QString KoAutoFormat::getWordAfterSpace(KoTextParag *parag, int const index)
+TQString KoAutoFormat::getWordAfterSpace(KoTextParag *parag, int const index)
{
- QString word;
+ TQString word;
KoTextString *s = parag->string();
for ( int i = index - 1; i >= 0; --i )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch.isSpace() )
break;
word.prepend( ch );
@@ -915,7 +915,7 @@ bool KoAutoFormat::doCompletion( KoTextCursor* textEditCursor, KoTextParag *para
if( m_completion )
{
bool part=false;
- QString lastWord, word;
+ TQString lastWord, word;
if (m_completionBox && m_completionBox->isShown() ) //word completion with the tool-tip box
{
word = m_completionBox->text();
@@ -923,16 +923,16 @@ bool KoAutoFormat::doCompletion( KoTextCursor* textEditCursor, KoTextParag *para
}
else
{
- QStringList wordlist, new_wordlist;
+ TQStringList wordlist, new_wordlist;
for (uint i=1; i <= m_countMaxWords; i++ )
{
lastWord = getLastWord(i, parag, index+1);
wordlist += m_listCompletion->substringCompletion( lastWord ); //find all completion words that contains lastWord
}
uint maxlength = 0;
- for ( QStringList::ConstIterator it = wordlist.begin(); it != wordlist.end(); ++it ) // several completion words were found
+ for ( TQStringList::ConstIterator it = wordlist.begin(); it != wordlist.end(); ++it ) // several completion words were found
{
- if ( (*it).startsWith( lastWord, false ) && new_wordlist.find(*it) == new_wordlist.end() ) //the completion words that begin with lastWord
+ if ( (*it).tqstartsWith( lastWord, false ) && new_wordlist.tqfind(*it) == new_wordlist.end() ) //the completion words that begin with lastWord
{
if ( (*it).length() > maxlength )
maxlength = (*it).length();
@@ -949,10 +949,10 @@ bool KoAutoFormat::doCompletion( KoTextCursor* textEditCursor, KoTextParag *para
//we must extract the common part of the completions
for (uint i = lastWord.length(); i<maxlength && !part; i++) //iterate through all completion words
{
- QChar ch = new_wordlist.first().at(i);
- for (QStringList::ConstIterator it = new_wordlist.begin(); it != new_wordlist.end(); ++it )
+ TQChar ch = new_wordlist.first().at(i);
+ for (TQStringList::ConstIterator it = new_wordlist.begin(); it != new_wordlist.end(); ++it )
{
- if ( (*it).at(i).lower() != ch.lower() )
+ if ( (*it).tqat(i).lower() != ch.lower() )
{
word = (*it).left(i); //the completion word is truncated here
//kdDebug() << "set the word completion to:" << word << endl;
@@ -1026,24 +1026,24 @@ bool KoAutoFormat::doToolTipCompletion( KoTextCursor* textEditCursor, KoTextPara
{
if( m_completion && m_toolTipCompletion && m_completionBox && m_completionBox->isShown() )
{
- if ( ( keyPressed == Qt::Key_Return && m_keyCompletionAction==Enter )
- || ( keyPressed == Qt::Key_Enter && m_keyCompletionAction==Enter )
- || ( keyPressed == Qt::Key_Tab && m_keyCompletionAction==Tab )
- || ( keyPressed == Qt::Key_Space && m_keyCompletionAction==Space )
- || ( keyPressed == Qt::Key_End && m_keyCompletionAction==End )
- || ( keyPressed == Qt::Key_Right && m_keyCompletionAction==Right ))
+ if ( ( keyPressed == TQt::Key_Return && m_keyCompletionAction==Enter )
+ || ( keyPressed == TQt::Key_Enter && m_keyCompletionAction==Enter )
+ || ( keyPressed == TQt::Key_Tab && m_keyCompletionAction==Tab )
+ || ( keyPressed == TQt::Key_Space && m_keyCompletionAction==Space )
+ || ( keyPressed == TQt::Key_End && m_keyCompletionAction==End )
+ || ( keyPressed == TQt::Key_Right && m_keyCompletionAction==Right ))
{
return doCompletion(textEditCursor, parag, index, txtObj);
}
}
return false;
}
-void KoAutoFormat::showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos )
+void KoAutoFormat::showToolTipBox(KoTextParag *parag, int index, TQWidget *widget, const TQPoint &pos )
{
if( m_completion && m_toolTipCompletion)
{
- QString lastWord, word;
+ TQString lastWord, word;
for (uint i=1; i <= m_countMaxWords; i++ )
{
lastWord = getLastWord(i, parag, index+1);
@@ -1058,12 +1058,12 @@ void KoAutoFormat::showToolTipBox(KoTextParag *parag, int index, QWidget *widge
return;
word=lastWord+word.right(word.length()-length);
if (!m_completionBox)
- m_completionBox = new KoCompletionBox(0,0,Qt::WType_Popup);
- QPoint const show_pos = widget->mapToGlobal(pos);
+ m_completionBox = new KoCompletionBox(0,0,TQt::WType_Popup);
+ TQPoint const show_pos = widget->mapToGlobal(pos);
m_completionBox->setText(word);
m_completionBox->setLastWord(lastWord);
m_completionBox->adjustSize();
- int const height = m_completionBox->sizeHint().height();
+ int const height = m_completionBox->tqsizeHint().height();
m_completionBox->move( show_pos.x(), show_pos.y() - height );
if (!m_completionBox->isShown() )
@@ -1092,13 +1092,13 @@ void KoAutoFormat::autoFormatIsActive()
m_autoReplaceNumber ||
m_autoChangeFormat ||
m_completion ||
- m_typographicDoubleQuotes.replace ||
- m_typographicSimpleQuotes.replace ||
+ m_typographicDoubleQuotes.tqreplace ||
+ m_typographicSimpleQuotes.tqreplace ||
m_entries.count()!=0 ||
m_allLanguages.count()!=0;
}
-void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *parag, int index, QChar ch,KoTextObject *txtObj )
+void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *parag, int index, TQChar ch,KoTextObject *txtObj )
{
m_ignoreUpperCase = false;
@@ -1114,7 +1114,7 @@ void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *para
//=>m_ignoreUpperCase = false
//m_ignoreUpperCase=false;
- QString word=getWordAfterSpace(parag,index);
+ TQString word=getWordAfterSpace(parag,index);
if ( m_autoChangeFormat && index > 3)
{
@@ -1158,7 +1158,7 @@ void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *para
doAutoIncludeAbbreviation(textEditCursor, parag, txtObj );
}
- //kdDebug(32500) << "KoAutoFormat::doAutoFormat ch=" << QString(ch) << endl;
+ //kdDebug(32500) << "KoAutoFormat::doAutoFormat ch=" << TQString(ch) << endl;
//if ( !m_enabled )
// return;
// Auto-correction happens when pressing space, tab, CR, punct etc.
@@ -1166,7 +1166,7 @@ void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *para
{
KCommand *cmd = 0L;
KMacroCommand *macro = 0L;
- QString lastWord = getWordAfterSpace(parag, index);
+ TQString lastWord = getWordAfterSpace(parag, index);
//kdDebug(32500) << "KoAutoFormat::doAutoFormat lastWord=" << lastWord << endl;
if ( ch == '.')
@@ -1248,8 +1248,8 @@ void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *para
//kdDebug(32500)<<" m_listCompletion->items() :"<<m_listCompletion->items()<<endl;
if( !m_ignoreUpperCase && m_completion && m_addCompletionWord && m_listCompletion->items().count() < m_nbMaxCompletionWord )
{
- QString completionWord("");
- QChar ch;
+ TQString completionWord("");
+ TQChar ch;
for (uint i=0;i<lastWord.length();i++)
{
ch = lastWord.at(i);
@@ -1323,13 +1323,13 @@ void KoAutoFormat::doAutoFormat( KoTextCursor* textEditCursor, KoTextParag *para
}
else
{
- if ( ch == '"' && m_typographicDoubleQuotes.replace )
+ if ( ch == '"' && m_typographicDoubleQuotes.tqreplace )
{
KCommand *cmd = doTypographicQuotes( textEditCursor, parag, index, txtObj, true /*double quote*/ );
if ( cmd )
txtObj->emitNewCommand( cmd );
}
- else if ( ch == '\'' && m_typographicDoubleQuotes.replace )
+ else if ( ch == '\'' && m_typographicDoubleQuotes.tqreplace )
{
KCommand *cmd = doTypographicQuotes( textEditCursor, parag, index, txtObj, false /* simple quote*/ );
if ( cmd )
@@ -1345,13 +1345,13 @@ KCommand *KoAutoFormat::doAutoCorrect( KoTextCursor* textEditCursor, KoTextParag
// Prepare an array with words of different lengths, all terminating at "index".
// Obviously only full words are put into the array
// But this allows 'find strings' with spaces and punctuation in them.
- QString * wordArray = new QString[m_maxFindLength+1];
+ TQString * wordArray = new TQString[m_maxFindLength+1];
{
- QString word;
+ TQString word;
KoTextString *s = parag->string();
for ( int i = index - 1; i >= 0; --i )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
// It's necessary to stop at spaces - #99063
if ( ch.isSpace() /*|| ch.isPunct()*/ || i==0)
{
@@ -1373,7 +1373,7 @@ KCommand *KoAutoFormat::doAutoCorrect( KoTextCursor* textEditCursor, KoTextParag
}
-KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, QString * _wordArray, bool _allLanguages )
+KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, TQString * _wordArray, bool _allLanguages )
{
KoTextDocument * textdoc = parag->textDocument();
@@ -1400,10 +1400,10 @@ KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextPara
cursor.setIndex( start + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
KCommand *cmd = 0L;
- kdDebug()<<"it->replace() :"<<it->replace()<<endl;
+ kdDebug()<<"it->tqreplace() :"<<it->tqreplace()<<endl;
if (!it->formatEntryContext() || !m_bAutoCorrectionWithFormat)
{
- cmd = txtObj->replaceSelectionCommand( textEditCursor, it->replace(),
+ cmd = txtObj->replaceSelectionCommand( textEditCursor, it->tqreplace(),
i18n("Autocorrect Word"),
KoTextDocument::HighlightSelection );
}
@@ -1414,7 +1414,7 @@ KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextPara
KoTextFormat * newFormat = new KoTextFormat(*lastFormat);
changeTextFormat(it->formatEntryContext(), newFormat, flags );
KMacroCommand *macro = new KMacroCommand( i18n("Autocorrect Word with Format"));
- KCommand *cmd2=txtObj->replaceSelectionCommand( textEditCursor, it->replace(),
+ KCommand *cmd2=txtObj->replaceSelectionCommand( textEditCursor, it->tqreplace(),
i18n("Autocorrect Word"),
KoTextDocument::HighlightSelection );
if ( cmd2 )
@@ -1423,13 +1423,13 @@ KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextPara
cursor.setParag( parag );
cursor.setIndex( start );
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
- cursor.setIndex( start + it->replace().length()/*+ length + 1*/ );
+ cursor.setIndex( start + it->tqreplace().length()/*+ length + 1*/ );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
cmd2 =txtObj->setFormatCommand( textEditCursor, &lastFormat, newFormat, flags, false, KoTextDocument::HighlightSelection );
macro->addCommand( cmd2);
- index = index - length + it->replace().length();
+ index = index - length + it->tqreplace().length();
textEditCursor->setIndex(index+1);
cmd2 =txtObj->setFormatCommand( textEditCursor, &newFormat, lastFormat, 0 );
macro->addCommand( cmd2);
@@ -1448,7 +1448,7 @@ KCommand *KoAutoFormat::autoFormatWord( KoTextCursor* textEditCursor, KoTextPara
txtObj->emitHideCursor();
textEditCursor->gotoRight();
txtObj->emitShowCursor();
- index = index - length + it->replace().length();
+ index = index - length + it->tqreplace().length();
return cmd;
}
}
@@ -1477,22 +1477,22 @@ KCommand *KoAutoFormat::doTypographicQuotes( KoTextCursor* textEditCursor, KoTex
// a. and the character before that is not an opening quote (so that we get quotations of single characters
// right)
// b. and the previous quote of a different kind (so that we get empty quotations right)
- QString replacement;
+ TQString replacement;
bool ending = true;
if( index > 0 )
{
- QChar::Category c1 = parag->at( index - 1 )->c.category();
+ TQChar::Category c1 = parag->at( index - 1 )->c.category();
// case 1 and 2
- if ( c1 == QChar::Separator_Space || c1 == QChar::Separator_Line || c1 == QChar::Separator_Paragraph ||
- c1 == QChar::Punctuation_Open || c1 == QChar::Other_Control )
+ if ( c1 == TQChar::Separator_Space || c1 == TQChar::Separator_Line || c1 == TQChar::Separator_Paragraph ||
+ c1 == TQChar::Punctuation_Open || c1 == TQChar::Other_Control )
ending = false;
// case 3
- if ( c1 == QChar::Punctuation_InitialQuote )
+ if ( c1 == TQChar::Punctuation_InitialQuote )
{
- QChar openingQuote;
+ TQChar openingQuote;
if( doubleQuotes )
openingQuote = m_typographicDoubleQuotes.begin;
@@ -1508,8 +1508,8 @@ KCommand *KoAutoFormat::doTypographicQuotes( KoTextCursor* textEditCursor, KoTex
// cases 2a and 3a
if( index > 1 && !ending )
{
- QChar::Category c2 = parag->at( index - 2 )->c.category();
- ending = (c2 == QChar::Punctuation_InitialQuote);
+ TQChar::Category c2 = parag->at( index - 2 )->c.category();
+ ending = (c2 == TQChar::Punctuation_InitialQuote);
}
if( ending )
@@ -1532,7 +1532,7 @@ KCommand *KoAutoFormat::doTypographicQuotes( KoTextCursor* textEditCursor, KoTex
}
KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag *parag,
- int index, const QString & word, KoTextObject *txtObj )
+ int index, const TQString & word, KoTextObject *txtObj )
{
KoTextDocument * textdoc = parag->textDocument();
unsigned int length = word.length();
@@ -1547,7 +1547,7 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
backCursor.setIndex( start );
// backCursor now points at the first char of the word
- QChar const firstChar = backCursor.parag()->at( backCursor.index() )->c;
+ TQChar const firstChar = backCursor.parag()->at( backCursor.index() )->c;
bool bNeedMove = false;
KCommand *cmd = 0L;
@@ -1557,7 +1557,7 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
// Go back over any space/tab/CR
while ( backCursor.index() > 0 || backCursor.parag()->prev() )
{
- beginningOfSentence = false; // we could go back -> false unless we'll find '.'
+ beginningOfSentence = false; // we could go back -> false unless we'll tqfind '.'
backCursor.gotoLeft();
if ( !backCursor.parag()->at( backCursor.index() )->c.isSpace() )
break;
@@ -1573,12 +1573,12 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
// Now look for exceptions
if ( beginningOfSentence )
{
- QChar const punct = backCursor.parag()->at( backCursor.index() )->c;
- QString const text = getLastWord( backCursor.parag(), backCursor.index() )
+ TQChar const punct = backCursor.parag()->at( backCursor.index() )->c;
+ TQString const text = getLastWord( backCursor.parag(), backCursor.index() )
+ punct;
kdDebug() << "text: " << text << endl;
// text has the word at the end of the 'sentence', including the termination. Example: "Mr."
- beginningOfSentence = (m_upperCaseExceptions.findIndex(text)==-1); // Ok if we can't find it
+ beginningOfSentence = (m_upperCaseExceptions.tqfindIndex(text)==-1); // Ok if we can't find it
}
if ( beginningOfSentence )
@@ -1589,7 +1589,7 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( start + 1 );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- cmd = txtObj->replaceSelectionCommand( textEditCursor, QString( firstChar.upper() ),
+ cmd = txtObj->replaceSelectionCommand( textEditCursor, TQString( firstChar.upper() ),
i18n("Autocorrect (capitalize first letter)"),
KoTextDocument::HighlightSelection );
bNeedMove = true;
@@ -1598,14 +1598,14 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
else if ( m_convertUpperUpper && isUpper( firstChar ) && length > 2 )
{
backCursor.setIndex( backCursor.index() + 1 );
- QChar secondChar = backCursor.parag()->at( backCursor.index() )->c;
+ TQChar secondChar = backCursor.parag()->at( backCursor.index() )->c;
//kdDebug(32500)<<" secondChar :"<<secondChar<<endl;
if ( isUpper( secondChar ) )
{
// Check next letter - we still want to be able to write fully uppercase words...
backCursor.setIndex( backCursor.index() + 1 );
- QChar thirdChar = backCursor.parag()->at( backCursor.index() )->c;
- if ( isLower( thirdChar ) && (m_twoUpperLetterException.findIndex(word)==-1))
+ TQChar thirdChar = backCursor.parag()->at( backCursor.index() )->c;
+ if ( isLower( thirdChar ) && (m_twoUpperLetterException.tqfindIndex(word)==-1))
{
// Ok, convert
KoTextCursor cursor( parag->document() );
@@ -1615,7 +1615,7 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
cursor.setIndex( start + 2 );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- QString replacement = word[1].lower();
+ TQString replacement = word[1].lower();
cmd = txtObj->replaceSelectionCommand( textEditCursor, replacement,
i18n("Autocorrect"),
KoTextDocument::HighlightSelection );
@@ -1637,14 +1637,14 @@ KCommand * KoAutoFormat::doUpperCase( KoTextCursor *textEditCursor, KoTextParag
return cmd;
}
-KCommand * KoAutoFormat::doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int& index, const QString & word , KoTextObject *txtObj )
+KCommand * KoAutoFormat::doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int& index, const TQString & word , KoTextObject *txtObj )
{
unsigned int length = word.length();
if ( length != 3 )
return 0L;
KoTextDocument * textdoc = parag->textDocument();
int start = index - length;
- if( word == QString("1/2") || word == QString("1/4") || word == QString("3/4") )
+ if( word == TQString("1/2") || word == TQString("1/4") || word == TQString("3/4") )
{
KoTextCursor cursor( parag->document() );
cursor.setParag( parag );
@@ -1652,14 +1652,14 @@ KCommand * KoAutoFormat::doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTe
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( start + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- QString replacement;
- if( word == QString("1/2") )
- replacement=QString("");
- else if (word == QString("1/4") )
- replacement=QString("");
- else if (word == QString("3/4") )
- replacement=QString("");
- QString cmdName = i18n("Autocorrect for Fraction");
+ TQString replacement;
+ if( word == TQString("1/2") )
+ replacement=TQString("�");
+ else if (word == TQString("1/4") )
+ replacement=TQString("�");
+ else if (word == TQString("3/4") )
+ replacement=TQString("�");
+ TQString cmdName = i18n("Autocorrect for Fraction");
KCommand *cmd =txtObj->replaceSelectionCommand( textEditCursor, replacement,
cmdName,
KoTextDocument::HighlightSelection );
@@ -1674,61 +1674,61 @@ KCommand * KoAutoFormat::doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTe
void KoAutoFormat::detectStartOfLink(KoTextParag * parag, int const index, bool const insertedDot)
{
- QString word;
+ TQString word;
KoTextString *s = parag->string();
for ( int i = 0; i < index; ++i )
{
word.append( s->at( i ).c );
}
- if (word.find("http")!=-1 || word.find("https")!=-1 || word.find("mailto")!=-1 || word.find("ftp")!=-1 || word.find("file")!=-1
- || word.find("news")!=-1 || word.find('@')!=-1)
+ if (word.tqfind("http")!=-1 || word.tqfind("https")!=-1 || word.tqfind("mailto")!=-1 || word.tqfind("ftp")!=-1 || word.tqfind("file")!=-1
+ || word.tqfind("news")!=-1 || word.tqfind('@')!=-1)
m_ignoreUpperCase=true;
else
{
- int const tmp_pos=word.find("www.");
- if (tmp_pos!=-1 && (word.find('.',tmp_pos+4)!=-1 || insertedDot) )
+ int const tmp_pos=word.tqfind("www.");
+ if (tmp_pos!=-1 && (word.tqfind('.',tmp_pos+4)!=-1 || insertedDot) )
m_ignoreUpperCase=true;
}
}
-void KoAutoFormat::doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int &index, QString & word, KoTextObject *txtObj )
+void KoAutoFormat::doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int &index, TQString & word, KoTextObject *txtObj )
{
kdDebug() << "link:" << word << endl;
char link_type = 0;
- int pos = word.find("http://");
- int tmp_pos = word.find("https://");
+ int pos = word.tqfind("http://");
+ int tmp_pos = word.tqfind("https://");
if(tmp_pos<pos && tmp_pos!=-1)
pos = tmp_pos;
- tmp_pos = word.find("mailto:/");
+ tmp_pos = word.tqfind("mailto:/");
if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1)
pos = tmp_pos;
- tmp_pos = word.find("ftp://");
+ tmp_pos = word.tqfind("ftp://");
if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1)
pos = tmp_pos;
- tmp_pos = word.find("ftp.");
+ tmp_pos = word.tqfind("ftp.");
if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1)
{
pos = tmp_pos;
link_type = 3;
}
- tmp_pos = word.find("file:/");
+ tmp_pos = word.tqfind("file:/");
if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1)
pos = tmp_pos;
- tmp_pos = word.find("news:");
+ tmp_pos = word.tqfind("news:");
if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1)
pos = tmp_pos;
- tmp_pos = word.find("www.");
- if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1 && word.find('.',tmp_pos+4)!=-1 )
+ tmp_pos = word.tqfind("www.");
+ if((tmp_pos<pos || pos==-1 ) && tmp_pos!=-1 && word.tqfind('.',tmp_pos+4)!=-1 )
{
pos = tmp_pos;
link_type = 2;
}
- tmp_pos = word.find('@');
+ tmp_pos = word.tqfind('@');
if ( pos == -1 && tmp_pos != -1 )
{
pos = tmp_pos-1;
- QChar c;
+ TQChar c;
while( pos>=0 )
{
c = word.at(pos);
@@ -1762,13 +1762,13 @@ void KoAutoFormat::doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *p
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( start + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- QString newWord = word;
+ TQString newWord = word;
if(link_type==1)
- newWord = QString("mailto:") + word;
+ newWord = TQString("mailto:") + word;
else if(link_type==2)
- newWord = QString("http://") + word;
+ newWord = TQString("http://") + word;
else if(link_type==3)
- newWord = QString("ftp://") + word;
+ newWord = TQString("ftp://") + word;
KoVariable* var = new KoLinkVariable( textdoc, word, newWord, m_varFormatCollection->format( "STRING" ), m_varCollection );
CustomItemsMap customItemsMap;
@@ -1778,7 +1778,7 @@ void KoAutoFormat::doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *p
txtObj->insert( textEditCursor, lastFormat, KoTextObject::customItemChar(), i18n("Insert Variable"),
KoTextDocument::HighlightSelection, KoTextObject::DefaultInsertFlags, customItemsMap );
var->recalc();
- parag->invalidate(0);
+ parag->tqinvalidate(0);
parag->setChanged( true );
// adjust index
@@ -1811,17 +1811,17 @@ void KoAutoFormat::doAutoIncludeUpperUpper(KoTextCursor* /*textEditCursor*/, KoT
for (int i=0; i<=(s->length() - 1);i++)
{
- QString word;
+ TQString word;
for ( int j = i ; j < s->length() - 1; j++ )
{
- QChar ch = s->at( j ).c;
+ TQChar ch = s->at( j ).c;
if ( ch.isSpace() )
break;
word.append( ch );
}
- if( word.length() > 2 && word.left(2)==word.left(2).upper() && word.at(3)!=word.at(3).upper() )
+ if( word.length() > 2 && word.left(2)==word.left(2).upper() && word.tqat(3)!=word.tqat(3).upper() )
{
- if ( m_twoUpperLetterException.findIndex(word )==-1)
+ if ( m_twoUpperLetterException.tqfindIndex(word )==-1)
m_twoUpperLetterException.append( word);
}
i+=word.length();
@@ -1837,12 +1837,12 @@ void KoAutoFormat::doAutoIncludeAbbreviation(KoTextCursor* /*textEditCursor*/, K
return;
for (int i=0; i<=(s->length() - 1);i++)
{
- QString wordAfter;
- QString word;
+ TQString wordAfter;
+ TQString word;
for ( int j = i ; j < s->length() - 1; j++ )
{
- QChar ch = s->at( j ).c;
+ TQChar ch = s->at( j ).c;
if ( ch.isSpace() )
break;
word.append( ch );
@@ -1851,14 +1851,14 @@ void KoAutoFormat::doAutoIncludeAbbreviation(KoTextCursor* /*textEditCursor*/, K
{
for ( int j = i+word.length()+1 ; j < s->length() - 1; j++ )
{
- QChar ch = s->at( j ).c;
+ TQChar ch = s->at( j ).c;
if ( ch.isSpace() )
break;
wordAfter.append( ch );
}
- if( word.length()>1 && !wordAfter.isEmpty() && wordAfter.at(0)==wordAfter.at(0).lower())
+ if( word.length()>1 && !wordAfter.isEmpty() && wordAfter.tqat(0)==wordAfter.tqat(0).lower())
{
- if ( m_upperCaseExceptions.findIndex(word )==-1)
+ if ( m_upperCaseExceptions.tqfindIndex(word )==-1)
m_upperCaseExceptions.append( word );
}
}
@@ -1872,13 +1872,13 @@ void KoAutoFormat::doAutoIncludeAbbreviation(KoTextCursor* /*textEditCursor*/, K
}
-KCommand * KoAutoFormat::doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag,int index, const QString & word, KoTextObject *txtObj )
+KCommand * KoAutoFormat::doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag,int index, const TQString & word, KoTextObject *txtObj )
{
bool underline = (word.at(0)=='_' && word.at(word.length()-1)=='_');
bool bold = (word.at(0)=='*' && word.at(word.length()-1)=='*');
if( bold || underline)
{
- QString replacement=word.mid(1,word.length()-2);
+ TQString replacement=word.mid(1,word.length()-2);
int start = index - word.length();
KoTextDocument * textdoc = parag->textDocument();
KMacroCommand *macro=new KMacroCommand(i18n("Autocorrection: Change Format"));
@@ -1923,7 +1923,7 @@ KCommand *KoAutoFormat::doUseBulletStyle(KoTextCursor * /*textEditCursor*/, KoTe
KoTextDocument * textdoc = parag->textDocument();
KoTextCursor cursor( parag->document() );
KoTextString *s = parag->string();
- QChar ch = s->at( 0 ).c;
+ TQChar ch = s->at( 0 ).c;
if( m_useBulletStyle && (ch =='*' || ch == '-' || ch =='+') && (s->at(1).c).isSpace())
{
@@ -1974,7 +1974,7 @@ KCommand *KoAutoFormat::doUseBulletStyle(KoTextCursor * /*textEditCursor*/, KoTe
c.setStyle( KoParagCounter::STYLE_CUSTOMBULLET );
c.setCustomBulletCharacter( m_bulletStyle );
}
- c.setSuffix(QString::null);
+ c.setSuffix(TQString());
cmd=txtObj->setCounterCommand( &cursor, c ,KoTextDocument::HighlightSelection );
if( cmd)
macroCmd->addCommand(cmd);
@@ -2003,18 +2003,18 @@ KCommand *KoAutoFormat::doUseNumberStyle(KoTextCursor * /*textEditCursor*/, KoTe
KoTextDocument * textdoc = parag->textDocument();
KoTextCursor cursor( parag->document() );
KoTextString *s = parag->string();
- QString word;
+ TQString word;
for ( int i = 0 ; i < s->length() - 1; i++ )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch.isSpace() )
break;
word.append( ch );
}
- QChar punct=word[word.length()-1];
+ TQChar punct=word[word.length()-1];
if( punct.isPunct() )
{
- QString number=word.mid(0,word.length()-1);
+ TQString number=word.mid(0,word.length()-1);
bool ok;
uint val=number.toUInt(&ok);
if( ok )
@@ -2043,7 +2043,7 @@ KCommand *KoAutoFormat::doUseNumberStyle(KoTextCursor * /*textEditCursor*/, KoTe
KoParagCounter c;
c.setNumbering( KoParagCounter::NUM_LIST );
c.setStyle( KoParagCounter::STYLE_NUM );
- c.setSuffix(QString( punct ));
+ c.setSuffix(TQString( punct ));
c.setStartNumber( (int)val);
// Look at which number this parag will have without a restart counter flag,
@@ -2083,7 +2083,7 @@ KCommand * KoAutoFormat::doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor
// Cut away spaces at end of paragraph
for ( int i = parag->lastCharPos(); i >= 0; --i )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch != ' ' ) // was: !ch.isSpace(), but this includes tabs, and this option is only about spaces
{
if( i == parag->lastCharPos() )
@@ -2094,7 +2094,7 @@ KCommand * KoAutoFormat::doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor
cursor.setParag( parag );
cursor.setIndex( parag->lastCharPos()+1 );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- KCommand *cmd=txtObj->replaceSelectionCommand( &cursor, "", QString::null, KoTextDocument::HighlightSelection );
+ KCommand *cmd=txtObj->replaceSelectionCommand( &cursor, "", TQString(), KoTextDocument::HighlightSelection );
if(cmd)
{
@@ -2112,7 +2112,7 @@ KCommand * KoAutoFormat::doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor
for ( int i = 0 ; i <= parag->lastCharPos() ; i++ )
{
- QChar ch = s->at( i ).c;
+ TQChar ch = s->at( i ).c;
if ( ch != ' ' ) // was: !ch.isSpace(), but this includes tabs, and this option is only about spaces
{
if( i == 0 )
@@ -2124,7 +2124,7 @@ KCommand * KoAutoFormat::doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor
cursor.setParag( parag );
cursor.setIndex( i );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- KCommand *cmd=txtObj->replaceSelectionCommand( &cursor, "", QString::null, KoTextDocument::HighlightSelection );
+ KCommand *cmd=txtObj->replaceSelectionCommand( &cursor, "", TQString(), KoTextDocument::HighlightSelection );
if(cmd)
{
@@ -2147,27 +2147,27 @@ KCommand * KoAutoFormat::doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor
return macroCmd;
}
-KCommand *KoAutoFormat::doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj )
+KCommand *KoAutoFormat::doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj )
{
//m_cacheNameOfDays
//todo
- int pos = m_cacheNameOfDays.findIndex( word.lower() );
+ int pos = m_cacheNameOfDays.tqfindIndex( word.lower() );
if ( pos == -1 )
return 0L;
KoTextDocument * textdoc = parag->textDocument();
- QString replaceStr= m_cacheNameOfDays[pos];
+ TQString replaceStr= m_cacheNameOfDays[pos];
int start = index - replaceStr.length();
int length = replaceStr.length();
- if( word.at(0).isLetter() && word.at(0)==word.at(0).lower() )
+ if( word.tqat(0).isLetter() && word.tqat(0)==word.tqat(0).lower() )
{
KoTextCursor cursor( parag->document() );
cursor.setParag( parag );
cursor.setIndex( start );
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( start + length );
- QString replacement = replaceStr.at(0).upper() + replaceStr.right( length-1 );
+ TQString replacement = replaceStr.tqat(0).upper() + replaceStr.right( length-1 );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- QString cmdName=i18n("Capitalize Name of Days");
+ TQString cmdName=i18n("Capitalize Name of Days");
KCommand *cmd =txtObj->replaceSelectionCommand( textEditCursor, replacement,
cmdName,
KoTextDocument::HighlightSelection );
@@ -2179,23 +2179,23 @@ KCommand *KoAutoFormat::doCapitalizeNameOfDays( KoTextCursor* textEditCursor, Ko
return 0L;
}
-KCommand *KoAutoFormat::doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj )
+KCommand *KoAutoFormat::doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj )
{
KoAutoFormatEntryMap::Iterator it = m_superScriptEntries.begin();
bool found = false;
- QString replace;
+ TQString tqreplace;
for ( ; it != m_superScriptEntries.end() ; ++it )
{
if( it.key()==word)
{
- replace = it.data().replace();
+ tqreplace = it.data().tqreplace();
found = true;
break;
}
else if ( it.key()=="othernb")
{
- QString tmp = it.data().replace();
- int pos = word.find( tmp );
+ TQString tmp = it.data().tqreplace();
+ int pos = word.tqfind( tmp );
if( pos != -1)
{
if( pos + tmp.length() == word.length())
@@ -2204,7 +2204,7 @@ KCommand *KoAutoFormat::doAutoSuperScript( KoTextCursor* textEditCursor, KoTextP
word.left( pos ).toInt( &ok);
if( ok )
{
- replace = tmp;
+ tqreplace = tmp;
found = true;
break;
}
@@ -2216,7 +2216,7 @@ KCommand *KoAutoFormat::doAutoSuperScript( KoTextCursor* textEditCursor, KoTextP
{
KoTextDocument * textdoc = parag->textDocument();
- int start = index - replace.length();
+ int start = index - tqreplace.length();
KoTextFormat * lastFormat = parag->at( start )->format();
KoTextFormat * newFormat = new KoTextFormat(*lastFormat);
KoTextCursor cursor( parag->document() );
@@ -2235,12 +2235,12 @@ KCommand *KoAutoFormat::doAutoSuperScript( KoTextCursor* textEditCursor, KoTextP
return 0L;
}
-bool KoAutoFormat::doIgnoreDoubleSpace( KoTextParag *parag, int index, QChar ch )
+bool KoAutoFormat::doIgnoreDoubleSpace( KoTextParag *parag, int index, TQChar ch )
{
if( m_ignoreDoubleSpace && ch==' ' && index >= 0 && !parag->hasAnySelection() )
{
KoTextString *s = parag->string();
- QChar ch = s->at( index ).c;
+ TQChar ch = s->at( index ).c;
if ( ch==' ' )
return true;
}
@@ -2292,7 +2292,7 @@ void KoAutoFormat::configUseBulletStyle( bool _ubs)
m_useBulletStyle=_ubs;
}
-void KoAutoFormat::configBulletStyle( QChar b )
+void KoAutoFormat::configBulletStyle( TQChar b )
{
m_bulletStyle = b;
}
@@ -2354,26 +2354,26 @@ void KoAutoFormat::configAddCompletionWord( bool b )
m_addCompletionWord= b;
}
-bool KoAutoFormat::isUpper( const QChar &c )
+bool KoAutoFormat::isUpper( const TQChar &c )
{
return c.lower() != c;
}
-bool KoAutoFormat::isLower( const QChar &c )
+bool KoAutoFormat::isLower( const TQChar &c )
{
// Note that this is not the same as !isUpper !
// For instance '1' is not lower nor upper,
return c.upper() != c;
}
-bool KoAutoFormat::isMark( const QChar &c )
+bool KoAutoFormat::isMark( const TQChar &c )
{
- return ( c == QChar( '.' ) ||
- c == QChar( '?' ) ||
- c == QChar( '!' ) );
+ return ( c == TQChar( '.' ) ||
+ c == TQChar( '?' ) ||
+ c == TQChar( '!' ) );
}
-bool KoAutoFormat::isSeparator( const QChar &c )
+bool KoAutoFormat::isSeparator( const TQChar &c )
{
return ( !c.isLetter() && !c.isNumber() && !c.isDigit() );
}
@@ -2381,19 +2381,19 @@ bool KoAutoFormat::isSeparator( const QChar &c )
void KoAutoFormat::buildMaxLen()
{
m_maxFindLength = 0;
- QDictIterator<KoAutoFormatEntry> it( m_entries );
+ TQDictIterator<KoAutoFormatEntry> it( m_entries );
for( ; it.current(); ++it )
{
- m_maxFindLength = QMAX( m_maxFindLength, it.currentKey().length() );
+ m_maxFindLength = TQMAX( m_maxFindLength, it.currentKey().length() );
}
- QDictIterator<KoAutoFormatEntry> it2( m_allLanguages );
+ TQDictIterator<KoAutoFormatEntry> it2( m_allLanguages );
for( ; it2.current(); ++it2 )
{
- m_maxFindLength = QMAX( m_maxFindLength, it2.currentKey().length() );
+ m_maxFindLength = TQMAX( m_maxFindLength, it2.currentKey().length() );
}
}
-QStringList KoAutoFormat::listCompletion() const
+TQStringList KoAutoFormat::listCompletion() const
{
return m_listCompletion->items();
}
@@ -2424,7 +2424,7 @@ void KoAutoFormat::configCapitalizeNameOfDays( bool b)
m_bCapitalizeNameOfDays = b;
}
-void KoAutoFormat::configAutoFormatLanguage( const QString &_lang)
+void KoAutoFormat::configAutoFormatLanguage( const TQString &_lang)
{
m_autoFormatLanguage=_lang;
}
@@ -2496,9 +2496,9 @@ void KoAutoFormat::changeTextFormat(KoSearchContext *formatOptions, KoTextFormat
if ( formatOptions->m_optionsMask & KoSearchContext::Shadow)
{
if ( formatOptions->m_options & KoSearchContext::Shadow )
- format->setShadow( 1, 1, Qt::gray );
+ format->setShadow( 1, 1, TQt::gray );
else
- format->setShadow( 0, 0, QColor() );
+ format->setShadow( 0, 0, TQColor() );
flags |=KoTextFormat::ShadowText;
}
diff --git a/lib/kotext/KoAutoFormat.h b/lib/kotext/KoAutoFormat.h
index 3e2283dd..4f59fbaa 100644
--- a/lib/kotext/KoAutoFormat.h
+++ b/lib/kotext/KoAutoFormat.h
@@ -21,15 +21,15 @@
#ifndef koautoformat_h
#define koautoformat_h
-#include <qstring.h>
-#include <qmap.h>
-#include <qvaluelist.h>
-#include <qstringlist.h>
-#include <qptrvector.h>
-#include <qdom.h>
-#include <qdict.h>
-#include <qlabel.h>
-#include <qwidget.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
+#include <tqptrvector.h>
+#include <tqdom.h>
+#include <tqdict.h>
+#include <tqlabel.h>
+#include <tqwidget.h>
#include <koffice_export.h>
class KoDocument;
@@ -46,20 +46,21 @@ class KoTextFormat;
-class KoCompletionBox : public QLabel
+class KoCompletionBox : public TQLabel
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCompletionBox( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
+ KoCompletionBox( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
~KoCompletionBox();
- QString& lastWord();
- void setLastWord(QString const &);
+ TQString& lastWord();
+ void setLastWord(TQString const &);
protected:
- void mousePressEvent( QMouseEvent * );
+ void mousePressEvent( TQMouseEvent * );
private:
- QString m_lastWord;
+ TQString m_lastWord;
};
@@ -71,11 +72,11 @@ class KoAutoFormatEntry
{
public:
// The text to find is actually the key in KWAutoFormat's map.
- // What we replace it with is replace().
- KoAutoFormatEntry(const QString& replace = QString::null);
+ // What we replace it with is tqreplace().
+ KoAutoFormatEntry(const TQString& tqreplace = TQString());
~KoAutoFormatEntry();
- QString replace() const { return m_replace; }
- void changeReplace(const QString & rep){ m_replace = rep; }
+ TQString tqreplace() const { return m_tqreplace; }
+ void changeReplace(const TQString & rep){ m_tqreplace = rep; }
KoSearchContext *formatEntryContext()const;
void createNewEntryContext();
@@ -83,12 +84,12 @@ public:
void clearFormatEntryContext( );
protected:
- QString m_replace;
+ TQString m_tqreplace;
// For formatting in the replacement - not implemented yet
KoSearchContext *m_formatOptions;
};
-typedef QMap< QString, KoAutoFormatEntry > KoAutoFormatEntryMap;
+typedef TQMap< TQString, KoAutoFormatEntry > KoAutoFormatEntryMap;
/******************************************************************/
/* Class: KoAutoFormat */
@@ -114,7 +115,7 @@ public:
* Called by edit widget when a character (@p ch) has been inserted
* into @p parag, at the given @p index.
*/
- void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch,KoTextObject *txtObj );
+ void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, TQChar ch,KoTextObject *txtObj );
/**
* Called by edit widget when a call a competion
@@ -122,29 +123,29 @@ public:
bool doCompletion( KoTextCursor* textEditCursor, KoTextParag *parag, int const index,KoTextObject *txtObj );
bool doToolTipCompletion( KoTextCursor* textEditCursor, KoTextParag *parag, int index,KoTextObject *txtObj,int keyPress );
- void showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos);
+ void showToolTipBox(KoTextParag *parag, int index, TQWidget *widget, const TQPoint &pos);
void removeToolTipCompletion();
- bool doIgnoreDoubleSpace( KoTextParag *parag, int index,QChar ch );
+ bool doIgnoreDoubleSpace( KoTextParag *parag, int index,TQChar ch );
/**
* Helper method, returns the last word before parag,index
*/
- static QString getLastWord( KoTextParag *parag, int const index );
- QString getLastWord( const int max_words, KoTextParag *parag, int const index );
+ static TQString getLastWord( KoTextParag *parag, int const index );
+ TQString getLastWord( const int max_words, KoTextParag *parag, int const index );
/**
* Helper method, returns the last word before parag,index
* different from getLastWord, because we test just space character
* and not punctualtion character
*/
- static QString getWordAfterSpace( KoTextParag * parag, int const index);
+ static TQString getWordAfterSpace( KoTextParag * parag, int const index);
// Config for the typographic quotes. Used by the dialog.
struct TypographicQuotes
{
- QChar begin, end;
- bool replace; // aka enabled
+ TQChar begin, end;
+ bool tqreplace; // aka enabled
};
// Configuration (on/off/settings). Called by the dialog.
@@ -159,7 +160,7 @@ public:
void configRemoveSpaceBeginEndLine( bool _space);
void configUseBulletStyle( bool _ubs);
- void configBulletStyle( QChar b );
+ void configBulletStyle( TQChar b );
void configAutoChangeFormat( bool b);
@@ -189,7 +190,7 @@ public:
void configCapitalizeNameOfDays( bool b);
- void configAutoFormatLanguage( const QString &_lang);
+ void configAutoFormatLanguage( const TQString &_lang);
void configKeyCompletionAction( KeyCompletionAction action );
@@ -223,7 +224,7 @@ public:
bool getConfigUseBulletSyle() const
{ return m_useBulletStyle;}
- QChar getConfigBulletStyle() const
+ TQChar getConfigBulletStyle() const
{ return m_bulletStyle; }
bool getConfigAutoChangeFormat() const
@@ -268,30 +269,30 @@ public:
bool getConfigCapitalizeNameOfDays() const
{ return m_bCapitalizeNameOfDays; }
- QString getConfigAutoFormatLanguage( )const
+ TQString getConfigAutoFormatLanguage( )const
{ return m_autoFormatLanguage;}
KeyCompletionAction getConfigKeyAction() const
{ return m_keyCompletionAction;}
- const QDict<KoAutoFormatEntry> & getAutoFormatEntries() const{
+ const TQDict<KoAutoFormatEntry> & getAutoFormatEntries() const{
return m_entries;
}
- KoAutoFormatEntry * findFormatEntry(const QString & text) {
+ KoAutoFormatEntry * findFormatEntry(const TQString & text) {
return m_entries[text];
}
// Add/remove entries, called by the dialog
- void addAutoFormatEntry( const QString &key, KoAutoFormatEntry *entry ) {
+ void addAutoFormatEntry( const TQString &key, KoAutoFormatEntry *entry ) {
m_entries.insert( key, entry );
buildMaxLen();
}
- void addAutoFormatEntry( const QString &key, const QString &replace );
+ void addAutoFormatEntry( const TQString &key, const TQString &tqreplace );
- void removeAutoFormatEntry( const QString &key ) {
+ void removeAutoFormatEntry( const TQString &key ) {
m_entries.setAutoDelete(true);
m_entries.remove( key );
m_entries.setAutoDelete(false);
@@ -302,17 +303,17 @@ public:
void copyAutoFormatEntries( const KoAutoFormat & other )
{ m_entries = other.m_entries; }
- void copyListException( const QStringList & _list)
+ void copyListException( const TQStringList & _list)
{ m_upperCaseExceptions=_list;}
- void copyListTwoUpperCaseException( const QStringList &_list)
+ void copyListTwoUpperCaseException( const TQStringList &_list)
{ m_twoUpperLetterException=_list; }
- QStringList listException() const {return m_upperCaseExceptions;}
+ TQStringList listException() const {return m_upperCaseExceptions;}
- QStringList listTwoUpperLetterException() const {return m_twoUpperLetterException;}
+ TQStringList listTwoUpperLetterException() const {return m_twoUpperLetterException;}
- QStringList listCompletion() const;
+ TQStringList listCompletion() const;
KCompletion *getCompletion() const { return m_listCompletion; }
@@ -323,52 +324,52 @@ public:
void readConfig(bool force = false);
void saveConfig();
- static bool isUpper( const QChar &c );
- static bool isLower( const QChar &c );
- static bool isMark( const QChar &c ); // End of sentence
- static bool isSeparator( const QChar &c );
+ static bool isUpper( const TQChar &c );
+ static bool isLower( const TQChar &c );
+ static bool isMark( const TQChar &c ); // End of sentence
+ static bool isSeparator( const TQChar &c );
void updateMaxWords();
protected:
//return a ref to index otherwise when we uperCase, index is bad !
KCommand *doAutoCorrect( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, KoTextObject *txtObj );
- KCommand *doUpperCase( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj );
+ KCommand *doUpperCase( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj );
KCommand * doTypographicQuotes( KoTextCursor* textEditCursor, KoTextParag *parag, int index, KoTextObject *txtObj, bool doubleQuotes );
void buildMaxLen();
- void doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int & index, QString & word, KoTextObject *txtObj );
+ void doAutoDetectUrl( KoTextCursor *textEditCursor, KoTextParag *parag, int & index, TQString & word, KoTextObject *txtObj );
KCommand *doRemoveSpaceBeginEndLine( KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int& index );
- KCommand *doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString & word, KoTextObject *txtObj );
+ KCommand *doAutoChangeFormat( KoTextCursor *textEditCursor, KoTextParag *parag, int index, const TQString & word, KoTextObject *txtObj );
KCommand *doUseBulletStyle(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int& index );
- KCommand *doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, const QString & word , KoTextObject *txtObj );
+ KCommand *doAutoReplaceNumber( KoTextCursor* textEditCursor, KoTextParag *parag, int & index, const TQString & word , KoTextObject *txtObj );
KCommand *doUseNumberStyle(KoTextCursor * /*textEditCursor*/, KoTextParag *parag, KoTextObject *txtObj, int& index );
void doAutoIncludeUpperUpper(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj );
void doAutoIncludeAbbreviation(KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj );
- KCommand *doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj );
+ KCommand *doAutoSuperScript( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj );
- KCommand *doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const QString & word , KoTextObject *txtObj );
+ KCommand *doCapitalizeNameOfDays( KoTextCursor* textEditCursor, KoTextParag *parag, int index, const TQString & word , KoTextObject *txtObj );
static void changeTextFormat(KoSearchContext *formatOptions, KoTextFormat * format, int & flags );
- void loadEntry( const QDomElement &nl, bool _allLanguages = false);
- QDomElement saveEntry( QDictIterator<KoAutoFormatEntry> _entry, QDomDocument doc);
+ void loadEntry( const TQDomElement &nl, bool _allLanguages = false);
+ TQDomElement saveEntry( TQDictIterator<KoAutoFormatEntry> _entry, TQDomDocument doc);
private:
void detectStartOfLink(KoTextParag * parag, int const index, bool const insertedDot);
void autoFormatIsActive();
void loadListOfWordCompletion();
- void loadAutoCorrection( const QDomElement & _de, bool _allLanguages = false );
+ void loadAutoCorrection( const TQDomElement & _de, bool _allLanguages = false );
void loadAllLanguagesAutoCorrection();
- KCommand *autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, QString * _wordArray, bool _allLanguages );
+ KCommand *autoFormatWord( KoTextCursor* textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj, TQString * _wordArray, bool _allLanguages );
void readAutoCorrectConfig();
KoDocument *m_doc;
KoVariableCollection *m_varCollection;
KoVariableFormatCollection *m_varFormatCollection;
- QString m_autoFormatLanguage;
+ TQString m_autoFormatLanguage;
bool m_configRead;
bool m_convertUpperCase, m_convertUpperUpper,m_advancedAutoCorrect;
bool m_autoDetectUrl, m_ignoreDoubleSpace, m_removeSpaceBeginEndLine;
@@ -388,7 +389,7 @@ private:
bool m_bCapitalizeNameOfDays;
/// Indicates if doAutoFormat has called itself
bool m_wordInserted;
- QChar m_bulletStyle;
+ TQChar m_bulletStyle;
TypographicQuotes m_typographicSimpleQuotes;
@@ -400,19 +401,19 @@ private:
KCompletion *m_listCompletion;
- QDict<KoAutoFormatEntry> m_entries;
- QDict<KoAutoFormatEntry> m_allLanguages;
+ TQDict<KoAutoFormatEntry> m_entries;
+ TQDict<KoAutoFormatEntry> m_allLanguages;
KoAutoFormatEntryMap m_superScriptEntries;
- QStringList m_upperCaseExceptions;
- QStringList m_twoUpperLetterException;
+ TQStringList m_upperCaseExceptions;
+ TQStringList m_twoUpperLetterException;
uint m_maxFindLength;
uint m_minCompletionWordLength;
uint m_nbMaxCompletionWord;
uint m_countMaxWords;
- QStringList m_cacheNameOfDays;
+ TQStringList m_cacheNameOfDays;
KoCompletionBox *m_completionBox;
KeyCompletionAction m_keyCompletionAction;
};
diff --git a/lib/kotext/KoAutoFormatDia.cpp b/lib/kotext/KoAutoFormatDia.cpp
index 20502404..6a602c92 100644
--- a/lib/kotext/KoAutoFormatDia.cpp
+++ b/lib/kotext/KoAutoFormatDia.cpp
@@ -28,29 +28,29 @@
#include <klistview.h>
#include <kstandarddirs.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qcombobox.h>
-#include <qdir.h>
-#include <qapplication.h>
-
-KoAutoFormatLineEdit::KoAutoFormatLineEdit ( QWidget * parent, const char * name )
- : QLineEdit(parent,name)
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqcombobox.h>
+#include <tqdir.h>
+#include <tqapplication.h>
+
+KoAutoFormatLineEdit::KoAutoFormatLineEdit ( TQWidget * tqparent, const char * name )
+ : TQLineEdit(tqparent,name)
{
}
-void KoAutoFormatLineEdit::keyPressEvent ( QKeyEvent *ke )
+void KoAutoFormatLineEdit::keyPressEvent ( TQKeyEvent *ke )
{
- if( ke->key() == QKeyEvent::Key_Return ||
- ke->key() == QKeyEvent::Key_Enter )
+ if( ke->key() == Qt::Key_Return ||
+ ke->key() == Qt::Key_Enter )
{
emit keyReturnPressed();
return;
}
- QLineEdit::keyPressEvent (ke);
+ TQLineEdit::keyPressEvent (ke);
}
@@ -58,63 +58,63 @@ void KoAutoFormatLineEdit::keyPressEvent ( QKeyEvent *ke )
/* Class: KoAutoFormatExceptionWidget */
/******************************************************************/
-KoAutoFormatExceptionWidget::KoAutoFormatExceptionWidget(QWidget *parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abreviation)
- :QWidget( parent )
+KoAutoFormatExceptionWidget::KoAutoFormatExceptionWidget(TQWidget *tqparent, const TQString &name,const TQStringList &_list, bool _autoInclude, bool _abreviation)
+ :TQWidget( tqparent )
{
m_bAbbreviation=_abreviation;
m_listException=_list;
- QGridLayout *grid = new QGridLayout(this, 4, 2, 0, KDialog::spacingHint());
+ TQGridLayout *grid = new TQGridLayout(this, 4, 2, 0, KDialog::spacingHint());
- QLabel *lab=new QLabel(name,this);
+ TQLabel *lab=new TQLabel(name,this);
grid->addMultiCellWidget(lab,0,0,0,1);
exceptionLine = new KoAutoFormatLineEdit( this );
grid->addWidget(exceptionLine,1,0);
- connect(exceptionLine,SIGNAL(keyReturnPressed()),SLOT(slotAddException()));
- connect(exceptionLine ,SIGNAL(textChanged ( const QString & )),
- SLOT(textChanged ( const QString & )));
+ connect(exceptionLine,TQT_SIGNAL(keyReturnPressed()),TQT_SLOT(slotAddException()));
+ connect(exceptionLine ,TQT_SIGNAL(textChanged ( const TQString & )),
+ TQT_SLOT(textChanged ( const TQString & )));
- pbAddException=new QPushButton(i18n("Add"),this);
- connect(pbAddException, SIGNAL(clicked()),SLOT(slotAddException()));
+ pbAddException=new TQPushButton(i18n("Add"),this);
+ connect(pbAddException, TQT_SIGNAL(clicked()),TQT_SLOT(slotAddException()));
grid->addWidget(pbAddException,1,1);
pbAddException->setEnabled(false);
- pbRemoveException=new QPushButton(i18n("Remove"),this);
- connect(pbRemoveException, SIGNAL(clicked()),SLOT(slotRemoveException()));
- grid->addWidget(pbRemoveException,2,1,Qt::AlignTop);
+ pbRemoveException=new TQPushButton(i18n("Remove"),this);
+ connect(pbRemoveException, TQT_SIGNAL(clicked()),TQT_SLOT(slotRemoveException()));
+ grid->addWidget(pbRemoveException,2,1,TQt::AlignTop);
- exceptionList=new QListBox(this);
+ exceptionList=new TQListBox(this);
exceptionList->insertStringList(m_listException);
exceptionList->sort();
grid->addWidget(exceptionList,2,0);
grid->setRowStretch( 2, 1 );
- connect( exceptionList , SIGNAL(selectionChanged () ),
- this,SLOT(slotExceptionListSelected()) );
+ connect( exceptionList , TQT_SIGNAL(selectionChanged () ),
+ this,TQT_SLOT(slotExceptionListSelected()) );
pbRemoveException->setEnabled( exceptionList->currentItem()!=-1);
- cbAutoInclude = new QCheckBox( i18n("Autoinclude"), this );
+ cbAutoInclude = new TQCheckBox( i18n("Autoinclude"), this );
grid->addWidget(cbAutoInclude,3,0);
cbAutoInclude->setChecked( _autoInclude );
}
-void KoAutoFormatExceptionWidget::textChanged ( const QString &_text )
+void KoAutoFormatExceptionWidget::textChanged ( const TQString &_text )
{
pbAddException->setEnabled(!_text.isEmpty());
}
void KoAutoFormatExceptionWidget::slotAddException()
{
- QString text=exceptionLine->text().stripWhiteSpace();
+ TQString text=exceptionLine->text().stripWhiteSpace();
if(!text.isEmpty())
{
if(text.at(text.length()-1)!='.' && m_bAbbreviation)
text=text+".";
- if( m_listException.findIndex( text )==-1)
+ if( m_listException.tqfindIndex( text )==-1)
{
m_listException<<text;
@@ -146,7 +146,7 @@ bool KoAutoFormatExceptionWidget::autoInclude()
return cbAutoInclude->isChecked();
}
-void KoAutoFormatExceptionWidget::setListException( const QStringList &list)
+void KoAutoFormatExceptionWidget::setListException( const TQStringList &list)
{
exceptionList->clear();
exceptionList->insertStringList(list);
@@ -166,10 +166,10 @@ void KoAutoFormatExceptionWidget::slotExceptionListSelected()
/* Class: KoAutoFormatDia */
/******************************************************************/
-KoAutoFormatDia::KoAutoFormatDia( QWidget *parent, const char *name,
+KoAutoFormatDia::KoAutoFormatDia( TQWidget *tqparent, const char *name,
KoAutoFormat * autoFormat )
: KDialogBase( Tabbed, i18n("Autocorrection"), Ok | Cancel | User1, Ok,
- parent, name, true, true, KGuiItem( i18n( "&Reset" ), "undo" )),
+ tqparent, name, true, true, KGuiItem( i18n( "&Reset" ), "undo" )),
oSimpleBegin( autoFormat->getConfigTypographicSimpleQuotes().begin ),
oSimpleEnd( autoFormat->getConfigTypographicSimpleQuotes().end ),
oDoubleBegin( autoFormat->getConfigTypographicDoubleQuotes().begin ),
@@ -187,8 +187,8 @@ KoAutoFormatDia::KoAutoFormatDia( QWidget *parent, const char *name,
setupTab2();
setupTab3();
setupTab4();
- setInitialSize( QSize(500, 300) );
- connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotResetConf()));
+ setInitialSize( TQSize(500, 300) );
+ connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotResetConf()));
noSignal=false;
}
@@ -220,25 +220,25 @@ void KoAutoFormatDia::slotResetConf()
void KoAutoFormatDia::setupTab1()
{
tab1 = addPage( i18n( "Simple Autocorrection" ) );
- QVBoxLayout *vbox = new QVBoxLayout(tab1, 0, KDialog::spacingHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(tab1, 0, KDialog::spacingHint());
- cbUpperCase = new QCheckBox( tab1 );
+ cbUpperCase = new TQCheckBox( tab1 );
cbUpperCase->setText( i18n(
"Convert &first letter of a sentence automatically to uppercase\n"
"(e.g. \"my house. in this town\" to \"my house. In this town\")"
) );
- QWhatsThis::add( cbUpperCase, i18n(
+ TQWhatsThis::add( cbUpperCase, i18n(
"Detect when a new sentence is started and always ensure that"
" the first character is an uppercase character."));
vbox->addWidget(cbUpperCase);
- cbUpperUpper = new QCheckBox( tab1 );
+ cbUpperUpper = new TQCheckBox( tab1 );
cbUpperUpper->setText( i18n(
"Convert &two uppercase characters to one uppercase and one"
" lowercase character\n (e.g. PErfect to Perfect)" ) );
- QWhatsThis::add( cbUpperUpper, i18n(
+ TQWhatsThis::add( cbUpperUpper, i18n(
"All words are checked for the common mistake of holding the "
"shift key down a bit too long. If some words must have two "
"uppercase characters, then those exceptions should be added in "
@@ -246,57 +246,57 @@ void KoAutoFormatDia::setupTab1()
vbox->addWidget(cbUpperUpper);
- cbDetectUrl=new QCheckBox( tab1 );
+ cbDetectUrl=new TQCheckBox( tab1 );
cbDetectUrl->setText( i18n( "Autoformat &URLs" ) );
- QWhatsThis::add( cbDetectUrl, i18n(
+ TQWhatsThis::add( cbDetectUrl, i18n(
"Detect when a URL (Uniform Resource Locator) is typed and "
"provide formatting that matches the way an Internet browser "
"would show a URL."));
vbox->addWidget(cbDetectUrl);
- cbIgnoreDoubleSpace=new QCheckBox( tab1 );
+ cbIgnoreDoubleSpace=new TQCheckBox( tab1 );
cbIgnoreDoubleSpace->setText( i18n( "&Suppress double spaces" ) );
- QWhatsThis::add( cbIgnoreDoubleSpace, i18n(
+ TQWhatsThis::add( cbIgnoreDoubleSpace, i18n(
"Make sure that more than one space cannot be typed, as this is a "
"common mistake which is quite hard to find in formatted text."));
vbox->addWidget(cbIgnoreDoubleSpace);
- cbRemoveSpaceBeginEndLine=new QCheckBox( tab1 );
+ cbRemoveSpaceBeginEndLine=new TQCheckBox( tab1 );
cbRemoveSpaceBeginEndLine->setText( i18n(
"R&emove spaces at the beginning and end of paragraphs" ) );
- QWhatsThis::add( cbRemoveSpaceBeginEndLine, i18n(
+ TQWhatsThis::add( cbRemoveSpaceBeginEndLine, i18n(
"Keep correct formatting and indenting of sentences by "
"automatically removing spaces typed at the beginning and end of "
"a paragraph."));
vbox->addWidget(cbRemoveSpaceBeginEndLine);
- cbAutoChangeFormat=new QCheckBox( tab1 );
+ cbAutoChangeFormat=new TQCheckBox( tab1 );
cbAutoChangeFormat->setText( i18n(
"Automatically do &bold and underline formatting") );
- QWhatsThis::add( cbAutoChangeFormat, i18n(
+ TQWhatsThis::add( cbAutoChangeFormat, i18n(
"When you use _underline_ or *bold*, the text between the "
"underscores or asterisks will be converted to underlined or "
"bold text.") );
vbox->addWidget(cbAutoChangeFormat);
- cbAutoReplaceNumber=new QCheckBox( tab1 );
+ cbAutoReplaceNumber=new TQCheckBox( tab1 );
cbAutoReplaceNumber->setText( i18n(
"We add the 1/2 char at the %1", "Re&place 1/2... with %1..." )
- .arg( QString( "" ) ) );
- QWhatsThis::add( cbAutoReplaceNumber, i18n(
+ .tqarg( TQString( "�" ) ) );
+ TQWhatsThis::add( cbAutoReplaceNumber, i18n(
"Most standard fraction notations will be converted when available"
) );
vbox->addWidget(cbAutoReplaceNumber);
- cbUseNumberStyle=new QCheckBox( tab1 );
+ cbUseNumberStyle=new TQCheckBox( tab1 );
cbUseNumberStyle->setText( i18n(
"Use &autonumbering for numbered paragraphs" ) );
- QWhatsThis::add( cbUseNumberStyle, i18n(
+ TQWhatsThis::add( cbUseNumberStyle, i18n(
"When typing '1)' or similar in front of a paragraph, "
"automatically convert the paragraph to use that numbering style. "
"This has the advantage that further paragraphs will also be "
@@ -304,38 +304,38 @@ void KoAutoFormatDia::setupTab1()
vbox->addWidget(cbUseNumberStyle);
- cbAutoSuperScript = new QCheckBox( tab1 );
+ cbAutoSuperScript = new TQCheckBox( tab1 );
cbAutoSuperScript->setText( i18n("Rep&lace 1st... with 1^st..."));
cbAutoSuperScript->setEnabled( m_docAutoFormat->nbSuperScriptEntry()>0 );
vbox->addWidget(cbAutoSuperScript);
- cbCapitalizeDaysName = new QCheckBox( tab1 );
+ cbCapitalizeDaysName = new TQCheckBox( tab1 );
cbCapitalizeDaysName->setText( i18n("Capitalize name of days"));
vbox->addWidget(cbCapitalizeDaysName);
- cbUseBulletStyle=new QCheckBox( tab1 );
+ cbUseBulletStyle=new TQCheckBox( tab1 );
cbUseBulletStyle->setText( i18n(
"Use l&ist-formatting for bulleted paragraphs" ) );
- QWhatsThis::add( cbUseBulletStyle, i18n(
+ TQWhatsThis::add( cbUseBulletStyle, i18n(
"When typing '*' or '-' in front of a paragraph, automatically "
"convert the paragraph to use that list-style. Using a list-style "
"formatting means that a correct bullet is used to draw the list."
) );
- connect( cbUseBulletStyle, SIGNAL( toggled( bool ) ),
- SLOT( slotBulletStyleToggled( bool ) ) );
+ connect( cbUseBulletStyle, TQT_SIGNAL( toggled( bool ) ),
+ TQT_SLOT( slotBulletStyleToggled( bool ) ) );
vbox->addWidget(cbUseBulletStyle);
- QHBoxLayout *hbox = new QHBoxLayout();
+ TQHBoxLayout *hbox = new TQHBoxLayout();
hbox->addSpacing( 20 );
hbox->setSpacing(KDialog::spacingHint());
- pbBulletStyle = new QPushButton( tab1 );
- pbBulletStyle->setFixedSize( pbBulletStyle->sizeHint() );
+ pbBulletStyle = new TQPushButton( tab1 );
+ pbBulletStyle->setFixedSize( pbBulletStyle->tqsizeHint() );
hbox->addWidget( pbBulletStyle );
- pbDefaultBulletStyle = new QPushButton( tab1 );
+ pbDefaultBulletStyle = new TQPushButton( tab1 );
pbDefaultBulletStyle->setText(i18n("Default"));
- pbDefaultBulletStyle->setFixedSize( pbDefaultBulletStyle->sizeHint() );
+ pbDefaultBulletStyle->setFixedSize( pbDefaultBulletStyle->tqsizeHint() );
hbox->addWidget( pbDefaultBulletStyle );
hbox->addStretch( 1 );
@@ -345,9 +345,9 @@ void KoAutoFormatDia::setupTab1()
initTab1();
- connect( pbBulletStyle, SIGNAL( clicked() ), SLOT( chooseBulletStyle() ) );
- connect( pbDefaultBulletStyle, SIGNAL( clicked()),
- SLOT( defaultBulletStyle() ) );
+ connect( pbBulletStyle, TQT_SIGNAL( clicked() ), TQT_SLOT( chooseBulletStyle() ) );
+ connect( pbDefaultBulletStyle, TQT_SIGNAL( clicked()),
+ TQT_SLOT( defaultBulletStyle() ) );
}
void KoAutoFormatDia::initTab1()
@@ -378,27 +378,27 @@ void KoAutoFormatDia::setupTab2()
{
tab2 = addPage( i18n( "Custom Quotes" ) );
- QVBoxLayout *vbox = new QVBoxLayout(tab2, 0, KDialog::spacingHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(tab2, 0, KDialog::spacingHint());
- cbTypographicDoubleQuotes = new QCheckBox( tab2 );
+ cbTypographicDoubleQuotes = new TQCheckBox( tab2 );
cbTypographicDoubleQuotes->setText( i18n(
"Replace &double quotes with typographical quotes" ) );
- connect( cbTypographicDoubleQuotes,SIGNAL(toggled ( bool)),
- SLOT(slotChangeStateDouble(bool)));
+ connect( cbTypographicDoubleQuotes,TQT_SIGNAL(toggled ( bool)),
+ TQT_SLOT(slotChangeStateDouble(bool)));
vbox->addWidget( cbTypographicDoubleQuotes );
- QHBoxLayout *hbox = new QHBoxLayout( );
+ TQHBoxLayout *hbox = new TQHBoxLayout( );
hbox->addSpacing( 20 );
- pbDoubleQuote1 = new QPushButton( tab2 );
- pbDoubleQuote1->setFixedSize( pbDoubleQuote1->sizeHint() );
+ pbDoubleQuote1 = new TQPushButton( tab2 );
+ pbDoubleQuote1->setFixedSize( pbDoubleQuote1->tqsizeHint() );
- pbDoubleQuote2 = new QPushButton( tab2 );
- pbDoubleQuote2->setFixedSize( pbDoubleQuote2->sizeHint() );
+ pbDoubleQuote2 = new TQPushButton( tab2 );
+ pbDoubleQuote2->setFixedSize( pbDoubleQuote2->tqsizeHint() );
- if (QApplication::reverseLayout()) {
+ if (TQApplication::reverseLayout()) {
hbox->addWidget( pbDoubleQuote2 );
hbox->addWidget( pbDoubleQuote1 );
} else {
@@ -408,38 +408,38 @@ void KoAutoFormatDia::setupTab2()
hbox->addSpacing( KDialog::spacingHint() );
- pbDoubleDefault = new QPushButton( tab2 );
+ pbDoubleDefault = new TQPushButton( tab2 );
pbDoubleDefault->setText(i18n("Default"));
- pbDoubleDefault->setFixedSize( pbDoubleDefault->sizeHint() );
+ pbDoubleDefault->setFixedSize( pbDoubleDefault->tqsizeHint() );
hbox->addWidget( pbDoubleDefault );
hbox->addStretch( 1 );
- connect(pbDoubleQuote1, SIGNAL( clicked() ), SLOT( chooseDoubleQuote1() ));
- connect(pbDoubleQuote2, SIGNAL( clicked() ), SLOT( chooseDoubleQuote2() ));
- connect(pbDoubleDefault, SIGNAL( clicked()), SLOT( defaultDoubleQuote() ));
+ connect(pbDoubleQuote1, TQT_SIGNAL( clicked() ), TQT_SLOT( chooseDoubleQuote1() ));
+ connect(pbDoubleQuote2, TQT_SIGNAL( clicked() ), TQT_SLOT( chooseDoubleQuote2() ));
+ connect(pbDoubleDefault, TQT_SIGNAL( clicked()), TQT_SLOT( defaultDoubleQuote() ));
vbox->addItem( hbox );
- cbTypographicSimpleQuotes = new QCheckBox( tab2 );
+ cbTypographicSimpleQuotes = new TQCheckBox( tab2 );
cbTypographicSimpleQuotes->setText( i18n(
"Replace &single quotes with typographical quotes" ) );
- connect( cbTypographicSimpleQuotes,SIGNAL(toggled ( bool)),
- SLOT(slotChangeStateSimple(bool)));
+ connect( cbTypographicSimpleQuotes,TQT_SIGNAL(toggled ( bool)),
+ TQT_SLOT(slotChangeStateSimple(bool)));
vbox->addWidget( cbTypographicSimpleQuotes );
- hbox = new QHBoxLayout( );
+ hbox = new TQHBoxLayout( );
hbox->addSpacing( 20 );
- pbSimpleQuote1 = new QPushButton( tab2 );
- pbSimpleQuote1->setFixedSize( pbSimpleQuote1->sizeHint() );
+ pbSimpleQuote1 = new TQPushButton( tab2 );
+ pbSimpleQuote1->setFixedSize( pbSimpleQuote1->tqsizeHint() );
- pbSimpleQuote2 = new QPushButton( tab2 );
- pbSimpleQuote2->setFixedSize( pbSimpleQuote2->sizeHint() );
+ pbSimpleQuote2 = new TQPushButton( tab2 );
+ pbSimpleQuote2->setFixedSize( pbSimpleQuote2->tqsizeHint() );
- if (QApplication::reverseLayout()) {
+ if (TQApplication::reverseLayout()) {
hbox->addWidget( pbSimpleQuote2 );
hbox->addWidget( pbSimpleQuote1 );
} else {
@@ -449,16 +449,16 @@ void KoAutoFormatDia::setupTab2()
hbox->addSpacing( KDialog::spacingHint() );
- pbSimpleDefault = new QPushButton( tab2 );
+ pbSimpleDefault = new TQPushButton( tab2 );
pbSimpleDefault->setText(i18n("Default"));
- pbSimpleDefault->setFixedSize( pbSimpleDefault->sizeHint() );
+ pbSimpleDefault->setFixedSize( pbSimpleDefault->tqsizeHint() );
hbox->addWidget( pbSimpleDefault );
hbox->addStretch( 1 );
- connect(pbSimpleQuote1, SIGNAL( clicked() ), SLOT( chooseSimpleQuote1() ));
- connect(pbSimpleQuote2, SIGNAL( clicked() ), SLOT( chooseSimpleQuote2() ));
- connect(pbSimpleDefault, SIGNAL( clicked()), SLOT( defaultSimpleQuote() ));
+ connect(pbSimpleQuote1, TQT_SIGNAL( clicked() ), TQT_SLOT( chooseSimpleQuote1() ));
+ connect(pbSimpleQuote2, TQT_SIGNAL( clicked() ), TQT_SLOT( chooseSimpleQuote2() ));
+ connect(pbSimpleDefault, TQT_SIGNAL( clicked()), TQT_SLOT( defaultSimpleQuote() ));
vbox->addItem( hbox );
vbox->addStretch( 1 );
@@ -468,13 +468,13 @@ void KoAutoFormatDia::setupTab2()
void KoAutoFormatDia::initTab2()
{
- bool state=m_autoFormat.getConfigTypographicDoubleQuotes().replace;
+ bool state=m_autoFormat.getConfigTypographicDoubleQuotes().tqreplace;
cbTypographicDoubleQuotes->setChecked( state );
pbDoubleQuote1->setText( oDoubleBegin );
pbDoubleQuote2->setText(oDoubleEnd );
slotChangeStateDouble(state);
- state=m_autoFormat.getConfigTypographicSimpleQuotes().replace;
+ state=m_autoFormat.getConfigTypographicSimpleQuotes().tqreplace;
cbTypographicSimpleQuotes->setChecked( state );
pbSimpleQuote1->setText( oSimpleBegin );
pbSimpleQuote2->setText(oSimpleEnd );
@@ -486,34 +486,34 @@ void KoAutoFormatDia::setupTab3()
{
tab3 = addPage( i18n( "Advanced Autocorrection" ) );
- QLabel *lblFind, *lblReplace;
+ TQLabel *lblFind, *lblReplace;
- QGridLayout *grid = new QGridLayout( tab3, 11, 7, 0, KDialog::spacingHint() );
+ TQGridLayout *grid = new TQGridLayout( tab3, 11, 7, 0, KDialog::spacingHint() );
- autoFormatLanguage = new QComboBox(tab3);
+ autoFormatLanguage = new TQComboBox(tab3);
- QStringList lst;
+ TQStringList lst;
lst<<i18n("Default");
lst<<i18n("All Languages");
exceptionLanguageName.insert( i18n("Default"), "");
exceptionLanguageName.insert( i18n("All Languages"), "all_languages");
KStandardDirs *standard = new KStandardDirs();
- QStringList tmp = standard->findDirs("data", "koffice/autocorrect/");
- QString path = *(tmp.end());
- for ( QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
+ TQStringList tmp = standard->findDirs("data", "koffice/autocorrect/");
+ TQString path = *(tmp.end());
+ for ( TQStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
{
path =*it;
}
delete standard;
- QDir dir( path);
- tmp =dir.entryList (QDir::Files);
- for ( QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
+ TQDir dir( path);
+ tmp =dir.entryList (TQDir::Files);
+ for ( TQStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
{
- if ( !(*it).contains("autocorrect"))
+ if ( !(*it).tqcontains("autocorrect"))
{
- QString readableName = KGlobal::locale()->twoAlphaToCountryName((*it).left((*it).length()-4));
- QString tmp;
+ TQString readableName = KGlobal::locale()->twoAlphaToCountryName((*it).left((*it).length()-4));
+ TQString tmp;
if ( readableName.isEmpty() )
tmp =(*it).left((*it).length()-4);
else
@@ -524,65 +524,65 @@ void KoAutoFormatDia::setupTab3()
}
autoFormatLanguage->insertStringList(lst);
- connect(autoFormatLanguage->listBox(), SIGNAL(selected ( const QString & )), this, SLOT(changeAutoformatLanguage(const QString & )));
+ connect(autoFormatLanguage->listBox(), TQT_SIGNAL(selected ( const TQString & )), this, TQT_SLOT(changeAutoformatLanguage(const TQString & )));
grid->addMultiCellWidget( autoFormatLanguage, 0, 0, 4, 6 );
- QLabel *lblAutoFormatLanguage = new QLabel( i18n("Replacements and exceptions for language:"), tab3);
+ TQLabel *lblAutoFormatLanguage = new TQLabel( i18n("Replacements and exceptions for language:"), tab3);
grid->addMultiCellWidget( lblAutoFormatLanguage, 0, 0, 0, 3 );
- cbAdvancedAutoCorrection = new QCheckBox( tab3 );
+ cbAdvancedAutoCorrection = new TQCheckBox( tab3 );
cbAdvancedAutoCorrection->setText( i18n("Enable word replacement") );
- connect( cbAdvancedAutoCorrection, SIGNAL(clicked ()), this, SLOT( slotChangeAdvancedAutoCorrection()));
+ connect( cbAdvancedAutoCorrection, TQT_SIGNAL(clicked ()), this, TQT_SLOT( slotChangeAdvancedAutoCorrection()));
grid->addMultiCellWidget( cbAdvancedAutoCorrection, 1, 1, 0, 6 );
- cbAutoCorrectionWithFormat = new QCheckBox( tab3 );
+ cbAutoCorrectionWithFormat = new TQCheckBox( tab3 );
cbAutoCorrectionWithFormat->setText( i18n("Replace text with format") );
grid->addMultiCellWidget( cbAutoCorrectionWithFormat, 2, 2, 0, 6 );
- lblFind = new QLabel( i18n( "&Find:" ), tab3 );
+ lblFind = new TQLabel( i18n( "&Find:" ), tab3 );
grid->addWidget( lblFind, 3, 0 );
- m_find = new KoAutoFormatLineEdit( tab3 );
- grid->addWidget( m_find, 3, 1 );
+ m_tqfind = new KoAutoFormatLineEdit( tab3 );
+ grid->addWidget( m_tqfind, 3, 1 );
- lblFind->setBuddy( m_find );
+ lblFind->setBuddy( m_tqfind );
- connect( m_find, SIGNAL( textChanged( const QString & ) ),
- SLOT( slotfind( const QString & ) ) );
- connect( m_find, SIGNAL( keyReturnPressed() ),
- SLOT( slotAddEntry()));
+ connect( m_tqfind, TQT_SIGNAL( textChanged( const TQString & ) ),
+ TQT_SLOT( slottqfind( const TQString & ) ) );
+ connect( m_tqfind, TQT_SIGNAL( keyReturnPressed() ),
+ TQT_SLOT( slotAddEntry()));
- pbSpecialChar1 = new QPushButton( "...", tab3 );
- QToolTip::add( pbSpecialChar1, i18n( "Insert a special character..." ) );
+ pbSpecialChar1 = new TQPushButton( "...", tab3 );
+ TQToolTip::add( pbSpecialChar1, i18n( "Insert a special character..." ) );
pbSpecialChar1->setFixedWidth( 40 );
grid->addWidget( pbSpecialChar1, 3, 2 );
- connect(pbSpecialChar1,SIGNAL(clicked()), SLOT(chooseSpecialChar1()));
+ connect(pbSpecialChar1,TQT_SIGNAL(clicked()), TQT_SLOT(chooseSpecialChar1()));
- lblReplace = new QLabel( i18n( "&Replace:" ), tab3 );
+ lblReplace = new TQLabel( i18n( "&Replace:" ), tab3 );
grid->addWidget( lblReplace, 3, 3 );
- m_replace = new KoAutoFormatLineEdit( tab3 );
- grid->addWidget( m_replace, 3, 4 );
+ m_tqreplace = new KoAutoFormatLineEdit( tab3 );
+ grid->addWidget( m_tqreplace, 3, 4 );
- lblReplace->setBuddy( m_replace );
+ lblReplace->setBuddy( m_tqreplace );
- connect( m_replace, SIGNAL( textChanged( const QString & ) ),
- SLOT( slotfind2( const QString & ) ) );
- connect( m_replace, SIGNAL( keyReturnPressed() ),
- SLOT( slotAddEntry()));
+ connect( m_tqreplace, TQT_SIGNAL( textChanged( const TQString & ) ),
+ TQT_SLOT( slottqfind2( const TQString & ) ) );
+ connect( m_tqreplace, TQT_SIGNAL( keyReturnPressed() ),
+ TQT_SLOT( slotAddEntry()));
- pbSpecialChar2 = new QPushButton( "...", tab3 );
- QToolTip::add( pbSpecialChar2, i18n( "Insert a special character..." ) );
+ pbSpecialChar2 = new TQPushButton( "...", tab3 );
+ TQToolTip::add( pbSpecialChar2, i18n( "Insert a special character..." ) );
pbSpecialChar2->setFixedWidth( 40 );
grid->addWidget( pbSpecialChar2, 3, 5 );
- connect(pbSpecialChar2,SIGNAL(clicked()), SLOT(chooseSpecialChar2()));
+ connect(pbSpecialChar2,TQT_SIGNAL(clicked()), TQT_SLOT(chooseSpecialChar2()));
- pbAdd = new QPushButton( i18n( "&Add"), tab3 );
+ pbAdd = new TQPushButton( i18n( "&Add"), tab3 );
grid->addWidget( pbAdd, 3, 6 );
- connect(pbAdd,SIGNAL(clicked()),this, SLOT(slotAddEntry()));
+ connect(pbAdd,TQT_SIGNAL(clicked()),this, TQT_SLOT(slotAddEntry()));
m_pListView = new KListView( tab3 );
m_pListView->addColumn( i18n( "Find" ) );
@@ -590,25 +590,25 @@ void KoAutoFormatDia::setupTab3()
m_pListView->setAllColumnsShowFocus( true );
grid->addMultiCellWidget( m_pListView, 4, 10, 0, 5 );
- connect(m_pListView, SIGNAL(doubleClicked ( QListViewItem * )),
- SLOT(slotChangeTextFormatEntry()) );
- connect(m_pListView, SIGNAL(clicked ( QListViewItem * ) ),
- SLOT(slotEditEntry()) );
+ connect(m_pListView, TQT_SIGNAL(doubleClicked ( TQListViewItem * )),
+ TQT_SLOT(slotChangeTextFormatEntry()) );
+ connect(m_pListView, TQT_SIGNAL(clicked ( TQListViewItem * ) ),
+ TQT_SLOT(slotEditEntry()) );
- pbRemove = new QPushButton( i18n( "Remove" ), tab3 );
- grid->addWidget( pbRemove, 4, 6, Qt::AlignTop );
+ pbRemove = new TQPushButton( i18n( "Remove" ), tab3 );
+ grid->addWidget( pbRemove, 4, 6, TQt::AlignTop );
- connect(pbRemove,SIGNAL(clicked()), SLOT(slotRemoveEntry()));
+ connect(pbRemove,TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveEntry()));
- pbChangeFormat= new QPushButton( i18n( "Change Format..." ), tab3 );
- grid->addWidget( pbChangeFormat, 5, 6, Qt::AlignTop );
+ pbChangeFormat= new TQPushButton( i18n( "Change Format..." ), tab3 );
+ grid->addWidget( pbChangeFormat, 5, 6, TQt::AlignTop );
- connect( pbChangeFormat, SIGNAL(clicked()), SLOT(slotChangeTextFormatEntry()));
+ connect( pbChangeFormat, TQT_SIGNAL(clicked()), TQT_SLOT(slotChangeTextFormatEntry()));
- pbClearFormat= new QPushButton( i18n( "Clear Format" ), tab3 );
- grid->addWidget( pbClearFormat, 6, 6, Qt::AlignTop );
+ pbClearFormat= new TQPushButton( i18n( "Clear Format" ), tab3 );
+ grid->addWidget( pbClearFormat, 6, 6, TQt::AlignTop );
- connect( pbClearFormat, SIGNAL(clicked()), SLOT(slotClearTextFormatEntry()));
+ connect( pbClearFormat, TQT_SIGNAL(clicked()), TQT_SLOT(slotClearTextFormatEntry()));
grid->setRowStretch( 10, 1 );
initTab3();
@@ -652,10 +652,10 @@ void KoAutoFormatDia::initTab3()
cbAutoCorrectionWithFormat->setChecked( m_autoFormat.getConfigCorrectionWithFormat());
m_pListView->clear();
- QDictIterator<KoAutoFormatEntry> it( m_docAutoFormat->getAutoFormatEntries());
+ TQDictIterator<KoAutoFormatEntry> it( m_docAutoFormat->getAutoFormatEntries());
for( ; it.current(); ++it )
{
- ( void )new QListViewItem( m_pListView, it.currentKey(), it.current()->replace() );
+ ( void )new TQListViewItem( m_pListView, it.currentKey(), it.current()->tqreplace() );
}
}
@@ -665,12 +665,12 @@ void KoAutoFormatDia::slotChangeAdvancedAutoCorrection()
cbAutoCorrectionWithFormat->setEnabled( state );
pbSpecialChar2->setEnabled( state );
pbSpecialChar1->setEnabled( state );
- m_replace->setEnabled( state);
- m_find->setEnabled( state);
+ m_tqreplace->setEnabled( state);
+ m_tqfind->setEnabled( state);
m_pListView->setEnabled( state);
- state = state && !m_replace->text().isEmpty() && !m_find->text().isEmpty();
- KoAutoFormatEntry * entry=m_docAutoFormat->findFormatEntry(m_find->text());
+ state = state && !m_tqreplace->text().isEmpty() && !m_tqfind->text().isEmpty();
+ KoAutoFormatEntry * entry=m_docAutoFormat->findFormatEntry(m_tqfind->text());
pbRemove->setEnabled(state && entry);
pbChangeFormat->setEnabled(state && entry);
pbClearFormat->setEnabled(state && entry);
@@ -678,13 +678,13 @@ void KoAutoFormatDia::slotChangeAdvancedAutoCorrection()
}
-void KoAutoFormatDia::changeAutoformatLanguage(const QString & text)
+void KoAutoFormatDia::changeAutoformatLanguage(const TQString & text)
{
if ( text==i18n("Default"))
- m_docAutoFormat->configAutoFormatLanguage( QString::null);
+ m_docAutoFormat->configAutoFormatLanguage( TQString());
else
{
- m_docAutoFormat->configAutoFormatLanguage( exceptionLanguageName.find(text).data());
+ m_docAutoFormat->configAutoFormatLanguage( exceptionLanguageName.tqfind(text).data());
}
if ( !noSignal )
{
@@ -708,7 +708,7 @@ void KoAutoFormatDia::changeAutoformatLanguage(const QString & text)
void KoAutoFormatDia::setupTab4()
{
tab4 = addPage( i18n( "Exceptions" ) );
- QVBoxLayout *vbox = new QVBoxLayout(tab4, 0, KDialog::spacingHint());
+ TQVBoxLayout *vbox = new TQVBoxLayout(tab4, 0, KDialog::spacingHint());
abbreviation=new KoAutoFormatExceptionWidget(tab4,
i18n("Do not treat as the end of a sentence:"),
@@ -765,10 +765,10 @@ void KoAutoFormatDia::slotChangeTextFormatEntry()
KoAutoFormatEntry *entry = 0L;
if ( addNewEntry )
{
- if ( m_replace->text().isEmpty() )
+ if ( m_tqreplace->text().isEmpty() )
return;
if ( !newEntry )
- newEntry = new KoAutoFormatEntry( m_replace->text());
+ newEntry = new KoAutoFormatEntry( m_tqreplace->text());
entry =newEntry;
}
else
@@ -813,28 +813,28 @@ void KoAutoFormatDia::slotRemoveEntry()
}
-void KoAutoFormatDia::slotfind( const QString & )
+void KoAutoFormatDia::slottqfind( const TQString & )
{
- KoAutoFormatEntry *entry = m_docAutoFormat->findFormatEntry(m_find->text());
+ KoAutoFormatEntry *entry = m_docAutoFormat->findFormatEntry(m_tqfind->text());
if ( entry )
{
- m_replace->setText(entry->replace().latin1());
+ m_tqreplace->setText(entry->tqreplace().latin1());
pbAdd->setText(i18n("&Modify"));
- m_pListView->setCurrentItem(m_pListView->findItem(m_find->text(),0));
+ m_pListView->setCurrentItem(m_pListView->tqfindItem(m_tqfind->text(),0));
} else {
- m_replace->clear();
+ m_tqreplace->clear();
pbAdd->setText(i18n("&Add"));
m_pListView->setCurrentItem(0L);
}
- slotfind2("");
+ slottqfind2("");
}
-void KoAutoFormatDia::slotfind2( const QString & )
+void KoAutoFormatDia::slottqfind2( const TQString & )
{
- bool state = !m_replace->text().isEmpty() && !m_find->text().isEmpty();
- KoAutoFormatEntry * entry=m_docAutoFormat->findFormatEntry(m_find->text());
+ bool state = !m_tqreplace->text().isEmpty() && !m_tqfind->text().isEmpty();
+ KoAutoFormatEntry * entry=m_docAutoFormat->findFormatEntry(m_tqfind->text());
pbRemove->setEnabled(state && entry);
if ( state && entry )
{
@@ -850,13 +850,13 @@ void KoAutoFormatDia::slotfind2( const QString & )
void KoAutoFormatDia::refreshEntryList()
{
m_pListView->clear();
- QDictIterator<KoAutoFormatEntry> it( m_docAutoFormat->getAutoFormatEntries());
+ TQDictIterator<KoAutoFormatEntry> it( m_docAutoFormat->getAutoFormatEntries());
for( ; it.current(); ++it )
{
- ( void )new QListViewItem( m_pListView, it.currentKey(), it.current()->replace() );
+ ( void )new TQListViewItem( m_pListView, it.currentKey(), it.current()->tqreplace() );
}
m_pListView->setCurrentItem(m_pListView->firstChild ());
- bool state = !(m_replace->text().isEmpty()) && !(m_find->text().isEmpty());
+ bool state = !(m_tqreplace->text().isEmpty()) && !(m_tqfind->text().isEmpty());
//we can delete item, as we search now in listbox and not in m_find lineedit
pbRemove->setEnabled(m_pListView->currentItem() && m_pListView->selectedItem()!=0 );
pbChangeFormat->setEnabled(state && m_pListView->currentItem() && m_pListView->selectedItem()!=0 );
@@ -866,14 +866,14 @@ void KoAutoFormatDia::refreshEntryList()
}
-void KoAutoFormatDia::addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry)
+void KoAutoFormatDia::addEntryList(const TQString &key, KoAutoFormatEntry *_autoEntry)
{
m_docAutoFormat->addAutoFormatEntry( key, _autoEntry );
}
-void KoAutoFormatDia::editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry)
+void KoAutoFormatDia::editEntryList(const TQString &key,const TQString &newFindString, KoAutoFormatEntry *_autoEntry)
{
if ( m_docAutoFormat->findFormatEntry(key) && m_docAutoFormat->findFormatEntry(key)->formatEntryContext())
_autoEntry->setFormatEntryContext( new KoSearchContext(*(m_docAutoFormat->findFormatEntry(key)->formatEntryContext()) ));
@@ -886,14 +886,14 @@ void KoAutoFormatDia::slotAddEntry()
{
if(!pbAdd->isEnabled())
return;
- QString repl = m_replace->text();
- QString find = m_find->text();
- if(repl.isEmpty() || find.isEmpty())
+ TQString repl = m_tqreplace->text();
+ TQString tqfind = m_tqfind->text();
+ if(repl.isEmpty() || tqfind.isEmpty())
{
KMessageBox::sorry( 0L, i18n( "An area is empty" ) );
return;
}
- if(repl==find)
+ if(repl==tqfind)
{
KMessageBox::sorry( 0L, i18n( "Find string is the same as replace string!" ) );
return;
@@ -904,18 +904,18 @@ void KoAutoFormatDia::slotAddEntry()
{
if ( newEntry )
{
- newEntry->changeReplace( m_replace->text());
- addEntryList(find, newEntry);
+ newEntry->changeReplace( m_tqreplace->text());
+ addEntryList(tqfind, newEntry);
delete tmp;
newEntry = 0L;
}
else
- addEntryList(find, tmp);
+ addEntryList(tqfind, tmp);
}
else
- editEntryList(find, find, tmp);
- m_replace->clear();
- m_find->clear();
+ editEntryList(tqfind, tqfind, tmp);
+ m_tqreplace->clear();
+ m_tqfind->clear();
refreshEntryList();
autocorrectionEntryChanged= true;
@@ -924,42 +924,42 @@ void KoAutoFormatDia::slotAddEntry()
void KoAutoFormatDia::chooseSpecialChar1()
{
- QString f = font().family();
- QChar c = ' ';
- bool const focus = m_find->hasFocus();
+ TQString f = font().family();
+ TQChar c = ' ';
+ bool const focus = m_tqfind->hasFocus();
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
- int const cursorpos = m_find->cursorPosition();
+ int const cursorpos = m_tqfind->cursorPosition();
if (focus)
- m_find->setText( m_find->text().insert( cursorpos, c ) );
+ m_tqfind->setText( m_tqfind->text().insert( cursorpos, c ) );
else
- m_find->setText( m_find->text().append(c) );
- m_find->setCursorPosition( cursorpos+1 );
+ m_tqfind->setText( m_tqfind->text().append(c) );
+ m_tqfind->setCursorPosition( cursorpos+1 );
}
}
void KoAutoFormatDia::chooseSpecialChar2()
{
- QString f = font().family();
- QChar c = ' ';
- bool const focus = m_replace->hasFocus();
+ TQString f = font().family();
+ TQChar c = ' ';
+ bool const focus = m_tqreplace->hasFocus();
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
- int const cursorpos = m_replace->cursorPosition();
+ int const cursorpos = m_tqreplace->cursorPosition();
if (focus)
- m_replace->setText( m_replace->text().insert(m_replace->cursorPosition(), c ) );
+ m_tqreplace->setText( m_tqreplace->text().insert(m_tqreplace->cursorPosition(), c ) );
else
- m_replace->setText( m_replace->text().append(c) );
- m_replace->setCursorPosition( cursorpos+1 );
+ m_tqreplace->setText( m_tqreplace->text().append(c) );
+ m_tqreplace->setCursorPosition( cursorpos+1 );
}
}
-void KoAutoFormatDia::slotItemRenamed(QListViewItem *, const QString & , int )
+void KoAutoFormatDia::slotItemRenamed(TQListViewItem *, const TQString & , int )
{
// Wow. This need a redesign (we don't have the old key anymore at this point !)
- // -> inherit QListViewItem and store the KoAutoFormatEntry pointer in it.
+ // -> inherit TQListViewItem and store the KoAutoFormatEntry pointer in it.
}
@@ -969,9 +969,9 @@ void KoAutoFormatDia::slotEditEntry()
return;
delete newEntry;
newEntry=0L;
- m_find->setText(m_pListView->currentItem()->text(0));
- m_replace->setText(m_pListView->currentItem()->text(1));
- bool state = !m_replace->text().isEmpty() && !m_find->text().isEmpty();
+ m_tqfind->setText(m_pListView->currentItem()->text(0));
+ m_tqreplace->setText(m_pListView->currentItem()->text(1));
+ bool state = !m_tqreplace->text().isEmpty() && !m_tqfind->text().isEmpty();
pbRemove->setEnabled(state);
pbChangeFormat->setEnabled( state );
pbClearFormat->setEnabled(state);
@@ -983,13 +983,13 @@ bool KoAutoFormatDia::applyConfig()
{
// First tab
KoAutoFormat::TypographicQuotes tq = m_autoFormat.getConfigTypographicSimpleQuotes();
- tq.replace = cbTypographicSimpleQuotes->isChecked();
+ tq.tqreplace = cbTypographicSimpleQuotes->isChecked();
tq.begin = pbSimpleQuote1->text()[ 0 ];
tq.end = pbSimpleQuote2->text()[ 0 ];
m_docAutoFormat->configTypographicSimpleQuotes( tq );
tq = m_autoFormat.getConfigTypographicDoubleQuotes();
- tq.replace = cbTypographicDoubleQuotes->isChecked();
+ tq.tqreplace = cbTypographicDoubleQuotes->isChecked();
tq.begin = pbDoubleQuote1->text()[ 0 ];
tq.end = pbDoubleQuote2->text()[ 0 ];
m_docAutoFormat->configTypographicDoubleQuotes( tq );
@@ -1024,9 +1024,9 @@ bool KoAutoFormatDia::applyConfig()
m_docAutoFormat->configIncludeTwoUpperUpperLetterException( twoUpperLetter->autoInclude());
m_docAutoFormat->configIncludeAbbreviation( abbreviation->autoInclude());
- QString lang = exceptionLanguageName.find(autoFormatLanguage->currentText()).data();
+ TQString lang = exceptionLanguageName.tqfind(autoFormatLanguage->currentText()).data();
if ( lang == i18n("Default") )
- m_docAutoFormat->configAutoFormatLanguage(QString::null);
+ m_docAutoFormat->configAutoFormatLanguage(TQString());
else
m_docAutoFormat->configAutoFormatLanguage(lang);
@@ -1056,8 +1056,8 @@ void KoAutoFormatDia::slotCancel()
void KoAutoFormatDia::chooseDoubleQuote1()
{
- QString f = font().family();
- QChar c = oDoubleBegin;
+ TQString f = font().family();
+ TQChar c = oDoubleBegin;
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
pbDoubleQuote1->setText( c );
@@ -1067,8 +1067,8 @@ void KoAutoFormatDia::chooseDoubleQuote1()
void KoAutoFormatDia::chooseDoubleQuote2()
{
- QString f = font().family();
- QChar c = oDoubleEnd;
+ TQString f = font().family();
+ TQChar c = oDoubleEnd;
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
pbDoubleQuote2->setText( c );
@@ -1084,8 +1084,8 @@ void KoAutoFormatDia::defaultDoubleQuote()
void KoAutoFormatDia::chooseSimpleQuote1()
{
- QString f = font().family();
- QChar c = oSimpleBegin;
+ TQString f = font().family();
+ TQChar c = oSimpleBegin;
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
pbSimpleQuote1->setText( c );
@@ -1094,8 +1094,8 @@ void KoAutoFormatDia::chooseSimpleQuote1()
void KoAutoFormatDia::chooseSimpleQuote2()
{
- QString f = font().family();
- QChar c = oSimpleEnd;
+ TQString f = font().family();
+ TQChar c = oSimpleEnd;
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
pbSimpleQuote2->setText( c );
@@ -1112,8 +1112,8 @@ void KoAutoFormatDia::defaultSimpleQuote()
void KoAutoFormatDia::chooseBulletStyle()
{
- QString f = font().family();
- QChar c = bulletStyle;
+ TQString f = font().family();
+ TQChar c = bulletStyle;
if ( KoCharSelectDia::selectChar( f, c, false ) )
{
pbBulletStyle->setText( c );
diff --git a/lib/kotext/KoAutoFormatDia.h b/lib/kotext/KoAutoFormatDia.h
index 9b1f92c5..38a9ecb3 100644
--- a/lib/kotext/KoAutoFormatDia.h
+++ b/lib/kotext/KoAutoFormatDia.h
@@ -22,24 +22,25 @@
#define koautoformatdia_h
#include <kdialogbase.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <KoAutoFormat.h>
-class QCheckBox;
+class TQCheckBox;
class KCharSelect;
-class QComboBox;
+class TQComboBox;
/**
*
*/
-class KoAutoFormatLineEdit : public QLineEdit
+class KoAutoFormatLineEdit : public TQLineEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoAutoFormatLineEdit ( QWidget * parent, const char * name=0 );
+ KoAutoFormatLineEdit ( TQWidget * tqparent, const char * name=0 );
protected:
- virtual void keyPressEvent ( QKeyEvent * );
+ virtual void keyPressEvent ( TQKeyEvent * );
signals:
void keyReturnPressed();
};
@@ -48,28 +49,29 @@ protected:
/* Class: KoAutoFormatExceptionWidget */
/******************************************************************/
-class KoAutoFormatExceptionWidget : public QWidget
+class KoAutoFormatExceptionWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoAutoFormatExceptionWidget(QWidget *_parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abbreviation=false);
+ KoAutoFormatExceptionWidget(TQWidget *_parent, const TQString &name,const TQStringList &_list, bool _autoInclude, bool _abbreviation=false);
- void setListException( const QStringList &list);
- QStringList getListException(){return m_listException;}
+ void setListException( const TQStringList &list);
+ TQStringList getListException(){return m_listException;}
bool autoInclude();
void setAutoInclude( bool b );
protected slots:
void slotAddException();
void slotRemoveException();
- void textChanged ( const QString & );
+ void textChanged ( const TQString & );
void slotExceptionListSelected();
private:
- QListBox *exceptionList;
+ TQListBox *exceptionList;
KoAutoFormatLineEdit *exceptionLine;
- QPushButton *pbAddException,*pbRemoveException;
- QCheckBox *cbAutoInclude;
- QStringList m_listException;
+ TQPushButton *pbAddException,*pbRemoveException;
+ TQCheckBox *cbAutoInclude;
+ TQStringList m_listException;
bool m_bAbbreviation;
};
@@ -80,12 +82,13 @@ protected slots:
class KOTEXT_EXPORT KoAutoFormatDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoAutoFormatDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
+ KoAutoFormatDia( TQWidget *tqparent, const char *name, KoAutoFormat * autoFormat );
~KoAutoFormatDia();
- void addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry);
- void editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry);
+ void addEntryList(const TQString &key, KoAutoFormatEntry *_autoEntry);
+ void editEntryList(const TQString &key,const TQString &newFindString, KoAutoFormatEntry *_autoEntry);
protected:
bool applyConfig();
void setupTab1();
@@ -100,31 +103,31 @@ protected:
void initTab3();
void initTab4();
- typedef QMap<QString, QString> KoExceptionLanguageName;
+ typedef TQMap<TQString, TQString> KoExceptionLanguageName;
KoExceptionLanguageName exceptionLanguageName;
- QWidget *tab1;
- QWidget *tab2;
- QWidget *tab3;
- QWidget *tab4;
+ TQWidget *tab1;
+ TQWidget *tab2;
+ TQWidget *tab3;
+ TQWidget *tab4;
- QComboBox *autoFormatLanguage;
+ TQComboBox *autoFormatLanguage;
- QCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
+ TQCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
*cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
- QPushButton *pbDoubleQuote1, *pbDoubleQuote2, /**pbEdit,*/ *pbRemove, *pbAdd, *pbDoubleDefault,
+ TQPushButton *pbDoubleQuote1, *pbDoubleQuote2, /**pbEdit,*/ *pbRemove, *pbAdd, *pbDoubleDefault,
*pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
- QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
- QPushButton *pbChangeFormat, *pbClearFormat;
+ TQPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
+ TQPushButton *pbChangeFormat, *pbClearFormat;
KCharSelect *charselect;
- KoAutoFormatLineEdit *m_find, *m_replace;
+ KoAutoFormatLineEdit *m_tqfind, *m_tqreplace;
KListView *m_pListView;
- QChar oSimpleBegin, oSimpleEnd;
- QChar oDoubleBegin, oDoubleEnd;
+ TQChar oSimpleBegin, oSimpleEnd;
+ TQChar oDoubleBegin, oDoubleEnd;
- QChar bulletStyle;
+ TQChar bulletStyle;
KoAutoFormat m_autoFormat; // The copy we're working on
KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
@@ -133,7 +136,7 @@ protected:
KoAutoFormatEntry *newEntry;
- QString initialLanguage;
+ TQString initialLanguage;
bool noSignal;
bool changeLanguage;
@@ -143,11 +146,11 @@ protected slots:
virtual void slotCancel();
void slotBulletStyleToggled( bool );
- void slotItemRenamed(QListViewItem * item, const QString & newText, int column);
+ void slotItemRenamed(TQListViewItem * item, const TQString & newText, int column);
void slotRemoveEntry();
void slotEditEntry();
- void slotfind( const QString & );
- void slotfind2( const QString & );
+ void slottqfind( const TQString & );
+ void slottqfind2( const TQString & );
void chooseSpecialChar1();
void chooseSpecialChar2();
void chooseDoubleQuote1();
@@ -166,7 +169,7 @@ protected slots:
void defaultBulletStyle();
void slotChangeTextFormatEntry();
void slotResetConf();
- void changeAutoformatLanguage(const QString & );
+ void changeAutoformatLanguage(const TQString & );
void slotClearTextFormatEntry();
void slotChangeAdvancedAutoCorrection();
};
diff --git a/lib/kotext/KoBgSpellCheck.cpp b/lib/kotext/KoBgSpellCheck.cpp
index 9dd0b9b9..d20dd80d 100644
--- a/lib/kotext/KoBgSpellCheck.cpp
+++ b/lib/kotext/KoBgSpellCheck.cpp
@@ -41,8 +41,8 @@ using namespace KSpell2;
#include <klocale.h>
#include <kdebug.h>
#include <kdeversion.h>
-#include <qtimer.h>
-#include <qptrdict.h>
+#include <tqtimer.h>
+#include <tqptrdict.h>
// #define DEBUG_BGSPELLCHECKING
@@ -51,7 +51,7 @@ class KoBgSpellCheck::Private
public:
int marked;
KoSpell *backSpeller;
- QPtrDict<KoTextParag> paragCache;
+ TQPtrDict<KoTextParag> paragCache;
bool startupChecking;
KoTextParag* intraWordParag;
int intraWordPosition;
@@ -59,9 +59,9 @@ public:
static const int delayAfterMarked = 10;
-KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, QObject *parent,
+KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, TQObject *tqparent,
const char *name )
- : QObject( parent, name )
+ : TQObject( tqparent, name )
{
#ifdef DEBUG_BGSPELLCHECKING
kdDebug(32500) << "KoBgSpellCheck::KoBgSpellCheck " << this << endl;
@@ -73,12 +73,12 @@ KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, QObject *parent,
d->intraWordPosition = 0;
d->backSpeller = new KoSpell( broker, this, "KoSpell" );
- connect( d->backSpeller, SIGNAL(misspelling(const QString&, int)),
- SLOT(spellCheckerMisspelling(const QString &, int )) );
- connect( d->backSpeller, SIGNAL(done()),
- SLOT(spellCheckerDone()) );
- connect( d->backSpeller, SIGNAL(aboutToFeedText()),
- SLOT(slotClearPara()) );
+ connect( d->backSpeller, TQT_SIGNAL(misspelling(const TQString&, int)),
+ TQT_SLOT(spellCheckerMisspelling(const TQString &, int )) );
+ connect( d->backSpeller, TQT_SIGNAL(done()),
+ TQT_SLOT(spellCheckerDone()) );
+ connect( d->backSpeller, TQT_SIGNAL(aboutToFeedText()),
+ TQT_SLOT(slotClearPara()) );
}
KoBgSpellCheck::~KoBgSpellCheck()
@@ -90,12 +90,12 @@ void KoBgSpellCheck::registerNewTextObject( KoTextObject *obj )
{
Q_ASSERT( obj );
- connect( obj, SIGNAL(paragraphCreated(KoTextParag*)),
- SLOT(slotParagraphCreated(KoTextParag*)) );
- connect( obj, SIGNAL(paragraphModified(KoTextParag*, int, int, int)),
- SLOT(slotParagraphModified(KoTextParag*, int, int, int)) );
- connect( obj, SIGNAL(paragraphDeleted(KoTextParag*)),
- SLOT(slotParagraphDeleted(KoTextParag*)) );
+ connect( obj, TQT_SIGNAL(paragraphCreated(KoTextParag*)),
+ TQT_SLOT(slotParagraphCreated(KoTextParag*)) );
+ connect( obj, TQT_SIGNAL(paragraphModified(KoTextParag*, int, int, int)),
+ TQT_SLOT(slotParagraphModified(KoTextParag*, int, int, int)) );
+ connect( obj, TQT_SIGNAL(paragraphDeleted(KoTextParag*)),
+ TQT_SLOT(slotParagraphDeleted(KoTextParag*)) );
}
void KoBgSpellCheck::setEnabled( bool b )
@@ -124,7 +124,7 @@ void KoBgSpellCheck::start()
d->backSpeller->start();
}
-void KoBgSpellCheck::spellCheckerMisspelling( const QString &old, int pos )
+void KoBgSpellCheck::spellCheckerMisspelling( const TQString &old, int pos )
{
KoTextParag* parag = d->backSpeller->currentParag();
#ifdef DEBUG_BGSPELLCHECKING
@@ -135,12 +135,12 @@ void KoBgSpellCheck::spellCheckerMisspelling( const QString &old, int pos )
#endif
markWord( parag, pos, old.length(), true );
// Repaint immediately, since the checking is timer-based (slow), it looks
- // slow (chunky) if we only repaint once a paragraph is completely done.
+ // slow (chunky) if we only tqrepaint once a paragraph is completely done.
parag->document()->emitRepaintChanged();
if ( d->startupChecking && d->marked > delayAfterMarked ) {
d->marked = 0;
- QTimer::singleShot( 1000, this, SLOT(checkerContinue()) );
+ TQTimer::singleShot( 1000, this, TQT_SLOT(checkerContinue()) );
} else {
if ( d->startupChecking )
++d->marked;
@@ -171,7 +171,7 @@ void KoBgSpellCheck::markWord( KoTextParag* parag, int pos, int length, bool mis
#endif
parag->setFormat( pos, length, &format, true, KoTextFormat::Misspelled );
parag->setChanged( true );
- // don't repaint here, in the slotParagraphModified case we want to repaint only once at the end
+ // don't tqrepaint here, in the slotParagraphModified case we want to tqrepaint only once at the end
}
void KoBgSpellCheck::checkerContinue()
@@ -187,7 +187,7 @@ void KoBgSpellCheck::spellCheckerDone()
if ( d->paragCache.isEmpty() )
return;
- QPtrDictIterator<KoTextParag> itr( d->paragCache );
+ TQPtrDictIterator<KoTextParag> itr( d->paragCache );
KoTextParag *parag = d->paragCache.take( itr.currentKey() );
#ifdef DEBUG_BGSPELLCHECKING
kdDebug(32500) << "spellCheckerDone : " << parag << ", cache = "<< d->paragCache.count() <<endl;
@@ -230,19 +230,19 @@ void KoBgSpellCheck::slotParagraphModified( KoTextParag* parag, int /*ParagModif
#if KDE_VERSION > KDE_MAKE_VERSION(3,3,0)
if ( length < 10 ) {
- QString str = parag->string()->stringToSpellCheck();
+ TQString str = parag->string()->stringToSpellCheck();
/// ##### do we really need to create a Filter every time?
Filter filter;
filter.setBuffer( str );
// pos - 1 wasn't enough for the case a splitting a word into two misspelled halves
- filter.setCurrentPosition( QMAX( 0, pos - 2 ) );
+ filter.setCurrentPosition( TQMAX( 0, pos - 2 ) );
int curPos = filter.currentPosition(); // Filter adjusted it by going back to the last word
- //kdDebug() << "str='" << str << "' set position " << QMAX(0, pos-2) << " got back curPos=" << curPos << endl;
+ //kdDebug() << "str='" << str << "' set position " << TQMAX(0, pos-2) << " got back curPos=" << curPos << endl;
filter.setSettings( d->backSpeller->settings() );
// Tricky: KSpell2::Filter::nextWord's behavior makes the for() loop skip ignored words,
// so it doesn't mark them as OK... So we need to clear the marks everywhere first.
- // To avoid flickering the repainting is only done once, after checking the parag.
+ // To avoid flickering the tqrepainting is only done once, after checking the parag.
markWord( parag, curPos, parag->length() - curPos, false );
for ( Word w = filter.nextWord(); !w.end; w = filter.nextWord() ) {
@@ -254,7 +254,7 @@ void KoBgSpellCheck::slotParagraphModified( KoTextParag* parag, int /*ParagModif
parag->document()->emitRepaintChanged();
#else
if ( length < 3 ) {
- QString word;
+ TQString word;
int start;
bool misspelled = !d->backSpeller->checkWordInParagraph( parag, pos,
word, start );
@@ -287,7 +287,7 @@ void KoBgSpellCheck::slotClearPara()
// (e.g. due to adding a word to the ignore list, not due to editing)
//
// TODO: do this all only if there was a format with 'misspelled' in the paragraph,
- // to minimize repaints
+ // to minimize tqrepaints
KoTextStringChar *ch = parag->at( 0 );
KoTextFormat format( *ch->format() );
format.setMisspelled( false );
diff --git a/lib/kotext/KoBgSpellCheck.h b/lib/kotext/KoBgSpellCheck.h
index dadb8b5d..08f47272 100644
--- a/lib/kotext/KoBgSpellCheck.h
+++ b/lib/kotext/KoBgSpellCheck.h
@@ -21,19 +21,20 @@
#define KOBGSPELLCHECK_H
#include <kspell2/broker.h>
-#include <qobject.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
#include <koffice_export.h>
class KoTextObject;
class KoDocument;
class KoTextParag;
class KoTextIterator;
-class KOTEXT_EXPORT KoBgSpellCheck : public QObject
+class KOTEXT_EXPORT KoBgSpellCheck : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoBgSpellCheck( const KSpell2::Broker::Ptr& broker, QObject *parent =0,
+ KoBgSpellCheck( const KSpell2::Broker::Ptr& broker, TQObject *tqparent =0,
const char *name =0 );
virtual ~KoBgSpellCheck();
@@ -60,7 +61,7 @@ public slots:
void setEnabled( bool b );
protected slots:
- void spellCheckerMisspelling(const QString &, int );
+ void spellCheckerMisspelling(const TQString &, int );
void spellCheckerDone();
void checkerContinue();
diff --git a/lib/kotext/KoBorder.cpp b/lib/kotext/KoBorder.cpp
index 01cfbea0..5c7461e6 100644
--- a/lib/kotext/KoBorder.cpp
+++ b/lib/kotext/KoBorder.cpp
@@ -18,7 +18,7 @@
*/
#include "KoBorder.h"
-#include <qdom.h>
+#include <tqdom.h>
#include <kdebug.h>
#include "KoZoomHandler.h"
#include "KoTextFormat.h"
@@ -27,16 +27,16 @@
#include <float.h>
static const struct BorderStyle {
- QPen::PenStyle penStyle;
- QCString oasisName;
- QCString uiStringStyle;
+ Qt::PenStyle penStyle;
+ TQCString oasisName;
+ TQCString uiStringStyle;
} s_borderStyles[] = {
- { QPen::SolidLine, "solid", "_________" }, // SOLID
- { QPen::DashLine, "dashed", "___ ___ __" }, // DASH
- { QPen::DotLine, "dotted", "_ _ _ _ _ _" }, // DOT
- { QPen::DashDotLine, "dot-dash", "___ _ ___ _" }, // DASH_DOT
- { QPen::DashDotDotLine, "dot-dot-dash", "___ _ _ ___" }, // DASH_DOT_DOT
- { QPen::SolidLine, "double", "===========" } // DOUBLE_LINE
+ { Qt::SolidLine, "solid", "_________" }, // SOLID
+ { Qt::DashLine, "dashed", "___ ___ __" }, // DASH
+ { Qt::DotLine, "dotted", "_ _ _ _ _ _" }, // DOT
+ { Qt::DashDotLine, "dot-dash", "___ _ ___ _" }, // DASH_DOT
+ { Qt::DashDotDotLine, "dot-dot-dash", "___ _ _ ___" }, // DASH_DOT_DOT
+ { Qt::SolidLine, "double", "===========" } // DOUBLE_LINE
};
KoBorder::KoBorder()
@@ -45,7 +45,7 @@ KoBorder::KoBorder()
setPenWidth( 1 );
}
-KoBorder::KoBorder( const QColor & c, BorderStyle s, double width )
+KoBorder::KoBorder( const TQColor & c, BorderStyle s, double width )
: color( c ), m_style( s )
{
setPenWidth( width );
@@ -74,9 +74,9 @@ void KoBorder::setPenWidth(double _w)
ptWidth = _w;
}
-QPen KoBorder::borderPen( const KoBorder & _brd, int width, QColor defaultColor )
+TQPen KoBorder::borderPen( const KoBorder & _brd, int width, TQColor defaultColor )
{
- QPen pen( _brd.color, width );
+ TQPen pen( _brd.color, width );
if ( !_brd.color.isValid() )
pen.setColor( defaultColor );
@@ -86,7 +86,7 @@ QPen KoBorder::borderPen( const KoBorder & _brd, int width, QColor defaultColor
}
// KOffice-1.3 file format (deprecated)
-KoBorder KoBorder::loadBorder( const QDomElement & elem )
+KoBorder KoBorder::loadBorder( const TQDomElement & elem )
{
KoBorder bd;
if ( elem.hasAttribute("red") )
@@ -101,7 +101,7 @@ KoBorder KoBorder::loadBorder( const QDomElement & elem )
return bd;
}
-void KoBorder::loadFoBorder( const QString& border )
+void KoBorder::loadFoBorder( const TQString& border )
{
//string like "0.088cm solid #800000"
@@ -110,10 +110,10 @@ void KoBorder::loadFoBorder( const QString& border )
return;
}
- // ## isn't it faster to use QStringList::split than parse it 3 times?
- QString _width = border.section(' ', 0, 0);
- QCString _style = border.section(' ', 1, 1).latin1();
- QString _color = border.section(' ', 2, 2);
+ // ## isn't it faster to use TQStringList::split than parse it 3 times?
+ TQString _width = border.section(' ', 0, 0);
+ TQCString _style = border.section(' ', 1, 1).latin1();
+ TQString _color = border.section(' ', 2, 2);
//TODO: let the user choose a more precise border width (in the current unit)
double const penWidth = KoUnit::parseValue( _width, 1.0 );
@@ -146,17 +146,17 @@ void KoBorder::loadFoBorder( const QString& border )
}
if ( _color.isEmpty() )
- color = QColor();
+ color = TQColor();
else
color.setNamedColor( _color );
}
-QString KoBorder::saveFoBorder() const
+TQString KoBorder::saveFoBorder() const
{
- if ( QABS( ptPenWidth ) < 1E-10 ) // i.e. ptPenWidth == 0
+ if ( TQABS( ptPenWidth ) < 1E-10 ) // i.e. ptPenWidth == 0
return "none";
//string like "2pt solid #800000"
- QString str = QString::number( ptPenWidth, 'g', DBL_DIG );
+ TQString str = TQString::number( ptPenWidth, 'g', DBL_DIG );
str += "pt ";
str += s_borderStyles[ m_style ].oasisName;
if ( color.isValid() ) {
@@ -167,7 +167,7 @@ QString KoBorder::saveFoBorder() const
}
// KOffice-1.3 file format (deprecated)
-void KoBorder::save( QDomElement & elem ) const
+void KoBorder::save( TQDomElement & elem ) const
{
if (color.isValid()) {
elem.setAttribute("red", color.red());
@@ -178,7 +178,7 @@ void KoBorder::save( QDomElement & elem ) const
elem.setAttribute("width", ptPenWidth);
}
-KoBorder::BorderStyle KoBorder::getStyle( const QString &style )
+KoBorder::BorderStyle KoBorder::getStyle( const TQString &style )
{
for ( uint i = 0; i < sizeof( s_borderStyles ) / sizeof *s_borderStyles; ++i ) {
if ( style == s_borderStyles[i].uiStringStyle.data() )
@@ -188,7 +188,7 @@ KoBorder::BorderStyle KoBorder::getStyle( const QString &style )
return KoBorder::SOLID;
}
-QString KoBorder::getStyle( const BorderStyle &style )
+TQString KoBorder::getStyle( const BorderStyle &style )
{
return s_borderStyles[style].uiStringStyle;
}
@@ -197,17 +197,17 @@ int KoBorder::zoomWidthX( double ptWidth, KoZoomHandler * zoomHandler, int minbo
{
// If a border was set, then zoom it and apply a minimum of 1, so that it's always visible.
// If no border was set, apply minborder ( 0 for paragraphs, 1 for frames )
- return ptWidth > 0 ? QMAX( 1, zoomHandler->zoomItX( ptWidth ) /*applies qRound*/ ) : minborder;
+ return ptWidth > 0 ? TQMAX( 1, zoomHandler->zoomItX( ptWidth ) /*applies tqRound*/ ) : minborder;
}
int KoBorder::zoomWidthY( double ptWidth, KoZoomHandler * zoomHandler, int minborder )
{
// If a border was set, then zoom it and apply a minimum of 1, so that it's always visible.
// If no border was set, apply minborder ( 0 for paragraphs, 1 for frames )
- return ptWidth > 0 ? QMAX( 1, zoomHandler->zoomItY( ptWidth ) /*applies qRound*/ ) : minborder;
+ return ptWidth > 0 ? TQMAX( 1, zoomHandler->zoomItY( ptWidth ) /*applies tqRound*/ ) : minborder;
}
-void KoBorder::drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, const QRect& rect, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, int minborder, const QPen& defaultPen, bool drawTopBorder /* = true */, bool drawBottomBorder /* = true */)
+void KoBorder::drawBorders( TQPainter& painter, KoZoomHandler * zoomHandler, const TQRect& rect, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, int minborder, const TQPen& defaultPen, bool drawTopBorder /* = true */, bool drawBottomBorder /* = true */)
{
int topBorderWidth = zoomWidthY( topBorder.width(), zoomHandler, minborder );
int bottomBorderWidth = zoomWidthY( bottomBorder.width(), zoomHandler, minborder );
@@ -228,7 +228,7 @@ void KoBorder::drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, cons
//kdDebug(32500) << " penWidths: top=" << topBorderPenWidth << " bottom=" << bottomBorderPenWidth
// << " left=" << leftBorderPenWidth << " right=" << rightBorderPenWidth << endl;
- QColor defaultColor = KoTextFormat::defaultTextColor( &painter );
+ TQColor defaultColor = KoTextFormat::defaultTextColor( &painter );
if ( topBorderWidth > 0 && drawTopBorder )
{
diff --git a/lib/kotext/KoBorder.h b/lib/kotext/KoBorder.h
index 4e577ac9..5225eb55 100644
--- a/lib/kotext/KoBorder.h
+++ b/lib/kotext/KoBorder.h
@@ -20,17 +20,17 @@
#ifndef KoBorder_h
#define KoBorder_h
-#include <qcolor.h>
-#include <qpen.h>
+#include <tqcolor.h>
+#include <tqpen.h>
#include <koffice_export.h>
-class QDomElement;
+class TQDomElement;
class KoZoomHandler;
-class QPainter;
+class TQPainter;
/**
* This class represents a border - for anything, like paragraph, or frame
*/
-class KOTEXT_EXPORT KoBorder : public Qt
+class KOTEXT_EXPORT KoBorder : public TQt
{
friend class KoTextCursor;
public:
@@ -39,8 +39,8 @@ public:
enum BorderType { LeftBorder = 0, RightBorder, TopBorder, BottomBorder };
KoBorder();
- KoBorder( const QColor & c, BorderStyle s, double width );
- QColor color;
+ KoBorder( const TQColor & c, BorderStyle s, double width );
+ TQColor color;
void setPenWidth(double _w);
void setStyle(BorderStyle _style);
// deprecated
@@ -53,31 +53,31 @@ public:
bool operator!=( const KoBorder _brd ) const;
// Load from XML
- static KoBorder loadBorder( const QDomElement & elem );
- void loadFoBorder( const QString& border );
+ static KoBorder loadBorder( const TQDomElement & elem );
+ void loadFoBorder( const TQString& border );
// Save to XML
- void save( QDomElement & elem ) const;
- QString saveFoBorder() const;
+ void save( TQDomElement & elem ) const;
+ TQString saveFoBorder() const;
// String to style enum, and vice versa, for UI.
- static BorderStyle getStyle( const QString &style );
- static QString getStyle( const BorderStyle &style );
+ static BorderStyle getStyle( const TQString &style );
+ static TQString getStyle( const BorderStyle &style );
// Zoom the border width. If ptWidth is 0, minborder is returned.
static int zoomWidthX( double ptWidth, KoZoomHandler * zoomHandler, int minborder ); // For left/right borders
static int zoomWidthY( double ptWidth, KoZoomHandler * zoomHandler, int minborder ); // For top/bottom borders
- // Get a ready-to-use QPen for this border.
- // defaultColor is the color to use for QColor() - either defaultTextColor() or defaultBgColor().
- static QPen borderPen( const KoBorder & brd, int width, QColor defaultColor );
+ // Get a ready-to-use TQPen for this border.
+ // defaultColor is the color to use for TQColor() - either defaultTextColor() or defaultBgColor().
+ static TQPen borderPen( const KoBorder & brd, int width, TQColor defaultColor );
// The do-it-all method :)
// Draws in @p painter the 4 borders on the _outside_ of @p rect.
// If a border is of size 0, minborder will be applied (no border if 0, defaultPen otherwise)
- static void drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, const QRect& rect,
+ static void drawBorders( TQPainter& painter, KoZoomHandler * zoomHandler, const TQRect& rect,
const KoBorder& left, const KoBorder& right,
const KoBorder& top, const KoBorder& bottom,
- int minborder, const QPen& defaultPen, bool drawTopBorder = true , bool drawBottomBorder = true );
+ int minborder, const TQPen& defaultPen, bool drawTopBorder = true , bool drawBottomBorder = true );
private:
double ptWidth;
double ptPenWidth;
diff --git a/lib/kotext/KoChangeCaseDia.cpp b/lib/kotext/KoChangeCaseDia.cpp
index 3b4dcdc9..1d2409b3 100644
--- a/lib/kotext/KoChangeCaseDia.cpp
+++ b/lib/kotext/KoChangeCaseDia.cpp
@@ -19,32 +19,32 @@
#include <klocale.h>
-#include <qvbox.h>
-#include <qwhatsthis.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqvbox.h>
+#include <tqwhatsthis.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
#include "KoChangeCaseDia.h"
-KoChangeCaseDia::KoChangeCaseDia( QWidget *parent, const char *name )
- : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
+KoChangeCaseDia::KoChangeCaseDia( TQWidget *tqparent, const char *name )
+ : KDialogBase( tqparent, name , true, "", Ok|Cancel, Ok, true )
{
setCaption( i18n("Change Case") );
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
- QButtonGroup *grp = new QButtonGroup( 1, QGroupBox::Horizontal, i18n( "Case" ),page );
+ TQButtonGroup *grp = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Case" ),page );
grp->setRadioButtonExclusive( TRUE );
- grp->layout();
- m_upperCase=new QRadioButton( i18n("&Uppercase"), grp );
- m_lowerCase=new QRadioButton( i18n("&Lowercase"), grp );
+ grp->tqlayout();
+ m_upperCase=new TQRadioButton( i18n("&Uppercase"), grp );
+ m_lowerCase=new TQRadioButton( i18n("&Lowercase"), grp );
- m_titleCase=new QRadioButton( i18n("T&itle case"), grp );
+ m_titleCase=new TQRadioButton( i18n("T&itle case"), grp );
- m_toggleCase=new QRadioButton( i18n("&Toggle case"), grp );
- m_sentenceCase=new QRadioButton( i18n("Sentence case"), grp );
- QWhatsThis::add( m_sentenceCase, i18n("Convert first letter of a sentence to uppercase."));
+ m_toggleCase=new TQRadioButton( i18n("&Toggle case"), grp );
+ m_sentenceCase=new TQRadioButton( i18n("Sentence case"), grp );
+ TQWhatsThis::add( m_sentenceCase, i18n("Convert first letter of a sentence to uppercase."));
m_upperCase->setChecked(true);
grp->setRadioButtonExclusive( TRUE );
diff --git a/lib/kotext/KoChangeCaseDia.h b/lib/kotext/KoChangeCaseDia.h
index 4d14be67..52b85e72 100644
--- a/lib/kotext/KoChangeCaseDia.h
+++ b/lib/kotext/KoChangeCaseDia.h
@@ -23,23 +23,24 @@
#include <kdialogbase.h>
#include <koffice_export.h>
-class QRadioButton;
-class QPushButton;
+class TQRadioButton;
+class TQPushButton;
class KOTEXT_EXPORT KoChangeCaseDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoChangeCaseDia( QWidget *parent, const char *name );
+ KoChangeCaseDia( TQWidget *tqparent, const char *name );
enum TypeOfCase { UpperCase =0, LowerCase=1, TitleCase=2, ToggleCase=3, SentenceCase=4};
TypeOfCase getTypeOfCase();
protected:
- QRadioButton *m_upperCase;
- QRadioButton *m_titleCase;
- QRadioButton *m_lowerCase;
- QRadioButton *m_toggleCase;
- QRadioButton *m_sentenceCase;
+ TQRadioButton *m_upperCase;
+ TQRadioButton *m_titleCase;
+ TQRadioButton *m_lowerCase;
+ TQRadioButton *m_toggleCase;
+ TQRadioButton *m_sentenceCase;
};
diff --git a/lib/kotext/KoCommentDia.cpp b/lib/kotext/KoCommentDia.cpp
index 7e0570c0..1e264012 100644
--- a/lib/kotext/KoCommentDia.cpp
+++ b/lib/kotext/KoCommentDia.cpp
@@ -18,35 +18,35 @@
*/
#include <klocale.h>
-#include <qvbox.h>
-#include <qmultilineedit.h>
+#include <tqvbox.h>
+#include <tqmultilineedit.h>
#include "KoCommentDia.h"
-#include <qlayout.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
#include <kglobal.h>
-#include <qdatetime.h>
-#include <qlabel.h>
+#include <tqdatetime.h>
+#include <tqlabel.h>
#include <kdebug.h>
-KoCommentDia::KoCommentDia( QWidget *parent, const QString &_note, const QString & _authorName, const QString &_createNote, const char *name )
- : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
+KoCommentDia::KoCommentDia( TQWidget *tqparent, const TQString &_note, const TQString & _authorName, const TQString &_createNote, const char *name )
+ : KDialogBase( tqparent, name , true, "", Ok|Cancel, Ok, true )
{
setCaption( i18n("Edit Comment") );
authorName = _authorName;
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
kdDebug()<<"_createNote :"<<_createNote<<endl;
if ( !_createNote.isEmpty() )
- new QLabel( _createNote, page );
+ new TQLabel( _createNote, page );
- m_multiLine = new QMultiLineEdit( page );
+ m_multiLine = new TQMultiLineEdit( page );
m_multiLine->setText( _note );
m_multiLine->setFocus();
- pbAddAuthorName = new QPushButton(i18n("Add Author Name"),page);
+ pbAddAuthorName = new TQPushButton(i18n("Add Author Name"),page);
if ( authorName.isEmpty() )
pbAddAuthorName->setEnabled( false );
else
- connect (pbAddAuthorName, SIGNAL(clicked ()), this , SLOT(slotAddAuthorName()));
- connect ( m_multiLine , SIGNAL( textChanged()), this, SLOT( slotTextChanged( )));
+ connect (pbAddAuthorName, TQT_SIGNAL(clicked ()), this , TQT_SLOT(slotAddAuthorName()));
+ connect ( m_multiLine , TQT_SIGNAL( textChanged()), this, TQT_SLOT( slotTextChanged( )));
slotTextChanged( );
resize( 300,100 );
@@ -57,16 +57,16 @@ void KoCommentDia::slotTextChanged( )
enableButtonOK( !m_multiLine->text().isEmpty() );
}
-QString KoCommentDia::commentText()
+TQString KoCommentDia::commentText()
{
return m_multiLine->text();
}
void KoCommentDia::slotAddAuthorName()
{
- QString date = KGlobal::locale()->formatDate( QDate::currentDate() );
- QString time = KGlobal::locale()->formatTime( QTime::currentTime() );
- QString result = QString("--------%1 ,%2, %3------\n").arg(authorName).arg(date).arg(time);
+ TQString date = KGlobal::locale()->formatDate( TQDate::tqcurrentDate() );
+ TQString time = KGlobal::locale()->formatTime( TQTime::currentTime() );
+ TQString result = TQString("--------%1 ,%2, %3------\n").tqarg(authorName).tqarg(date).tqarg(time);
m_multiLine->insertLine( result, m_multiLine->numLines() );
}
diff --git a/lib/kotext/KoCommentDia.h b/lib/kotext/KoCommentDia.h
index f16c7c0a..a925e802 100644
--- a/lib/kotext/KoCommentDia.h
+++ b/lib/kotext/KoCommentDia.h
@@ -22,24 +22,25 @@
#include <kdialogbase.h>
#include <koffice_export.h>
-class QPushButton;
-class QMultiLineEdit;
+class TQPushButton;
+class TQMultiLineEdit;
class KOTEXT_EXPORT KoCommentDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCommentDia( QWidget *parent, const QString &_note=QString::null, const QString & _authorName=QString::null, const QString &_createNote=QString::null, const char *name=0L );
- QString commentText();
+ KoCommentDia( TQWidget *tqparent, const TQString &_note=TQString(), const TQString & _authorName=TQString(), const TQString &_createNote=TQString(), const char *name=0L );
+ TQString commentText();
private slots:
void slotAddAuthorName();
void slotTextChanged( );
protected:
- QMultiLineEdit *m_multiLine;
- QString authorName;
- QPushButton *pbAddAuthorName;
+ TQMultiLineEdit *m_multiLine;
+ TQString authorName;
+ TQPushButton *pbAddAuthorName;
};
#endif
diff --git a/lib/kotext/KoCompletionBase.ui b/lib/kotext/KoCompletionBase.ui
index 7fece619..97beae8c 100644
--- a/lib/kotext/KoCompletionBase.ui
+++ b/lib/kotext/KoCompletionBase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoCompletionBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>KoCompletionBase</cstring>
</property>
@@ -16,7 +16,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>cbAllowCompletion</cstring>
</property>
@@ -27,15 +27,15 @@
<string>Toggle autocompletion on and off: if this is checked then autocompletion will be enabled.</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout9</cstring>
+ <cstring>tqlayout9</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QListBox">
+ <widget class="TQListBox">
<property name="name">
<cstring>m_lbListCompletion</cstring>
</property>
@@ -43,15 +43,15 @@
<string>Suggestion list for autocompletion: contains all the words that will be autocompleted.</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout8</cstring>
+ <cstring>tqlayout8</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>pbAddCompletionEntry</cstring>
</property>
@@ -62,7 +62,7 @@
<string>By clicking this button you can add manually an individual word to the completion list.</string>
</property>
</widget>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>pbRemoveCompletionEntry</cstring>
</property>
@@ -83,7 +83,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>31</height>
@@ -94,7 +94,7 @@
</widget>
</hbox>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>cbAddCompletionWord</cstring>
</property>
@@ -105,7 +105,7 @@
<string>If this option is enabled, any word equal to or longer than the "Characters needed" typed in this document will automatically be added to the list of words used by the completion.</string>
</property>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>completionBox</cstring>
</property>
@@ -116,7 +116,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>cbShowToolTip</cstring>
</property>
@@ -127,15 +127,15 @@
<string>If this option is enabled, a tool tip box will appear when you type the beginning of a word that exists in the completion list. To complete the word, press the key you set to accept suggestions in the "Key to accept suggestion" drop-down list.</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout11</cstring>
+ <cstring>tqlayout11</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QSlider" row="1" column="1">
+ <widget class="TQSlider" row="1" column="1">
<property name="name">
<cstring>slider2</cstring>
</property>
@@ -165,7 +165,7 @@
This option is most important when Automatically add words to completion list is enabled.</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@@ -176,7 +176,7 @@ This option is most important when Automatically add words to completion list is
<cstring>slider1</cstring>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel3</cstring>
</property>
@@ -187,7 +187,7 @@ This option is most important when Automatically add words to completion list is
<cstring>slider2</cstring>
</property>
</widget>
- <widget class="QSpinBox" row="1" column="2">
+ <widget class="TQSpinBox" row="1" column="2">
<property name="name">
<cstring>m_maxNbWordCompletion</cstring>
</property>
@@ -205,7 +205,7 @@ This option is most important when Automatically add words to completion list is
This option is most important when Automatically add words to completion list is enabled.</string>
</property>
</widget>
- <widget class="QSlider" row="0" column="1">
+ <widget class="TQSlider" row="0" column="1">
<property name="name">
<cstring>slider1</cstring>
</property>
@@ -225,7 +225,7 @@ This option is most important when Automatically add words to completion list is
<string>Use this spinbox/slider combination to prevent automatically adding short words to the completion list. You can select any value from 5-100 and the words will need to be at least the number of characters set here to be added to the list.</string>
</property>
</widget>
- <widget class="QSpinBox" row="0" column="2">
+ <widget class="TQSpinBox" row="0" column="2">
<property name="name">
<cstring>m_minWordLength</cstring>
</property>
@@ -241,7 +241,7 @@ This option is most important when Automatically add words to completion list is
</widget>
</grid>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>cbAppendSpace</cstring>
</property>
@@ -252,15 +252,15 @@ This option is most important when Automatically add words to completion list is
<string>If checked, it adds a single space to the end of a word after autocompletion, this means it is not necessary to add the space manually for the next word.</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout10</cstring>
+ <cstring>tqlayout10</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -271,7 +271,7 @@ This option is most important when Automatically add words to completion list is
<cstring>m_completionKeyAction</cstring>
</property>
</widget>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<property name="name">
<cstring>m_completionKeyAction</cstring>
</property>
@@ -289,7 +289,7 @@ This option is most important when Automatically add words to completion list is
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>101</width>
<height>20</height>
@@ -300,15 +300,15 @@ This option is most important when Automatically add words to completion list is
</widget>
</vbox>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout5</cstring>
+ <cstring>tqlayout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>pbSaveCompletionEntry</cstring>
</property>
@@ -329,7 +329,7 @@ This option is most important when Automatically add words to completion list is
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>101</width>
<height>20</height>
@@ -366,5 +366,5 @@ This option is most important when Automatically add words to completion list is
<slot>setValue(int)</slot>
</connection>
</connections>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>
diff --git a/lib/kotext/KoCompletionDia.cpp b/lib/kotext/KoCompletionDia.cpp
index 0f4b4dd5..f2860cf1 100644
--- a/lib/kotext/KoCompletionDia.cpp
+++ b/lib/kotext/KoCompletionDia.cpp
@@ -25,23 +25,23 @@
#include <kcompletion.h>
#include <kconfig.h>
#include <kdebug.h>
-#include <qlayout.h>
-#include <qvbox.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qwhatsthis.h>
-
-KoCompletionDia::KoCompletionDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat )
- : KDialogBase( parent, name , true, i18n( "Completion" ), Ok|Cancel|User1,
+#include <tqlayout.h>
+#include <tqvbox.h>
+#include <tqcheckbox.h>
+#include <tqpushbutton.h>
+#include <tqspinbox.h>
+#include <tqcombobox.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+
+KoCompletionDia::KoCompletionDia( TQWidget *tqparent, const char *name, KoAutoFormat * autoFormat )
+ : KDialogBase( tqparent, name , true, i18n( "Completion" ), Ok|Cancel|User1,
Ok, true, KGuiItem( i18n( "&Reset" ), "undo" ) )
{
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
m_widget = new KoCompletion(page, autoFormat);
- m_widget->layout()->setMargin(0);
- connect( this, SIGNAL( user1Clicked() ), m_widget, SLOT(slotResetConf()));
+ m_widget->tqlayout()->setMargin(0);
+ connect( this, TQT_SIGNAL( user1Clicked() ), m_widget, TQT_SLOT(slotResetConf()));
setButtonWhatsThis(Ok,i18n("This will save your options."));
setButtonWhatsThis(Cancel,i18n("This will abort all changes."));
setButtonWhatsThis(User1,i18n("This will reset to the state after you clicked on the Make Default button."));
@@ -53,12 +53,12 @@ void KoCompletionDia::slotOk()
KDialogBase::slotOk();
}
-KoCompletion::KoCompletion(QWidget *parent, KoAutoFormat *autoFormat) : KoCompletionBase(parent),
+KoCompletion::KoCompletion(TQWidget *tqparent, KoAutoFormat *autoFormat) : KoCompletionBase(tqparent),
m_autoFormat( *autoFormat ),
m_docAutoFormat( autoFormat )
{
- connect(cbAllowCompletion, SIGNAL(toggled ( bool )), this, SLOT( changeButtonStatus()));
- QStringList lst;
+ connect(cbAllowCompletion, TQT_SIGNAL(toggled ( bool )), this, TQT_SLOT( changeButtontqStatus()));
+ TQStringList lst;
lst << i18n( "Enter" );
lst << i18n( "Tab" );
lst << i18n( "Space" );
@@ -66,18 +66,18 @@ KoCompletion::KoCompletion(QWidget *parent, KoAutoFormat *autoFormat) : KoComple
lst << i18n( "Right" );
m_completionKeyAction->insertStringList( lst );
- connect( m_lbListCompletion, SIGNAL( selected ( const QString & ) ), this, SLOT( slotCompletionWordSelected( const QString & )));
- connect( m_lbListCompletion, SIGNAL( highlighted ( const QString & ) ), this, SLOT( slotCompletionWordSelected( const QString & )));
+ connect( m_lbListCompletion, TQT_SIGNAL( selected ( const TQString & ) ), this, TQT_SLOT( slotCompletionWordSelected( const TQString & )));
+ connect( m_lbListCompletion, TQT_SIGNAL( highlighted ( const TQString & ) ), this, TQT_SLOT( slotCompletionWordSelected( const TQString & )));
- connect( pbAddCompletionEntry, SIGNAL( clicked() ), this, SLOT( slotAddCompletionEntry()));
- connect( pbRemoveCompletionEntry, SIGNAL( clicked() ), this, SLOT( slotRemoveCompletionEntry()));
- connect( pbSaveCompletionEntry, SIGNAL( clicked() ), this, SLOT( slotSaveCompletionEntry()));
+ connect( pbAddCompletionEntry, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddCompletionEntry()));
+ connect( pbRemoveCompletionEntry, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveCompletionEntry()));
+ connect( pbSaveCompletionEntry, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSaveCompletionEntry()));
slotResetConf(); // aka load config
- changeButtonStatus();
+ changeButtontqStatus();
}
-void KoCompletion::changeButtonStatus() {
+void KoCompletion::changeButtontqStatus() {
bool state = cbAllowCompletion->isChecked();
completionBox->setEnabled( state);
@@ -122,15 +122,15 @@ void KoCompletion::slotResetConf() {
default:
m_completionKeyAction->setCurrentItem( 0 );
}
- changeButtonStatus();
+ changeButtontqStatus();
}
void KoCompletion::slotAddCompletionEntry() {
bool ok;
- QString const newWord = KInputDialog::getText( i18n("Add Completion Entry"), i18n("Enter entry:"), QString::null, &ok, this ).lower();
+ TQString const newWord = KInputDialog::getText( i18n("Add Completion Entry"), i18n("Enter entry:"), TQString(), &ok, this ).lower();
if ( ok )
{
- if ( !m_listCompletion.contains( newWord ))
+ if ( !m_listCompletion.tqcontains( newWord ))
{
m_listCompletion.append( newWord );
m_lbListCompletion->insertItem( newWord );
@@ -142,7 +142,7 @@ void KoCompletion::slotAddCompletionEntry() {
}
void KoCompletion::slotRemoveCompletionEntry() {
- QString text = m_lbListCompletion->currentText();
+ TQString text = m_lbListCompletion->currentText();
if( !text.isEmpty() )
{
m_listCompletion.remove( text );
@@ -152,7 +152,7 @@ void KoCompletion::slotRemoveCompletionEntry() {
}
}
-void KoCompletion::slotCompletionWordSelected( const QString & word) {
+void KoCompletion::slotCompletionWordSelected( const TQString & word) {
pbRemoveCompletionEntry->setEnabled( !word.isEmpty() );
}
diff --git a/lib/kotext/KoCompletionDia.h b/lib/kotext/KoCompletionDia.h
index 7ce49b13..c29135aa 100644
--- a/lib/kotext/KoCompletionDia.h
+++ b/lib/kotext/KoCompletionDia.h
@@ -28,23 +28,24 @@
*/
class KoCompletion : public KoCompletionBase {
Q_OBJECT
+ TQ_OBJECT
public:
- KoCompletion(QWidget *parent, KoAutoFormat *autoFormat );
+ KoCompletion(TQWidget *tqparent, KoAutoFormat *autoFormat );
void saveSettings();
protected slots:
- void changeButtonStatus();
+ void changeButtontqStatus();
void slotResetConf();
void slotAddCompletionEntry();
void slotRemoveCompletionEntry();
- void slotCompletionWordSelected( const QString & );
+ void slotCompletionWordSelected( const TQString & );
void slotSaveCompletionEntry();
protected:
KoAutoFormat m_autoFormat; // The copy we're working on
KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
- QStringList m_listCompletion; // The copy of the completion items - don't use m_autoFormat.getCompletion()!
+ TQStringList m_listCompletion; // The copy of the completion items - don't use m_autoFormat.getCompletion()!
};
/**
@@ -52,9 +53,10 @@ protected:
*/
class KOTEXT_EXPORT KoCompletionDia : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- KoCompletionDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
+ KoCompletionDia( TQWidget *tqparent, const char *name, KoAutoFormat * autoFormat );
protected slots:
virtual void slotOk();
diff --git a/lib/kotext/KoComplexText.cpp b/lib/kotext/KoComplexText.cpp
index b955b332..41c10239 100644
--- a/lib/kotext/KoComplexText.cpp
+++ b/lib/kotext/KoComplexText.cpp
@@ -7,27 +7,27 @@
**
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
-** This file is part of the kernel module of the Qt GUI Toolkit.
+** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -36,11 +36,11 @@
**********************************************************************/
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
#include "KoRichText.h"
-//#include "qfontdata_p.h"
-#include "qfontmetrics.h"
-#include "qrect.h"
+//#include "tqfontdata_p.h"
+#include "tqfontmetrics.h"
+#include "tqrect.h"
#include <stdlib.h>
@@ -48,32 +48,32 @@
/* a small helper class used internally to resolve Bidi embedding levels.
Each line of text caches the embedding level at the start of the line for faster
- relayouting
+ retqlayouting
*/
-KoBidiContext::KoBidiContext( uchar l, QChar::Direction e, KoBidiContext *p, bool o )
+KoBidiContext::KoBidiContext( uchar l, TQChar::Direction e, KoBidiContext *p, bool o )
: level(l) , override(o), dir(e)
{
if ( p )
p->ref();
- parent = p;
+ tqparent = p;
count = 0;
}
KoBidiContext::~KoBidiContext()
{
- if( parent && parent->deref() )
- delete parent;
+ if( tqparent && tqparent->deref() )
+ delete tqparent;
}
-static QChar *shapeBuffer = 0;
-static int shapeBufSize = 0;
+static TQChar *tqshapeBuffer = 0;
+static int tqshapeBufSize = 0;
/*
Arabic shaping obeys a number of rules according to the joining classes (see Unicode book, section on
arabic).
- Each unicode char has a joining class (right, dual (left&right), center (joincausing) or transparent).
- transparent joining is not encoded in QChar::joining(), but applies to all combining marks and format marks.
+ Each tqunicode char has a joining class (right, dual (left&right), center (joincausing) or transparent).
+ transparent joining is not encoded in TQChar::joining(), but applies to all combining marks and format marks.
Right join-causing: dual + center
Left join-causing: dual + right + center
@@ -103,31 +103,31 @@ static int shapeBufSize = 0;
*/
/*
- Two small helper functions for arabic shaping. They get the next shape causing character on either
+ Two small helper functions for arabic shaping. They get the next tqshape causing character on either
side of the char in question. Implements rule R1.
leftChar() returns true if the char to the left is a left join-causing char
rightChar() returns true if the char to the right is a right join-causing char
*/
-static inline const QChar *prevChar( const QString &str, int pos )
+static inline const TQChar *prevChar( const TQString &str, int pos )
{
//kdDebug() << "leftChar: pos=" << pos << endl;
pos--;
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
while( pos > -1 ) {
if( !ch->isMark() )
return ch;
pos--;
ch--;
}
- return &QChar::replacement;
+ return &TQChar::tqreplacement;
}
-static inline const QChar *nextChar( const QString &str, int pos)
+static inline const TQChar *nextChar( const TQString &str, int pos)
{
pos++;
int len = str.length();
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
while( pos < len ) {
//kdDebug() << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << endl;
if( !ch->isMark() )
@@ -136,37 +136,37 @@ static inline const QChar *nextChar( const QString &str, int pos)
pos++;
ch++;
}
- return &QChar::replacement;
+ return &TQChar::tqreplacement;
}
-static inline bool prevVisualCharJoins( const QString &str, int pos)
+static inline bool prevVisualCharJoins( const TQString &str, int pos)
{
- return ( prevChar( str, pos )->joining() != QChar::OtherJoining );
+ return ( prevChar( str, pos )->joining() != TQChar::OtherJoining );
}
-static inline bool nextVisualCharJoins( const QString &str, int pos)
+static inline bool nextVisualCharJoins( const TQString &str, int pos)
{
- QChar::Joining join = nextChar( str, pos )->joining();
- return ( join == QChar::Dual || join == QChar::Center );
+ TQChar::Joining join = nextChar( str, pos )->joining();
+ return ( join == TQChar::Dual || join == TQChar::Center );
}
-KoComplexText::Shape KoComplexText::glyphVariant( const QString &str, int pos)
+KoComplexText::Shape KoComplexText::glyphVariant( const TQString &str, int pos)
{
// ignores L1 - L3, done in the codec
- QChar::Joining joining = str[pos].joining();
- //kdDebug() << "checking " << str[pos].unicode() << ", joining=" << joining << endl;
+ TQChar::Joining joining = str[pos].joining();
+ //kdDebug() << "checking " << str[pos].tqunicode() << ", joining=" << joining << endl;
switch ( joining ) {
- case QChar::OtherJoining:
- case QChar::Center:
- // these don't change shape
+ case TQChar::OtherJoining:
+ case TQChar::Center:
+ // these don't change tqshape
return XIsolated;
- case QChar::Right:
+ case TQChar::Right:
// only rule R2 applies
if( nextVisualCharJoins( str, pos ) )
return XFinal;
return XIsolated;
- case QChar::Dual:
+ case TQChar::Dual:
bool right = nextVisualCharJoins( str, pos );
bool left = prevVisualCharJoins( str, pos );
//kdDebug() << "dual: right=" << right << ", left=" << left << endl;
@@ -184,34 +184,34 @@ KoComplexText::Shape KoComplexText::glyphVariant( const QString &str, int pos)
/* and the same thing for logical ordering :)
*/
-static inline bool prevLogicalCharJoins( const QString &str, int pos)
+static inline bool prevLogicalCharJoins( const TQString &str, int pos)
{
- return ( nextChar( str, pos )->joining() != QChar::OtherJoining );
+ return ( nextChar( str, pos )->joining() != TQChar::OtherJoining );
}
-static inline bool nextLogicalCharJoins( const QString &str, int pos)
+static inline bool nextLogicalCharJoins( const TQString &str, int pos)
{
- QChar::Joining join = prevChar( str, pos )->joining();
- return ( join == QChar::Dual || join == QChar::Center );
+ TQChar::Joining join = prevChar( str, pos )->joining();
+ return ( join == TQChar::Dual || join == TQChar::Center );
}
-KoComplexText::Shape KoComplexText::glyphVariantLogical( const QString &str, int pos)
+KoComplexText::Shape KoComplexText::glyphVariantLogical( const TQString &str, int pos)
{
// ignores L1 - L3, ligatures are job of the codec
- QChar::Joining joining = str[pos].joining();
- //kdDebug() << "checking " << str[pos].unicode() << ", joining=" << joining << endl;
+ TQChar::Joining joining = str[pos].joining();
+ //kdDebug() << "checking " << str[pos].tqunicode() << ", joining=" << joining << endl;
switch ( joining ) {
- case QChar::OtherJoining:
- case QChar::Center:
- // these don't change shape
+ case TQChar::OtherJoining:
+ case TQChar::Center:
+ // these don't change tqshape
return XIsolated;
- case QChar::Right:
+ case TQChar::Right:
// only rule R2 applies
if( nextLogicalCharJoins( str, pos ) )
return XFinal;
return XIsolated;
- case QChar::Dual:
+ case TQChar::Dual:
bool right = nextLogicalCharJoins( str, pos );
bool left = prevLogicalCharJoins( str, pos );
//kdDebug() << "dual: right=" << right << ", left=" << left << endl;
@@ -229,11 +229,11 @@ KoComplexText::Shape KoComplexText::glyphVariantLogical( const QString &str, int
// -------------------------------------------------------------
-// The unicode to unicode shaping codec.
+// The tqunicode to tqunicode shaping codec.
// does only presentation forms B at the moment, but that should be enough for
// simple display
static const ushort arabicUnicodeMapping[256][2] = {
- // base of shaped forms, and number-1 of them ( 0 for non shaping,
+ // base of tqshaped forms, and number-1 of them ( 0 for non shaping,
// 1 for right binding and 3 for dual binding
{ 0x0600, 0 }, // 0x600
{ 0x0601, 0 }, // 0x601
@@ -355,7 +355,7 @@ static const ushort arabicUnicodeMapping[256][2] = {
{ 0x066e, 0 }, // 0x66e
{ 0x066f, 0 }, // 0x66f
- // ### some glyphs do not have shaped mappings in the presentation forms A.
+ // ### some glyphs do not have tqshaped mappings in the presentation forms A.
// these have the shaping set to 0 for the moment. Will have to find out better mappings for them.
{ 0x0670, 0 }, // 0x670
{ 0xfb50, 1 }, // 0x671 R Alef Wasla
@@ -512,7 +512,7 @@ static const ushort arabicUnicodeMapping[256][2] = {
};
-// this is a bit tricky. Alef always binds to the right, so the second parameter descibing the shape
+// this is a bit tricky. Alef always binds to the right, so the second parameter descibing the tqshape
// of the lam can be either initial of medial. So initial maps to the isolated form of the ligature,
// medial to the final form
static const ushort arabicUnicodeLamAlefMapping[6][4] = {
@@ -524,14 +524,14 @@ static const ushort arabicUnicodeLamAlefMapping[6][4] = {
{ 0xfffd, 0xfffd, 0xfefb, 0xfefc } // 0x627 R Alef
};
-static inline int getShape( const QChar * /* base */, uchar cell, int shape,
- const QFontMetrics * /* fm */ )
+static inline int getShape( const TQChar * /* base */, uchar cell, int tqshape,
+ const TQFontMetrics * /* fm */ )
{
- uint ch = arabicUnicodeMapping[cell][0] + shape;
+ uint ch = arabicUnicodeMapping[cell][0] + tqshape;
/*
- // we revert to the unshaped glyph in case the shaped version doesn't exist
+ // we revert to the untqshaped glyph in case the tqshaped version doesn't exist
if ( fm && !fm->inFont( ch ) ) {
- switch( shape ) {
+ switch( tqshape ) {
case KoComplexText::XIsolated:
break; // try base form
case KoComplexText::XFinal:
@@ -551,47 +551,47 @@ static inline int getShape( const QChar * /* base */, uchar cell, int shape,
return ch;
}
-QString KoComplexText::shapedString(const QString& uc, int from, int len, QPainter::TextDirection dir, const QFontMetrics *fm )
+TQString KoComplexText::tqshapedString(const TQString& uc, int from, int len, TQPainter::TextDirection dir, const TQFontMetrics *fm )
{
if( len < 0 )
len = uc.length() - from;
if( len == 0 ) {
- return QString::null;
+ return TQString();
}
// we have to ignore NSMs at the beginning and add at the end.
int num = uc.length() - from - len;
- const QChar *ch = uc.unicode() + from + len;
+ const TQChar *ch = uc.tqunicode() + from + len;
while ( num > 0 && ch->combiningClass() != 0 ) {
ch++;
num--;
len++;
}
- ch = uc.unicode() + from;
+ ch = uc.tqunicode() + from;
while ( len > 0 && ch->combiningClass() != 0 ) {
ch++;
len--;
from++;
}
- if ( len == 0 ) return QString::null;
-
- if( !shapeBuffer || len > shapeBufSize ) {
- if( shapeBuffer ) free( (void *) shapeBuffer );
- shapeBuffer = (QChar *) malloc( len*sizeof( QChar ) );
-// delete [] shapeBuffer;
-// shapeBuffer = new QChar[ len + 1];
- shapeBufSize = len;
+ if ( len == 0 ) return TQString();
+
+ if( !tqshapeBuffer || len > tqshapeBufSize ) {
+ if( tqshapeBuffer ) free( (void *) tqshapeBuffer );
+ tqshapeBuffer = (TQChar *) malloc( len*sizeof( TQChar ) );
+// delete [] tqshapeBuffer;
+// tqshapeBuffer = new TQChar[ len + 1];
+ tqshapeBufSize = len;
}
int lenOut = 0;
- QChar *data = shapeBuffer;
- if ( dir == QPainter::RTL )
+ TQChar *data = tqshapeBuffer;
+ if ( dir == TQPainter::RTL )
ch += len - 1;
for ( int i = 0; i < len; i++ ) {
uchar r = ch->row();
uchar c = ch->cell();
if ( r != 0x06 ) {
- if ( dir == QPainter::RTL && ch->mirrored() )
+ if ( dir == TQPainter::RTL && ch->mirrored() )
*data = ch->mirroredChar();
else
*data = *ch;
@@ -599,15 +599,15 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
lenOut++;
} else {
int pos = i + from;
- if ( dir == QPainter::RTL )
+ if ( dir == TQPainter::RTL )
pos = from + len - 1 - i;
- int shape = glyphVariantLogical( uc, pos );
- //kdDebug() << "mapping U+" << ch->unicode() << " to shape " << shape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][shape] << endl;
+ int tqshape = glyphVariantLogical( uc, pos );
+ //kdDebug() << "mapping U+" << ch->tqunicode() << " to tqshape " << tqshape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][tqshape] << endl;
// take care of lam-alef ligatures (lam right of alef)
ushort map;
switch ( c ) {
case 0x44: { // lam
- const QChar *pch = nextChar( uc, pos );
+ const TQChar *pch = nextChar( uc, pos );
if ( pch->row() == 0x06 ) {
switch ( pch->cell() ) {
case 0x22:
@@ -615,7 +615,7 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
case 0x25:
case 0x27:
//kdDebug() << " lam of lam-alef ligature" << endl;
- map = arabicUnicodeLamAlefMapping[pch->cell() - 0x22][shape];
+ map = arabicUnicodeLamAlefMapping[pch->cell() - 0x22][tqshape];
goto next;
default:
break;
@@ -627,7 +627,7 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
case 0x23: // alef with hamza above
case 0x25: // alef with hamza below
case 0x27: // alef
- if ( prevChar( uc, pos )->unicode() == 0x0644 ) {
+ if ( prevChar( uc, pos )->tqunicode() == 0x0644 ) {
// have a lam alef ligature
//kdDebug() << " alef of lam-alef ligature" << endl;
goto skip;
@@ -635,40 +635,40 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
default:
break;
}
- map = getShape( ch, c, shape, fm );
+ map = getShape( ch, c, tqshape, fm );
next:
*data = map;
data++;
lenOut++;
}
skip:
- if ( dir == QPainter::RTL )
+ if ( dir == TQPainter::RTL )
ch--;
else
ch++;
}
- if ( dir == QPainter::Auto && !uc.simpleText() ) {
- return bidiReorderString( QConstString( shapeBuffer, lenOut ).string() );
+ if ( dir == TQPainter::Auto && !uc.simpleText() ) {
+ return bidiReorderString( TQConstString( tqshapeBuffer, lenOut ).string() );
}
- if ( dir == QPainter::RTL ) {
+ if ( dir == TQPainter::RTL ) {
// reverses the non spacing marks to be again after the base char
- QChar *s = shapeBuffer;
+ TQChar *s = tqshapeBuffer;
int i = 0;
while ( i < lenOut ) {
if ( s->combiningClass() != 0 ) {
// non spacing marks
int clen = 1;
- QChar *ch = s;
+ TQChar *ch = s;
do {
ch++;
clen++;
} while ( ch->combiningClass() != 0 );
int j = 0;
- QChar *cp = s;
+ TQChar *cp = s;
while ( j < clen/2 ) {
- QChar tmp = *cp;
+ TQChar tmp = *cp;
*cp = *ch;
*ch = tmp;
cp++;
@@ -684,28 +684,28 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
}
}
- return QConstString( shapeBuffer, lenOut ).string();
+ return TQConstString( tqshapeBuffer, lenOut ).string();
}
-QChar KoComplexText::shapedCharacter( const QString &str, int pos, const QFontMetrics *fm )
+TQChar KoComplexText::tqshapedCharacter( const TQString &str, int pos, const TQFontMetrics *fm )
{
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
if ( ch->row() != 0x06 )
return *ch;
else {
- int shape = glyphVariantLogical( str, pos );
- //kdDebug() << "mapping U+" << ch->unicode() << " to shape " << shape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][shape] << endl;
+ int tqshape = glyphVariantLogical( str, pos );
+ //kdDebug() << "mapping U+" << ch->tqunicode() << " to tqshape " << tqshape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][tqshape] << endl;
// lam aleph ligatures
switch ( ch->cell() ) {
case 0x44: { // lam
- const QChar *nch = nextChar( str, pos );
+ const TQChar *nch = nextChar( str, pos );
if ( nch->row() == 0x06 ) {
switch ( nch->cell() ) {
case 0x22:
case 0x23:
case 0x25:
case 0x27:
- return QChar(arabicUnicodeLamAlefMapping[nch->cell() - 0x22][shape]);
+ return TQChar(arabicUnicodeLamAlefMapping[nch->cell() - 0x22][tqshape]);
default:
break;
}
@@ -716,20 +716,20 @@ QChar KoComplexText::shapedCharacter( const QString &str, int pos, const QFontMe
case 0x23: // alef with hamza above
case 0x25: // alef with hamza below
case 0x27: // alef
- if ( prevChar( str, pos )->unicode() == 0x0644 )
+ if ( prevChar( str, pos )->tqunicode() == 0x0644 )
// have a lam alef ligature
- return QChar(0);
+ return TQChar(0);
default:
break;
}
- return QChar( getShape( ch, ch->cell(), shape, fm ) );
+ return TQChar( getShape( ch, ch->cell(), tqshape, fm ) );
}
}
-// Avoid using QFontPrivate, to which we don't have access. We don't use positionMarks() anyway
+// Avoid using TQFontPrivate, to which we don't have access. We don't use positionMarks() anyway
#if 0
-QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
- int pos, QRect *boundingRect )
+TQPointArray KoComplexText::positionMarks( TQFontPrivate *f, const TQString &str,
+ int pos, TQRect *boundingRect )
{
int len = str.length();
int nmarks = 0;
@@ -737,23 +737,23 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
nmarks++;
if ( !nmarks )
- return QPointArray();
+ return TQPointArray();
- QChar baseChar = KoComplexText::shapedCharacter( str, pos );
- QRect baseRect = f->boundingRect( baseChar );
+ TQChar baseChar = KoComplexText::tqshapedCharacter( str, pos );
+ TQRect baseRect = f->boundingRect( baseChar );
int baseOffset = f->textWidth( str, pos, 1 );
//kdDebug() << "base char: bounding rect at " << baseRect.x() << "/" << baseRect.y() << " (" << baseRect.width() << "/" << baseRect.height() << ")" << endl;
int offset = f->actual.pixelSize / 10 + 1;
//kdDebug() << "offset = " << offset << endl;
- QPointArray pa( nmarks );
+ TQPointArray pa( nmarks );
int i;
unsigned char lastCmb = 0;
- QRect attachmentRect;
+ TQRect attachmentRect;
if ( boundingRect )
*boundingRect = baseRect;
for( i = 0; i < nmarks; i++ ) {
- QChar mark = str[pos+i+1];
+ TQChar mark = str[pos+i+1];
unsigned char cmb = mark.combiningClass();
if ( cmb < 200 ) {
// fixed position classes. We approximate by mapping to one of the others.
@@ -766,19 +766,19 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
if ( (cmb >= 10 && cmb <= 18) ||
cmb == 20 || cmb == 22 ||
cmb == 29 || cmb == 32 )
- cmb = QChar::Combining_Below;
+ cmb = TQChar::Combining_Below;
// above
else if ( cmb == 23 || cmb == 27 || cmb == 28 ||
cmb == 30 || cmb == 31 || (cmb >= 33 && cmb <= 36 ) )
- cmb = QChar::Combining_Above;
+ cmb = TQChar::Combining_Above;
//below-right
else if ( cmb == 103 )
- cmb = QChar::Combining_BelowRight;
+ cmb = TQChar::Combining_BelowRight;
// above-right
else if ( cmb == 24 || cmb == 107 )
- cmb = QChar::Combining_AboveRight;
+ cmb = TQChar::Combining_AboveRight;
else if ( cmb == 25 )
- cmb = QChar::Combining_AboveLeft;
+ cmb = TQChar::Combining_AboveLeft;
// fixed:
// 19 21
@@ -790,61 +790,61 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
attachmentRect = baseRect;
}
- QPoint p;
- QRect markRect = f->boundingRect( mark );
+ TQPoint p;
+ TQRect markRect = f->boundingRect( mark );
switch( cmb ) {
- case QChar::Combining_DoubleBelow:
+ case TQChar::Combining_DoubleBelow:
// ### wrong in rtl context!
- case QChar::Combining_BelowLeft:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowLeftAttached:
+ case TQChar::Combining_BelowLeft:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowLeftAttached:
p += attachmentRect.bottomLeft() - markRect.topLeft();
break;
- case QChar::Combining_Below:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowAttached:
+ case TQChar::Combining_Below:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowAttached:
p += attachmentRect.bottomLeft() - markRect.topLeft();
- p += QPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
+ p += TQPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
break;
- case QChar::Combining_BelowRight:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowRightAttached:
+ case TQChar::Combining_BelowRight:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowRightAttached:
p += attachmentRect.bottomRight() - markRect.topRight();
break;
- case QChar::Combining_Left:
- p += QPoint( -offset, 0 );
- case QChar::Combining_LeftAttached:
+ case TQChar::Combining_Left:
+ p += TQPoint( -offset, 0 );
+ case TQChar::Combining_LeftAttached:
break;
- case QChar::Combining_Right:
- p += QPoint( offset, 0 );
- case QChar::Combining_RightAttached:
+ case TQChar::Combining_Right:
+ p += TQPoint( offset, 0 );
+ case TQChar::Combining_RightAttached:
break;
- case QChar::Combining_DoubleAbove:
+ case TQChar::Combining_DoubleAbove:
// ### wrong in RTL context!
- case QChar::Combining_AboveLeft:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveLeftAttached:
+ case TQChar::Combining_AboveLeft:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveLeftAttached:
p += attachmentRect.topLeft() - markRect.bottomLeft();
break;
- case QChar::Combining_Above:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveAttached:
+ case TQChar::Combining_Above:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveAttached:
p += attachmentRect.topLeft() - markRect.bottomLeft();
- p += QPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
+ p += TQPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
break;
- case QChar::Combining_AboveRight:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveRightAttached:
+ case TQChar::Combining_AboveRight:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveRightAttached:
p += attachmentRect.topRight() - markRect.bottomRight();
break;
- case QChar::Combining_IotaSubscript:
+ case TQChar::Combining_IotaSubscript:
default:
break;
}
- //kdDebug() << "char=" << mark.unicode() << " combiningClass = " << cmb << " offset=" << p.x() << "/" << p.y() << endl;
+ //kdDebug() << "char=" << mark.tqunicode() << " combiningClass = " << cmb << " offset=" << p.x() << "/" << p.y() << endl;
markRect.moveBy( p.x(), p.y() );
- p += QPoint( -baseOffset, 0 );
+ p += TQPoint( -baseOffset, 0 );
attachmentRect |= markRect;
if ( boundingRect )
*boundingRect |= markRect;
@@ -860,23 +860,23 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
#include <iostream>
#endif
-static QChar::Direction basicDirection(const QString &str, int start = 0)
+static TQChar::Direction basicDirection(const TQString &str, int start = 0)
{
int len = str.length();
int pos = start > len ? len -1 : start;
- const QChar *uc = str.unicode() + pos;
+ const TQChar *uc = str.tqunicode() + pos;
while( pos < len ) {
switch( uc->direction() )
{
- case QChar::DirL:
- case QChar::DirLRO:
- case QChar::DirLRE:
- return QChar::DirL;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirRLO:
- case QChar::DirRLE:
- return QChar::DirR;
+ case TQChar::DirL:
+ case TQChar::DirLRO:
+ case TQChar::DirLRE:
+ return TQChar::DirL;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirRLO:
+ case TQChar::DirRLE:
+ return TQChar::DirR;
default:
break;
}
@@ -885,18 +885,18 @@ static QChar::Direction basicDirection(const QString &str, int start = 0)
}
if ( start != 0 )
return basicDirection( str );
- return QChar::DirL;
+ return TQChar::DirL;
}
// transforms one line of the paragraph to visual order
// the caller is responisble to delete the returned list of KoTextRuns.
-QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, const QString &text, int start, int len,
- QChar::Direction basicDir )
+TQPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, const TQString &text, int start, int len,
+ TQChar::Direction basicDir )
{
int last = start + len - 1;
//printf("doing BiDi reordering from %d to %d!\n", start, last);
- QPtrList<KoTextRun> *runs = new QPtrList<KoTextRun>;
+ TQPtrList<KoTextRun> *runs = new TQPtrList<KoTextRun>;
runs->setAutoDelete(TRUE);
KoBidiContext *context = control->context;
@@ -904,31 +904,31 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// first line
//if( start != 0 )
// kdDebug() << "bidiReorderLine::internal error" << endl;
- if( basicDir == QChar::DirR || (basicDir == QChar::DirON && text.isRightToLeft() ) ) {
- context = new KoBidiContext( 1, QChar::DirR );
- control->status.last = QChar::DirR;
+ if( basicDir == TQChar::DirR || (basicDir == TQChar::DirON && text.isRightToLeft() ) ) {
+ context = new KoBidiContext( 1, TQChar::DirR );
+ control->status.last = TQChar::DirR;
} else {
- context = new KoBidiContext( 0, QChar::DirL );
- control->status.last = QChar::DirL;
+ context = new KoBidiContext( 0, TQChar::DirL );
+ control->status.last = TQChar::DirL;
}
}
- KoBidiStatus status = control->status;
- QChar::Direction dir = QChar::DirON;
+ KoBiditqStatus status = control->status;
+ TQChar::Direction dir = TQChar::DirON;
int sor = start;
int eor = start;
int current = start;
while(current <= last) {
- QChar::Direction dirCurrent;
+ TQChar::Direction dirCurrent;
if(current == (int)text.length()) {
KoBidiContext *c = context;
- while ( c->parent )
- c = c->parent;
+ while ( c->tqparent )
+ c = c->tqparent;
dirCurrent = c->dir;
} else if ( current == last ) {
- dirCurrent = ( basicDir != QChar::DirON ? basicDir : basicDirection( text, current ) );
+ dirCurrent = ( basicDir != TQChar::DirON ? basicDir : basicDirection( text, current ) );
} else
dirCurrent = text.at(current).direction();
@@ -940,7 +940,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
switch(dirCurrent) {
// embedding and overrides (X1-X9 in the BiDi specs)
- case QChar::DirRLE:
+ case TQChar::DirRLE:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -949,14 +949,14 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level++;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirR, context);
- status.last = QChar::DirR;
- status.lastStrong = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirR, context);
+ status.last = TQChar::DirR;
+ status.lastStrong = TQChar::DirR;
}
break;
}
- case QChar::DirLRE:
+ case TQChar::DirLRE:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -965,14 +965,14 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level += 2;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirL, context);
- status.last = QChar::DirL;
- status.lastStrong = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirL, context);
+ status.last = TQChar::DirL;
+ status.lastStrong = TQChar::DirL;
}
break;
}
- case QChar::DirRLO:
+ case TQChar::DirRLO:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -981,15 +981,15 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level++;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirR, context, TRUE);
- dir = QChar::DirR;
- status.last = QChar::DirR;
- status.lastStrong = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirR, context, TRUE);
+ dir = TQChar::DirR;
+ status.last = TQChar::DirR;
+ status.lastStrong = TQChar::DirR;
}
break;
}
- case QChar::DirLRO:
+ case TQChar::DirLRO:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -998,122 +998,122 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level += 2;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirL, context, TRUE);
- dir = QChar::DirL;
- status.last = QChar::DirL;
- status.lastStrong = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirL, context, TRUE);
+ dir = TQChar::DirL;
+ status.last = TQChar::DirL;
+ status.lastStrong = TQChar::DirL;
}
break;
}
- case QChar::DirPDF:
+ case TQChar::DirPDF:
{
- KoBidiContext *c = context->parent;
+ KoBidiContext *c = context->tqparent;
if(c) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
status.last = context->dir;
if( context->deref() ) delete context;
context = c;
if(context->override)
dir = context->dir;
else
- dir = QChar::DirON;
+ dir = TQChar::DirON;
status.lastStrong = context->dir;
}
break;
}
// strong types
- case QChar::DirL:
- if(dir == QChar::DirON)
- dir = QChar::DirL;
+ case TQChar::DirL:
+ if(dir == TQChar::DirON)
+ dir = TQChar::DirL;
switch(status.last)
{
- case QChar::DirL:
- eor = current; status.eor = QChar::DirL; break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirL:
+ eor = current; status.eor = TQChar::DirL; break;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirCS:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(dir != QChar::DirL) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirCS:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(dir != TQChar::DirL) {
//last stuff takes embedding dir
- if( context->dir == QChar::DirR ) {
- if(status.eor != QChar::DirR) {
+ if( context->dir == TQChar::DirR ) {
+ if(status.eor != TQChar::DirR) {
// AN or EN
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
}
else
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
} else {
- if(status.eor != QChar::DirL) {
+ if(status.eor != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirL;
} else {
- eor = current; status.eor = QChar::DirL; break;
+ eor = current; status.eor = TQChar::DirL; break;
}
}
} else {
- eor = current; status.eor = QChar::DirL;
+ eor = current; status.eor = TQChar::DirL;
}
default:
break;
}
- status.lastStrong = QChar::DirL;
+ status.lastStrong = TQChar::DirL;
break;
- case QChar::DirAL:
- case QChar::DirR:
- if(dir == QChar::DirON) dir = QChar::DirR;
+ case TQChar::DirAL:
+ case TQChar::DirR:
+ if(dir == TQChar::DirON) dir = TQChar::DirR;
switch(status.last)
{
- case QChar::DirR:
- case QChar::DirAL:
- eor = current; status.eor = QChar::DirR; break;
- case QChar::DirL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ eor = current; status.eor = TQChar::DirR; break;
+ case TQChar::DirL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirCS:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if( status.eor != QChar::DirR && status.eor != QChar::DirAL ) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirCS:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if( status.eor != TQChar::DirR && status.eor != TQChar::DirAL ) {
//last stuff takes embedding dir
- if(context->dir == QChar::DirR || status.lastStrong == QChar::DirR) {
+ if(context->dir == TQChar::DirR || status.lastStrong == TQChar::DirR) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
eor = current;
} else {
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
}
} else {
- eor = current; status.eor = QChar::DirR;
+ eor = current; status.eor = TQChar::DirR;
}
default:
break;
@@ -1123,68 +1123,68 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// weak types:
- case QChar::DirNSM:
+ case TQChar::DirNSM:
// ### if @sor, set dir to dirSor
break;
- case QChar::DirEN:
- if(status.lastStrong != QChar::DirAL) {
+ case TQChar::DirEN:
+ if(status.lastStrong != TQChar::DirAL) {
// if last strong was AL change EN to AL
- if(dir == QChar::DirON) {
- if(status.lastStrong == QChar::DirL)
- dir = QChar::DirL;
+ if(dir == TQChar::DirON) {
+ if(status.lastStrong == TQChar::DirL)
+ dir = TQChar::DirL;
else
- dir = QChar::DirAN;
+ dir = TQChar::DirAN;
}
switch(status.last)
{
- case QChar::DirET:
- if ( status.lastStrong == QChar::DirR || status.lastStrong == QChar::DirAL ) {
+ case TQChar::DirET:
+ if ( status.lastStrong == TQChar::DirR || status.lastStrong == TQChar::DirAL ) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
}
// fall through
- case QChar::DirEN:
- case QChar::DirL:
+ case TQChar::DirEN:
+ case TQChar::DirL:
eor = current;
status.eor = dirCurrent;
break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirAN:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; status.eor = QChar::DirEN;
- dir = QChar::DirAN; break;
- case QChar::DirES:
- case QChar::DirCS:
- if(status.eor == QChar::DirEN || dir == QChar::DirAN) {
+ ++eor; sor = eor; status.eor = TQChar::DirEN;
+ dir = TQChar::DirAN; break;
+ case TQChar::DirES:
+ case TQChar::DirCS:
+ if(status.eor == TQChar::DirEN || dir == TQChar::DirAN) {
eor = current; break;
}
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(status.eor == QChar::DirR) {
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(status.eor == TQChar::DirR) {
// neutrals go to R
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirEN;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirEN;
+ dir = TQChar::DirAN;
}
- else if( status.eor == QChar::DirL ||
- (status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
+ else if( status.eor == TQChar::DirL ||
+ (status.eor == TQChar::DirEN && status.lastStrong == TQChar::DirL)) {
eor = current; status.eor = dirCurrent;
} else {
// numbers on both sides, neutrals get right to left direction
- if(dir != QChar::DirL) {
+ if(dir != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
eor = current - 1;
- dir = QChar::DirR;
+ dir = TQChar::DirR;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
} else {
eor = current; status.eor = dirCurrent;
}
@@ -1194,50 +1194,50 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
}
break;
}
- case QChar::DirAN:
- dirCurrent = QChar::DirAN;
- if(dir == QChar::DirON) dir = QChar::DirAN;
+ case TQChar::DirAN:
+ dirCurrent = TQChar::DirAN;
+ if(dir == TQChar::DirON) dir = TQChar::DirAN;
switch(status.last)
{
- case QChar::DirL:
- case QChar::DirAN:
- eor = current; status.eor = QChar::DirAN; break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
+ case TQChar::DirL:
+ case TQChar::DirAN:
+ eor = current; status.eor = TQChar::DirAN; break;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirCS:
- if(status.eor == QChar::DirAN) {
- eor = current; status.eor = QChar::DirR; break;
+ case TQChar::DirCS:
+ if(status.eor == TQChar::DirAN) {
+ eor = current; status.eor = TQChar::DirR; break;
}
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(status.eor == QChar::DirR) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(status.eor == TQChar::DirR) {
// neutrals go to R
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
- } else if( status.eor == QChar::DirL ||
- (status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
+ } else if( status.eor == TQChar::DirL ||
+ (status.eor == TQChar::DirEN && status.lastStrong == TQChar::DirL)) {
eor = current; status.eor = dirCurrent;
} else {
// numbers on both sides, neutrals get right to left direction
- if(dir != QChar::DirL) {
+ if(dir != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
eor = current - 1;
- dir = QChar::DirR;
+ dir = TQChar::DirR;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
} else {
eor = current; status.eor = dirCurrent;
}
@@ -1246,29 +1246,29 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
break;
}
break;
- case QChar::DirES:
- case QChar::DirCS:
+ case TQChar::DirES:
+ case TQChar::DirCS:
break;
- case QChar::DirET:
- if(status.last == QChar::DirEN) {
- dirCurrent = QChar::DirEN;
+ case TQChar::DirET:
+ if(status.last == TQChar::DirEN) {
+ dirCurrent = TQChar::DirEN;
eor = current; status.eor = dirCurrent;
break;
}
break;
// boundary neutrals should be ignored
- case QChar::DirBN:
+ case TQChar::DirBN:
break;
// neutrals
- case QChar::DirB:
+ case TQChar::DirB:
// ### what do we do with newline and paragraph separators that come to here?
break;
- case QChar::DirS:
+ case TQChar::DirS:
// ### implement rule L1
break;
- case QChar::DirWS:
- case QChar::DirON:
+ case TQChar::DirWS:
+ case TQChar::DirON:
break;
default:
break;
@@ -1281,27 +1281,27 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// set status.last as needed.
switch(dirCurrent)
{
- case QChar::DirET:
- case QChar::DirES:
- case QChar::DirCS:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
+ case TQChar::DirET:
+ case TQChar::DirES:
+ case TQChar::DirCS:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
switch(status.last)
{
- case QChar::DirL:
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirL:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
status.last = dirCurrent;
break;
default:
- status.last = QChar::DirON;
+ status.last = TQChar::DirON;
}
break;
- case QChar::DirNSM:
- case QChar::DirBN:
+ case TQChar::DirNSM:
+ case TQChar::DirBN:
// ignore these
break;
default:
@@ -1344,7 +1344,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
#ifdef BIDI_DEBUG
cout << "reorderLine: lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh << endl;
cout << "logical order is:" << endl;
- QPtrListIterator<KoTextRun> it2(*runs);
+ TQPtrListIterator<KoTextRun> it2(*runs);
KoTextRun *r2;
for ( ; (r2 = it2.current()); ++it2 )
cout << " " << r2 << " start=" << r2->start << " stop=" << r2->stop << " level=" << (uint)r2->level << endl;
@@ -1381,7 +1381,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
#ifdef BIDI_DEBUG
cout << "visual order is:" << endl;
- QPtrListIterator<KoTextRun> it3(*runs);
+ TQPtrListIterator<KoTextRun> it3(*runs);
KoTextRun *r3;
for ( ; (r3 = it3.current()); ++it3 )
{
@@ -1396,7 +1396,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
}
-QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /*basicDir*/ )
+TQString KoComplexText::bidiReorderString( const TQString &str, TQChar::Direction /*basicDir*/ )
{
// ### fix basic direction
@@ -1404,10 +1404,10 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
int lineStart = 0;
int lineEnd = 0;
int len = str.length();
- QString visual;
+ TQString visual;
visual.setUnicode( 0, len );
- QChar *vch = (QChar *)visual.unicode();
- const QChar *ch = str.unicode();
+ TQChar *vch = (TQChar *)visual.tqunicode();
+ const TQChar *ch = str.tqunicode();
while( lineStart < len ) {
lineEnd = lineStart;
while( *ch != '\n' && lineEnd < len ) {
@@ -1415,7 +1415,7 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
lineEnd++;
}
lineEnd++;
- QPtrList<KoTextRun> *runs = bidiReorderLine( &control, str, lineStart, lineEnd - lineStart );
+ TQPtrList<KoTextRun> *runs = bidiReorderLine( &control, str, lineStart, lineEnd - lineStart );
// reorder the content of the line, and output to visual
KoTextRun *r = runs->first();
@@ -1451,21 +1451,21 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
return visual;
}
-KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, QChar::Direction dir) {
+KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, TQChar::Direction dir) {
start = _start;
stop = _stop;
- if(dir == QChar::DirON) dir = context->dir;
+ if(dir == TQChar::DirON) dir = context->dir;
level = context->level;
// add level of run (cases I1 & I2)
if( level % 2 ) {
- if(dir == QChar::DirL || dir == QChar::DirAN)
+ if(dir == TQChar::DirL || dir == TQChar::DirAN)
level++;
} else {
- if( dir == QChar::DirR )
+ if( dir == TQChar::DirR )
level++;
- else if( dir == QChar::DirAN )
+ else if( dir == TQChar::DirAN )
level += 2;
}
#ifdef BIDI_DEBUG
@@ -1473,4 +1473,4 @@ KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, QChar::Direc
#endif
}
-#endif //QT_NO_COMPLEXTEXT
+#endif //TQT_NO_COMPLEXTEXT
diff --git a/lib/kotext/KoComplexText.h b/lib/kotext/KoComplexText.h
index 8349c66d..f4f4253f 100644
--- a/lib/kotext/KoComplexText.h
+++ b/lib/kotext/KoComplexText.h
@@ -7,27 +7,27 @@
**
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
-** This file is part of the kernel module of the Qt GUI Toolkit.
+** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -35,68 +35,68 @@
**
**********************************************************************/
-#ifndef QCOMPLEXTEXT_H
-#define QCOMPLEXTEXT_H
+#ifndef TQCOMPLEXTEXT_H
+#define TQCOMPLEXTEXT_H
//
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of Qt Remote Control. This header file may change from version to
+// This file is not part of the TQt API. It exists for the convenience
+// of TQt Remote Control. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
//
-#ifndef QT_H
-#include <qstring.h>
-#include <qpointarray.h>
-#include <qfont.h>
-#include <qpainter.h>
-#include <qptrlist.h>
-#include <qshared.h>
-#endif // QT_H
-
-#ifndef QT_NO_COMPLEXTEXT
-
-// bidi helper classes. Internal to Qt
-struct Q_EXPORT KoBidiStatus {
- KoBidiStatus() {
- eor = QChar::DirON;
- lastStrong = QChar::DirON;
- last = QChar:: DirON;
+#ifndef TQT_H
+#include <tqstring.h>
+#include <tqpointarray.h>
+#include <tqfont.h>
+#include <tqpainter.h>
+#include <tqptrlist.h>
+#include <tqshared.h>
+#endif // TQT_H
+
+#ifndef TQT_NO_COMPLEXTEXT
+
+// bidi helper classes. Internal to TQt
+struct TQ_EXPORT KoBiditqStatus {
+ KoBiditqStatus() {
+ eor = TQChar::DirON;
+ lastStrong = TQChar::DirON;
+ last = TQChar:: DirON;
}
- QChar::Direction eor;
- QChar::Direction lastStrong;
- QChar::Direction last;
+ TQChar::Direction eor;
+ TQChar::Direction lastStrong;
+ TQChar::Direction last;
};
-struct Q_EXPORT KoBidiContext : public QShared {
- // ### ref and deref parent?
- KoBidiContext( uchar level, QChar::Direction embedding, KoBidiContext *parent = 0, bool override = FALSE );
+struct TQ_EXPORT KoBidiContext : public TQShared {
+ // ### ref and deref tqparent?
+ KoBidiContext( uchar level, TQChar::Direction embedding, KoBidiContext *tqparent = 0, bool override = FALSE );
~KoBidiContext();
unsigned char level;
bool override : 1;
- QChar::Direction dir : 5;
+ TQChar::Direction dir : 5;
- KoBidiContext *parent;
+ KoBidiContext *tqparent;
};
-struct Q_EXPORT KoBidiControl {
+struct TQ_EXPORT KoBidiControl {
KoBidiControl() { context = 0; }
- KoBidiControl( KoBidiContext *c, KoBidiStatus s)
+ KoBidiControl( KoBidiContext *c, KoBiditqStatus s)
{ context = c; if( context ) context->ref(); status = s; }
~KoBidiControl() { if ( context && context->deref() ) delete context; }
void setContext( KoBidiContext *c ) { if ( context == c ) return; if ( context && context->deref() ) delete context; context = c; context->ref(); }
KoBidiContext *context;
- KoBidiStatus status;
+ KoBiditqStatus status;
};
-struct Q_EXPORT KoTextRun {
- KoTextRun(int _start, int _stop, KoBidiContext *context, QChar::Direction dir);
+struct TQ_EXPORT KoTextRun {
+ KoTextRun(int _start, int _stop, KoBidiContext *context, TQChar::Direction dir);
int start;
int stop;
@@ -104,7 +104,7 @@ struct Q_EXPORT KoTextRun {
uchar level;
};
-class Q_EXPORT KoComplexText {
+class TQ_EXPORT KoComplexText {
public:
enum Shape {
XIsolated,
@@ -112,20 +112,20 @@ public:
XInitial,
XMedial
};
- static Shape glyphVariant( const QString &str, int pos);
- static Shape glyphVariantLogical( const QString &str, int pos);
+ static Shape glyphVariant( const TQString &str, int pos);
+ static Shape glyphVariantLogical( const TQString &str, int pos);
- static QString shapedString( const QString &str, int from = 0, int len = -1, QPainter::TextDirection dir = QPainter::Auto, const QFontMetrics *fm = 0);
- static QChar shapedCharacter(const QString &str, int pos, const QFontMetrics *fm = 0);
+ static TQString tqshapedString( const TQString &str, int from = 0, int len = -1, TQPainter::TextDirection dir = TQPainter::Auto, const TQFontMetrics *fm = 0);
+ static TQChar tqshapedCharacter(const TQString &str, int pos, const TQFontMetrics *fm = 0);
// positions non spacing marks relative to the base character at position pos.
- //static QPointArray positionMarks( QFontPrivate *f, const QString &str, int pos, QRect *boundingRect = 0 );
+ //static TQPointArray positionMarks( TQFontPrivate *f, const TQString &str, int pos, TQRect *boundingRect = 0 );
- static QPtrList<KoTextRun> *bidiReorderLine( KoBidiControl *control, const QString &str, int start, int len,
- QChar::Direction basicDir = QChar::DirON );
- static QString bidiReorderString( const QString &str, QChar::Direction basicDir = QChar::DirON );
+ static TQPtrList<KoTextRun> *bidiReorderLine( KoBidiControl *control, const TQString &str, int start, int len,
+ TQChar::Direction basicDir = TQChar::DirON );
+ static TQString bidiReorderString( const TQString &str, TQChar::Direction basicDir = TQChar::DirON );
};
-#endif //QT_NO_COMPLEXTEXT
+#endif //TQT_NO_COMPLEXTEXT
#endif
diff --git a/lib/kotext/KoCreateStyleDia.cpp b/lib/kotext/KoCreateStyleDia.cpp
index e38be5f4..cf9130af 100644
--- a/lib/kotext/KoCreateStyleDia.cpp
+++ b/lib/kotext/KoCreateStyleDia.cpp
@@ -19,30 +19,30 @@
#include <klocale.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
#include "KoCreateStyleDia.h"
#include <kmessagebox.h>
-KoCreateStyleDia::KoCreateStyleDia( const QStringList & _list, QWidget *parent, const char *name )
- : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
+KoCreateStyleDia::KoCreateStyleDia( const TQStringList & _list, TQWidget *tqparent, const char *name )
+ : KDialogBase( tqparent, name , true, "", Ok|Cancel, Ok, true )
{
styleList=_list;
setCaption( i18n("Create New Style") );
- QVBox *page = makeVBoxMainWidget();
- new QLabel(i18n("Please specify a new style name:"), page);
- m_styleName = new QLineEdit( page );
- m_styleName->setMinimumWidth( m_styleName->sizeHint().width() * 3 );
+ TQVBox *page = makeVBoxMainWidget();
+ new TQLabel(i18n("Please specify a new style name:"), page);
+ m_styleName = new TQLineEdit( page );
+ m_styleName->setMinimumWidth( m_styleName->tqsizeHint().width() * 3 );
- connect( m_styleName, SIGNAL(textChanged ( const QString & )), this, SLOT(nameChanged( const QString &)));
+ connect( m_styleName, TQT_SIGNAL(textChanged ( const TQString & )), this, TQT_SLOT(nameChanged( const TQString &)));
m_styleName->setFocus();
enableButtonOK( false );
}
void KoCreateStyleDia::slotOk()
{
- if ( styleList.findIndex(m_styleName->text() ) != -1 )
+ if ( styleList.tqfindIndex(m_styleName->text() ) != -1 )
{
KMessageBox::error(this, i18n("Name already exists! Please choose another name"));
m_styleName->clear();
@@ -51,12 +51,12 @@ void KoCreateStyleDia::slotOk()
KDialogBase::slotOk();
}
-QString KoCreateStyleDia::nameOfNewStyle()const
+TQString KoCreateStyleDia::nameOfNewStyle()const
{
return m_styleName->text();
}
-void KoCreateStyleDia::nameChanged( const QString &text)
+void KoCreateStyleDia::nameChanged( const TQString &text)
{
enableButtonOK( !text.isEmpty() );
}
diff --git a/lib/kotext/KoCreateStyleDia.h b/lib/kotext/KoCreateStyleDia.h
index b7fb44af..b4c6a5c5 100644
--- a/lib/kotext/KoCreateStyleDia.h
+++ b/lib/kotext/KoCreateStyleDia.h
@@ -21,24 +21,25 @@
#define __KoCreateStyleDia__
#include <kdialogbase.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <koffice_export.h>
-class QLineEdit;
+class TQLineEdit;
class KOTEXT_EXPORT KoCreateStyleDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCreateStyleDia( const QStringList & _list, QWidget *parent, const char *name );
- QString nameOfNewStyle()const;
+ KoCreateStyleDia( const TQStringList & _list, TQWidget *tqparent, const char *name );
+ TQString nameOfNewStyle()const;
protected slots:
virtual void slotOk();
- void nameChanged( const QString &text);
+ void nameChanged( const TQString &text);
protected:
- QStringList styleList;
- QLineEdit *m_styleName;
+ TQStringList styleList;
+ TQLineEdit *m_styleName;
};
#endif
diff --git a/lib/kotext/KoCustomVariablesDia.cpp b/lib/kotext/KoCustomVariablesDia.cpp
index 32a99743..af709678 100644
--- a/lib/kotext/KoCustomVariablesDia.cpp
+++ b/lib/kotext/KoCustomVariablesDia.cpp
@@ -23,11 +23,11 @@
#include <klocale.h>
#include <kbuttonbox.h>
-#include <qcombobox.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qheader.h>
+#include <tqcombobox.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqheader.h>
#include <klineedit.h>
#include <kdebug.h>
@@ -37,20 +37,20 @@
*
******************************************************************/
-KoVariableNameDia::KoVariableNameDia( QWidget *parent )
- : KDialogBase( parent, "", TRUE,i18n( "Entry Name" ),Ok|Cancel )
+KoVariableNameDia::KoVariableNameDia( TQWidget *tqparent )
+ : KDialogBase( tqparent, "", TRUE,i18n( "Entry Name" ),Ok|Cancel )
{
init();
}
-KoVariableNameDia::KoVariableNameDia( QWidget *parent, const QPtrList<KoVariable>& vars )
- : KDialogBase( parent, "", TRUE, i18n( "Variable Name" ), Ok|Cancel )
+KoVariableNameDia::KoVariableNameDia( TQWidget *tqparent, const TQPtrList<KoVariable>& vars )
+ : KDialogBase( tqparent, "", TRUE, i18n( "Variable Name" ), Ok|Cancel )
{
init();
enableButtonOK(false);
- QPtrListIterator<KoVariable> it( vars );
+ TQPtrListIterator<KoVariable> it( vars );
for ( ; it.current() ; ++it ) {
KoVariable *var = it.current();
if ( var->type() == VT_CUSTOM )
@@ -63,30 +63,30 @@ void KoVariableNameDia::init()
{
back = makeVBoxMainWidget();
- QHBox *row1 = new QHBox( back );
+ TQHBox *row1 = new TQHBox( back );
row1->setSpacing( KDialog::spacingHint() );
- QLabel *l = new QLabel( i18n( "Name:" ), row1 );
- l->setFixedSize( l->sizeHint() );
- names = new QComboBox( TRUE, row1 );
+ TQLabel *l = new TQLabel( i18n( "Name:" ), row1 );
+ l->setFixedSize( l->tqsizeHint() );
+ names = new TQComboBox( TRUE, row1 );
names->setFocus();
- connect( names, SIGNAL( textChanged ( const QString & )),
- this, SLOT( textChanged ( const QString & )));
- connect( this, SIGNAL( okClicked() ),
- this, SLOT( accept() ) );
- connect( this, SIGNAL( cancelClicked() ),
- this, SLOT( reject() ) );
+ connect( names, TQT_SIGNAL( textChanged ( const TQString & )),
+ this, TQT_SLOT( textChanged ( const TQString & )));
+ connect( this, TQT_SIGNAL( okClicked() ),
+ this, TQT_SLOT( accept() ) );
+ connect( this, TQT_SIGNAL( cancelClicked() ),
+ this, TQT_SLOT( reject() ) );
enableButtonOK( !names->currentText().isEmpty() );
resize( 350, 100 );
}
-QString KoVariableNameDia::getName() const
+TQString KoVariableNameDia::getName() const
{
return names->currentText();
}
-void KoVariableNameDia::textChanged ( const QString &_text )
+void KoVariableNameDia::textChanged ( const TQString &_text )
{
enableButtonOK(!_text.isEmpty());
}
@@ -97,8 +97,8 @@ void KoVariableNameDia::textChanged ( const QString &_text )
*
******************************************************************/
-KoCustomVariablesListItem::KoCustomVariablesListItem( QListView *parent )
- : QListViewItem( parent )
+KoCustomVariablesListItem::KoCustomVariablesListItem( TQListView *tqparent )
+ : TQListViewItem( tqparent )
{
editWidget = new KLineEdit( listView()->viewport() );
listView()->addChild( editWidget );
@@ -106,11 +106,11 @@ KoCustomVariablesListItem::KoCustomVariablesListItem( QListView *parent )
void KoCustomVariablesListItem::setup()
{
- QListViewItem::setup();
- setHeight( QMAX( listView()->fontMetrics().height(),
- editWidget->sizeHint().height() ) );
- //if ( listView()->columnWidth( 1 ) < editWidget->sizeHint().width() )
- // listView()->setColumnWidth( 1, editWidget->sizeHint().width() );
+ TQListViewItem::setup();
+ setHeight( TQMAX( listView()->fontMetrics().height(),
+ editWidget->tqsizeHint().height() ) );
+ //if ( listView()->columnWidth( 1 ) < editWidget->tqsizeHint().width() )
+ // listView()->setColumnWidth( 1, editWidget->tqsizeHint().width() );
}
void KoCustomVariablesListItem::update()
@@ -135,21 +135,21 @@ KoCustomVariable *KoCustomVariablesListItem::getVariable() const
void KoCustomVariablesListItem::applyValue()
{
- QString newVal=editWidget->text();
+ TQString newVal=editWidget->text();
if(var->value()!=newVal)
var->setValue( newVal );
}
-int KoCustomVariablesListItem::width( const QFontMetrics & fm, const QListView *lv, int c ) const
+int KoCustomVariablesListItem::width( const TQFontMetrics & fm, const TQListView *lv, int c ) const
{
- // The text of the 2nd column isn't known to QListViewItem, only we know it
+ // The text of the 2nd column isn't known to TQListViewItem, only we know it
// (it's in our lineedit)
if ( c == 1 ) {
- QString val = editWidget->text();
+ TQString val = editWidget->text();
int w = fm.width( val );
return w;
} else
- return QListViewItem::width( fm, lv, c );
+ return TQListViewItem::width( fm, lv, c );
}
/******************************************************************
@@ -158,24 +158,24 @@ int KoCustomVariablesListItem::width( const QFontMetrics & fm, const QListView *
*
******************************************************************/
-KoCustomVariablesList::KoCustomVariablesList( QWidget *parent )
- : KListView( parent )
+KoCustomVariablesList::KoCustomVariablesList( TQWidget *tqparent )
+ : KListView( tqparent )
{
header()->setMovingEnabled( FALSE );
addColumn( i18n( "Variable" ) );
addColumn( i18n( "Value" ) );
- connect( header(), SIGNAL( sizeChange( int, int, int ) ),
- this, SLOT( columnSizeChange( int, int, int ) ) );
- connect( header(), SIGNAL( sectionClicked( int ) ),
- this, SLOT( sectionClicked( int ) ) );
+ connect( header(), TQT_SIGNAL( sizeChange( int, int, int ) ),
+ this, TQT_SLOT( columnSizeChange( int, int, int ) ) );
+ connect( header(), TQT_SIGNAL( sectionClicked( int ) ),
+ this, TQT_SLOT( sectionClicked( int ) ) );
- setResizeMode(QListView::LastColumn);
+ setResizeMode(TQListView::LastColumn);
setSorting( -1 );
}
void KoCustomVariablesList::setValues()
{
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
for ( ; it.current(); ++it )
( (KoCustomVariablesListItem *)it.current() )->applyValue();
}
@@ -193,7 +193,7 @@ void KoCustomVariablesList::sectionClicked( int )
void KoCustomVariablesList::updateItems()
{
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
for ( ; it.current(); ++it )
( (KoCustomVariablesListItem*)it.current() )->update();
}
@@ -204,21 +204,21 @@ void KoCustomVariablesList::updateItems()
*
******************************************************************/
-KoCustomVariablesDia::KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVariable> &variables )
- : KDialogBase( parent, "", TRUE,i18n( "Variable Value Editor" ), Ok|Cancel )
+KoCustomVariablesDia::KoCustomVariablesDia( TQWidget *tqparent, const TQPtrList<KoVariable> &variables )
+ : KDialogBase( tqparent, "", TRUE,i18n( "Variable Value Editor" ), Ok|Cancel )
{
back = makeVBoxMainWidget();
list = new KoCustomVariablesList( back );
- QStringList lst;
- QPtrListIterator<KoVariable> it( variables );
+ TQStringList lst;
+ TQPtrListIterator<KoVariable> it( variables );
for ( ; it.current() ; ++it ) {
KoVariable *var = it.current();
if ( var->type() == VT_CUSTOM ) {
KoCustomVariable *v = (KoCustomVariable*)var;
- if ( !lst.contains( v->name() ) ) {
+ if ( !lst.tqcontains( v->name() ) ) {
lst.append( v->name() );
KoCustomVariablesListItem *item = new KoCustomVariablesListItem( list );
item->setVariable( v );
@@ -227,10 +227,10 @@ KoCustomVariablesDia::KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVa
}
- connect( this, SIGNAL( okClicked() ),
- this, SLOT( slotOk() ) );
- connect( this, SIGNAL( cancelClicked() ),
- this, SLOT( reject() ) );
+ connect( this, TQT_SIGNAL( okClicked() ),
+ this, TQT_SLOT( slotOk() ) );
+ connect( this, TQT_SIGNAL( cancelClicked() ),
+ this, TQT_SLOT( reject() ) );
showButtonOK(lst.count()>0);
resize( 600, 400 );
@@ -248,28 +248,28 @@ void KoCustomVariablesDia::slotOk()
*
******************************************************************/
-KoCustomVarDialog::KoCustomVarDialog( QWidget *parent )
- : KDialogBase( parent, "", TRUE,i18n( "Add Variable" ), Ok|Cancel )
+KoCustomVarDialog::KoCustomVarDialog( TQWidget *tqparent )
+ : KDialogBase( tqparent, "", TRUE,i18n( "Add Variable" ), Ok|Cancel )
{
init();
m_name->setFocus();
- connect( this, SIGNAL( okClicked() ),
- this, SLOT( slotAddOk() ) );
- connect( this, SIGNAL( cancelClicked() ),
- this, SLOT( reject() ) );
+ connect( this, TQT_SIGNAL( okClicked() ),
+ this, TQT_SLOT( slotAddOk() ) );
+ connect( this, TQT_SIGNAL( cancelClicked() ),
+ this, TQT_SLOT( reject() ) );
- connect( m_name, SIGNAL( textChanged(const QString&) ),
- this, SLOT( slotTextChanged(const QString&) ) );
+ connect( m_name, TQT_SIGNAL( textChanged(const TQString&) ),
+ this, TQT_SLOT( slotTextChanged(const TQString&) ) );
enableButtonOK( false );
resize( 350, 100 );
}
// edit existing variable
-KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var )
- : KDialogBase( parent, "", TRUE,i18n( "Edit Variable" ), Ok|Cancel )
+KoCustomVarDialog::KoCustomVarDialog( TQWidget *tqparent, KoCustomVariable *var )
+ : KDialogBase( tqparent, "", TRUE,i18n( "Edit Variable" ), Ok|Cancel )
{
m_var = var;
init();
@@ -279,13 +279,13 @@ KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var )
m_value->setFocus();
- connect( this, SIGNAL( okClicked() ),
- this, SLOT( slotEditOk() ) );
- connect( this, SIGNAL( cancelClicked() ),
- this, SLOT( reject() ) );
+ connect( this, TQT_SIGNAL( okClicked() ),
+ this, TQT_SLOT( slotEditOk() ) );
+ connect( this, TQT_SIGNAL( cancelClicked() ),
+ this, TQT_SLOT( reject() ) );
- connect( m_value, SIGNAL( textChanged(const QString&) ),
- this, SLOT( slotTextChanged(const QString&) ) );
+ connect( m_value, TQT_SIGNAL( textChanged(const TQString&) ),
+ this, TQT_SLOT( slotTextChanged(const TQString&) ) );
enableButtonOK( true );
resize( 350, 100 );
@@ -294,16 +294,16 @@ KoCustomVarDialog::KoCustomVarDialog( QWidget *parent, KoCustomVariable *var )
void KoCustomVarDialog::init()
{
back = makeVBoxMainWidget();
- QHBox *row1 = new QHBox( back );
+ TQHBox *row1 = new TQHBox( back );
row1->setSpacing( KDialog::spacingHint() );
- QLabel *ln = new QLabel( i18n( "Name:" ), row1 );
- ln->setFixedSize( ln->sizeHint() );
+ TQLabel *ln = new TQLabel( i18n( "Name:" ), row1 );
+ ln->setFixedSize( ln->tqsizeHint() );
m_name = new KLineEdit( row1 );
- QHBox *row2 = new QHBox( back );
+ TQHBox *row2 = new TQHBox( back );
row2->setSpacing( KDialog::spacingHint() );
- QLabel *lv = new QLabel( i18n( "Value:" ), row2 );
- lv->setFixedSize( lv->sizeHint() );
+ TQLabel *lv = new TQLabel( i18n( "Value:" ), row2 );
+ lv->setFixedSize( lv->tqsizeHint() );
m_value = new KLineEdit( row2 );
}
@@ -317,20 +317,20 @@ void KoCustomVarDialog::slotEditOk()
accept();
}
-void KoCustomVarDialog::slotTextChanged(const QString&text)
+void KoCustomVarDialog::slotTextChanged(const TQString&text)
{
enableButtonOK( !text.isEmpty() );
}
-QString KoCustomVarDialog::name()
+TQString KoCustomVarDialog::name()
{
if ( m_name->text().isEmpty() )
- return QString( "No name" );
+ return TQString( "No name" );
return m_name->text();
}
-QString KoCustomVarDialog::value()
+TQString KoCustomVarDialog::value()
{
if ( m_value->text().isEmpty() )
- return QString( "No value" );
+ return TQString( "No value" );
return m_value->text();
}
diff --git a/lib/kotext/KoCustomVariablesDia.h b/lib/kotext/KoCustomVariablesDia.h
index 14d5dbf0..b5883ddb 100644
--- a/lib/kotext/KoCustomVariablesDia.h
+++ b/lib/kotext/KoCustomVariablesDia.h
@@ -23,15 +23,15 @@
#include "KoVariable.h"
#include <kdialogbase.h>
-#include <qptrlist.h>
-#include <qstring.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
#include <klistview.h>
#include <koffice_export.h>
-class QComboBox;
-class QVBox;
-class QResizeEvent;
+class TQComboBox;
+class TQVBox;
+class TQResizeEvent;
class KLineEdit;
-class QCloseEvent;
+class TQCloseEvent;
/******************************************************************
*
@@ -42,21 +42,22 @@ class QCloseEvent;
class KoVariableNameDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
// For KWMailMergeVariableInsertDia
- KoVariableNameDia( QWidget *parent );
+ KoVariableNameDia( TQWidget *tqparent );
// For kwview
- KoVariableNameDia( QWidget *parent, const QPtrList<KoVariable> &vars );
- QString getName() const;
+ KoVariableNameDia( TQWidget *tqparent, const TQPtrList<KoVariable> &vars );
+ TQString getName() const;
protected slots:
- void textChanged ( const QString &_text );
+ void textChanged ( const TQString &_text );
protected:
void init();
- QComboBox *names;
- QVBox *back;
+ TQComboBox *names;
+ TQVBox *back;
};
/**
@@ -64,16 +65,16 @@ protected:
* Used by KoCustomVariablesDia
* Represents an item in the listview, holding a lineedit to edit the value of the variable.
*/
-class KoCustomVariablesListItem : public QListViewItem
+class KoCustomVariablesListItem : public TQListViewItem
{
public:
- KoCustomVariablesListItem( QListView *parent );
+ KoCustomVariablesListItem( TQListView *tqparent );
void setVariable( KoCustomVariable *v );
KoCustomVariable *getVariable() const;
virtual void setup();
- virtual int width ( const QFontMetrics & fm, const QListView * lv, int c ) const;
+ virtual int width ( const TQFontMetrics & fm, const TQListView * lv, int c ) const;
void update();
// Gets the value from the lineedit and sets it into the variable
@@ -92,9 +93,10 @@ protected:
class KoCustomVariablesList : public KListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCustomVariablesList( QWidget *parent );
+ KoCustomVariablesList( TQWidget *tqparent );
void setValues();
void updateItems();
@@ -115,14 +117,15 @@ private:
class KOTEXT_EXPORT KoCustomVariablesDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCustomVariablesDia( QWidget *parent, const QPtrList<KoVariable> &variables );
+ KoCustomVariablesDia( TQWidget *tqparent, const TQPtrList<KoVariable> &variables );
protected slots:
void slotOk();
protected:
- QVBox *back;
+ TQVBox *back;
KoCustomVariablesList *list;
};
@@ -135,27 +138,28 @@ protected:
class KOTEXT_EXPORT KoCustomVarDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Add new variable
*/
- KoCustomVarDialog( QWidget *parent );
+ KoCustomVarDialog( TQWidget *tqparent );
/**
* Edit existing variable @p var
*/
- KoCustomVarDialog( QWidget *parent, KoCustomVariable *var );
+ KoCustomVarDialog( TQWidget *tqparent, KoCustomVariable *var );
- virtual QString name();
- virtual QString value();
+ virtual TQString name();
+ virtual TQString value();
protected slots:
void slotAddOk();
void slotEditOk();
- void slotTextChanged(const QString&);
+ void slotTextChanged(const TQString&);
protected:
- QVBox *back;
+ TQVBox *back;
KLineEdit *m_name;
KLineEdit *m_value;
diff --git a/lib/kotext/KoDecorationTab.cpp b/lib/kotext/KoDecorationTab.cpp
index 57837dbc..8fb82755 100644
--- a/lib/kotext/KoDecorationTab.cpp
+++ b/lib/kotext/KoDecorationTab.cpp
@@ -25,32 +25,32 @@
#include <knuminput.h>
#include <klocale.h>
-#include <qbuttongroup.h>
+#include <tqbuttongroup.h>
#include "KoDecorationTab.moc"
-KoDecorationTab::KoDecorationTab( QWidget* parent, const char* name, WFlags fl )
- : KoDecorationTabBase( parent, name, fl )
+KoDecorationTab::KoDecorationTab( TQWidget* tqparent, const char* name, WFlags fl )
+ : KoDecorationTabBase( tqparent, name, fl )
{
shadowDistanceKDoubleNumInput->setRange(0, 9, 0.5, false);
- connect( textKColorButton, SIGNAL( changed( const QColor& ) ), this, SIGNAL( fontColorChanged( const QColor& ) ) );
- connect( backgroundKColorButton, SIGNAL( changed( const QColor& ) ), this, SIGNAL( backgroundColorChanged( const QColor& ) ) );
- connect( shadowKColorButton, SIGNAL( changed( const QColor& ) ), this, SIGNAL( shadowColorChanged( const QColor& ) ) );
- connect( shadowDistanceKDoubleNumInput, SIGNAL( valueChanged( double ) ), this, SIGNAL( shadowDistanceChanged( double ) ) );
- connect( shadowDirectionButtonGroup, SIGNAL( clicked( int ) ), this, SIGNAL( shadowDirectionChanged( int ) ) );
+ connect( textKColorButton, TQT_SIGNAL( changed( const TQColor& ) ), this, TQT_SIGNAL( fontColorChanged( const TQColor& ) ) );
+ connect( backgroundKColorButton, TQT_SIGNAL( changed( const TQColor& ) ), this, TQT_SIGNAL( backgroundColorChanged( const TQColor& ) ) );
+ connect( shadowKColorButton, TQT_SIGNAL( changed( const TQColor& ) ), this, TQT_SIGNAL( shadowColorChanged( const TQColor& ) ) );
+ connect( shadowDistanceKDoubleNumInput, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SIGNAL( shadowDistanceChanged( double ) ) );
+ connect( shadowDirectionButtonGroup, TQT_SIGNAL( clicked( int ) ), this, TQT_SIGNAL( shadowDirectionChanged( int ) ) );
}
KoDecorationTab::~KoDecorationTab()
{
}
-QColor KoDecorationTab::getTextColor() const
+TQColor KoDecorationTab::getTextColor() const
{
return textKColorButton->color();
}
-QColor KoDecorationTab::getBackgroundColor() const
+TQColor KoDecorationTab::getBackgroundColor() const
{
return backgroundKColorButton->color();
}
@@ -69,22 +69,22 @@ double KoDecorationTab::getShadowDistanceY() const
return shadowDistanceY( sd, dist );
}
-QColor KoDecorationTab::getShadowColor() const
+TQColor KoDecorationTab::getShadowColor() const
{
return shadowKColorButton->color();
}
-void KoDecorationTab::setTextColor( const QColor &color )
+void KoDecorationTab::setTextColor( const TQColor &color )
{
textKColorButton->setColor( color );
}
-void KoDecorationTab::setBackgroundColor( const QColor &color )
+void KoDecorationTab::setBackgroundColor( const TQColor &color )
{
backgroundKColorButton->setColor( color );
}
-void KoDecorationTab::setShadow( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor )
+void KoDecorationTab::setShadow( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor )
{
short int sd = SD_RIGHT_UP;
double dist = 0.0;
@@ -104,7 +104,7 @@ void KoDecorationTab::setShadow( double shadowDistanceX, double shadowDistanceY,
shadowDirectionButtonGroup->setButton( sd );
- dist = QMAX( QABS(shadowDistanceX), QABS(shadowDistanceY) );
+ dist = TQMAX( TQABS(shadowDistanceX), TQABS(shadowDistanceY) );
shadowDistanceKDoubleNumInput->setValue( dist );
shadowKColorButton->setColor( shadowColor.isValid() ? shadowColor: gray );
diff --git a/lib/kotext/KoDecorationTab.h b/lib/kotext/KoDecorationTab.h
index e50a06c9..be5222fc 100644
--- a/lib/kotext/KoDecorationTab.h
+++ b/lib/kotext/KoDecorationTab.h
@@ -22,30 +22,31 @@
#include <kodecorationtabbase.h>
-#include <qcolor.h>
+#include <tqcolor.h>
class KoDecorationTab : public KoDecorationTabBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoDecorationTab( QWidget* parent=0, const char* name=0, WFlags fl=0 );
+ KoDecorationTab( TQWidget* tqparent=0, const char* name=0, WFlags fl=0 );
~KoDecorationTab();
- QColor getTextColor() const;
- QColor getBackgroundColor() const;
+ TQColor getTextColor() const;
+ TQColor getBackgroundColor() const;
double getShadowDistanceX() const;
double getShadowDistanceY() const;
- QColor getShadowColor() const;
+ TQColor getShadowColor() const;
- void setTextColor( const QColor &color );
- void setBackgroundColor( const QColor &color );
- void setShadow( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ void setTextColor( const TQColor &color );
+ void setBackgroundColor( const TQColor &color );
+ void setShadow( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
signals:
- void fontColorChanged( const QColor& );
- void backgroundColorChanged( const QColor& );
- void shadowColorChanged( const QColor& );
+ void fontColorChanged( const TQColor& );
+ void backgroundColorChanged( const TQColor& );
+ void shadowColorChanged( const TQColor& );
void shadowDistanceChanged( double );
void shadowDirectionChanged( int );
void shadowChanged();
diff --git a/lib/kotext/KoFontDia.cpp b/lib/kotext/KoFontDia.cpp
index 39d6017f..7373ec0e 100644
--- a/lib/kotext/KoFontDia.cpp
+++ b/lib/kotext/KoFontDia.cpp
@@ -19,8 +19,8 @@
#include "KoFontDia.h"
-#include <qvbox.h>
-#include <qhbox.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
#include "KoRichText.h"
@@ -28,79 +28,79 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqpushbutton.h>
+#include <tqtabwidget.h>
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
#include <knuminput.h>
#include <KoGlobal.h>
-#include <qvgroupbox.h>
-#include <qvbox.h>
-#include <qhgroupbox.h>
-#include <qhbuttongroup.h>
+#include <tqvgroupbox.h>
+#include <tqvbox.h>
+#include <tqhgroupbox.h>
+#include <tqhbuttongroup.h>
#include <kcolorbutton.h>
#include <kiconloader.h>
KoFontDia::KoFontDia( const KoTextFormat& initialFormat,
- KSpell2::Broker::Ptr broker, QWidget* parent, const char* name )
- : KDialogBase( parent, name, true,
+ KSpell2::Broker::Ptr broker, TQWidget* tqparent, const char* name )
+ : KDialogBase( tqparent, name, true,
i18n("Select Font"), Ok|Cancel|User1|Apply, Ok ),
m_initialFormat(initialFormat),
m_changedFlags(KoTextFormat::NoFlags)
{
setButtonText( KDialogBase::User1, i18n("&Reset") );
- QVBox *mainWidget = new QVBox( this );
- QHBox *mainHBox = new QHBox( mainWidget );
+ TQVBox *mainWidget = new TQVBox( this );
+ TQHBox *mainHBox = new TQHBox( mainWidget );
- QTabWidget *fontTabWidget = new QTabWidget( mainHBox );
+ TQTabWidget *fontTabWidget = new TQTabWidget( mainHBox );
// Font tab
fontTab = new KoFontTab( KFontChooser::SmoothScalableFonts, this );
fontTabWidget->addTab( fontTab, i18n( "Font" ) );
- connect( fontTab, SIGNAL( familyChanged() ), this, SLOT( slotFontFamilyChanged() ) );
- connect( fontTab, SIGNAL( boldChanged() ), this, SLOT( slotFontBoldChanged() ) );
- connect( fontTab, SIGNAL( italicChanged() ), this, SLOT( slotFontItalicChanged() ) );
- connect( fontTab, SIGNAL( sizeChanged() ), this, SLOT( slotFontSizeChanged() ) );
+ connect( fontTab, TQT_SIGNAL( familyChanged() ), this, TQT_SLOT( slotFontFamilyChanged() ) );
+ connect( fontTab, TQT_SIGNAL( boldChanged() ), this, TQT_SLOT( slotFontBoldChanged() ) );
+ connect( fontTab, TQT_SIGNAL( italicChanged() ), this, TQT_SLOT( slotFontItalicChanged() ) );
+ connect( fontTab, TQT_SIGNAL( sizeChanged() ), this, TQT_SLOT( slotFontSizeChanged() ) );
//Highlighting tab
highlightingTab = new KoHighlightingTab( this );
fontTabWidget->addTab( highlightingTab, i18n( "Highlighting" ) );
- connect( highlightingTab, SIGNAL( underlineChanged( int ) ), this, SLOT( slotUnderlineChanged( int ) ) );
- connect( highlightingTab, SIGNAL( underlineStyleChanged( int ) ), this, SLOT( slotUnderlineStyleChanged( int ) ) );
- connect( highlightingTab, SIGNAL( underlineColorChanged( const QColor & ) ), this, SLOT( slotUnderlineColorChanged( const QColor & ) ) );
- connect( highlightingTab, SIGNAL( strikethroughChanged( int ) ), this, SLOT( slotStrikethroughChanged( int ) ) );
- connect( highlightingTab, SIGNAL( strikethroughStyleChanged( int ) ), this, SLOT( slotStrikethroughStyleChanged( int ) ) );
- connect( highlightingTab, SIGNAL( wordByWordChanged( bool ) ), this, SLOT( slotWordByWordChanged( bool ) ) );
- connect( highlightingTab, SIGNAL( capitalisationChanged( int ) ), this, SLOT( slotCapitalisationChanged( int ) ) );
+ connect( highlightingTab, TQT_SIGNAL( underlineChanged( int ) ), this, TQT_SLOT( slotUnderlineChanged( int ) ) );
+ connect( highlightingTab, TQT_SIGNAL( underlineStyleChanged( int ) ), this, TQT_SLOT( slotUnderlineStyleChanged( int ) ) );
+ connect( highlightingTab, TQT_SIGNAL( underlineColorChanged( const TQColor & ) ), this, TQT_SLOT( slotUnderlineColorChanged( const TQColor & ) ) );
+ connect( highlightingTab, TQT_SIGNAL( strikethroughChanged( int ) ), this, TQT_SLOT( slotStrikethroughChanged( int ) ) );
+ connect( highlightingTab, TQT_SIGNAL( strikethroughStyleChanged( int ) ), this, TQT_SLOT( slotStrikethroughStyleChanged( int ) ) );
+ connect( highlightingTab, TQT_SIGNAL( wordByWordChanged( bool ) ), this, TQT_SLOT( slotWordByWordChanged( bool ) ) );
+ connect( highlightingTab, TQT_SIGNAL( capitalisationChanged( int ) ), this, TQT_SLOT( slotCapitalisationChanged( int ) ) );
//Decoratio tab
decorationTab = new KoDecorationTab( this );
fontTabWidget->addTab( decorationTab, i18n( "Decoration" ) );
- connect( decorationTab, SIGNAL( fontColorChanged( const QColor& ) ), this, SLOT( slotFontColorChanged( const QColor& ) ) );
- connect( decorationTab, SIGNAL( backgroundColorChanged( const QColor& ) ), this, SLOT( slotBackgroundColorChanged( const QColor& ) ) );
- connect( decorationTab, SIGNAL( shadowColorChanged( const QColor& ) ), this, SLOT( slotShadowColorChanged( const QColor& ) ) );
- connect( decorationTab, SIGNAL( shadowDistanceChanged( double ) ), this, SLOT( slotShadowDistanceChanged( double ) ) );
- connect( decorationTab, SIGNAL( shadowDirectionChanged( int ) ), this, SLOT( slotShadowDirectionChanged( int ) ) );
+ connect( decorationTab, TQT_SIGNAL( fontColorChanged( const TQColor& ) ), this, TQT_SLOT( slotFontColorChanged( const TQColor& ) ) );
+ connect( decorationTab, TQT_SIGNAL( backgroundColorChanged( const TQColor& ) ), this, TQT_SLOT( slotBackgroundColorChanged( const TQColor& ) ) );
+ connect( decorationTab, TQT_SIGNAL( shadowColorChanged( const TQColor& ) ), this, TQT_SLOT( slotShadowColorChanged( const TQColor& ) ) );
+ connect( decorationTab, TQT_SIGNAL( shadowDistanceChanged( double ) ), this, TQT_SLOT( slotShadowDistanceChanged( double ) ) );
+ connect( decorationTab, TQT_SIGNAL( shadowDirectionChanged( int ) ), this, TQT_SLOT( slotShadowDirectionChanged( int ) ) );
//Layout tab
- layoutTab = new KoLayoutTab( true, this );
- fontTabWidget->addTab( layoutTab, i18n( "Layout" ) );
- connect( layoutTab, SIGNAL( subSuperScriptChanged() ), this, SLOT( slotSubSuperChanged() ) );;
- connect( layoutTab, SIGNAL( offsetChanged( int ) ), this, SLOT( slotOffsetChanged( int ) ) );
- connect( layoutTab, SIGNAL( relativeSizeChanged( double ) ), this, SLOT( slotRelativeSizeChanged( double ) ) );
- connect( layoutTab, SIGNAL( hyphenationChanged( bool ) ), this, SLOT( slotHyphenationChanged( bool ) ) );
+ tqlayoutTab = new KoLayoutTab( true, this );
+ fontTabWidget->addTab( tqlayoutTab, i18n( "Layout" ) );
+ connect( tqlayoutTab, TQT_SIGNAL( subSuperScriptChanged() ), this, TQT_SLOT( slotSubSuperChanged() ) );;
+ connect( tqlayoutTab, TQT_SIGNAL( offsetChanged( int ) ), this, TQT_SLOT( slotOffsetChanged( int ) ) );
+ connect( tqlayoutTab, TQT_SIGNAL( relativeSizeChanged( double ) ), this, TQT_SLOT( slotRelativeSizeChanged( double ) ) );
+ connect( tqlayoutTab, TQT_SIGNAL( hyphenationChanged( bool ) ), this, TQT_SLOT( slotHyphenationChanged( bool ) ) );
//Language tab
languageTab = new KoLanguageTab( broker, this );
fontTabWidget->addTab( languageTab, i18n( "Language" ) );
- connect( languageTab, SIGNAL( languageChanged() ), this, SLOT( slotLanguageChanged() ) );
+ connect( languageTab, TQT_SIGNAL( languageChanged() ), this, TQT_SLOT( slotLanguageChanged() ) );
//Related properties List View
//relatedPropertiesListView = new KListView( mainHBox );
@@ -115,7 +115,7 @@ KoFontDia::KoFontDia( const KoTextFormat& initialFormat,
void KoFontDia::init()
{
- connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotReset()) );
+ connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotReset()) );
slotReset();
}
@@ -123,7 +123,7 @@ void KoFontDia::init()
KoTextFormat KoFontDia::newFormat() const
{
return KoTextFormat( fontTab->getSelection(),
- layoutTab->getSubSuperScript(),
+ tqlayoutTab->getSubSuperScript(),
decorationTab->getTextColor(),
decorationTab->getBackgroundColor(),
highlightingTab->getUnderlineColor(),
@@ -133,10 +133,10 @@ KoTextFormat KoFontDia::newFormat() const
highlightingTab->getStrikethroughStyle(),
highlightingTab->getCapitalisation(),
languageTab->getLanguage(),
- layoutTab->getRelativeTextSize(),
- layoutTab->getOffsetFromBaseline(),
+ tqlayoutTab->getRelativeTextSize(),
+ tqlayoutTab->getOffsetFromBaseline(),
highlightingTab->getWordByWord(),
- layoutTab->getAutoHyphenation(),
+ tqlayoutTab->getAutoHyphenation(),
decorationTab->getShadowDistanceX(),
decorationTab->getShadowDistanceY(),
decorationTab->getShadowColor()
@@ -167,8 +167,8 @@ void KoFontDia::slotReset()
decorationTab->setTextColor( m_initialFormat.color() );
decorationTab->setBackgroundColor( m_initialFormat.textBackgroundColor() );
decorationTab->setShadow( m_initialFormat.shadowDistanceX(), m_initialFormat.shadowDistanceY(), m_initialFormat.shadowColor() );
- layoutTab->setSubSuperScript( m_initialFormat.vAlign(), m_initialFormat.offsetFromBaseLine(), m_initialFormat.relativeTextSize() );
- layoutTab->setAutoHyphenation( m_initialFormat.hyphenation() );
+ tqlayoutTab->setSubSuperScript( m_initialFormat.vAlign(), m_initialFormat.offsetFromBaseLine(), m_initialFormat.relativeTextSize() );
+ tqlayoutTab->setAutoHyphenation( m_initialFormat.hyphenation() );
languageTab->setLanguage( m_initialFormat.language() );
}
@@ -196,13 +196,13 @@ void KoFontDia::slotFontSizeChanged()
fontDiaPreview->setFont( fontTab->getSelection() );
}
-void KoFontDia::slotFontColorChanged( const QColor& color )
+void KoFontDia::slotFontColorChanged( const TQColor& color )
{
m_changedFlags |= KoTextFormat::Color;
fontDiaPreview->setFontColor( color );
}
-void KoFontDia::slotBackgroundColorChanged( const QColor& color )
+void KoFontDia::slotBackgroundColorChanged( const TQColor& color )
{
m_changedFlags |= KoTextFormat::TextBackgroundColor;
fontDiaPreview->setBackgroundColor( color );
@@ -217,21 +217,21 @@ void KoFontDia::slotCapitalisationChanged( int item )
void KoFontDia::slotUnderlineChanged( int item )
{
m_changedFlags |= KoTextFormat::ExtendUnderLine;
- if ( !item ) fontDiaPreview->setUnderlining( item, 0, Qt::black, false );
+ if ( !item ) fontDiaPreview->setUnderlining( item, 0, TQt::black, false );
else fontDiaPreview->setUnderlining( item, highlightingTab->getUnderlineStyle(), highlightingTab->getUnderlineColor(), highlightingTab->getWordByWord() );
}
void KoFontDia::slotUnderlineStyleChanged( int item )
{
m_changedFlags |= KoTextFormat::ExtendUnderLine;
- if ( !highlightingTab->getUnderline() ) fontDiaPreview->setUnderlining( 0, 0, Qt::black, false );
+ if ( !highlightingTab->getUnderline() ) fontDiaPreview->setUnderlining( 0, 0, TQt::black, false );
else fontDiaPreview->setUnderlining( highlightingTab->getUnderline(), item, highlightingTab->getUnderlineColor(), highlightingTab->getWordByWord() );
}
-void KoFontDia::slotUnderlineColorChanged( const QColor &color )
+void KoFontDia::slotUnderlineColorChanged( const TQColor &color )
{
m_changedFlags |= KoTextFormat::ExtendUnderLine;
- if ( !highlightingTab->getUnderline() ) fontDiaPreview->setUnderlining( 0, 0, Qt::black, false );
+ if ( !highlightingTab->getUnderline() ) fontDiaPreview->setUnderlining( 0, 0, TQt::black, false );
else fontDiaPreview->setUnderlining( highlightingTab->getUnderline(), highlightingTab->getUnderlineStyle(), color, highlightingTab->getWordByWord() );
}
@@ -267,7 +267,7 @@ void KoFontDia::slotShadowDirectionChanged( int )
fontDiaPreview->setShadow( decorationTab->getShadowDistanceX(), decorationTab->getShadowDistanceY(), decorationTab->getShadowColor() );
}
-void KoFontDia::slotShadowColorChanged( const QColor & )
+void KoFontDia::slotShadowColorChanged( const TQColor & )
{
m_changedFlags |= KoTextFormat::ShadowText;
fontDiaPreview->setShadow( decorationTab->getShadowDistanceX(), decorationTab->getShadowDistanceY(), decorationTab->getShadowColor() );
@@ -276,19 +276,19 @@ void KoFontDia::slotShadowColorChanged( const QColor & )
void KoFontDia::slotSubSuperChanged()
{
m_changedFlags |= KoTextFormat::VAlign;
- fontDiaPreview->setSubSuperscript( layoutTab->getSubSuperScript(), layoutTab->getOffsetFromBaseline(), layoutTab->getRelativeTextSize() );
+ fontDiaPreview->setSubSuperscript( tqlayoutTab->getSubSuperScript(), tqlayoutTab->getOffsetFromBaseline(), tqlayoutTab->getRelativeTextSize() );
}
void KoFontDia::slotOffsetChanged( int offset )
{
m_changedFlags |= KoTextFormat::OffsetFromBaseLine;
- fontDiaPreview->setSubSuperscript( layoutTab->getSubSuperScript(), offset, layoutTab->getRelativeTextSize() );
+ fontDiaPreview->setSubSuperscript( tqlayoutTab->getSubSuperScript(), offset, tqlayoutTab->getRelativeTextSize() );
}
void KoFontDia::slotRelativeSizeChanged( double relativeSize )
{
m_changedFlags |= KoTextFormat::VAlign;
- fontDiaPreview->setSubSuperscript( layoutTab->getSubSuperScript(), layoutTab->getOffsetFromBaseline(), relativeSize );
+ fontDiaPreview->setSubSuperscript( tqlayoutTab->getSubSuperScript(), tqlayoutTab->getOffsetFromBaseline(), relativeSize );
}
void KoFontDia::slotHyphenationChanged( bool )
diff --git a/lib/kotext/KoFontDia.h b/lib/kotext/KoFontDia.h
index fa43dc5e..cd170764 100644
--- a/lib/kotext/KoFontDia.h
+++ b/lib/kotext/KoFontDia.h
@@ -21,9 +21,9 @@
#define __kofontdia_h__
#include <kfontdialog.h>
-#include <qtabwidget.h>
+#include <tqtabwidget.h>
#include <KoTextFormat.h>
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include <koffice_export.h>
#include "KoFontTab.h"
@@ -36,19 +36,20 @@
#include <kspell2/broker.h>
-class QComboBox;
+class TQComboBox;
class KOTEXT_EXPORT KoFontDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/// If your application supports spell-checking, pass here the KSpell2 Broker
/// so that the font dialog can show which languages are supported for spellchecking.
KoFontDia( const KoTextFormat& initialFormat,
KSpell2::Broker::Ptr broker = 0,
- QWidget* parent = 0, const char* name = 0 );
+ TQWidget* tqparent = 0, const char* name = 0 );
int changedFlags() const { return m_changedFlags; }
@@ -62,18 +63,18 @@ protected slots:
void slotFontBoldChanged();
void slotFontItalicChanged();
void slotFontSizeChanged();
- void slotFontColorChanged( const QColor& color );
- void slotBackgroundColorChanged( const QColor& color );
+ void slotFontColorChanged( const TQColor& color );
+ void slotBackgroundColorChanged( const TQColor& color );
void slotCapitalisationChanged( int item );
void slotUnderlineChanged( int item );
void slotUnderlineStyleChanged( int item );
- void slotUnderlineColorChanged( const QColor &color );
+ void slotUnderlineColorChanged( const TQColor &color );
void slotStrikethroughChanged( int item );
void slotStrikethroughStyleChanged( int item );
void slotWordByWordChanged( bool state );
void slotShadowDistanceChanged( double distance );
void slotShadowDirectionChanged( int direction );
- void slotShadowColorChanged( const QColor &color );
+ void slotShadowColorChanged( const TQColor &color );
void slotSubSuperChanged();
void slotOffsetChanged( int offset );
void slotRelativeSizeChanged( double relativeSize );
@@ -90,7 +91,7 @@ private:
KoFontTab *fontTab;
KoHighlightingTab *highlightingTab;
KoDecorationTab *decorationTab;
- KoLayoutTab *layoutTab;
+ KoLayoutTab *tqlayoutTab;
KoLanguageTab *languageTab;
KoFontDiaPreview *fontDiaPreview;
diff --git a/lib/kotext/KoFontDiaPreview.cpp b/lib/kotext/KoFontDiaPreview.cpp
index 32473e43..04d56e4c 100644
--- a/lib/kotext/KoFontDiaPreview.cpp
+++ b/lib/kotext/KoFontDiaPreview.cpp
@@ -23,31 +23,31 @@
#include <klocale.h>
-#include <qfontmetrics.h>
-#include <qrect.h>
-#include <qpainter.h>
-#include <qfont.h>
-#include <qstringlist.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqfontmetrics.h>
+#include <tqrect.h>
+#include <tqpainter.h>
+#include <tqfont.h>
+#include <tqstringlist.h>
+#include <tqstring.h>
+#include <tqregexp.h>
#include <math.h>
#include "KoFontDiaPreview.moc"
-KoFontDiaPreview::KoFontDiaPreview( QWidget* parent, const char* name , WFlags fl )
- : QFrame( parent, name, fl )
+KoFontDiaPreview::KoFontDiaPreview( TQWidget* tqparent, const char* name , WFlags fl )
+ : TQFrame( tqparent, name, fl )
,m_text( i18n( "The quick brown dog jumps over the lazy cat." ) )
,displayText( i18n( "The quick brown dog jumps over the lazy cat." ) )
,m_font( KoGlobal::defaultFont() )
- ,m_textColor( Qt::black )
- ,m_backgroundColor( Qt::white )
+ ,m_textColor( TQt::black )
+ ,m_backgroundColor( TQt::white )
,m_shadowDistanceX( 0 )
,m_shadowDistanceY( 0 )
- ,m_shadowColor( Qt::black )
+ ,m_shadowColor( TQt::black )
,m_underlining( 0 )
,m_underliningStyle( 0 )
- ,m_underliningColor( Qt::black )
+ ,m_underliningColor( TQt::black )
,m_wordByWord( false )
,m_strikethrough( 0 )
,m_strikethroughStyle( 0 )
@@ -57,9 +57,9 @@ KoFontDiaPreview::KoFontDiaPreview( QWidget* parent, const char* name , WFlags f
,m_relativeSize( 1 )
{
- setFrameStyle( QFrame::WinPanel | QFrame::Plain );
+ setFrameStyle( TQFrame::WinPanel | TQFrame::Plain );
setBackgroundMode( PaletteBase );
- setBackgroundColor( Qt::white );
+ setBackgroundColor( TQt::white );
setMinimumSize( 400, 100 );
}
@@ -67,32 +67,32 @@ KoFontDiaPreview::~KoFontDiaPreview()
{
}
-void KoFontDiaPreview::setText( const QString &text )
+void KoFontDiaPreview::setText( const TQString &text )
{
m_text = text;
update();
}
-void KoFontDiaPreview::setFont( const QFont &font )
+void KoFontDiaPreview::setFont( const TQFont &font )
{
m_font = font;
m_fontSize = m_font.pointSize();
update();
}
-void KoFontDiaPreview::setFontColor( const QColor &textColor )
+void KoFontDiaPreview::setFontColor( const TQColor &textColor )
{
m_textColor = textColor;
update();
}
-void KoFontDiaPreview::setBackgroundColor( const QColor &backgroundColor )
+void KoFontDiaPreview::setBackgroundColor( const TQColor &backgroundColor )
{
m_backgroundColor = backgroundColor;
update();
}
-void KoFontDiaPreview::setShadow( double sdx, double sdy, QColor shadowColor )
+void KoFontDiaPreview::setShadow( double sdx, double sdy, TQColor shadowColor )
{
m_shadowDistanceX = sdx;
m_shadowDistanceY = sdy;
@@ -100,7 +100,7 @@ void KoFontDiaPreview::setShadow( double sdx, double sdy, QColor shadowColor )
update();
}
-void KoFontDiaPreview::setUnderlining( int underlining, int underliningStyle, const QColor underliningColor, bool wordByWord )
+void KoFontDiaPreview::setUnderlining( int underlining, int underliningStyle, const TQColor underliningColor, bool wordByWord )
{
m_underlining = underlining;
m_underliningStyle = underliningStyle;
@@ -137,7 +137,7 @@ void KoFontDiaPreview::setSubSuperscript( int subSuper, int offset, double relat
update();
}
-QString KoFontDiaPreview::formatCapitalisation( const QString &string )
+TQString KoFontDiaPreview::formatCapitalisation( const TQString &string )
{
switch ( m_capitalisation )
{
@@ -154,7 +154,7 @@ QString KoFontDiaPreview::formatCapitalisation( const QString &string )
}
}
-void KoFontDiaPreview::drawContents( QPainter* p )
+void KoFontDiaPreview::drawContents( TQPainter* p )
{
p->save();
@@ -162,7 +162,7 @@ void KoFontDiaPreview::drawContents( QPainter* p )
//Capitalisation
double capitalisationCoeff;
- QFontMetrics fmCapitalisation( m_font );
+ TQFontMetrics fmCapitalisation( m_font );
switch ( m_capitalisation )
{
@@ -190,18 +190,18 @@ void KoFontDiaPreview::drawContents( QPainter* p )
displayText = formatCapitalisation( m_text );
// draw the stuff
- QFontMetrics fm( displayFont );
- QRect br = fm.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), Qt::AlignCenter | Qt::WordBreak, displayText );
+ TQFontMetrics fm( displayFont );
+ TQRect br = fm.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), TQt::AlignCenter | TQt::WordBreak, displayText );
if ( br.width() > contentsRect().width() || br.height() > contentsRect().height() ) {
displayText = formatCapitalisation( i18n( "Font too large for the preview pane" ) );
displayFont.setPointSizeFloat( 14 * capitalisationCoeff );
}
- QFontMetrics fm1( displayFont );
- br = fm1.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), Qt::AlignCenter | Qt::WordBreak, displayText );
+ TQFontMetrics fm1( displayFont );
+ br = fm1.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), TQt::AlignCenter | TQt::WordBreak, displayText );
- int xorg = qRound( ( contentsRect().width() - br.width() ) / 2 ) + contentsRect().x() - fm1.leftBearing( displayText.at( 0 ) );
+ int xorg = tqRound( ( contentsRect().width() - br.width() ) / 2 ) + contentsRect().x() - fm1.leftBearing( displayText.at( 0 ) );
// sub / superscript modifications
int subSuperOffset = 0;
@@ -224,17 +224,17 @@ void KoFontDiaPreview::drawContents( QPainter* p )
break;
}
- QFontMetrics fm2( displayFont );
- br = fm2.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), Qt::AlignCenter | Qt::WordBreak, displayText );
- int yorg = qRound( ( contentsRect().height() - br.height() ) / 2 ) + fm1.ascent() + subSuperOffset;
+ TQFontMetrics fm2( displayFont );
+ br = fm2.boundingRect( contentsRect().x(), contentsRect().y(), contentsRect().width(), contentsRect().height(), TQt::AlignCenter | TQt::WordBreak, displayText );
+ int yorg = tqRound( ( contentsRect().height() - br.height() ) / 2 ) + fm1.ascent() + subSuperOffset;
int sxorg = xorg + int( m_shadowDistanceX );
int syorg = yorg + int( m_shadowDistanceY );
- QStringList textWords = QStringList::split( " ", displayText );
+ TQStringList textWords = TQStringList::split( " ", displayText );
int x = xorg;
int y = yorg;
int sx = sxorg;
int sy = syorg;
- int bx= QMIN( x, sx );
+ int bx= TQMIN( x, sx );
int xend = bx;
int yUnderline;
int widthUnderline;
@@ -247,7 +247,7 @@ void KoFontDiaPreview::drawContents( QPainter* p )
p->setPen( m_textColor );
int count = 1;
- for ( QStringList::iterator it = textWords.begin(); it != textWords.end(); ++it ) {
+ for ( TQStringList::iterator it = textWords.begin(); it != textWords.end(); ++it ) {
int boffset = 0;
if ( x + fm2.width( (*it) ) > contentsRect().width() ) {
y += fm1.lineSpacing();
@@ -255,10 +255,10 @@ void KoFontDiaPreview::drawContents( QPainter* p )
xend = x;
x = xorg;
sx = sxorg;
- bx= QMIN( x, sx );
+ bx= TQMIN( x, sx );
count = 1;
}
- QString textDraw;
+ TQString textDraw;
if ( (*it) == textWords.last() ) {
textDraw = (*it);
}
@@ -266,23 +266,23 @@ void KoFontDiaPreview::drawContents( QPainter* p )
textDraw = (*it) + " ";
}
/*background*/
- if ( count == 1 ) boffset = QABS( int( m_shadowDistanceX ) );
+ if ( count == 1 ) boffset = TQABS( int( m_shadowDistanceX ) );
else boffset = 0;
- if ( bx < xend && (bx + fm2.width( textDraw ) + boffset ) < xend && ( QMIN( y, sy ) - fm2.ascent() ) < ( QMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + QABS( m_shadowDistanceY ) ) ) {
- p->fillRect( bx, QMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + QABS( int( m_shadowDistanceY ) ), fm2.width( textDraw ) + boffset , fm2.height() + QABS( int( m_shadowDistanceY ) ) - ( QMIN( yorg, syorg ) - QMIN( y, sy ) + fm2.height() + QABS( int( m_shadowDistanceY ) ) ), m_backgroundColor );
+ if ( bx < xend && (bx + fm2.width( textDraw ) + boffset ) < xend && ( TQMIN( y, sy ) - fm2.ascent() ) < ( TQMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + TQABS( m_shadowDistanceY ) ) ) {
+ p->fillRect( bx, TQMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + TQABS( int( m_shadowDistanceY ) ), fm2.width( textDraw ) + boffset , fm2.height() + TQABS( int( m_shadowDistanceY ) ) - ( TQMIN( yorg, syorg ) - TQMIN( y, sy ) + fm2.height() + TQABS( int( m_shadowDistanceY ) ) ), m_backgroundColor );
}
- else if ( bx < xend && (bx + fm2.width( textDraw ) + boffset ) >= xend && ( QMIN( y, sy ) - fm2.ascent() ) < ( QMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + QABS( m_shadowDistanceY ) ) ) {
- p->fillRect( bx, QMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + QABS( int( m_shadowDistanceY ) ), xend - bx , fm2.height() + QABS( int( m_shadowDistanceY ) ) - ( QMIN( yorg, syorg ) - QMIN( y, sy ) + fm2.height() + QABS( int( m_shadowDistanceY ) ) ), m_backgroundColor );
- p->fillRect( xend, QMIN( y, sy ) - fm2.ascent(), fm2.width( textDraw ) + boffset - xend + bx, fm2.height() + QABS( int( m_shadowDistanceY ) ), m_backgroundColor );
+ else if ( bx < xend && (bx + fm2.width( textDraw ) + boffset ) >= xend && ( TQMIN( y, sy ) - fm2.ascent() ) < ( TQMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + TQABS( m_shadowDistanceY ) ) ) {
+ p->fillRect( bx, TQMIN( yorg, syorg ) - fm2.ascent() + fm2.height() + TQABS( int( m_shadowDistanceY ) ), xend - bx , fm2.height() + TQABS( int( m_shadowDistanceY ) ) - ( TQMIN( yorg, syorg ) - TQMIN( y, sy ) + fm2.height() + TQABS( int( m_shadowDistanceY ) ) ), m_backgroundColor );
+ p->fillRect( xend, TQMIN( y, sy ) - fm2.ascent(), fm2.width( textDraw ) + boffset - xend + bx, fm2.height() + TQABS( int( m_shadowDistanceY ) ), m_backgroundColor );
}
else {
- p->fillRect( bx, QMIN( y, sy ) - fm2.ascent(), fm2.width( textDraw ) + boffset , fm2.height() + QABS( int( m_shadowDistanceY ) ), m_backgroundColor );
+ p->fillRect( bx, TQMIN( y, sy ) - fm2.ascent(), fm2.width( textDraw ) + boffset , fm2.height() + TQABS( int( m_shadowDistanceY ) ), m_backgroundColor );
}
- if ( count == 1 ) boffset = QABS( int( m_shadowDistanceX ) );
+ if ( count == 1 ) boffset = TQABS( int( m_shadowDistanceX ) );
else boffset = 0;
- bx += fm2.width( textDraw ) + boffset;//( count == 1 )?0:0;//QABS( m_shadowDistanceX ):0;
+ bx += fm2.width( textDraw ) + boffset;//( count == 1 )?0:0;//TQABS( m_shadowDistanceX ):0;
/*shadow*/
if ( m_shadowDistanceX || m_shadowDistanceY )
{
@@ -308,13 +308,13 @@ void KoFontDiaPreview::drawContents( QPainter* p )
( m_wordByWord )? widthUnderline = fm2.width( (*it) ): widthUnderline = fm2.width( textDraw );
thicknessUnderline = 1;
drawUnderline( x, yUnderline, widthUnderline, thicknessUnderline, m_underliningColor, p );
- yUnderline = y + qRound( fm2.descent() / 2 );
+ yUnderline = y + tqRound( fm2.descent() / 2 );
drawUnderline( x, yUnderline, widthUnderline, thicknessUnderline, m_underliningColor, p );
break;
case KoTextFormat::U_SIMPLE_BOLD:
yUnderline = y + fm2.descent();
( m_wordByWord )? widthUnderline = fm2.width( (*it) ): widthUnderline = fm2.width( textDraw );
- thicknessUnderline = qRound( displayFont.pointSize() / 10 ) + 1;
+ thicknessUnderline = tqRound( displayFont.pointSize() / 10 ) + 1;
drawUnderline( x, yUnderline, widthUnderline, thicknessUnderline, m_underliningColor, p );
break;
case KoTextFormat::U_WAVE:
@@ -331,23 +331,23 @@ void KoFontDiaPreview::drawContents( QPainter* p )
case KoTextFormat::S_NONE:
break;
case KoTextFormat::S_SIMPLE:
- yStrikethrough = y - qRound( fm2.ascent() / 3 );
+ yStrikethrough = y - tqRound( fm2.ascent() / 3 );
( m_wordByWord )? widthStrikethrough = fm2.width( (*it) ): widthStrikethrough = fm2.width( textDraw );
thicknessStrikethrough = 1;
drawStrikethrough( x, yStrikethrough, widthStrikethrough, thicknessStrikethrough, p );
break;
case KoTextFormat::S_DOUBLE:
- yStrikethrough = y - qRound( fm2.ascent() / 4 );
+ yStrikethrough = y - tqRound( fm2.ascent() / 4 );
( m_wordByWord )? widthStrikethrough = fm2.width( (*it) ): widthStrikethrough = fm2.width( textDraw );
thicknessStrikethrough = 1;
drawStrikethrough( x, yStrikethrough, widthStrikethrough, thicknessStrikethrough, p );
- yStrikethrough = y - 2 * qRound( fm2.ascent() / 4 );
+ yStrikethrough = y - 2 * tqRound( fm2.ascent() / 4 );
drawStrikethrough( x, yStrikethrough, widthStrikethrough, thicknessStrikethrough, p );
break;
case KoTextFormat::S_SIMPLE_BOLD:
- yStrikethrough = y - qRound( fm2.ascent() / 3 );
+ yStrikethrough = y - tqRound( fm2.ascent() / 3 );
( m_wordByWord )? widthStrikethrough = fm2.width( (*it) ): widthStrikethrough = fm2.width( textDraw );
- thicknessStrikethrough = qRound( displayFont.pointSize() / 10 ) + 1;
+ thicknessStrikethrough = tqRound( displayFont.pointSize() / 10 ) + 1;
drawStrikethrough( x, yStrikethrough, widthStrikethrough, thicknessStrikethrough, p );
break;
default:
@@ -361,37 +361,37 @@ void KoFontDiaPreview::drawContents( QPainter* p )
p->restore();
}
-void KoFontDiaPreview::drawUnderline( int x, int y, int width, int thickness, QColor & color, QPainter *p )
+void KoFontDiaPreview::drawUnderline( int x, int y, int width, int thickness, TQColor & color, TQPainter *p )
{
p->save();
switch ( m_underliningStyle ) {
case KoTextFormat::U_SOLID:
- p->setPen( QPen( color, thickness, Qt::SolidLine ) );
+ p->setPen( TQPen( color, thickness, TQt::SolidLine ) );
break;
case KoTextFormat::U_DASH:
- p->setPen( QPen( color, thickness, Qt::DashLine ) );
+ p->setPen( TQPen( color, thickness, TQt::DashLine ) );
break;
case KoTextFormat::U_DOT:
- p->setPen( QPen( color, thickness, Qt::DotLine ) );
+ p->setPen( TQPen( color, thickness, TQt::DotLine ) );
break;
case KoTextFormat::U_DASH_DOT:
- p->setPen( QPen( color, thickness, Qt::DashDotLine ) );
+ p->setPen( TQPen( color, thickness, TQt::DashDotLine ) );
break;
case KoTextFormat::U_DASH_DOT_DOT:
- p->setPen( QPen( color, thickness, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( color, thickness, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, thickness, Qt::SolidLine ) );
+ p->setPen( TQPen( color, thickness, TQt::SolidLine ) );
}
p->drawLine( x, y, x+ width, y );
p->restore();
}
-void KoFontDiaPreview::drawUnderlineWave( int x, int y, int width, int thickness, QColor & color, QPainter *p )
+void KoFontDiaPreview::drawUnderlineWave( int x, int y, int width, int thickness, TQColor & color, TQPainter *p )
{
p->save();
int offset = 2 * thickness;
- QPen pen(color, thickness, Qt::SolidLine);
+ TQPen pen(color, thickness, TQt::SolidLine);
pen.setCapStyle(Qt::RoundCap);
p->setPen(pen);
double anc=acos(1.0-2*(static_cast<double>(offset-(x)%offset)/static_cast<double>(offset)))/3.1415*180;
@@ -400,7 +400,7 @@ void KoFontDiaPreview::drawUnderlineWave( int x, int y, int width, int thickness
if(2*((x/offset)/2)==x/offset)
pos*=-1;
//draw first part of wave
- p->drawArc( (x/offset)*offset, y, offset, offset, 0, -qRound(pos*anc*16) );
+ p->drawArc( (x/offset)*offset, y, offset, offset, 0, -tqRound(pos*anc*16) );
//now the main part
int zigzag_x = (x/offset+1)*offset;
for ( ; zigzag_x + offset <= width+x; zigzag_x += offset)
@@ -410,31 +410,31 @@ void KoFontDiaPreview::drawUnderlineWave( int x, int y, int width, int thickness
}
//and here we finish
anc=acos(1.0-2*(static_cast<double>((x+width)%offset)/static_cast<double>(offset)))/3.1415*180;
- p->drawArc( zigzag_x, y, offset, offset, 180*16, -qRound(pos*anc*16) );
+ p->drawArc( zigzag_x, y, offset, offset, 180*16, -tqRound(pos*anc*16) );
p->restore();
}
-void KoFontDiaPreview::drawStrikethrough( int x, int y, int width, int thickness, QPainter *p )
+void KoFontDiaPreview::drawStrikethrough( int x, int y, int width, int thickness, TQPainter *p )
{
p->save();
switch ( m_strikethroughStyle ) {
case KoTextFormat::S_SOLID:
- p->setPen( QPen( Qt::black, thickness, Qt::SolidLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::SolidLine ) );
break;
case KoTextFormat::S_DASH:
- p->setPen( QPen( Qt::black, thickness, Qt::DashLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::DashLine ) );
break;
case KoTextFormat::S_DOT:
- p->setPen( QPen( Qt::black, thickness, Qt::DotLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::DotLine ) );
break;
case KoTextFormat::S_DASH_DOT:
- p->setPen( QPen( Qt::black, thickness, Qt::DashDotLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::DashDotLine ) );
break;
case KoTextFormat::S_DASH_DOT_DOT:
- p->setPen( QPen( Qt::black, thickness, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( Qt::black, thickness, Qt::SolidLine ) );
+ p->setPen( TQPen( TQt::black, thickness, TQt::SolidLine ) );
}
p->drawLine( x, y, x+ width, y );
p->restore();
diff --git a/lib/kotext/KoFontDiaPreview.h b/lib/kotext/KoFontDiaPreview.h
index 2b0411a7..5cba0fbc 100644
--- a/lib/kotext/KoFontDiaPreview.h
+++ b/lib/kotext/KoFontDiaPreview.h
@@ -20,31 +20,32 @@
#ifndef __kofontdiapreview_h__
#define __kofontdiapreview_h__
-#include <qframe.h>
-#include <qstring.h>
-#include <qcolor.h>
-#include <qfont.h>
-#include <qpainter.h>
+#include <tqframe.h>
+#include <tqstring.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqpainter.h>
/**
* The font dialog Preview
*/
-class KoFontDiaPreview : public QFrame
+class KoFontDiaPreview : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KoFontDiaPreview( QWidget* parent =0, const char* name = 0, WFlags fl = 0 );
+ KoFontDiaPreview( TQWidget* tqparent =0, const char* name = 0, WFlags fl = 0 );
~KoFontDiaPreview();
- void setText( const QString &text );
- void setFont( const QFont &font );
- void setFontColor( const QColor &textColor );
- void setBackgroundColor( const QColor &backgroundColor );
- void setShadow( double sdx, double sdy, QColor shadowColor );
- void setUnderlining( int underlining, int underliningStyle, const QColor underliningColor, bool wordByWord );
+ void setText( const TQString &text );
+ void setFont( const TQFont &font );
+ void setFontColor( const TQColor &textColor );
+ void setBackgroundColor( const TQColor &backgroundColor );
+ void setShadow( double sdx, double sdy, TQColor shadowColor );
+ void setUnderlining( int underlining, int underliningStyle, const TQColor underliningColor, bool wordByWord );
void setWordByWord( bool wordByWord );
void setStrikethrough( int strikethrough, int strikethroughStylestrikethrough, bool wordByWord );
void setCapitalisation( int capitalisation );
@@ -52,21 +53,21 @@ public:
private:
- void drawContents( QPainter* );
+ void drawContents( TQPainter* );
- QString m_text;
- QString displayText;
- QFont m_font;
- QFont displayFont;
+ TQString m_text;
+ TQString displayText;
+ TQFont m_font;
+ TQFont displayFont;
int m_fontSize;
- QColor m_textColor;
- QColor m_backgroundColor;
+ TQColor m_textColor;
+ TQColor m_backgroundColor;
double m_shadowDistanceX;
double m_shadowDistanceY;
- QColor m_shadowColor;
+ TQColor m_shadowColor;
int m_underlining;
int m_underliningStyle;
- QColor m_underliningColor;
+ TQColor m_underliningColor;
bool m_wordByWord;
int m_strikethrough;
int m_strikethroughStyle;
@@ -75,10 +76,10 @@ private:
int m_offset;
double m_relativeSize;
- QString formatCapitalisation( const QString &string );
- void drawUnderline( int x, int y, int width, int thickness, QColor & color, QPainter *p );
- void drawUnderlineWave( int x, int y, int width, int thickness, QColor & color, QPainter *p );
- void drawStrikethrough( int x, int y, int width, int thickness, QPainter *p );
+ TQString formatCapitalisation( const TQString &string );
+ void drawUnderline( int x, int y, int width, int thickness, TQColor & color, TQPainter *p );
+ void drawUnderlineWave( int x, int y, int width, int thickness, TQColor & color, TQPainter *p );
+ void drawStrikethrough( int x, int y, int width, int thickness, TQPainter *p );
};
#endif
diff --git a/lib/kotext/KoFontTab.cpp b/lib/kotext/KoFontTab.cpp
index 754e9174..fe8f1621 100644
--- a/lib/kotext/KoFontTab.cpp
+++ b/lib/kotext/KoFontTab.cpp
@@ -19,32 +19,32 @@
#include "KoFontTab.h"
-KoFontTab::KoFontTab( uint fontListCriteria, QWidget* parent, const char* name, WFlags fl )
- : KoFontTabBase( parent, name, fl )
+KoFontTab::KoFontTab( uint fontListCriteria, TQWidget* tqparent, const char* name, WFlags fl )
+ : KoFontTabBase( tqparent, name, fl )
{
- QStringList list;
+ TQStringList list;
KFontChooser_local::getFontList(list, fontListCriteria);
characterFont->setFamilyList( list );
comparisonFont = characterFont->font();
- connect( characterFont, SIGNAL( fontSelected( const QFont & ) ), this, SLOT( slotFontChanged( const QFont & ) ) );
+ connect( characterFont, TQT_SIGNAL( fontSelected( const TQFont & ) ), this, TQT_SLOT( slotFontChanged( const TQFont & ) ) );
}
KoFontTab::~KoFontTab()
{
}
-QFont KoFontTab::getSelection()
+TQFont KoFontTab::getSelection()
{
return characterFont->font();
}
-void KoFontTab::setSelection( const QFont &font )
+void KoFontTab::setSelection( const TQFont &font )
{
characterFont->setFont( font );
}
-void KoFontTab::slotFontChanged( const QFont &font )
+void KoFontTab::slotFontChanged( const TQFont &font )
{
if ( comparisonFont.family() != font.family() ) emit familyChanged();
if ( comparisonFont.bold() != font.bold() ) emit boldChanged();
diff --git a/lib/kotext/KoFontTab.h b/lib/kotext/KoFontTab.h
index 4d6ff9c3..5cb1d3bb 100644
--- a/lib/kotext/KoFontTab.h
+++ b/lib/kotext/KoFontTab.h
@@ -21,20 +21,21 @@
#define __kofonttab_h__
#include <kofonttabbase.h>
-#include <qfont.h>
+#include <tqfont.h>
class KoFontTab : public KoFontTabBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoFontTab( uint fontListCriteria=0, QWidget* parent=0, const char* name=0, WFlags fl=0 );
+ KoFontTab( uint fontListCriteria=0, TQWidget* tqparent=0, const char* name=0, WFlags fl=0 );
~KoFontTab();
- QFont getSelection();
+ TQFont getSelection();
public slots:
- void setSelection( const QFont &font );
+ void setSelection( const TQFont &font );
signals:
void familyChanged();
@@ -43,10 +44,10 @@ signals:
void sizeChanged();
private:
- QFont comparisonFont;
+ TQFont comparisonFont;
private slots:
- void slotFontChanged( const QFont &font );
+ void slotFontChanged( const TQFont &font );
};
#endif
diff --git a/lib/kotext/KoHighlightingTab.cpp b/lib/kotext/KoHighlightingTab.cpp
index 8b90c5b5..b2f829d1 100644
--- a/lib/kotext/KoHighlightingTab.cpp
+++ b/lib/kotext/KoHighlightingTab.cpp
@@ -20,10 +20,10 @@
#include "KoHighlightingTab.h"
#include "KoTextFormat.h"
-#include <qstringlist.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
+#include <tqstringlist.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
#include <kcombobox.h>
#include <kcolorbutton.h>
@@ -31,8 +31,8 @@
#include "KoHighlightingTab.moc"
-KoHighlightingTab::KoHighlightingTab( QWidget* parent, const char* name, WFlags fl )
- : KoHighlightingTabBase( parent, name, fl )
+KoHighlightingTab::KoHighlightingTab( TQWidget* tqparent, const char* name, WFlags fl )
+ : KoHighlightingTabBase( tqparent, name, fl )
{
underlineStyleKComboBox->insertStringList( KoTextFormat::underlineTypeList() );
underlineLineStyleKComboBox->insertStringList( KoTextFormat::underlineStyleList() );
@@ -40,19 +40,19 @@ KoHighlightingTab::KoHighlightingTab( QWidget* parent, const char* name, WFlags
strikethroughLineStyleKComboBox->insertStringList( KoTextFormat::strikeOutStyleList() );
capitalisationButtonGroup->setColumnLayout( 3, Qt::Horizontal );
- QStringList attributes = KoTextFormat::fontAttributeList();
- for ( QStringList::Iterator it = attributes.begin(); it != attributes.end(); ++it ) {
- capitalisationButtonGroup->insert( new QRadioButton( *it, capitalisationButtonGroup ) );
+ TQStringList attributes = KoTextFormat::fontAttributeList();
+ for ( TQStringList::Iterator it = attributes.begin(); it != attributes.end(); ++it ) {
+ capitalisationButtonGroup->insert( new TQRadioButton( *it, capitalisationButtonGroup ) );
}
capitalisationButtonGroup->setButton( 0 );
- connect( underlineStyleKComboBox, SIGNAL( activated( int ) ), this, SLOT( slotUnderlineChanged( int ) ) );
- connect( underlineLineStyleKComboBox, SIGNAL( activated( int ) ), this, SIGNAL( underlineStyleChanged( int ) ) );
- connect( underlineKColorButton, SIGNAL( changed( const QColor & ) ), this, SIGNAL( underlineColorChanged( const QColor & ) ) );
- connect( strikethroughStyleKComboBox, SIGNAL( activated( int ) ), this, SLOT( slotStrikethroughChanged( int ) ) );
- connect( strikethroughLineStyleKComboBox, SIGNAL( activated( int ) ), this, SIGNAL( strikethroughStyleChanged( int ) ) );
- connect( underlineWordByWordCheckBox, SIGNAL( toggled( bool ) ), this, SIGNAL( wordByWordChanged( bool ) ) );
- connect( capitalisationButtonGroup, SIGNAL( clicked( int ) ), this, SIGNAL( capitalisationChanged( int ) ) );
+ connect( underlineStyleKComboBox, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotUnderlineChanged( int ) ) );
+ connect( underlineLineStyleKComboBox, TQT_SIGNAL( activated( int ) ), this, TQT_SIGNAL( underlineStyleChanged( int ) ) );
+ connect( underlineKColorButton, TQT_SIGNAL( changed( const TQColor & ) ), this, TQT_SIGNAL( underlineColorChanged( const TQColor & ) ) );
+ connect( strikethroughStyleKComboBox, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotStrikethroughChanged( int ) ) );
+ connect( strikethroughLineStyleKComboBox, TQT_SIGNAL( activated( int ) ), this, TQT_SIGNAL( strikethroughStyleChanged( int ) ) );
+ connect( underlineWordByWordCheckBox, TQT_SIGNAL( toggled( bool ) ), this, TQT_SIGNAL( wordByWordChanged( bool ) ) );
+ connect( capitalisationButtonGroup, TQT_SIGNAL( clicked( int ) ), this, TQT_SIGNAL( capitalisationChanged( int ) ) );
}
KoHighlightingTab::~KoHighlightingTab()
@@ -69,7 +69,7 @@ KoTextFormat::UnderlineStyle KoHighlightingTab::getUnderlineStyle() const
return static_cast<KoTextFormat::UnderlineStyle>( underlineLineStyleKComboBox->currentItem() );
}
-QColor KoHighlightingTab::getUnderlineColor() const
+TQColor KoHighlightingTab::getUnderlineColor() const
{
return underlineKColorButton->color();
}
@@ -106,7 +106,7 @@ void KoHighlightingTab::setUnderlineStyle( KoTextFormat::UnderlineStyle item )
emit underlineStyleChanged( static_cast<int>( item ) );
}
-void KoHighlightingTab::setUnderlineColor( const QColor &color )
+void KoHighlightingTab::setUnderlineColor( const TQColor &color )
{
underlineKColorButton->setColor( color );
}
diff --git a/lib/kotext/KoHighlightingTab.h b/lib/kotext/KoHighlightingTab.h
index 3e0c261c..b60b6582 100644
--- a/lib/kotext/KoHighlightingTab.h
+++ b/lib/kotext/KoHighlightingTab.h
@@ -23,19 +23,20 @@
#include <kohighlightingtabbase.h>
#include <KoTextFormat.h>
-#include <qcolor.h>
+#include <tqcolor.h>
class KoHighlightingTab : public KoHighlightingTabBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoHighlightingTab( QWidget* parent=0, const char* name=0, WFlags fl=0 );
+ KoHighlightingTab( TQWidget* tqparent=0, const char* name=0, WFlags fl=0 );
~KoHighlightingTab();
KoTextFormat::UnderlineType getUnderline() const;
KoTextFormat::UnderlineStyle getUnderlineStyle() const;
- QColor getUnderlineColor() const;
+ TQColor getUnderlineColor() const;
KoTextFormat::StrikeOutType getStrikethrough() const;
KoTextFormat::StrikeOutStyle getStrikethroughStyle() const;
bool getWordByWord() const;
@@ -43,7 +44,7 @@ public:
void setUnderline( KoTextFormat::UnderlineType item );
void setUnderlineStyle( KoTextFormat::UnderlineStyle item );
- void setUnderlineColor( const QColor &color );
+ void setUnderlineColor( const TQColor &color );
void setStrikethrough( int item );
void setStrikethroughStyle( int item );
void setWordByWord( bool state );
@@ -52,7 +53,7 @@ public:
signals:
void underlineChanged( int item );
void underlineStyleChanged( int item );
- void underlineColorChanged( const QColor & );
+ void underlineColorChanged( const TQColor & );
void strikethroughChanged( int item );
void strikethroughStyleChanged( int item );
void wordByWordChanged( bool state );
diff --git a/lib/kotext/KoImportStyleDia.cpp b/lib/kotext/KoImportStyleDia.cpp
index 80be24ca..99ff15b4 100644
--- a/lib/kotext/KoImportStyleDia.cpp
+++ b/lib/kotext/KoImportStyleDia.cpp
@@ -18,29 +18,29 @@
*/
#include <klocale.h>
-#include <qvbox.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlistbox.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqlistbox.h>
#include "KoImportStyleDia.h"
#include <kdebug.h>
-#include <qlabel.h>
+#include <tqlabel.h>
-KoImportStyleDia::KoImportStyleDia( KoStyleCollection* currentCollection, QWidget *parent, const char *name )
- : KDialogBase( parent, name , true, "", Ok|Cancel|User1, Ok, true )
+KoImportStyleDia::KoImportStyleDia( KoStyleCollection* currentCollection, TQWidget *tqparent, const char *name )
+ : KDialogBase( tqparent, name , true, "", Ok|Cancel|User1, Ok, true )
{
setCaption( i18n("Import Styles") );
m_currentCollection = currentCollection;
- QVBox *page = makeVBoxMainWidget();
- new QLabel(i18n("Select styles to import:"), page);
- m_listStyleName = new QListBox( page );
- m_listStyleName->setSelectionMode( QListBox::Multi );
+ TQVBox *page = makeVBoxMainWidget();
+ new TQLabel(i18n("Select styles to import:"), page);
+ m_listStyleName = new TQListBox( page );
+ m_listStyleName->setSelectionMode( TQListBox::Multi );
enableButtonOK( m_listStyleName->count() != 0 );
setButtonText( KDialogBase::User1, i18n("Load...") );
- connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotLoadFile()));
- setInitialSize( QSize( 300, 400 ) );
+ connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotLoadFile()));
+ setInitialSize( TQSize( 300, 400 ) );
setFocus();
}
@@ -65,8 +65,8 @@ void KoImportStyleDia::generateStyleList()
void KoImportStyleDia::updateFollowingStyle( KoParagStyle* removedStyle )
{
- QValueList<KoUserStyle *> lst = m_styleList.styleList();
- for( QValueList<KoUserStyle *>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TQValueList<KoUserStyle *> lst = m_styleList.styleList();
+ for( TQValueList<KoUserStyle *>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *it );
if ( style->followingStyle() == removedStyle )
{
@@ -92,26 +92,26 @@ void KoImportStyleDia::slotOk()
KDialogBase::slotOk();
}
-QString KoImportStyleDia::generateStyleName( const QString & templateName ) const
+TQString KoImportStyleDia::generateStyleName( const TQString & templateName ) const
{
- QString name;
+ TQString name;
int num = 1;
bool exists;
do {
- name = templateName.arg( num );
+ name = templateName.tqarg( num );
exists = m_currentCollection->findStyle( name ) != 0;
++num;
} while ( exists );
return name;
}
-QString KoImportStyleDia::generateStyleDisplayName( const QString & templateName ) const
+TQString KoImportStyleDia::generateStyleDisplayName( const TQString & templateName ) const
{
- QString name;
+ TQString name;
int num = 1;
bool exists;
do {
- name = templateName.arg( num );
+ name = templateName.tqarg( num );
exists = m_currentCollection->findStyleByDisplayName( name ) != 0;
++num;
} while ( exists );
diff --git a/lib/kotext/KoImportStyleDia.h b/lib/kotext/KoImportStyleDia.h
index 70a458de..eaf24f5c 100644
--- a/lib/kotext/KoImportStyleDia.h
+++ b/lib/kotext/KoImportStyleDia.h
@@ -21,19 +21,20 @@
#define __KoImportStyleDia__
#include <kdialogbase.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <KoStyleCollection.h>
-class QLineEdit;
-class QListBox;
-class QPushButton;
+class TQLineEdit;
+class TQListBox;
+class TQPushButton;
class KOTEXT_EXPORT KoImportStyleDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/// @param currentCollection collection of styles already present in the document
/// (this is used to avoid conflicts in the style names and displayNames)
- KoImportStyleDia( KoStyleCollection* currentCollection, QWidget *parent, const char *name );
+ KoImportStyleDia( KoStyleCollection* currentCollection, TQWidget *tqparent, const char *name );
~KoImportStyleDia();
const KoStyleCollection& importedStyles() const { return m_styleList; }
@@ -48,8 +49,8 @@ protected:
virtual void loadFile()=0;
void clear();
- QString generateStyleName( const QString & templateName ) const;
- QString generateStyleDisplayName( const QString & templateName ) const;
+ TQString generateStyleName( const TQString & templateName ) const;
+ TQString generateStyleDisplayName( const TQString & templateName ) const;
// @return collection of styles already present in the document
const KoStyleCollection* currentCollection() const { return m_currentCollection; }
@@ -57,7 +58,7 @@ protected:
void initList();
// used by subclasses, hmm...
- QListBox *m_listStyleName;
+ TQListBox *m_listStyleName;
KoStyleCollection m_styleList;
private:
diff --git a/lib/kotext/KoLanguageTab.cpp b/lib/kotext/KoLanguageTab.cpp
index 1dff08d4..47fb045e 100644
--- a/lib/kotext/KoLanguageTab.cpp
+++ b/lib/kotext/KoLanguageTab.cpp
@@ -23,43 +23,43 @@
#include <kcombobox.h>
#include <kiconloader.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include "KoLanguageTab.moc"
-KoLanguageTab::KoLanguageTab( KSpell2::Broker::Ptr broker, QWidget* parent, const char* name, WFlags fl )
- : KoLanguageTabBase( parent, name, fl )
+KoLanguageTab::KoLanguageTab( KSpell2::Broker::Ptr broker, TQWidget* tqparent, const char* name, WFlags fl )
+ : KoLanguageTabBase( tqparent, name, fl )
{
- const QStringList langNames = KoGlobal::listOfLanguages();
- const QStringList langTags = KoGlobal::listTagOfLanguages();
- QStringList spellCheckLanguages;
+ const TQStringList langNames = KoGlobal::listOfLanguages();
+ const TQStringList langTags = KoGlobal::listTagOfLanguages();
+ TQStringList spellCheckLanguages;
if ( broker )
spellCheckLanguages = broker->languages();
- QStringList::ConstIterator itName = langNames.begin();
- QStringList::ConstIterator itTag = langTags.begin();
+ TQStringList::ConstIterator itName = langNames.begin();
+ TQStringList::ConstIterator itTag = langTags.begin();
for ( ; itName != langNames.end() && itTag != langTags.end(); ++itName, ++itTag )
{
- if ( spellCheckLanguages.find( *itTag ) != spellCheckLanguages.end() )
+ if ( spellCheckLanguages.tqfind( *itTag ) != spellCheckLanguages.end() )
languageKComboBox->insertItem( SmallIcon( "spellcheck" ), *itName );
else
languageKComboBox->insertItem( *itName );
}
- connect( languageKComboBox, SIGNAL( activated( int ) ), this, SIGNAL( languageChanged() ) );
+ connect( languageKComboBox, TQT_SIGNAL( activated( int ) ), this, TQT_SIGNAL( languageChanged() ) );
}
KoLanguageTab::~KoLanguageTab()
{
}
-QString KoLanguageTab::getLanguage() const
+TQString KoLanguageTab::getLanguage() const
{
return KoGlobal::tagOfLanguage( languageKComboBox->currentText() );
}
-void KoLanguageTab::setLanguage( const QString &item )
+void KoLanguageTab::setLanguage( const TQString &item )
{
languageKComboBox->setCurrentText( KoGlobal::languageFromTag( item ) );
}
diff --git a/lib/kotext/KoLanguageTab.h b/lib/kotext/KoLanguageTab.h
index cc80c4b8..f33c85e6 100644
--- a/lib/kotext/KoLanguageTab.h
+++ b/lib/kotext/KoLanguageTab.h
@@ -27,13 +27,14 @@
class KoLanguageTab : public KoLanguageTabBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoLanguageTab( KSpell2::Broker::Ptr broker = 0, QWidget* parent=0, const char* name=0, WFlags fl=0 );
+ KoLanguageTab( KSpell2::Broker::Ptr broker = 0, TQWidget* tqparent=0, const char* name=0, WFlags fl=0 );
~KoLanguageTab();
- QString getLanguage() const;
- void setLanguage( const QString &item );
+ TQString getLanguage() const;
+ void setLanguage( const TQString &item );
signals:
void languageChanged();
diff --git a/lib/kotext/KoLayoutTab.cpp b/lib/kotext/KoLayoutTab.cpp
index f1a87a8d..2ec9da69 100644
--- a/lib/kotext/KoLayoutTab.cpp
+++ b/lib/kotext/KoLayoutTab.cpp
@@ -22,21 +22,21 @@
#include <knuminput.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqspinbox.h>
#include "KoLayoutTab.moc"
-KoLayoutTab::KoLayoutTab( bool withSubSuperScript, QWidget* parent, const char* name, WFlags fl )
- : KoLayoutTabBase( parent, name, fl )
+KoLayoutTab::KoLayoutTab( bool withSubSuperScript, TQWidget* tqparent, const char* name, WFlags fl )
+ : KoLayoutTabBase( tqparent, name, fl )
{
if ( !withSubSuperScript ) positionButtonGroup->hide();
- connect( positionButtonGroup, SIGNAL( clicked( int ) ), this, SLOT( slotSubSuperScriptChanged( int ) ) );
- connect( offsetSpinBox, SIGNAL( valueChanged( int ) ), this, SIGNAL( offsetChanged( int ) ) );
- connect( relativeSizeKDoubleSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( slotRelativeSizeChanged( double ) ) );
- connect( hyphenateCheckBox, SIGNAL( toggled( bool ) ), this, SIGNAL( hyphenationChanged( bool ) ) );
+ connect( positionButtonGroup, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( slotSubSuperScriptChanged( int ) ) );
+ connect( offsetSpinBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SIGNAL( offsetChanged( int ) ) );
+ connect( relativeSizeKDoubleSpinBox, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( slotRelativeSizeChanged( double ) ) );
+ connect( hyphenateCheckBox, TQT_SIGNAL( toggled( bool ) ), this, TQT_SIGNAL( hyphenationChanged( bool ) ) );
}
KoLayoutTab::~KoLayoutTab()
diff --git a/lib/kotext/KoLayoutTab.h b/lib/kotext/KoLayoutTab.h
index cc40d02c..6620721d 100644
--- a/lib/kotext/KoLayoutTab.h
+++ b/lib/kotext/KoLayoutTab.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __kolayouttab_h__
-#define __kolayouttab_h__
+#ifndef __kotqlayouttab_h__
+#define __kotqlayouttab_h__
#include <kolayouttabbase.h>
#include <KoTextFormat.h>
@@ -26,9 +26,10 @@
class KoLayoutTab : public KoLayoutTabBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoLayoutTab( bool withSubSuperScript, QWidget* parent=0, const char* name=0, WFlags fl=0 );
+ KoLayoutTab( bool withSubSuperScript, TQWidget* tqparent=0, const char* name=0, WFlags fl=0 );
~KoLayoutTab();
KoTextFormat::VerticalAlignment getSubSuperScript() const;
diff --git a/lib/kotext/KoListStyleStack.cpp b/lib/kotext/KoListStyleStack.cpp
index 45631b07..346eb5d5 100644
--- a/lib/kotext/KoListStyleStack.cpp
+++ b/lib/kotext/KoListStyleStack.cpp
@@ -16,7 +16,7 @@ void KoListStyleStack::pop()
m_stack.pop();
}
-void KoListStyleStack::push( const QDomElement& style )
+void KoListStyleStack::push( const TQDomElement& style )
{
m_stack.push( style );
}
@@ -27,20 +27,20 @@ void KoListStyleStack::setInitialLevel( int initialLevel )
m_initialLevel = initialLevel;
}
-QDomElement KoListStyleStack::currentListStyle() const
+TQDomElement KoListStyleStack::currentListStyle() const
{
Q_ASSERT( !m_stack.isEmpty() );
return m_stack.top();
}
-QDomElement KoListStyleStack::currentListStyleProperties() const
+TQDomElement KoListStyleStack::currentListStyleProperties() const
{
- QDomElement style = currentListStyle();
+ TQDomElement style = currentListStyle();
return KoDom::namedItemNS( style, KoXmlNS::style, "list-level-properties" );
}
-QDomElement KoListStyleStack::currentListStyleTextProperties() const
+TQDomElement KoListStyleStack::currentListStyleTextProperties() const
{
- QDomElement style = currentListStyle();
+ TQDomElement style = currentListStyle();
return KoDom::namedItemNS( style, KoXmlNS::style, "text-properties" );
}
diff --git a/lib/kotext/KoListStyleStack.h b/lib/kotext/KoListStyleStack.h
index 5dc95b4b..0b77bf44 100644
--- a/lib/kotext/KoListStyleStack.h
+++ b/lib/kotext/KoListStyleStack.h
@@ -20,8 +20,8 @@
#ifndef KOLISTSTYLESTACK_H
#define KOLISTSTYLESTACK_H
-#include <qdom.h>
-#include <qvaluestack.h>
+#include <tqdom.h>
+#include <tqvaluestack.h>
/**
* This class implements the list styles currently active at a given point.
@@ -45,14 +45,14 @@ public:
/**
* Pushes the new list-style onto the stack.
*/
- void push( const QDomElement& style );
+ void push( const TQDomElement& style );
/// @return true if we're inside a list (i.e. the stack isn't empty)
bool hasListStyle() const { return !m_stack.isEmpty(); }
/// @return currenty applicable list style, i.e. the one on top of the stack
/// Most list-level properties are the attributes of that element.
- QDomElement currentListStyle() const;
+ TQDomElement currentListStyle() const;
/**
* @return the style:list-level-properties for the currenty applicable list style.
@@ -60,12 +60,12 @@ public:
* like text:min-label-width, text:space-before, and style:font-name
* are the attributes of that element.
*/
- QDomElement currentListStyleProperties() const;
+ TQDomElement currentListStyleProperties() const;
/**
* @return the style:text-properties for the currenty applicable list style.
*/
- QDomElement currentListStyleTextProperties() const;
+ TQDomElement currentListStyleTextProperties() const;
/**
* Set the initial level of the list, i.e. of item at the bottom of the stack.
@@ -82,7 +82,7 @@ public:
private:
- QValueStack<QDomElement> m_stack;
+ TQValueStack<TQDomElement> m_stack;
int m_initialLevel;
};
diff --git a/lib/kotext/KoOasisContext.cpp b/lib/kotext/KoOasisContext.cpp
index 87f4be66..2c9aea8d 100644
--- a/lib/kotext/KoOasisContext.cpp
+++ b/lib/kotext/KoOasisContext.cpp
@@ -33,20 +33,20 @@ KoOasisContext::KoOasisContext( KoDocument* doc, KoVariableCollection& varColl,
{
}
-static QDomElement findListLevelStyle( const QDomElement& fullListStyle, int level )
+static TQDomElement findListLevelStyle( const TQDomElement& fullListStyle, int level )
{
- for ( QDomNode n = fullListStyle.firstChild(); !n.isNull(); n = n.nextSibling() )
+ for ( TQDomNode n = fullListStyle.firstChild(); !n.isNull(); n = n.nextSibling() )
{
- const QDomElement listLevelItem = n.toElement();
- if ( listLevelItem.attributeNS( KoXmlNS::text, "level", QString::null ).toInt() == level )
+ const TQDomElement listLevelItem = n.toElement();
+ if ( listLevelItem.attributeNS( KoXmlNS::text, "level", TQString() ).toInt() == level )
return listLevelItem;
}
- return QDomElement();
+ return TQDomElement();
}
-bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level )
+bool KoOasisContext::pushListLevelStyle( const TQString& listStyleName, int level )
{
- QDomElement* fullListStyle = oasisStyles().listStyles()[listStyleName];
+ TQDomElement* fullListStyle = oasisStyles().listStyles()[listStyleName];
if ( !fullListStyle ) {
kdWarning(32500) << "List style " << listStyleName << " not found!" << endl;
return false;
@@ -57,16 +57,16 @@ bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level
bool KoOasisContext::pushOutlineListLevelStyle( int level )
{
- QDomElement outlineStyle = KoDom::namedItemNS( oasisStyles().officeStyle(), KoXmlNS::text, "outline-style" );
+ TQDomElement outlineStyle = KoDom::namedItemNS( oasisStyles().officeStyle(), KoXmlNS::text, "outline-style" );
return pushListLevelStyle( "<outline-style>", outlineStyle, level );
}
-bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, // for debug only
- const QDomElement& fullListStyle, int level )
+bool KoOasisContext::pushListLevelStyle( const TQString& listStyleName, // for debug only
+ const TQDomElement& fullListStyle, int level )
{
// Find applicable list-level-style for level
int i = level;
- QDomElement listLevelStyle;
+ TQDomElement listLevelStyle;
while ( i > 0 && listLevelStyle.isNull() ) {
listLevelStyle = findListLevelStyle( fullListStyle, i );
--i;
@@ -114,7 +114,7 @@ void KoSavingContext::setCursorPosition( KoTextParag* cursorTextParagraph,
m_cursorTextIndex = cursorTextIndex;
}
-void KoSavingContext::addFontFace( const QString& fontName )
+void KoSavingContext::addFontFace( const TQString& fontName )
{
m_fontFaces[fontName] = true;
}
@@ -122,8 +122,8 @@ void KoSavingContext::addFontFace( const QString& fontName )
void KoSavingContext::writeFontFaces( KoXmlWriter& writer )
{
writer.startElement( "office:font-face-decls" );
- const QStringList fontFaces = m_fontFaces.keys();
- for ( QStringList::const_iterator ffit = fontFaces.begin(), ffend = fontFaces.end() ; ffit != ffend ; ++ffit ) {
+ const TQStringList fontFaces = m_fontFaces.keys();
+ for ( TQStringList::const_iterator ffit = fontFaces.begin(), ffend = fontFaces.end() ; ffit != ffend ; ++ffit ) {
writer.startElement( "style:font-face" );
writer.addAttribute( "style:name", *ffit );
writer.addAttribute( "svg:font-family", *ffit );
diff --git a/lib/kotext/KoOasisContext.h b/lib/kotext/KoOasisContext.h
index 9be3e2ab..70b7c7db 100644
--- a/lib/kotext/KoOasisContext.h
+++ b/lib/kotext/KoOasisContext.h
@@ -63,12 +63,12 @@ public:
///// List handling
KoListStyleStack& listStyleStack() { return m_listStyleStack; }
- QString currentListStyleName() const { return m_currentListStyleName; }
- void setCurrentListStyleName( const QString& s ) { m_currentListStyleName = s; }
+ TQString currentListStyleName() const { return m_currentListStyleName; }
+ void setCurrentListStyleName( const TQString& s ) { m_currentListStyleName = s; }
/// Used for lists (numbered paragraphs)
/// @return true on success (a list style was found and pushed)
- bool pushListLevelStyle( const QString& listStyleName, int level );
+ bool pushListLevelStyle( const TQString& listStyleName, int level );
/// Used for outline levels
bool pushOutlineListLevelStyle( int level );
@@ -81,11 +81,11 @@ public:
private:
/// @return true on success (a list style was found and pushed)
- bool pushListLevelStyle( const QString& listStyleName, const QDomElement& fullListStyle, int level );
+ bool pushListLevelStyle( const TQString& listStyleName, const TQDomElement& fullListStyle, int level );
private:
KoListStyleStack m_listStyleStack;
- QString m_currentListStyleName;
+ TQString m_currentListStyleName;
KoVariableCollection& m_varColl;
KoTextParag* m_cursorTextParagraph;
@@ -138,17 +138,17 @@ public:
/// Store bookmarks [for the current text paragraph beind saved]
/// so that KoTextParag can save them at the right place inside the text
struct BookmarkPosition {
- BookmarkPosition() : name(), pos( -1 ), startEqualsEnd( false ) {} // for QValueList
- BookmarkPosition( const QString& nm, int p, bool simple )
+ BookmarkPosition() : name(), pos( -1 ), startEqualsEnd( false ) {} // for TQValueList
+ BookmarkPosition( const TQString& nm, int p, bool simple )
: name( nm ), pos( p ), startEqualsEnd( simple ) {}
- QString name;
+ TQString name;
int pos;
bool startEqualsEnd;
bool operator<( BookmarkPosition& rhs ) const {
return pos < rhs.pos;
}
};
- typedef QValueList<BookmarkPosition> BookmarkPositions;
+ typedef TQValueList<BookmarkPosition> BookmarkPositions;
void setBookmarkPositions( const BookmarkPositions& bkStarts,
const BookmarkPositions& bkEnds ) {
m_bookmarkStarts = bkStarts;
@@ -157,8 +157,8 @@ public:
const BookmarkPositions& bookmarkStarts() const { return m_bookmarkStarts; }
const BookmarkPositions& bookmarkEnds() const { return m_bookmarkEnds; }
- void addFontFace( const QString& fontName );
- typedef QMap<QString, bool> FontFaces;
+ void addFontFace( const TQString& fontName );
+ typedef TQMap<TQString, bool> FontFaces;
void writeFontFaces( KoXmlWriter& writer );
// See KoParagLayout::saveOasis
diff --git a/lib/kotext/KoParagCounter.cpp b/lib/kotext/KoParagCounter.cpp
index e163f757..71887c2c 100644
--- a/lib/kotext/KoParagCounter.cpp
+++ b/lib/kotext/KoParagCounter.cpp
@@ -27,8 +27,8 @@
#include <KoGenStyles.h>
#include <KoXmlNS.h>
#include <kdebug.h>
-#include <qdom.h>
-#include <qbuffer.h>
+#include <tqdom.h>
+#include <tqbuffer.h>
static KoTextParag * const INVALID_PARAG = (KoTextParag *)-1;
@@ -40,10 +40,10 @@ KoParagCounter::KoParagCounter()
m_startNumber = 1;
m_displayLevels = 1;
m_restartCounter = false;
- m_customBulletChar = QChar( '-' );
- m_customBulletFont = QString::null;
- m_align = Qt::AlignAuto;
- invalidate();
+ m_customBulletChar = TQChar( '-' );
+ m_customBulletFont = TQString();
+ m_align = TQt::AlignAuto;
+ tqinvalidate();
}
bool KoParagCounter::operator==( const KoParagCounter & c2 ) const
@@ -63,17 +63,17 @@ bool KoParagCounter::operator==( const KoParagCounter & c2 ) const
m_custom==c2.m_custom);
}
-QString KoParagCounter::custom() const
+TQString KoParagCounter::custom() const
{
return m_custom;
}
-QChar KoParagCounter::customBulletCharacter() const
+TQChar KoParagCounter::customBulletCharacter() const
{
return m_customBulletChar;
}
-QString KoParagCounter::customBulletFont() const
+TQString KoParagCounter::customBulletFont() const
{
return m_customBulletFont;
}
@@ -83,12 +83,12 @@ unsigned int KoParagCounter::depth() const
return m_depth;
}
-void KoParagCounter::invalidate()
+void KoParagCounter::tqinvalidate()
{
m_cache.number = -1;
- m_cache.text = QString::null;
+ m_cache.text = TQString();
m_cache.width = -1;
- m_cache.parent = INVALID_PARAG;
+ m_cache.tqparent = INVALID_PARAG;
m_cache.counterFormat = 0;
}
@@ -112,7 +112,7 @@ bool KoParagCounter::isBullet() const
return isBullet( m_style );
}
-void KoParagCounter::load( QDomElement & element )
+void KoParagCounter::load( TQDomElement & element )
{
m_numbering = static_cast<Numbering>( element.attribute("numberingtype", "2").toInt() );
m_style = static_cast<Style>( element.attribute("type").toInt() );
@@ -120,14 +120,14 @@ void KoParagCounter::load( QDomElement & element )
if ( m_numbering == NUM_LIST && m_style == STYLE_NONE )
m_numbering = NUM_NONE;
m_depth = element.attribute("depth").toInt();
- m_customBulletChar = QChar( element.attribute("bullet").toInt() );
+ m_customBulletChar = TQChar( element.attribute("bullet").toInt() );
m_prefix = element.attribute("lefttext");
if ( m_prefix.lower() == "(null)" ) // very old kword thing
- m_prefix = QString::null;
+ m_prefix = TQString();
m_suffix = element.attribute("righttext");
if ( m_suffix.lower() == "(null)" )
- m_suffix = QString::null;
- QString s = element.attribute("start");
+ m_suffix = TQString();
+ TQString s = element.attribute("start");
if ( s.isEmpty() )
m_startNumber = 1;
else if ( s[0].isDigit() )
@@ -136,18 +136,18 @@ void KoParagCounter::load( QDomElement & element )
m_startNumber = s.lower()[0].latin1() - 'a' + 1;
s = element.attribute("display-levels");
if ( !s.isEmpty() )
- m_displayLevels = QMIN( s.toInt(), m_depth+1 ); // can't be > depth+1
+ m_displayLevels = TQMIN( s.toInt(), m_depth+1 ); // can't be > depth+1
else // Not specified -> compat with koffice-1.2: make equal to depth+1
m_displayLevels = m_depth+1;
m_customBulletFont = element.attribute("bulletfont");
m_custom = element.attribute("customdef");
m_align = element.attribute("align", "0").toInt(); //AlignAuto as defeult
- QString restart = element.attribute("restart");
+ TQString restart = element.attribute("restart");
m_restartCounter = (restart == "true") || (restart == "1");
- invalidate();
+ tqinvalidate();
}
-static int importCounterType( QChar numFormat )
+static int importCounterType( TQChar numFormat )
{
if ( numFormat == '1' )
return KoParagCounter::STYLE_NUM;
@@ -163,7 +163,7 @@ static int importCounterType( QChar numFormat )
}
// should only be called with style != none and != a bullet.
-static QChar exportCounterType( KoParagCounter::Style style )
+static TQChar exportCounterType( KoParagCounter::Style style )
{
static const int s_oasisCounterTypes[] =
{ '\0', '1', 'a', 'A', 'i', 'I',
@@ -173,22 +173,22 @@ static QChar exportCounterType( KoParagCounter::Style style )
0x25CF, // disc -> large disc
0x27A2 // box -> right-pointing triangle
};
- return QChar( s_oasisCounterTypes[ style ] );
+ return TQChar( s_oasisCounterTypes[ style ] );
}
void KoParagCounter::loadOasis( KoOasisContext& context, int restartNumbering,
bool orderedList, bool heading, int level, bool loadingStyle )
{
- const QDomElement listStyle = context.listStyleStack().currentListStyle();
- const QDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
- const QDomElement listStyleTextProperties = context.listStyleStack().currentListStyleTextProperties();
+ const TQDomElement listStyle = context.listStyleStack().currentListStyle();
+ const TQDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
+ const TQDomElement listStyleTextProperties = context.listStyleStack().currentListStyleTextProperties();
loadOasisListStyle( listStyle, listStyleProperties, listStyleTextProperties,
restartNumbering, orderedList, heading, level, loadingStyle );
}
-void KoParagCounter::loadOasisListStyle( const QDomElement& listStyle,
- const QDomElement& listStyleProperties,
- const QDomElement& listStyleTextProperties,
+void KoParagCounter::loadOasisListStyle( const TQDomElement& listStyle,
+ const TQDomElement& listStyleProperties,
+ const TQDomElement& listStyleTextProperties,
int restartNumbering,
bool orderedList, bool heading, int level,
bool loadingStyle )
@@ -197,26 +197,26 @@ void KoParagCounter::loadOasisListStyle( const QDomElement& listStyle,
m_depth = level - 1; // depth start at 0
// restartNumbering can either be provided by caller, or taken from the style
if ( restartNumbering == -1 && listStyle.hasAttributeNS( KoXmlNS::text, "start-value" ) )
- restartNumbering = listStyle.attributeNS( KoXmlNS::text, "start-value", QString::null ).toInt();
+ restartNumbering = listStyle.attributeNS( KoXmlNS::text, "start-value", TQString() ).toInt();
// styles have a start-value, but that doesn't mean restartNumbering, as it does for paragraphs
m_restartCounter = loadingStyle ? false : ( restartNumbering != -1 );
m_startNumber = ( restartNumbering != -1 ) ? restartNumbering : 1;
//kdDebug() << k_funcinfo << "IN: restartNumbering=" << restartNumbering << " OUT: m_restartCounter=" << m_restartCounter << " m_startNumber=" << m_startNumber << endl;
- m_prefix = listStyle.attributeNS( KoXmlNS::style, "num-prefix", QString::null );
- m_suffix = listStyle.attributeNS( KoXmlNS::style, "num-suffix", QString::null );
+ m_prefix = listStyle.attributeNS( KoXmlNS::style, "num-prefix", TQString() );
+ m_suffix = listStyle.attributeNS( KoXmlNS::style, "num-suffix", TQString() );
if ( orderedList || heading ) {
- m_style = static_cast<Style>( importCounterType( listStyle.attributeNS( KoXmlNS::style, "num-format", QString::null)[0] ) );
- QString dl = listStyle.attributeNS( KoXmlNS::text, "display-levels", QString::null );
+ m_style = static_cast<Style>( importCounterType( listStyle.attributeNS( KoXmlNS::style, "num-format", TQString())[0] ) );
+ TQString dl = listStyle.attributeNS( KoXmlNS::text, "display-levels", TQString() );
m_displayLevels = dl.isEmpty() ? 1 : dl.toInt();
} else { // bullets, see 3.3.6 p138
m_style = STYLE_CUSTOMBULLET;
- QString bulletChar = listStyle.attributeNS( KoXmlNS::text, "bullet-char", QString::null );
+ TQString bulletChar = listStyle.attributeNS( KoXmlNS::text, "bullet-char", TQString() );
if ( !bulletChar.isEmpty() ) {
// Reverse engineering, I found those codes:
- switch( bulletChar[0].unicode() ) {
+ switch( bulletChar[0].tqunicode() ) {
case 0x2022: // small disc -> circle
m_style = STYLE_CIRCLEBULLET;
break;
@@ -235,22 +235,22 @@ void KoParagCounter::loadOasisListStyle( const QDomElement& listStyle,
m_style = STYLE_BOXBULLET;
break;
default:
- kdDebug() << "Unhandled bullet code 0x" << QString::number( (uint)m_customBulletChar.unicode(), 16 ) << endl;
+ kdDebug() << "Unhandled bullet code 0x" << TQString::number( (uint)m_customBulletChar.tqunicode(), 16 ) << endl;
// fallback
case 0x2794: // arrow
case 0x2717: // cross
case 0x2714: // checkmark
m_customBulletChar = bulletChar[0];
- // often StarSymbol when it comes from OO; doesn't matter, Qt finds it in another font if needed.
+ // often StarSymbol when it comes from OO; doesn't matter, TQt finds it in another font if needed.
if ( listStyleProperties.hasAttributeNS( KoXmlNS::style, "font-name" ) )
{
- m_customBulletFont = listStyleProperties.attributeNS( KoXmlNS::style, "font-name", QString::null );
- kdDebug() << "m_customBulletFont style:font-name = " << listStyleProperties.attributeNS( KoXmlNS::style, "font-name", QString::null ) << endl;
+ m_customBulletFont = listStyleProperties.attributeNS( KoXmlNS::style, "font-name", TQString() );
+ kdDebug() << "m_customBulletFont style:font-name = " << listStyleProperties.attributeNS( KoXmlNS::style, "font-name", TQString() ) << endl;
}
else if ( listStyleTextProperties.hasAttributeNS( KoXmlNS::fo, "font-family" ) )
{
- m_customBulletFont = listStyleTextProperties.attributeNS( KoXmlNS::fo, "font-family", QString::null );
- kdDebug() << "m_customBulletFont fo:font-family = " << listStyleTextProperties.attributeNS( KoXmlNS::fo, "font-family", QString::null ) << endl;
+ m_customBulletFont = listStyleTextProperties.attributeNS( KoXmlNS::fo, "font-family", TQString() );
+ kdDebug() << "m_customBulletFont fo:font-family = " << listStyleTextProperties.attributeNS( KoXmlNS::fo, "font-family", TQString() ) << endl;
}
// ## TODO in fact we're supposed to read it from the style pointed to by text:style-name
break;
@@ -259,7 +259,7 @@ void KoParagCounter::loadOasisListStyle( const QDomElement& listStyle,
m_style = STYLE_DISCBULLET;
}
}
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::saveOasis( KoGenStyle& listStyle, bool savingStyle ) const
@@ -267,16 +267,16 @@ void KoParagCounter::saveOasis( KoGenStyle& listStyle, bool savingStyle ) const
Q_ASSERT( (Style)m_style != STYLE_NONE );
// Prepare a sub-xmlwriter for the list-level-style-* element
- QBuffer buffer;
+ TQBuffer buffer;
buffer.open( IO_WriteOnly );
- KoXmlWriter listLevelWriter( &buffer, 3 /*indentation*/ );
+ KoXmlWriter listLevelWriter( TQT_TQIODEVICE(&buffer), 3 /*indentation*/ );
const char* tagName = isBullet() ? "text:list-level-style-bullet" : "text:list-level-style-number";
listLevelWriter.startElement( tagName );
saveOasisListLevel( listLevelWriter, true, savingStyle );
listLevelWriter.endElement();
- const QString listLevelContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
+ const TQString listLevelContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
listStyle.addChildElement( tagName, listLevelContents );
}
@@ -289,7 +289,7 @@ void KoParagCounter::saveOasisListLevel( KoXmlWriter& listLevelWriter, bool incl
if ( isBullet() )
{
- QChar bulletChar;
+ TQChar bulletChar;
if ( (Style)m_style == STYLE_CUSTOMBULLET )
{
bulletChar = m_customBulletChar;
@@ -299,7 +299,7 @@ void KoParagCounter::saveOasisListLevel( KoXmlWriter& listLevelWriter, bool incl
{
bulletChar = exportCounterType( (Style)m_style );
}
- listLevelWriter.addAttribute( "text:bullet-char", QString( bulletChar ) );
+ listLevelWriter.addAttribute( "text:bullet-char", TQString( bulletChar ) );
}
else
{
@@ -308,7 +308,7 @@ void KoParagCounter::saveOasisListLevel( KoXmlWriter& listLevelWriter, bool incl
if ( (Style)m_style == STYLE_CUSTOM )
; // not implemented
else
- listLevelWriter.addAttribute( "style:num-format", QString( exportCounterType( (Style)m_style ) ) );
+ listLevelWriter.addAttribute( "style:num-format", TQString( exportCounterType( (Style)m_style ) ) );
// m_startNumber/m_restartCounter is saved by kotextparag itself, except for styles.
if ( savingStyle && m_restartCounter ) {
@@ -324,9 +324,9 @@ void KoParagCounter::saveOasisListLevel( KoXmlWriter& listLevelWriter, bool incl
if ( includeLevelAndProperties ) // false when called for footnotes-configuration
{
listLevelWriter.startElement( "style:list-level-properties" );
- listLevelWriter.addAttribute( "fo:text-align", KoParagLayout::saveOasisAlignment( (Qt::AlignmentFlags)m_align ) );
+ listLevelWriter.addAttribute( "fo:text-align", KoParagLayout::saveOasisAlignment( (TQt::AlignmentFlags)m_align ) );
// OASIS has other style properties: text:space-before (indent), text:min-label-width (TODO),
- // text:min-label-distance, style:font-name (for bullets), image size and vertical alignment.
+ // text:min-label-distance, style:font-name (for bullets), image size and vertical tqalignment.
listLevelWriter.endElement(); // style:list-level-properties
}
}
@@ -345,7 +345,7 @@ int KoParagCounter::number( const KoTextParag *paragraph )
}
// Go looking for another paragraph at the same level or higher level.
- // (This code shares logic with parent())
+ // (This code shares logic with tqparent())
KoTextParag *otherParagraph = paragraph->prev();
KoParagCounter *otherCounter;
@@ -434,11 +434,11 @@ KoParagCounter::Numbering KoParagCounter::numbering() const
}
// Go looking for another paragraph at a higher level.
-KoTextParag *KoParagCounter::parent( const KoTextParag *paragraph )
+KoTextParag *KoParagCounter::tqparent( const KoTextParag *paragraph )
{
// Return cached value if possible.
- if ( m_cache.parent != INVALID_PARAG )
- return m_cache.parent;
+ if ( m_cache.tqparent != INVALID_PARAG )
+ return m_cache.tqparent;
KoTextParag *otherParagraph = paragraph->prev();
KoParagCounter *otherCounter;
@@ -489,22 +489,22 @@ KoTextParag *KoParagCounter::parent( const KoTextParag *paragraph )
}
break;
}
- m_cache.parent = otherParagraph;
- return m_cache.parent;
+ m_cache.tqparent = otherParagraph;
+ return m_cache.tqparent;
}
-QString KoParagCounter::prefix() const
+TQString KoParagCounter::prefix() const
{
return m_prefix;
}
-void KoParagCounter::save( QDomElement & element )
+void KoParagCounter::save( TQDomElement & element )
{
element.setAttribute( "type", static_cast<int>( m_style ) );
element.setAttribute( "depth", m_depth );
if ( (Style)m_style == STYLE_CUSTOMBULLET )
{
- element.setAttribute( "bullet", m_customBulletChar.unicode() );
+ element.setAttribute( "bullet", m_customBulletChar.tqunicode() );
if ( !m_customBulletFont.isEmpty() )
element.setAttribute( "bulletfont", m_customBulletFont );
}
@@ -528,69 +528,69 @@ void KoParagCounter::save( QDomElement & element )
element.setAttribute( "align", m_align );
}
-void KoParagCounter::setCustom( QString c )
+void KoParagCounter::setCustom( TQString c )
{
m_custom = c;
- invalidate();
+ tqinvalidate();
}
-void KoParagCounter::setCustomBulletCharacter( QChar c )
+void KoParagCounter::setCustomBulletCharacter( TQChar c )
{
m_customBulletChar = c;
- invalidate();
+ tqinvalidate();
}
-void KoParagCounter::setCustomBulletFont( QString f )
+void KoParagCounter::setCustomBulletFont( TQString f )
{
m_customBulletFont = f;
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::setDepth( unsigned int d )
{
m_depth = d;
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::setNumbering( Numbering n )
{
m_numbering = n;
- invalidate();
+ tqinvalidate();
}
-void KoParagCounter::setPrefix( QString p )
+void KoParagCounter::setPrefix( TQString p )
{
m_prefix = p;
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::setStartNumber( int s )
{
m_startNumber = s;
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::setDisplayLevels( int l )
{
m_displayLevels = l;
- invalidate();
+ tqinvalidate();
}
-void KoParagCounter::setAlignment( int a )
+void KoParagCounter::tqsetAlignment( int a )
{
m_align = a;
- invalidate();
+ tqinvalidate();
}
void KoParagCounter::setStyle( Style s )
{
m_style = s;
- invalidate();
+ tqinvalidate();
}
-void KoParagCounter::setSuffix( QString s )
+void KoParagCounter::setSuffix( TQString s )
{
m_suffix = s;
- invalidate();
+ tqinvalidate();
}
int KoParagCounter::startNumber() const
@@ -603,7 +603,7 @@ int KoParagCounter::displayLevels() const
return m_displayLevels;
}
-int KoParagCounter::alignment() const
+int KoParagCounter::tqalignment() const
{
return m_align;
}
@@ -613,7 +613,7 @@ KoParagCounter::Style KoParagCounter::style() const
return m_style;
}
-QString KoParagCounter::suffix() const
+TQString KoParagCounter::suffix() const
{
return m_suffix;
}
@@ -626,11 +626,11 @@ bool KoParagCounter::restartCounter() const
void KoParagCounter::setRestartCounter( bool restart )
{
m_restartCounter = restart;
- invalidate();
+ tqinvalidate();
}
// Return the text for that level only
-QString KoParagCounter::levelText( const KoTextParag *paragraph )
+TQString KoParagCounter::levelText( const KoTextParag *paragraph )
{
if ( m_numbering == NUM_NONE )
return "";
@@ -643,7 +643,7 @@ QString KoParagCounter::levelText( const KoTextParag *paragraph )
bullet = false;
}
- QString text;
+ TQString text;
if ( !bullet )
{
// Ensure paragraph number is valid.
@@ -705,7 +705,7 @@ QString KoParagCounter::levelText( const KoTextParag *paragraph )
}
// Return the full text to be displayed
-QString KoParagCounter::text( const KoTextParag *paragraph )
+TQString KoParagCounter::text( const KoTextParag *paragraph )
{
// Return cached value if possible.
if ( !m_cache.text.isNull() )
@@ -714,14 +714,14 @@ QString KoParagCounter::text( const KoTextParag *paragraph )
// If necessary, grab the text of the preceding levels.
if ( m_displayLevels > 1 && m_numbering != NUM_NONE )
{
- KoTextParag* p = parent( paragraph );
- int displayLevels = QMIN( m_displayLevels, m_depth+1 ); // can't be >depth+1
+ KoTextParag* p = tqparent( paragraph );
+ int displayLevels = TQMIN( m_displayLevels, m_depth+1 ); // can't be >depth+1
for ( int level = 1 ; level < displayLevels ; ++level ) {
//kdDebug() << "additional level=" << level << "/" << displayLevels-1 << endl;
if ( p )
{
KoParagCounter* counter = p->counter();
- QString str = counter->levelText( p );
+ TQString str = counter->levelText( p );
// If the preceding level is a bullet, replace it with blanks.
if ( counter->isBullet() )
for ( unsigned i = 0; i < str.length(); i++ )
@@ -729,7 +729,7 @@ QString KoParagCounter::text( const KoTextParag *paragraph )
str.append('.'); // hardcoded on purpose (like OO) until anyone complains
- // Find the number of missing parents, and add dummy text for them.
+ // Find the number of missing tqparents, and add dummy text for them.
int missingParents = m_depth - level - p->counter()->m_depth;
//kdDebug() << "levelText = " << str << " missingParents=" << missingParents << endl;
level += missingParents;
@@ -740,9 +740,9 @@ QString KoParagCounter::text( const KoTextParag *paragraph )
m_cache.text.prepend( str );
// Prepare next iteration
if ( level < displayLevels ) // no need to calc it if we won't use it
- p = counter->parent( p );
+ p = counter->tqparent( p );
}
- else // toplevel parents are missing
+ else // toplevel tqparents are missing
{
// Special case for one-paragraph-documents like preview widgets
KoTextDocument* textdoc = paragraph->textDocument();
@@ -761,7 +761,7 @@ QString KoParagCounter::text( const KoTextParag *paragraph )
// Now apply prefix and suffix
// We want the '.' to be before the number in a RTL parag,
- // but we can't paint the whole string using QPainter::RTL direction, otherwise
+ // but we can't paint the whole string using TQPainter::RTL direction, otherwise
// '10' becomes '01'.
m_cache.text.prepend( paragraph->string()->isRightToLeft() ? suffix() : prefix() );
m_cache.text.append( paragraph->string()->isRightToLeft() ? prefix() : suffix() );
@@ -786,14 +786,14 @@ int KoParagCounter::width( const KoTextParag *paragraph )
m_cache.width = 0;
if ( m_style != STYLE_NONE || m_numbering == NUM_FOOTNOTE)
{
- QString text = m_cache.text;
+ TQString text = m_cache.text;
if ( m_style == STYLE_CUSTOMBULLET && !text.isEmpty() )
{
text.append( " " ); // append two trailing spaces, see KoTextParag::drawLabel
}
else if ( !text.isEmpty() )
text.append( ' ' ); // append a trailing space, see KoTextParag::drawLabel
- QFontMetrics fm = m_cache.counterFormat->refFontMetrics();
+ TQFontMetrics fm = m_cache.counterFormat->refFontMetrics();
for ( unsigned int i = 0; i < text.length(); i++ )
//m_cache.width += m_cache.counterFormat->width( text, i );
m_cache.width += fm.width( text[i] );
@@ -811,8 +811,8 @@ int KoParagCounter::bulletX()
Q_ASSERT( m_cache.width != -1 );
Q_ASSERT( m_cache.counterFormat );
int x = 0;
- QFontMetrics fm = m_cache.counterFormat->refFontMetrics();
- QString text = prefix();
+ TQFontMetrics fm = m_cache.counterFormat->refFontMetrics();
+ TQString text = prefix();
for ( unsigned int i = 0; i < text.length(); i++ )
x += fm.width( text[i] );
// Now go from 100%-zoom to LU
@@ -831,53 +831,53 @@ KoTextFormat* KoParagCounter::counterFormat( const KoTextParag *paragraph )
///
-const QCString RNUnits[] = {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"};
-const QCString RNTens[] = {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"};
-const QCString RNHundreds[] = {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"};
-const QCString RNThousands[] = {"", "m", "mm", "mmm"};
+const TQCString RNUnits[] = {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"};
+const TQCString RNTens[] = {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"};
+const TQCString RNHundreds[] = {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"};
+const TQCString RNThousands[] = {"", "m", "mm", "mmm"};
-QString KoParagCounter::makeRomanNumber( int n )
+TQString KoParagCounter::makeRomanNumber( int n )
{
if ( n >= 0 )
- return QString::fromLatin1( RNThousands[ ( n / 1000 ) ] +
+ return TQString::tqfromLatin1( RNThousands[ ( n / 1000 ) ] +
RNHundreds[ ( n / 100 ) % 10 ] +
RNTens[ ( n / 10 ) % 10 ] +
RNUnits[ ( n ) % 10 ] );
else { // should never happen, but better not crash if it does
kdWarning(32500) << "makeRomanNumber: n=" << n << endl;
- return QString::number( n );
+ return TQString::number( n );
}
}
-QString KoParagCounter::makeAlphaUpperNumber( int n )
+TQString KoParagCounter::makeAlphaUpperNumber( int n )
{
- QString tmp;
+ TQString tmp;
char bottomDigit;
while ( n > 26 )
{
bottomDigit = (n-1) % 26;
n = (n-1) / 26;
- tmp.prepend( QChar( 'A' + bottomDigit ) );
+ tmp.prepend( TQChar( 'A' + bottomDigit ) );
}
- tmp.prepend( QChar( 'A' + n -1 ) );
+ tmp.prepend( TQChar( 'A' + n -1 ) );
return tmp;
}
-QString KoParagCounter::makeAlphaLowerNumber( int n )
+TQString KoParagCounter::makeAlphaLowerNumber( int n )
{
- QString tmp;
+ TQString tmp;
char bottomDigit;
while ( n > 26 )
{
bottomDigit = (n-1) % 26;
n = (n-1) / 26;
- tmp.prepend( QChar( 'a' + bottomDigit ) );
+ tmp.prepend( TQChar( 'a' + bottomDigit ) );
}
- tmp.prepend( QChar( 'a' + n - 1 ) );
+ tmp.prepend( TQChar( 'a' + n - 1 ) );
return tmp;
}
-int KoParagCounter::fromRomanNumber( const QString &string )
+int KoParagCounter::fromRomanNumber( const TQString &string )
{
int ret = 0;
int stringStart = 0;
@@ -885,26 +885,26 @@ int KoParagCounter::fromRomanNumber( const QString &string )
for (int base = 1000; base >= 1 && stringStart < stringLen; base /= 10)
{
- const QCString *rn;
+ const TQCString *rn;
int rnNum;
switch (base)
{
case 1000:
rn = RNThousands;
- rnNum = sizeof (RNThousands) / sizeof (const QCString);
+ rnNum = sizeof (RNThousands) / sizeof (const TQCString);
break;
case 100:
rn = RNHundreds;
- rnNum = sizeof (RNHundreds) / sizeof (const QCString);
+ rnNum = sizeof (RNHundreds) / sizeof (const TQCString);
break;
case 10:
rn = RNTens;
- rnNum = sizeof (RNTens) / sizeof (const QCString);
+ rnNum = sizeof (RNTens) / sizeof (const TQCString);
break;
case 1:
default:
rn = RNUnits;
- rnNum = sizeof (RNUnits) / sizeof (const QCString);
+ rnNum = sizeof (RNUnits) / sizeof (const TQCString);
break;
}
@@ -924,7 +924,7 @@ int KoParagCounter::fromRomanNumber( const QString &string )
return (ret == 0 || stringStart != stringLen) ? -1 /*invalid value*/ : ret;
}
-int KoParagCounter::fromAlphaUpperNumber( const QString &string )
+int KoParagCounter::fromAlphaUpperNumber( const TQString &string )
{
int ret = 0;
@@ -945,7 +945,7 @@ int KoParagCounter::fromAlphaUpperNumber( const QString &string )
return (ret == 0) ? -1 /*invalid value*/ : ret;
}
-int KoParagCounter::fromAlphaLowerNumber( const QString &string )
+int KoParagCounter::fromAlphaLowerNumber( const TQString &string )
{
int ret = 0;
@@ -969,11 +969,11 @@ int KoParagCounter::fromAlphaLowerNumber( const QString &string )
#ifndef NDEBUG
void KoParagCounter::printRTDebug( KoTextParag* parag )
{
- QString additionalInfo;
+ TQString additionalInfo;
if ( restartCounter() )
additionalInfo = "[restartCounter]";
if ( m_style == STYLE_CUSTOMBULLET )
- additionalInfo += " [customBullet: " + QString::number( m_customBulletChar.unicode() )
+ additionalInfo += " [customBullet: " + TQString::number( m_customBulletChar.tqunicode() )
+ " in font '" + m_customBulletFont + "']";
static const char * const s_numbering[] = { "List", "Chapter", "None", "Footnote" };
kdDebug(32500) << " Counter style=" << style()
diff --git a/lib/kotext/KoParagCounter.h b/lib/kotext/KoParagCounter.h
index f58a1b93..4f32df58 100644
--- a/lib/kotext/KoParagCounter.h
+++ b/lib/kotext/KoParagCounter.h
@@ -17,9 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qstring.h>
+#include <tqstring.h>
#include <koffice_export.h>
-class QDomElement;
+class TQDomElement;
class KoXmlWriter;
class KoGenStyle;
class KoTextParag;
@@ -40,7 +40,7 @@ public:
/** Invalidate the internal cache. Use it whenever the number associated with this
* counter may have changed. */
- void invalidate();
+ void tqinvalidate();
/** Return the current value of the counter as a number.
*/
@@ -48,12 +48,12 @@ public:
/** Return the current value of the counter as a text.
* This returns only the current level, e.g. "1."
*/
- QString levelText( const KoTextParag *paragraph );
+ TQString levelText( const KoTextParag *paragraph );
/** Return the current value of the counter as a text.
* This returns the full text, all levels included (if displayLevels>1),
* e.g. "1.2.1." if displayLevels==3.
*/
- QString text( const KoTextParag *paragraph );
+ TQString text( const KoTextParag *paragraph );
/**
* Work out the width of the text required for this counter.
@@ -68,9 +68,9 @@ public:
int bulletX();
/// KOffice-1.3 loading code
- void load( QDomElement & element );
+ void load( TQDomElement & element );
/// KOffice-1.3 saving code
- void save( QDomElement & element );
+ void save( TQDomElement & element );
/** Load from OASIS XML
* @param heading true if heading, false if normal list
* @param level 1-based
@@ -82,9 +82,9 @@ public:
*/
void loadOasis( KoOasisContext& context, int restartNumbering, bool orderedList, bool heading, int level, bool loadingStyle = false );
/// Part of loadOasis that is shared with KWVariableSettings::loadOasis for footnotes/endnotes
- void loadOasisListStyle( const QDomElement& listStyle,
- const QDomElement& listStyleProperties,
- const QDomElement& listStyleTextProperties,
+ void loadOasisListStyle( const TQDomElement& listStyle,
+ const TQDomElement& listStyleProperties,
+ const TQDomElement& listStyleTextProperties,
int restartNumbering,
bool orderedList, bool heading, int level, bool loadingStyle );
/// Save as OASIS XML
@@ -155,27 +155,27 @@ public:
/** Prefix and suffix strings.
*/
- QString prefix() const;
- void setPrefix( QString p );
- QString suffix() const;
- void setSuffix( QString s );
+ TQString prefix() const;
+ void setPrefix( TQString p );
+ TQString suffix() const;
+ void setSuffix( TQString s );
/** The character and font for STYLE_CUSTOMBULLET.
*/
- QChar customBulletCharacter() const;
- void setCustomBulletCharacter( QChar c );
- QString customBulletFont() const;
- void setCustomBulletFont( QString f );
+ TQChar customBulletCharacter() const;
+ void setCustomBulletCharacter( TQChar c );
+ TQString customBulletFont() const;
+ void setCustomBulletFont( TQString f );
/** The string STYLE_CUSTOM.
*/
- QString custom() const;
- void setCustom( QString c );
+ TQString custom() const;
+ void setCustom( TQString c );
- /** Counter alignment
+ /** Counter tqalignment
*/
- int alignment() const;
- void setAlignment( int a );
+ int tqalignment() const;
+ void tqsetAlignment( int a );
/**
* Return the format to use for the counter.
@@ -183,13 +183,13 @@ public:
*/
static KoTextFormat* counterFormat( const KoTextParag *paragraph );
- static QString makeRomanNumber( int n );
- static QString makeAlphaUpperNumber( int n );
- static QString makeAlphaLowerNumber( int n );
+ static TQString makeRomanNumber( int n );
+ static TQString makeAlphaUpperNumber( int n );
+ static TQString makeAlphaLowerNumber( int n );
- static int fromRomanNumber( const QString & );
- static int fromAlphaUpperNumber( const QString & );
- static int fromAlphaLowerNumber( const QString & );
+ static int fromRomanNumber( const TQString & );
+ static int fromAlphaUpperNumber( const TQString & );
+ static int fromAlphaLowerNumber( const TQString & );
#ifndef NDEBUG
void printRTDebug( KoTextParag* parag );
@@ -197,10 +197,10 @@ public:
private:
- /** Return our parent paragraph, if there is such a thing. For a paragraph "1.1.",
- * the parent is the paragraph numbered "1.".
+ /** Return our tqparent paragraph, if there is such a thing. For a paragraph "1.1.",
+ * the tqparent is the paragraph numbered "1.".
*/
- KoTextParag *parent( const KoTextParag *paragraph );
+ KoTextParag *tqparent( const KoTextParag *paragraph );
Numbering m_numbering:3; // Numbering (maximum value: 8)
bool m_restartCounter:1;
@@ -210,12 +210,12 @@ private:
char m_depth;
short int m_startNumber;
- QChar m_customBulletChar;
+ TQChar m_customBulletChar;
- QString m_customBulletFont;
- QString m_custom;
- QString m_prefix;
- QString m_suffix;
+ TQString m_customBulletFont;
+ TQString m_custom;
+ TQString m_prefix;
+ TQString m_suffix;
int m_align;
class Private;
@@ -225,17 +225,17 @@ private:
*
* VALUE VALUE WHEN INVALID
* number of this counter -1
- * text of this counter QString::null
+ * text of this counter TQString()
* width of the label -1
- * parent (KoTextParag *)-1
+ * tqparent (KoTextParag *)-1
* the format that was used to calculate the width 0
*/
struct
{
int number;
- QString text;
+ TQString text;
int width;
- KoTextParag *parent;
+ KoTextParag *tqparent;
KoTextFormat * counterFormat;
} m_cache;
};
diff --git a/lib/kotext/KoParagDecorationTab.ui b/lib/kotext/KoParagDecorationTab.ui
index 4610f11b..c3892601 100644
--- a/lib/kotext/KoParagDecorationTab.ui
+++ b/lib/kotext/KoParagDecorationTab.ui
@@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoParagDecorationTab</class>
<author>Martin Ellis &lt;martin.ellis@kdemail.net&gt;</author>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>KoBorderWidgetBase</cstring>
</property>
@@ -20,7 +20,7 @@
<property name="margin">
<number>0</number>
</property>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>backgroundColorGroupBox</cstring>
</property>
@@ -45,7 +45,7 @@ the end of the text and the margin).&lt;/p&gt;</string>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>lblBackgroundColor</cstring>
</property>
@@ -66,7 +66,7 @@ the end of the text and the margin).&lt;/p&gt;</string>
</widget>
</hbox>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>bordersGroupBox</cstring>
</property>
@@ -103,7 +103,7 @@ modified in the preview.&lt;/p&gt;</string>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
+ <widget class="TQLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
<property name="name">
<cstring>previewLayout</cstring>
</property>
@@ -111,7 +111,7 @@ modified in the preview.&lt;/p&gt;</string>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>borderPreviewLabel</cstring>
</property>
@@ -119,7 +119,7 @@ modified in the preview.&lt;/p&gt;</string>
<string>Preview:</string>
</property>
</widget>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>borderPreview</cstring>
</property>
@@ -131,7 +131,7 @@ modified in the preview.&lt;/p&gt;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>200</width>
<height>200</height>
@@ -146,7 +146,7 @@ modified in the preview.&lt;/p&gt;</string>
</widget>
</vbox>
</widget>
- <widget class="QFrame" row="0" column="0">
+ <widget class="TQFrame" row="0" column="0">
<property name="name">
<cstring>borderControlFrame</cstring>
</property>
@@ -171,7 +171,7 @@ modified in the preview.&lt;/p&gt;</string>
<property name="margin">
<number>0</number>
</property>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>lblBorderWidth</cstring>
</property>
@@ -200,7 +200,7 @@ modified in the preview.&lt;/p&gt;</string>
<cstring>cbBorderStyle</cstring>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>textLabel3</cstring>
</property>
@@ -211,7 +211,7 @@ modified in the preview.&lt;/p&gt;</string>
<cstring>bBorderColor</cstring>
</property>
</widget>
- <widget class="QButtonGroup" row="3" column="0" rowspan="1" colspan="2">
+ <widget class="TQButtonGroup" row="3" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>bordersButtonGroup</cstring>
</property>
@@ -315,7 +315,7 @@ modified in the preview.&lt;/p&gt;</string>
</widget>
</hbox>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>lblBorderStyle</cstring>
</property>
@@ -326,7 +326,7 @@ modified in the preview.&lt;/p&gt;</string>
<cstring>cbBorderStyle</cstring>
</property>
</widget>
- <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>cbJoinBorder</cstring>
</property>
@@ -361,7 +361,7 @@ regardless of the style of the preceeding and subsequent paragraphs.&lt;/p&gt;</
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>250</width>
<height>21</height>
@@ -388,7 +388,7 @@ regardless of the style of the preceeding and subsequent paragraphs.&lt;/p&gt;</
<data format="PNG" length="101">89504e470d0a1a0a0000000d49484452000000140000001408060000008d891d0d0000002c49444154388d63601805b400ffc9a4e90748b571d48594db38ea42ca6d4451cf422543e180895c8da3000e00765a11f509a137610000000049454e44ae426082</data>
</image>
</images>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kcolorbutton.h</includehint>
<includehint>kcombobox.h</includehint>
diff --git a/lib/kotext/KoParagDia.cpp b/lib/kotext/KoParagDia.cpp
index 589cfb80..02949bb0 100644
--- a/lib/kotext/KoParagDia.cpp
+++ b/lib/kotext/KoParagDia.cpp
@@ -36,72 +36,72 @@
#include <klocale.h>
#include <knumvalidator.h>
#include <KoGlobal.h>
-#include <qgroupbox.h>
+#include <tqgroupbox.h>
#include <knuminput.h>
#include <kdeversion.h>
#include <kpushbutton.h>
#include <kcombobox.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qhbuttongroup.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qvbox.h>
-#include <qhbox.h>
-#include <qtooltip.h>
-#include <qlayout.h>
-#include <qapplication.h>
-#include <qwidgetstack.h>
-
-KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTypeLetter, bool disableAll, QWidget * parent, const char* name )
- :QWidget( parent, name ),
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqhbuttongroup.h>
+#include <tqlabel.h>
+#include <tqradiobutton.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqtooltip.h>
+#include <tqlayout.h>
+#include <tqapplication.h>
+#include <tqwidgetstack.h>
+
+KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTypeLetter, bool disableAll, TQWidget * tqparent, const char* name )
+ :TQWidget( tqparent, name ),
stylesList()
{
noSignals = true;
styleBuffer = 999;
- QVBoxLayout *vbox = new QVBoxLayout( this,0, 0/*KDialog::marginHint(), KDialog::spacingHint()*/ );
- gStyle = new QGroupBox( i18n( "St&yle" ), this, "styleLayout" );
+ TQVBoxLayout *vbox = new TQVBoxLayout( this,0, 0/*KDialog::marginHint(), KDialog::spacingHint()*/ );
+ gStyle = new TQGroupBox( i18n( "St&yle" ), this, "styleLayout" );
vbox->addWidget( gStyle);
- QGridLayout * grid = new QGridLayout(gStyle, 12, 5, KDialog::marginHint(), KDialog::spacingHint());
+ TQGridLayout * grid = new TQGridLayout(gStyle, 12, 5, KDialog::marginHint(), KDialog::spacingHint());
grid->addRowSpacing(0, fontMetrics().height()/2);
makeCounterRepresenterList( stylesList, onlyStyleTypeLetter );
- lstStyle = new QListBox( gStyle, "styleListBox" );
+ lstStyle = new TQListBox( gStyle, "styleListBox" );
grid->addMultiCellWidget( lstStyle, 1, 11, 0, 0);
fillStyleCombo();
- connect( lstStyle, SIGNAL( selectionChanged() ), this, SLOT( numStyleChanged() ) );
+ connect( lstStyle, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( numStyleChanged() ) );
- QLabel *lPrefix = new QLabel( gStyle, "lPrefix" );
+ TQLabel *lPrefix = new TQLabel( gStyle, "lPrefix" );
lPrefix->setText( i18n( "Pre&fix text:" ) );
grid->addWidget( lPrefix, 1, 1);
- sPrefix = new QLineEdit( gStyle, "sPrefix" );
+ sPrefix = new TQLineEdit( gStyle, "sPrefix" );
lPrefix->setBuddy( sPrefix );
grid->addWidget( sPrefix, 1, 2);
- QLabel *lSuffix = new QLabel( gStyle, "lSuffix" );
+ TQLabel *lSuffix = new TQLabel( gStyle, "lSuffix" );
lSuffix->setText( i18n( "Suffi&x text:" ) );
grid->addWidget( lSuffix, 1, 3);
- sSuffix = new QLineEdit( gStyle, "sSuffix" );
+ sSuffix = new TQLineEdit( gStyle, "sSuffix" );
lSuffix->setBuddy( sSuffix );
grid->addWidget( sSuffix, 1, 4 );
- lStart = new QLabel( gStyle, "lStart" );
+ lStart = new TQLabel( gStyle, "lStart" );
lStart->setText( i18n( "&Start at:" ) );
grid->addWidget( lStart, 2, 1 );
- spnDepth = new QSpinBox( 0, 15, 1, gStyle );
+ spnDepth = new TQSpinBox( 0, 15, 1, gStyle );
if ( displayDepth )
grid->addWidget( spnDepth, 3, 2 );
else
spnDepth->hide();
- spnDisplayLevels = new QSpinBox( 0, 15, 1, gStyle );
+ spnDisplayLevels = new TQSpinBox( 0, 15, 1, gStyle );
spnDisplayLevels->setMinValue( 1 );
if ( displayDepth )
grid->addWidget( spnDisplayLevels, 3, 4 );
@@ -109,27 +109,27 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
spnDisplayLevels->hide();
- QHBoxLayout *customCharBox = new QHBoxLayout(0, 0, 6);
- lCustom = new QLabel( i18n( "Custo&m character:" ), gStyle, "custom char label" );
+ TQHBoxLayout *customCharBox = new TQHBoxLayout(0, 0, 6);
+ lCustom = new TQLabel( i18n( "Custo&m character:" ), gStyle, "custom char label" );
customCharBox->addWidget( lCustom );
- bCustom = new QPushButton( "", gStyle, "bCustom" );
+ bCustom = new TQPushButton( "", gStyle, "bCustom" );
lCustom->setBuddy( bCustom );
customCharBox->addWidget( bCustom );
- connect( bCustom, SIGNAL( clicked() ), this, SLOT( selectCustomBullet() ) );
+ connect( bCustom, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectCustomBullet() ) );
- QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
customCharBox->addItem( spacer_2 );
- grid->addMultiCellLayout(customCharBox, 4, 4, 1, 4, Qt::AlignLeft);
+ grid->addMultiCellLayout(customCharBox, 4, 4, 1, 4, TQt::AlignLeft);
spnStart = new KoSpinBox( gStyle );
spnStart->setMinValue ( 1);
lStart->setBuddy( spnStart );
grid->addWidget( spnStart, 2, 2);
- lAlignment = new QLabel( gStyle, "lAlignment" );
- lAlignment->setText( i18n( "Counter alignment:" ) );
+ lAlignment = new TQLabel( gStyle, "lAlignment" );
+ lAlignment->setText( i18n( "Counter tqalignment:" ) );
grid->addWidget( lAlignment, 2, 3 );
cbAlignment = new KComboBox( gStyle, "cbAlignment" );
@@ -139,7 +139,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
cbAlignment->setCurrentItem(0);
grid->addWidget( cbAlignment, 2, 4 );
- QLabel *lDepth = new QLabel( gStyle, "lDepth" );
+ TQLabel *lDepth = new TQLabel( gStyle, "lDepth" );
lDepth->setText( i18n( "&Depth:" ) );
lDepth->setBuddy( spnDepth );
if ( displayDepth )
@@ -147,7 +147,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
else
lDepth->hide();
- QLabel *lDisplayLevels = new QLabel( gStyle );
+ TQLabel *lDisplayLevels = new TQLabel( gStyle );
lDisplayLevels->setText( i18n( "Display le&vels:" ) );
lDisplayLevels->setBuddy( spnDisplayLevels );
if ( displayDepth )
@@ -155,7 +155,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
else
lDisplayLevels->hide();
- cbRestart = new QCheckBox( i18n( "&Restart numbering at this paragraph" ), gStyle );
+ cbRestart = new TQCheckBox( i18n( "&Restart numbering at this paragraph" ), gStyle );
grid->addMultiCellWidget( cbRestart, 5, 5, 1, 3 );
if ( onlyStyleTypeLetter )
@@ -166,14 +166,14 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
}
- connect( cbRestart, SIGNAL( toggled(bool) ), this, SLOT( restartChanged(bool) ) );
+ connect( cbRestart, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( restartChanged(bool) ) );
- connect( sSuffix, SIGNAL( textChanged (const QString &) ), this, SLOT( suffixChanged(const QString &) ) );
- connect( sPrefix, SIGNAL( textChanged (const QString &) ), this, SLOT( prefixChanged(const QString &) ) );
- connect( spnStart, SIGNAL( valueChanged (int) ), this, SLOT( startChanged(int) ) );
- connect( spnDepth, SIGNAL( valueChanged (int) ), this, SLOT( depthChanged(int) ) );
- connect( spnDisplayLevels, SIGNAL( valueChanged (int) ), this, SLOT( displayLevelsChanged(int) ) );
- connect( cbAlignment, SIGNAL( activated (const QString&) ), this, SLOT( alignmentChanged(const QString&) ) );
+ connect( sSuffix, TQT_SIGNAL( textChanged (const TQString &) ), this, TQT_SLOT( suffixChanged(const TQString &) ) );
+ connect( sPrefix, TQT_SIGNAL( textChanged (const TQString &) ), this, TQT_SLOT( prefixChanged(const TQString &) ) );
+ connect( spnStart, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( startChanged(int) ) );
+ connect( spnDepth, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( depthChanged(int) ) );
+ connect( spnDisplayLevels, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( displayLevelsChanged(int) ) );
+ connect( cbAlignment, TQT_SIGNAL( activated (const TQString&) ), this, TQT_SLOT( tqalignmentChanged(const TQString&) ) );
noSignals = false;
if ( disableAll )
{
@@ -192,21 +192,21 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp
}
}
-void KoCounterStyleWidget::alignmentChanged(const QString& s)
+void KoCounterStyleWidget::tqalignmentChanged(const TQString& s)
{
int a;
if(s==i18n("Align Left"))
- a=Qt::AlignLeft;
+ a=TQt::AlignLeft;
else if(s==i18n("Align Right"))
- a=Qt::AlignRight;
+ a=TQt::AlignRight;
else if(s==i18n("Align Auto"))
- a=Qt::AlignAuto;
+ a=TQt::AlignAuto;
else {
kdError()<<"Not Implemented"<<endl;
return;
}
- m_counter.setAlignment(a);
- emit sig_alignmentChanged(a);
+ m_counter.tqsetAlignment(a);
+ emit sig_tqalignmentChanged(a);
}
void KoCounterStyleWidget::setCounter( const KoParagCounter& counter )
@@ -253,7 +253,7 @@ void KoCounterStyleWidget::fillStyleCombo(KoParagCounter::Numbering type) {
noSignals=true;
unsigned int cur = lstStyle->currentItem();
lstStyle->clear();
- QPtrListIterator<StyleRepresenter> style( stylesList );
+ TQPtrListIterator<StyleRepresenter> style( stylesList );
while ( style.current() ) {
if(style.current()->style() == KoParagCounter::STYLE_NONE) {
if(type == KoParagCounter::NUM_NONE)
@@ -286,7 +286,7 @@ void KoCounterStyleWidget::displayStyle( KoParagCounter::Style style )
bCustom->setText( m_counter.customBulletCharacter() );
if ( !m_counter.customBulletFont().isEmpty() )
- bCustom->setFont( QFont( m_counter.customBulletFont() ) );
+ bCustom->setFont( TQFont( m_counter.customBulletFont() ) );
sPrefix->setText( m_counter.prefix() );
sSuffix->setText( m_counter.suffix() );
@@ -296,11 +296,11 @@ void KoCounterStyleWidget::displayStyle( KoParagCounter::Style style )
spnStart->setValue( m_counter.startNumber() );
cbRestart->setChecked( m_counter.restartCounter() );
- if(m_counter.alignment()==Qt::AlignLeft)
+ if(m_counter.tqalignment()==TQt::AlignLeft)
cbAlignment->setCurrentText(i18n("Align Left"));
- else if(m_counter.alignment()==Qt::AlignRight)
+ else if(m_counter.tqalignment()==TQt::AlignRight)
cbAlignment->setCurrentText(i18n("Align Right"));
- else if(m_counter.alignment()==Qt::AlignAuto)
+ else if(m_counter.tqalignment()==TQt::AlignAuto)
cbAlignment->setCurrentText(i18n("Align Auto"));
else
kdError()<<"Not Implemented"<<endl;
@@ -336,7 +336,7 @@ void KoCounterStyleWidget::numTypeChanged( int nType ) {
}
-void KoCounterStyleWidget::makeCounterRepresenterList( QPtrList<StyleRepresenter>& stylesList, bool onlyStyleTypeLetter )
+void KoCounterStyleWidget::makeCounterRepresenterList( TQPtrList<StyleRepresenter>& stylesList, bool onlyStyleTypeLetter )
{
stylesList.setAutoDelete( true );
stylesList.append( new StyleRepresenter(i18n( "Arabic Numbers" )
@@ -372,17 +372,17 @@ void KoCounterStyleWidget::selectCustomBullet() {
++i;
lstStyle->setCurrentItem(i);
- QString f = m_counter.customBulletFont();
+ TQString f = m_counter.customBulletFont();
if ( f.isEmpty() )
f = "symbol";
- QChar c = m_counter.customBulletCharacter();
+ TQChar c = m_counter.customBulletCharacter();
if ( KoCharSelectDia::selectChar( f, c ) ) {
emit changeCustomBullet( f, c );
m_counter.setCustomBulletFont( f );
m_counter.setCustomBulletCharacter( c );
if ( !f.isEmpty() )
- bCustom->setFont( QFont( f ) );
+ bCustom->setFont( TQFont( f ) );
bCustom->setText( c );
}
}
@@ -405,8 +405,8 @@ void KoCounterStyleWidget::numStyleChanged() {
-KoSpinBox::KoSpinBox( QWidget * parent, const char * name )
- : QSpinBox(parent,name)
+KoSpinBox::KoSpinBox( TQWidget * tqparent, const char * name )
+ : TQSpinBox(tqparent,name)
{
m_Etype=NONE;
//max value supported by roman number
@@ -417,9 +417,9 @@ KoSpinBox::~KoSpinBox( )
}
KoSpinBox::KoSpinBox( int minValue, int maxValue, int step ,
- QWidget * parent , const char * name )
- : QSpinBox(minValue, maxValue,step ,
- parent , name)
+ TQWidget * tqparent , const char * name )
+ : TQSpinBox(minValue, maxValue,step ,
+ tqparent , name)
{
m_Etype=NONE;
}
@@ -431,16 +431,16 @@ void KoSpinBox::setCounterType(counterType _type)
}
-QString KoSpinBox::mapValueToText( int value )
+TQString KoSpinBox::mapValueToText( int value )
{
if(value==0 && m_Etype==NUM)
- return QString("0");
+ return TQString("0");
else if(value==0 && m_Etype!=NUM)
- return QString::null;
+ return TQString();
switch(m_Etype)
{
case NUM:
- return QString::number(value);
+ return TQString::number(value);
case ALPHAB_L:
return KoParagCounter::makeAlphaLowerNumber( value );
case ALPHAB_U:
@@ -451,16 +451,16 @@ QString KoSpinBox::mapValueToText( int value )
return KoParagCounter::makeRomanNumber( value ).upper();
case NONE:
default:
- return QString::null;
+ return TQString();
}
//never here
- return QString::null;
+ return TQString();
}
int KoSpinBox::mapTextToValue( bool * ok )
{
int ret;
- QString txt = text();
+ TQString txt = text();
*ok = TRUE;
switch(m_Etype)
@@ -497,8 +497,8 @@ int KoSpinBox::mapTextToValue( bool * ok )
/* class KPagePreview */
/******************************************************************/
-KPagePreview::KPagePreview( QWidget* parent, const char* name )
- : QGroupBox( i18n( "Preview" ), parent, name )
+KPagePreview::KPagePreview( TQWidget* tqparent, const char* name )
+ : TQGroupBox( i18n( "Preview" ), tqparent, name )
{
left = 0;
right = 0;
@@ -508,7 +508,7 @@ KPagePreview::KPagePreview( QWidget* parent, const char* name )
after = 0;
}
-void KPagePreview::drawContents( QPainter* p )
+void KPagePreview::drawContents( TQPainter* p )
{
int wid = 148;
int hei = 210;
@@ -524,32 +524,32 @@ void KPagePreview::drawContents( QPainter* p )
int spc = convert(spacing);
// draw page
- p->setPen( QPen( black ) );
- p->setBrush( QBrush( black ) );
+ p->setPen( TQPen( black ) );
+ p->setBrush( TQBrush( black ) );
p->drawRect( _x + 1, _y + 1, wid, hei );
- p->setBrush( QBrush( white ) );
+ p->setBrush( TQBrush( white ) );
p->drawRect( _x, _y, wid, hei );
// draw parags
p->setPen( NoPen );
- p->setBrush( QBrush( lightGray ) );
+ p->setBrush( TQBrush( lightGray ) );
for ( int i = 1; i <= 4; i++ )
p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 );
- p->setBrush( QBrush( darkGray ) );
+ p->setBrush( TQBrush( darkGray ) );
for ( int i = 5; i <= 8; i++ )
{
- QRect rect( ( i == 5 ? df : dl ) + _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ) * spc + static_cast<int>( before / 2 ),
+ TQRect rect( ( i == 5 ? df : dl ) + _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ) * spc + static_cast<int>( before / 2 ),
wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ) - ( ( i == 12 ? 0 : dr ) + ( i == 5 ? df : dl ) ), 6);
if(rect.width ()>=0)
p->drawRect( rect );
}
- p->setBrush( QBrush( lightGray ) );
+ p->setBrush( TQBrush( lightGray ) );
for ( int i = 9; i <= 12; i++ )
p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + 3 * spc +
@@ -571,13 +571,13 @@ int KPagePreview::convert(double input) {
/* class KPagePreview2 */
/******************************************************************/
-KPagePreview2::KPagePreview2( QWidget* parent, const char* name )
- : QGroupBox( i18n( "Preview" ), parent, name )
+KPagePreview2::KPagePreview2( TQWidget* tqparent, const char* name )
+ : TQGroupBox( i18n( "Preview" ), tqparent, name )
{
- align = Qt::AlignLeft;
+ align = TQt::AlignLeft;
}
-void KPagePreview2::drawContents( QPainter* p )
+void KPagePreview2::drawContents( TQPainter* p )
{
int wid = 148;
int hei = 210;
@@ -585,22 +585,22 @@ void KPagePreview2::drawContents( QPainter* p )
int _y = ( height() - hei ) / 2;
// draw page
- p->setPen( QPen( black ) );
- p->setBrush( QBrush( black ) );
+ p->setPen( TQPen( black ) );
+ p->setBrush( TQBrush( black ) );
p->drawRect( _x + 1, _y + 1, wid, hei );
- p->setBrush( QBrush( white ) );
+ p->setBrush( TQBrush( white ) );
p->drawRect( _x, _y, wid, hei );
// draw parags
p->setPen( NoPen );
- p->setBrush( QBrush( lightGray ) );
+ p->setBrush( TQBrush( lightGray ) );
for ( int i = 1; i <= 4; i++ )
p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 );
- p->setBrush( QBrush( darkGray ) );
+ p->setBrush( TQBrush( darkGray ) );
int __x = 0, __w = 0;
for ( int i = 5; i <= 8; i++ ) {
@@ -616,17 +616,19 @@ void KPagePreview2::drawContents( QPainter* p )
}
switch ( align ) {
- case Qt::AlignAuto:
- case Qt::AlignLeft:
+#ifndef USE_QT4
+ case TQt::AlignAuto:
+#endif // USE_QT4
+ case TQt::AlignLeft:
__x = _x + 6;
break;
- case Qt::AlignHCenter:
+ case TQt::AlignHCenter:
__x = _x + ( wid - __w ) / 2;
break;
- case Qt::AlignRight:
+ case TQt::AlignRight:
__x = _x + ( wid - __w ) - 6;
break;
- case Qt::AlignJustify:
+ case TQt::AlignJustify:
{
if ( i < 8 ) __w = wid - 12;
__x = _x + 6;
@@ -636,7 +638,7 @@ void KPagePreview2::drawContents( QPainter* p )
p->drawRect( __x, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ), __w, 6 );
}
- p->setBrush( QBrush( lightGray ) );
+ p->setBrush( TQBrush( lightGray ) );
for ( int i = 9; i <= 12; i++ )
p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + 3, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 );
@@ -648,12 +650,12 @@ void KPagePreview2::drawContents( QPainter* p )
/******************************************************************/
-KoBorderPreview::KoBorderPreview( QWidget* parent, const char* name )
- :QFrame(parent,name)
+KoBorderPreview::KoBorderPreview( TQWidget* tqparent, const char* name )
+ :TQFrame(tqparent,name)
{
}
-void KoBorderPreview::mousePressEvent( QMouseEvent *_ev )
+void KoBorderPreview::mousePressEvent( TQMouseEvent *_ev )
{
emit choosearea(_ev);
}
@@ -678,10 +680,10 @@ void KoBorderPreview::setBorder( KoBorder::BorderType which, const KoBorder& bor
}
}
-void KoBorderPreview::drawContents( QPainter* painter )
+void KoBorderPreview::drawContents( TQPainter* painter )
{
- QRect r = contentsRect();
- QFontMetrics fm( font() );
+ TQRect r = contentsRect();
+ TQFontMetrics fm( font() );
painter->fillRect( r.x() + fm.width( 'W' ), r.y() + fm.height(), r.width() - 2 * fm.width( 'W' ),
r.height() - 2 * fm.height(), white );
@@ -738,35 +740,35 @@ void KoBorderPreview::drawContents( QPainter* painter )
}
}
-QPen KoBorderPreview::setBorderPen( KoBorder _brd )
+TQPen KoBorderPreview::setBorderPen( KoBorder _brd )
{
- QPen pen( black, 1, SolidLine );
+ TQPen pen( black, 1, SolidLine );
pen.setWidth( static_cast<int>( _brd.penWidth() ) );
pen.setColor( _brd.color );
switch ( _brd.getStyle() ) {
case KoBorder::SOLID:
- pen.setStyle( SolidLine );
+ pen.setStyle( Qt::SolidLine );
break;
case KoBorder::DASH:
- pen.setStyle( DashLine );
+ pen.setStyle( Qt::DashLine );
break;
case KoBorder::DOT:
- pen.setStyle( DotLine );
+ pen.setStyle( Qt::DotLine );
break;
case KoBorder::DASH_DOT:
- pen.setStyle( DashDotLine );
+ pen.setStyle( Qt::DashDotLine );
break;
case KoBorder::DASH_DOT_DOT:
- pen.setStyle( DashDotDotLine );
+ pen.setStyle( Qt::DashDotDotLine );
break;
case KoBorder::DOUBLE_LINE:
- pen.setStyle( SolidLine );
+ pen.setStyle( Qt::SolidLine );
break;
}
- return QPen( pen );
+ return TQPen( pen );
}
/******************************************************************/
@@ -774,25 +776,25 @@ QPen KoBorderPreview::setBorderPen( KoBorder _brd )
/******************************************************************/
class MyFlow : public KoTextFlow {
public:
- MyFlow(QWidget *parent, KoTextZoomHandler *zoom) {
- m_parent = parent;
+ MyFlow(TQWidget *tqparent, KoTextZoomHandler *zoom) {
+ m_parent = tqparent;
m_zoomHandler = zoom;
}
int availableHeight() const {
return m_zoomHandler->pixelToLayoutUnitY(m_parent->height());
}
private:
- QWidget *m_parent;
+ TQWidget *m_parent;
KoTextZoomHandler *m_zoomHandler;
};
-KoStylePreview::KoStylePreview( const QString& title, const QString& text, QWidget* parent, const char* name )
- : QGroupBox( title, parent, name )
+KoStylePreview::KoStylePreview( const TQString& title, const TQString& text, TQWidget* tqparent, const char* name )
+ : TQGroupBox( title, tqparent, name )
{
setMinimumHeight(80);
m_zoomHandler = new KoTextZoomHandler;
- QFont font = KoGlobal::defaultFont();
- m_textdoc = new KoTextDocument( m_zoomHandler, new KoTextFormatCollection( font, QColor(), KGlobal::locale()->language(), false ) );
+ TQFont font = KoGlobal::defaultFont();
+ m_textdoc = new KoTextDocument( m_zoomHandler, new KoTextFormatCollection( font, TQColor(), KGlobal::locale()->language(), false ) );
m_textdoc->setFlow( new MyFlow(this, m_zoomHandler) );
//m_textdoc->setWidth( KoTextZoomHandler::ptToLayoutUnitPt( 1000 ) );
@@ -810,26 +812,26 @@ void KoStylePreview::setCounter( const KoParagCounter & counter )
{
KoTextParag * parag = m_textdoc->firstParag();
parag->setCounter( counter );
- repaint( true );
+ tqrepaint( true );
}
void KoStylePreview::setStyle( KoParagStyle * style )
{
KoTextParag * parag = m_textdoc->firstParag();
parag->applyStyle( style );
- repaint(true);
+ tqrepaint(true);
}
-void KoStylePreview::drawContents( QPainter *painter )
+void KoStylePreview::drawContents( TQPainter *painter )
{
painter->save();
- QRect r = contentsRect();
+ TQRect r = contentsRect();
//kdDebug(32500) << "KoStylePreview::drawContents contentsRect=" << DEBUGRECT(r) << endl;
- QRect whiteRect( r.x() + 10, r.y() + 10,
+ TQRect whiteRect( r.x() + 10, r.y() + 10,
r.width() - 20, r.height() - 20 );
- QColorGroup cg = QApplication::palette().active();
- painter->fillRect( whiteRect, cg.brush( QColorGroup::Base ) );
+ TQColorGroup cg = TQApplication::tqpalette().active();
+ painter->fillRect( whiteRect, cg.brush( TQColorGroup::Base ) );
KoTextParag * parag = m_textdoc->firstParag();
int widthLU = m_zoomHandler->pixelToLayoutUnitX( whiteRect.width() - 2 ); // keep one pixel border horizontally
@@ -837,14 +839,14 @@ void KoStylePreview::drawContents( QPainter *painter )
{
// For centering to work, and to even get word wrapping when the thing is too big :)
m_textdoc->setWidth( widthLU );
- parag->invalidate(0);
+ parag->tqinvalidate(0);
}
parag->format();
- QRect textRect = parag->pixelRect( m_zoomHandler );
+ TQRect textRect = parag->pixelRect( m_zoomHandler );
- // Center vertically, but not horizontally, to keep the parag alignment working,
- textRect.moveTopLeft( QPoint( whiteRect.x(),
+ // Center vertically, but not horizontally, to keep the parag tqalignment working,
+ textRect.moveTopLeft( TQPoint( whiteRect.x(),
whiteRect.y() + ( whiteRect.height() - textRect.height() ) / 2 ) );
// Move it from the left border a little
textRect.rLeft() += 4;
@@ -858,13 +860,13 @@ void KoStylePreview::drawContents( QPainter *painter )
painter->restore();
}
-KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth,QWidget * parent, const char * name )
- : KoParagLayoutWidget( KoParagDia::PD_SPACING, parent, name ), m_unit( unit )
+KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth,TQWidget * tqparent, const char * name )
+ : KoParagLayoutWidget( KoParagDia::PD_SPACING, tqparent, name ), m_unit( unit )
{
- QString unitName = KoUnit::unitName( m_unit );
- QGridLayout *mainGrid = new QGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() );
+ TQString unitName = KoUnit::unitName( m_unit );
+ TQGridLayout *mainGrid = new TQGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() );
- // mainGrid gives equal space to each groupbox, apparently
+ // mainGrid gives equal space to each groupbox, aptqparently
// I tried setRowStretch but the result is awful (much space between them and not equal!)
// Any other way (in order to make the 2nd, the one with a single checkbox, a bit
// smaller than the other 3) ? (DF)
@@ -872,51 +874,51 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW
// --------------- indent ---------------
double frameWidth=_frameWidth;
- QString length;
+ TQString length;
if(frameWidth==-1) {
frameWidth=9999;
} else {
length=i18n("Frame width: %1 %2")
- .arg(KoUnit::toUserStringValue(frameWidth,m_unit))
- .arg(KoUnit::unitName(m_unit));
+ .tqarg(KoUnit::toUserStringValue(frameWidth,m_unit))
+ .tqarg(KoUnit::unitName(m_unit));
frameWidth=KoUnit::toUserValue(frameWidth,m_unit);
}
- QGroupBox * indentFrame = new QGroupBox( i18n( "Indent" ), this );
- QGridLayout * indentGrid = new QGridLayout( indentFrame, 5, 2, KDialog::marginHint(), KDialog::spacingHint() );
+ TQGroupBox * indentFrame = new TQGroupBox( i18n( "Indent" ), this );
+ TQGridLayout * indentGrid = new TQGridLayout( indentFrame, 5, 2, KDialog::marginHint(), KDialog::spacingHint() );
- QLabel * lLimit = new QLabel(length , indentFrame );
+ TQLabel * lLimit = new TQLabel(length , indentFrame );
if(frameWidth!=-1)
{
- lLimit->setAlignment( AlignRight );
+ lLimit->tqsetAlignment( AlignRight );
indentGrid->addWidget( lLimit, 1,0 );
}
- QLabel * lLeft = new QLabel( i18n("&Left:"), indentFrame );
- lLeft->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQLabel * lLeft = new TQLabel( i18n("&Left:"), indentFrame );
+ lLeft->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
indentGrid->addWidget( lLeft, 1, 0 );
eLeft = new KoUnitDoubleSpinBox( indentFrame, 0, 9999, 1, 0.0, m_unit );
lLeft->setBuddy( eLeft );
indentGrid->addWidget( eLeft, 1, 1 );
- connect( eLeft, SIGNAL( valueChangedPt(double ) ), this, SLOT( leftChanged( double ) ) );
+ connect( eLeft, TQT_SIGNAL( valueChangedPt(double ) ), this, TQT_SLOT( leftChanged( double ) ) );
- QLabel * lRight = new QLabel( i18n("&Right:"), indentFrame );
- lRight->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQLabel * lRight = new TQLabel( i18n("&Right:"), indentFrame );
+ lRight->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
indentGrid->addWidget( lRight, 2, 0 );
eRight = new KoUnitDoubleSpinBox( indentFrame, 0, 9999, 1, 0.0, m_unit );
lRight->setBuddy( eRight );
indentGrid->addWidget( eRight, 2, 1 );
- connect( eRight, SIGNAL( valueChangedPt( double ) ), this, SLOT( rightChanged( double ) ) );
+ connect( eRight, TQT_SIGNAL( valueChangedPt( double ) ), this, TQT_SLOT( rightChanged( double ) ) );
- QLabel * lFirstLine = new QLabel( i18n("&First line:"), indentFrame );
- lFirstLine->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ TQLabel * lFirstLine = new TQLabel( i18n("&First line:"), indentFrame );
+ lFirstLine->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
indentGrid->addWidget( lFirstLine, 3, 0 );
eFirstLine = new KoUnitDoubleSpinBox( indentFrame, -9999, 9999, 1, 0.0, m_unit );
lFirstLine->setBuddy( eFirstLine );
- connect( eFirstLine, SIGNAL( valueChangedPt( double ) ), this, SLOT( firstChanged( double ) ) );
+ connect( eFirstLine, TQT_SIGNAL( valueChangedPt( double ) ), this, TQT_SLOT( firstChanged( double ) ) );
indentGrid->addWidget( eFirstLine, 3, 1 );
// grid row spacing
@@ -926,33 +928,33 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW
mainGrid->addWidget( indentFrame, 0, 0 );
// --------------- line spacing ---------------
- QGroupBox * spacingFrame = new QGroupBox( i18n( "Line &Spacing" ), this, "spacingFrame" );
- QGridLayout * spacingGrid = new QGridLayout( spacingFrame, 2, 1,
+ TQGroupBox * spacingFrame = new TQGroupBox( i18n( "Line &Spacing" ), this, "spacingFrame" );
+ TQGridLayout * spacingGrid = new TQGridLayout( spacingFrame, 2, 1,
KDialog::marginHint(), KDialog::spacingHint() );
- cSpacing = new QComboBox( false, spacingFrame, "" );
+ cSpacing = new TQComboBox( false, spacingFrame, "" );
// Keep order in sync with lineSpacingType() and display()
cSpacing->insertItem( i18n( "Line spacing value", "Single" ) );
cSpacing->insertItem( i18n( "Line spacing value", "1.5 Lines" ) );
cSpacing->insertItem( i18n( "Line spacing value", "Double" ) );
cSpacing->insertItem( i18n( "Proportional") ); // LS_MULTIPLE, called Proportional like in OO
- cSpacing->insertItem( i18n( "Line Distance (%1)" ).arg(unitName) ); // LS_CUSTOM
- cSpacing->insertItem( i18n( "At Least (%1)" ).arg(unitName) );
- cSpacing->insertItem( i18n( "Fixed (%1)").arg(unitName) ); // LS_FIXED
+ cSpacing->insertItem( i18n( "Line Distance (%1)" ).tqarg(unitName) ); // LS_CUSTOM
+ cSpacing->insertItem( i18n( "At Least (%1)" ).tqarg(unitName) );
+ cSpacing->insertItem( i18n( "Fixed (%1)").tqarg(unitName) ); // LS_FIXED
- connect( cSpacing, SIGNAL( activated( int ) ), this, SLOT( spacingActivated( int ) ) );
+ connect( cSpacing, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( spacingActivated( int ) ) );
spacingGrid->addWidget( cSpacing, 1, 0 );
- sSpacingStack = new QWidgetStack( spacingFrame );
+ sSpacingStack = new TQWidgetStack( spacingFrame );
eSpacing = new KoUnitDoubleSpinBox( spacingFrame, 0, 9999, CM_TO_POINT(1),
0.0, m_unit );
eSpacing->setRange( 0, 9999, 1, false);
- connect( eSpacing, SIGNAL( valueChanged( double ) ), this, SLOT( spacingChanged( double ) ) );
+ connect( eSpacing, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( spacingChanged( double ) ) );
eSpacingPercent = new KIntNumInput( 100, spacingFrame );
eSpacingPercent->setRange( 0, 1000, 10, false );
eSpacingPercent->setSuffix( " %" );
- connect( eSpacingPercent, SIGNAL( valueChanged( int ) ), this, SLOT( spacingChanged( int ) ) );
+ connect( eSpacingPercent, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( spacingChanged( int ) ) );
sSpacingStack->addWidget( eSpacing );
sSpacingStack->addWidget( eSpacingPercent );
@@ -967,26 +969,26 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW
eSpacing->setEnabled( true );
// --------------- paragraph spacing ---------------
- QGroupBox * pSpaceFrame = new QGroupBox( i18n( "Para&graph Space" ), this, "pSpaceFrame" );
- QGridLayout * pSpaceGrid = new QGridLayout( pSpaceFrame, 3, 2,
+ TQGroupBox * pSpaceFrame = new TQGroupBox( i18n( "Para&graph Space" ), this, "pSpaceFrame" );
+ TQGridLayout * pSpaceGrid = new TQGridLayout( pSpaceFrame, 3, 2,
KDialog::marginHint(), KDialog::spacingHint() );
- QLabel * lBefore = new QLabel( i18n("Before:"), pSpaceFrame );
- lBefore->setAlignment( AlignRight );
+ TQLabel * lBefore = new TQLabel( i18n("Before:"), pSpaceFrame );
+ lBefore->tqsetAlignment( AlignRight );
pSpaceGrid->addWidget( lBefore, 1, 0 );
eBefore = new KoUnitDoubleSpinBox( pSpaceFrame, 0, 9999, CM_TO_POINT(1), 0.0, m_unit );
eBefore->setRange( 0 , 9999, 1, false);
- connect( eBefore, SIGNAL( valueChanged( double ) ), this, SLOT( beforeChanged( double ) ) );
+ connect( eBefore, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( beforeChanged( double ) ) );
pSpaceGrid->addWidget( eBefore, 1, 1 );
- QLabel * lAfter = new QLabel( i18n("After:"), pSpaceFrame );
- lAfter->setAlignment( AlignRight );
+ TQLabel * lAfter = new TQLabel( i18n("After:"), pSpaceFrame );
+ lAfter->tqsetAlignment( AlignRight );
pSpaceGrid->addWidget( lAfter, 2, 0 );
eAfter = new KoUnitDoubleSpinBox( pSpaceFrame, 0, 9999, 1, 0.0, m_unit );
eAfter->setRange( 0, 9999, 1, false);
- connect( eAfter, SIGNAL( valueChanged( double ) ), this, SLOT( afterChanged( double ) ) );
+ connect( eAfter, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( afterChanged( double ) ) );
pSpaceGrid->addWidget( eAfter, 2, 1 );
// grid row spacing
@@ -1005,12 +1007,12 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW
double KoIndentSpacingWidget::leftIndent() const
{
- return QMAX(0, eLeft->value() );
+ return TQMAX(0, eLeft->value() );
}
double KoIndentSpacingWidget::rightIndent() const
{
- return QMAX(0,eRight->value() );
+ return TQMAX(0,eRight->value() );
}
double KoIndentSpacingWidget::firstLineIndent() const
@@ -1020,12 +1022,12 @@ double KoIndentSpacingWidget::firstLineIndent() const
double KoIndentSpacingWidget::spaceBeforeParag() const
{
- return QMAX(0, eBefore->value() );
+ return TQMAX(0, eBefore->value() );
}
double KoIndentSpacingWidget::spaceAfterParag() const
{
- return QMAX(0, eAfter->value() );
+ return TQMAX(0, eAfter->value() );
}
KoParagLayout::SpacingType KoIndentSpacingWidget::lineSpacingType() const
@@ -1055,31 +1057,31 @@ KoParagLayout::SpacingType KoIndentSpacingWidget::lineSpacingType() const
double KoIndentSpacingWidget::lineSpacing() const
{
return (lineSpacingType() == KoParagLayout::LS_MULTIPLE)
- ? QMAX( 1, eSpacingPercent->value() ) / 100.0
- : QMAX( 0, eSpacing->value() );
+ ? TQMAX( 1, eSpacingPercent->value() ) / 100.0
+ : TQMAX( 0, eSpacing->value() );
}
void KoIndentSpacingWidget::display( const KoParagLayout & lay )
{
- double _left = lay.margins[QStyleSheetItem::MarginLeft];
+ double _left = lay.margins[TQStyleSheetItem::MarginLeft];
eLeft->changeValue( _left );
//prev1->setLeft( _left ); done by leftChanged() below
leftChanged( _left ); // sets min value for eFirstLine
- double _right = lay.margins[QStyleSheetItem::MarginRight];
+ double _right = lay.margins[TQStyleSheetItem::MarginRight];
eRight->changeValue( _right );
prev1->setRight( _right );
- double _first = lay.margins[QStyleSheetItem::MarginFirstLine];
+ double _first = lay.margins[TQStyleSheetItem::MarginFirstLine];
eFirstLine->changeValue( _first );
prev1->setFirst( _first );
- double _before = lay.margins[QStyleSheetItem::MarginTop];
+ double _before = lay.margins[TQStyleSheetItem::MarginTop];
eBefore->changeValue( _before );
prev1->setBefore( _before );
- double _after = lay.margins[QStyleSheetItem::MarginBottom];
+ double _after = lay.margins[TQStyleSheetItem::MarginBottom];
eAfter->changeValue( _after );
prev1->setAfter( _after );
@@ -1113,23 +1115,23 @@ void KoIndentSpacingWidget::display( const KoParagLayout & lay )
}
updateLineSpacing( _type );
- eSpacing->setValue( (_type == KoParagLayout::LS_MULTIPLE) ? QMAX( 1, _spacing )
+ eSpacing->setValue( (_type == KoParagLayout::LS_MULTIPLE) ? TQMAX( 1, _spacing )
: KoUnit::toUserValue( _spacing, m_unit ) );
- eSpacingPercent->setValue( ( _type == KoParagLayout::LS_MULTIPLE ) ? qRound( _spacing * 100 ) : 100 );
+ eSpacingPercent->setValue( ( _type == KoParagLayout::LS_MULTIPLE ) ? tqRound( _spacing * 100 ) : 100 );
}
void KoIndentSpacingWidget::save( KoParagLayout & lay )
{
lay.setLineSpacingValue(lineSpacing());
lay.lineSpacingType = lineSpacingType();
- lay.margins[QStyleSheetItem::MarginLeft] = leftIndent();
- lay.margins[QStyleSheetItem::MarginRight] = rightIndent();
- lay.margins[QStyleSheetItem::MarginFirstLine] = firstLineIndent();
- lay.margins[QStyleSheetItem::MarginTop] = spaceBeforeParag();
- lay.margins[QStyleSheetItem::MarginBottom] = spaceAfterParag();
+ lay.margins[TQStyleSheetItem::MarginLeft] = leftIndent();
+ lay.margins[TQStyleSheetItem::MarginRight] = rightIndent();
+ lay.margins[TQStyleSheetItem::MarginFirstLine] = firstLineIndent();
+ lay.margins[TQStyleSheetItem::MarginTop] = spaceBeforeParag();
+ lay.margins[TQStyleSheetItem::MarginBottom] = spaceAfterParag();
}
-QString KoIndentSpacingWidget::tabName()
+TQString KoIndentSpacingWidget::tabName()
{
return i18n( "Indent && S&pacing" );
}
@@ -1138,7 +1140,7 @@ void KoIndentSpacingWidget::leftChanged( double val )
{
prev1->setLeft( val );
// The minimum first-line margin is -leftMargin() (where leftMargin>=0)
- eFirstLine->setMinValue( -QMAX( 0, val ) );
+ eFirstLine->setMinValue( -TQMAX( 0, val ) );
}
void KoIndentSpacingWidget::rightChanged( double val )
@@ -1203,24 +1205,24 @@ void KoIndentSpacingWidget::afterChanged( double _val )
}
-KoParagAlignWidget::KoParagAlignWidget( bool breakLine, QWidget * parent, const char * name )
- : KoParagLayoutWidget( KoParagDia::PD_ALIGN, parent, name )
+KoParagAlignWidget::KoParagAlignWidget( bool breakLine, TQWidget * tqparent, const char * name )
+ : KoParagLayoutWidget( KoParagDia::PD_ALIGN, tqparent, name )
{
- QGridLayout *grid = new QGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() );
+ TQGridLayout *grid = new TQGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() );
- QVGroupBox * AlignGroup = new QVGroupBox( i18n( "Alignment" ), this );
+ TQVGroupBox * AlignGroup = new TQVGroupBox( i18n( "Alignment" ), this );
- rLeft = new QRadioButton( i18n( "&Left" ), AlignGroup );
- connect( rLeft, SIGNAL( clicked() ), this, SLOT( alignLeft() ) );
+ rLeft = new TQRadioButton( i18n( "&Left" ), AlignGroup );
+ connect( rLeft, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignLeft() ) );
- rCenter = new QRadioButton( i18n( "C&enter" ), AlignGroup );
- connect( rCenter, SIGNAL( clicked() ), this, SLOT( alignCenter() ) );
+ rCenter = new TQRadioButton( i18n( "C&enter" ), AlignGroup );
+ connect( rCenter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignCenter() ) );
- rRight = new QRadioButton( i18n( "&Right" ), AlignGroup );
- connect( rRight, SIGNAL( clicked() ), this, SLOT( alignRight() ) );
+ rRight = new TQRadioButton( i18n( "&Right" ), AlignGroup );
+ connect( rRight, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignRight() ) );
- rJustify = new QRadioButton( i18n( "&Justify" ), AlignGroup );
- connect( rJustify, SIGNAL( clicked() ), this, SLOT( alignJustify() ) );
+ rJustify = new TQRadioButton( i18n( "&Justify" ), AlignGroup );
+ connect( rJustify, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignJustify() ) );
clearAligns();
rLeft->setChecked( true );
@@ -1228,15 +1230,15 @@ KoParagAlignWidget::KoParagAlignWidget( bool breakLine, QWidget * parent, const
grid->addWidget(AlignGroup, 0, 0);
// --------------- End of page /frame ---------------
- QGroupBox * endFramePage = new QGroupBox( i18n( "Behavior at &End of Frame/Page" ), this );
- QGridLayout * endFramePageGrid = new QGridLayout( endFramePage, 4, 1,
+ TQGroupBox * endFramePage = new TQGroupBox( i18n( "Behavior at &End of Frame/Page" ), this );
+ TQGridLayout * endFramePageGrid = new TQGridLayout( endFramePage, 4, 1,
KDialog::marginHint(), KDialog::spacingHint() );
- cKeepLinesTogether = new QCheckBox( i18n("&Keep lines together"),endFramePage);
+ cKeepLinesTogether = new TQCheckBox( i18n("&Keep lines together"),endFramePage);
endFramePageGrid->addWidget( cKeepLinesTogether, 1, 0 );
- cHardBreakBefore = new QCheckBox( i18n("Insert break before paragraph"),endFramePage);
+ cHardBreakBefore = new TQCheckBox( i18n("Insert break before paragraph"),endFramePage);
endFramePageGrid->addWidget( cHardBreakBefore, 2, 0 );
- cHardBreakAfter = new QCheckBox( i18n("Insert break after paragraph"),endFramePage);
+ cHardBreakAfter = new TQCheckBox( i18n("Insert break after paragraph"),endFramePage);
endFramePageGrid->addWidget( cHardBreakAfter, 3, 0 );
endFramePageGrid->addRowSpacing( 0, fontMetrics().height() / 2 ); // groupbox title
@@ -1271,22 +1273,24 @@ int KoParagAlignWidget::pageBreaking() const
void KoParagAlignWidget::display( const KoParagLayout & lay )
{
- int align = lay.alignment;
+ int align = lay.tqalignment;
prev2->setAlign( align );
clearAligns();
switch ( align ) {
- case Qt::AlignAuto: // see KoView::setAlign
- case Qt::AlignLeft:
+#ifndef USE_QT4
+ case TQt::AlignAuto: // see KoView::setAlign
+#endif // USE_QT4
+ case TQt::AlignLeft:
rLeft->setChecked( true );
break;
- case Qt::AlignHCenter:
+ case TQt::AlignHCenter:
rCenter->setChecked( true );
break;
- case Qt::AlignRight:
+ case TQt::AlignRight:
rRight->setChecked( true );
break;
- case Qt::AlignJustify:
+ case TQt::AlignJustify:
rJustify->setChecked( true );
}
@@ -1298,49 +1302,49 @@ void KoParagAlignWidget::display( const KoParagLayout & lay )
void KoParagAlignWidget::save( KoParagLayout & lay )
{
- lay.alignment = align();
+ lay.tqalignment = align();
lay.pageBreaking = pageBreaking();
}
int KoParagAlignWidget::align() const
{
- if ( rLeft->isChecked() ) return Qt::AlignLeft;
- else if ( rCenter->isChecked() ) return Qt::AlignHCenter;
- else if ( rRight->isChecked() ) return Qt::AlignRight;
- else if ( rJustify->isChecked() ) return Qt::AlignJustify;
+ if ( rLeft->isChecked() ) return TQt::AlignLeft;
+ else if ( rCenter->isChecked() ) return TQt::AlignHCenter;
+ else if ( rRight->isChecked() ) return TQt::AlignRight;
+ else if ( rJustify->isChecked() ) return TQt::AlignJustify;
- return Qt::AlignLeft;
+ return TQt::AlignLeft;
}
-QString KoParagAlignWidget::tabName()
+TQString KoParagAlignWidget::tabName()
{
return i18n( "General &Layout" );
}
void KoParagAlignWidget::alignLeft()
{
- prev2->setAlign( Qt::AlignLeft );
+ prev2->setAlign( TQt::AlignLeft );
clearAligns();
rLeft->setChecked( true );
}
void KoParagAlignWidget::alignCenter()
{
- prev2->setAlign( Qt::AlignHCenter );
+ prev2->setAlign( TQt::AlignHCenter );
clearAligns();
rCenter->setChecked( true );
}
void KoParagAlignWidget::alignRight()
{
- prev2->setAlign( Qt::AlignRight );
+ prev2->setAlign( TQt::AlignRight );
clearAligns();
rRight->setChecked( true );
}
void KoParagAlignWidget::alignJustify()
{
- prev2->setAlign( Qt::AlignJustify );
+ prev2->setAlign( TQt::AlignJustify );
clearAligns();
rJustify->setChecked( true );
}
@@ -1355,11 +1359,11 @@ void KoParagAlignWidget::clearAligns()
////////////////////////////////////////////////////////////////////////////////
-KoParagDecorationWidget::KoParagDecorationWidget( QWidget * parent,
+KoParagDecorationWidget::KoParagDecorationWidget( TQWidget * tqparent,
const char * name )
- : KoParagLayoutWidget( KoParagDia::PD_DECORATION, parent, name )
+ : KoParagLayoutWidget( KoParagDia::PD_DECORATION, tqparent, name )
{
- QVBoxLayout *tabLayout = new QVBoxLayout( this );
+ TQVBoxLayout *tabLayout = new TQVBoxLayout( this );
wDeco = new KoParagDecorationTab( this );
tabLayout->add( wDeco );
@@ -1373,33 +1377,33 @@ KoParagDecorationWidget::KoParagDecorationWidget( QWidget * parent,
// Set up Border Width combo box
for( unsigned int i = 1; i <= 10; i++ )
- wDeco->cbBorderWidth->insertItem(QString::number(i));
+ wDeco->cbBorderWidth->insertItem(TQString::number(i));
// Setup the border toggle buttons, and merge checkbox
- connect( wDeco->bBorderLeft, SIGNAL( toggled( bool ) ),
- this, SLOT( brdLeftToggled( bool ) ) );
- connect( wDeco->bBorderRight, SIGNAL( toggled( bool ) ),
- this, SLOT( brdRightToggled( bool ) ) );
- connect( wDeco->bBorderTop, SIGNAL( toggled( bool ) ),
- this, SLOT( brdTopToggled( bool ) ) );
- connect( wDeco->bBorderBottom, SIGNAL( toggled( bool ) ),
- this, SLOT( brdBottomToggled( bool ) ) );
- connect( wDeco->cbJoinBorder, SIGNAL( toggled( bool ) ),
- this, SLOT( brdJoinToggled( bool ) ) );
+ connect( wDeco->bBorderLeft, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( brdLeftToggled( bool ) ) );
+ connect( wDeco->bBorderRight, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( brdRightToggled( bool ) ) );
+ connect( wDeco->bBorderTop, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( brdTopToggled( bool ) ) );
+ connect( wDeco->bBorderBottom, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( brdBottomToggled( bool ) ) );
+ connect( wDeco->cbJoinBorder, TQT_SIGNAL( toggled( bool ) ),
+ this, TQT_SLOT( brdJoinToggled( bool ) ) );
// Set up Border preview widget
wPreview = new KoBorderPreview( wDeco->borderPreview );
- QVBoxLayout *previewLayout = new QVBoxLayout( wDeco->borderPreview );
+ TQVBoxLayout *previewLayout = new TQVBoxLayout( wDeco->borderPreview );
previewLayout->addWidget( wPreview );
- connect( wPreview, SIGNAL( choosearea(QMouseEvent * ) ),
- this, SLOT( slotPressEvent(QMouseEvent *) ) );
+ connect( wPreview, TQT_SIGNAL( choosearea(TQMouseEvent * ) ),
+ this, TQT_SLOT( slotPressEvent(TQMouseEvent *) ) );
}
///////
// Current GUI selections
KoBorder::BorderStyle KoParagDecorationWidget::curBorderStyle() const
{
- QString selection = wDeco->cbBorderStyle->currentText();
+ TQString selection = wDeco->cbBorderStyle->currentText();
return KoBorder::getStyle( selection );
}
@@ -1407,7 +1411,7 @@ unsigned int KoParagDecorationWidget::curBorderWidth() const {
return wDeco->cbBorderWidth->currentText().toUInt();
}
-QColor KoParagDecorationWidget::curBorderColor() const {
+TQColor KoParagDecorationWidget::curBorderColor() const {
return wDeco->bBorderColor->color();
}
///////
@@ -1441,16 +1445,16 @@ void KoParagDecorationWidget::clickedBorderPreview( KoBorder& border,
// Establish which border position was clicked in the border preview,
// and update the appropriate border
-void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev)
+void KoParagDecorationWidget::slotPressEvent(TQMouseEvent *_ev)
{
const int OFFSETX = 15;
const int OFFSETY = 7;
const int Ko_SPACE = 30;
- QRect r = wPreview->contentsRect();
- QRect rect(r.x() + OFFSETX, r.y() + OFFSETY,
+ TQRect r = wPreview->contentsRect();
+ TQRect rect(r.x() + OFFSETX, r.y() + OFFSETY,
r.width() - OFFSETX, r.y() + OFFSETY + Ko_SPACE);
- if(rect.contains(QPoint(_ev->x(),_ev->y())))
+ if(rect.tqcontains(TQPoint(_ev->x(),_ev->y())))
{
clickedBorderPreview( m_topBorder, KoBorder::TopBorder,
wDeco->bBorderTop );
@@ -1458,7 +1462,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev)
rect.setCoords(r.x() + OFFSETX, r.height() - OFFSETY - Ko_SPACE,
r.width() - OFFSETX, r.height() - OFFSETY);
- if(rect.contains(QPoint(_ev->x(),_ev->y())))
+ if(rect.tqcontains(TQPoint(_ev->x(),_ev->y())))
{
clickedBorderPreview( m_bottomBorder, KoBorder::BottomBorder,
wDeco->bBorderBottom );
@@ -1466,7 +1470,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev)
rect.setCoords(r.x() + OFFSETX, r.y() + OFFSETY,
r.x() + Ko_SPACE + OFFSETX, r.height() - OFFSETY);
- if(rect.contains(QPoint(_ev->x(),_ev->y())))
+ if(rect.tqcontains(TQPoint(_ev->x(),_ev->y())))
{
clickedBorderPreview( m_leftBorder, KoBorder::LeftBorder,
wDeco->bBorderLeft );
@@ -1474,7 +1478,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev)
rect.setCoords(r.width() - OFFSETX - Ko_SPACE, r.y() + OFFSETY,
r.width() - OFFSETX, r.height() - OFFSETY);
- if(rect.contains(QPoint(_ev->x(),_ev->y())))
+ if(rect.tqcontains(TQPoint(_ev->x(),_ev->y())))
{
clickedBorderPreview( m_rightBorder, KoBorder::RightBorder,
wDeco->bBorderRight );
@@ -1526,11 +1530,11 @@ void KoParagDecorationWidget::save( KoParagLayout & lay )
lay.joinBorder = m_joinBorder;
}
-QColor KoParagDecorationWidget::backgroundColor() const {
+TQColor KoParagDecorationWidget::backgroundColor() const {
return wDeco->bBackgroundColor->color();
}
-QString KoParagDecorationWidget::tabName() {
+TQString KoParagDecorationWidget::tabName() {
// Why D&e..? Because &De.. conflicts with &Delete in
// the style manager.
return i18n( "D&ecorations" );
@@ -1590,56 +1594,56 @@ void KoParagDecorationWidget::brdJoinToggled( bool _on ) {
////////////////////////////////////////////////////////////////////////////////
-KoParagCounterWidget::KoParagCounterWidget( bool disableAll, QWidget * parent, const char * name )
- : KoParagLayoutWidget( KoParagDia::PD_NUMBERING, parent, name )
+KoParagCounterWidget::KoParagCounterWidget( bool disableAll, TQWidget * tqparent, const char * name )
+ : KoParagLayoutWidget( KoParagDia::PD_NUMBERING, tqparent, name )
{
- QVBoxLayout *Form1Layout = new QVBoxLayout( this );
+ TQVBoxLayout *Form1Layout = new TQVBoxLayout( this );
Form1Layout->setSpacing( KDialog::spacingHint() );
Form1Layout->setMargin( KDialog::marginHint() );
- gNumbering = new QButtonGroup( this, "numberingGroup" );
+ gNumbering = new TQButtonGroup( this, "numberingGroup" );
gNumbering->setTitle( i18n( "Numbering" ) );
gNumbering->setColumnLayout(0, Qt::Vertical );
- gNumbering->layout()->setSpacing( 0 );
- gNumbering->layout()->setMargin( 0 );
- QHBoxLayout *numberingGroupLayout = new QHBoxLayout( gNumbering->layout() );
- numberingGroupLayout->setAlignment( Qt::AlignTop );
+ gNumbering->tqlayout()->setSpacing( 0 );
+ gNumbering->tqlayout()->setMargin( 0 );
+ TQHBoxLayout *numberingGroupLayout = new TQHBoxLayout( gNumbering->tqlayout() );
+ numberingGroupLayout->tqsetAlignment( TQt::AlignTop );
numberingGroupLayout->setSpacing( KDialog::spacingHint() );
numberingGroupLayout->setMargin( KDialog::marginHint() );
// What type of numbering is required?
- QRadioButton *rNone = new QRadioButton( gNumbering, "rNone" );
+ TQRadioButton *rNone = new TQRadioButton( gNumbering, "rNone" );
rNone->setText( i18n( "&None" ) );
numberingGroupLayout->addWidget( rNone );
gNumbering->insert( rNone , KoParagCounter::NUM_NONE);
- QRadioButton *rList = new QRadioButton( gNumbering, "rList" );
+ TQRadioButton *rList = new TQRadioButton( gNumbering, "rList" );
rList->setText( i18n( "&List" ) );
gNumbering->insert( rList , KoParagCounter::NUM_LIST);
numberingGroupLayout->addWidget( rList );
- QRadioButton *rChapter = new QRadioButton( gNumbering, "rChapter" );
+ TQRadioButton *rChapter = new TQRadioButton( gNumbering, "rChapter" );
rChapter->setText( i18n( "Chapt&er" ) );
gNumbering->insert( rChapter , KoParagCounter::NUM_CHAPTER);
numberingGroupLayout->addWidget( rChapter );
Form1Layout->addWidget( gNumbering );
- connect( gNumbering, SIGNAL( clicked( int ) ), this, SLOT( numTypeChanged( int ) ) );
+ connect( gNumbering, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( numTypeChanged( int ) ) );
m_styleWidget = new KoCounterStyleWidget( true, false, disableAll, this );
- connect( m_styleWidget, SIGNAL( sig_suffixChanged (const QString &) ), this, SLOT( suffixChanged(const QString &) ) );
- connect( m_styleWidget, SIGNAL( sig_prefixChanged (const QString &) ), this, SLOT( prefixChanged(const QString &) ) );
- connect( m_styleWidget, SIGNAL( sig_startChanged(int) ), this, SLOT( startChanged(int) ) );
- connect( m_styleWidget, SIGNAL( sig_restartChanged(bool) ), this, SLOT( restartChanged(bool) ) );
- connect( m_styleWidget, SIGNAL( sig_depthChanged (int) ), this, SLOT( depthChanged(int) ) );
- connect( m_styleWidget, SIGNAL( sig_displayLevelsChanged (int) ), this, SLOT( displayLevelsChanged(int) ) );
- connect( m_styleWidget, SIGNAL( sig_alignmentChanged (int) ), this, SLOT( alignmentChanged(int) ) );
- connect( m_styleWidget, SIGNAL( changeCustomBullet( const QString & , QChar ) ), this, SLOT( slotChangeCustomBullet( const QString & , QChar ) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_suffixChanged (const TQString &) ), this, TQT_SLOT( suffixChanged(const TQString &) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_prefixChanged (const TQString &) ), this, TQT_SLOT( prefixChanged(const TQString &) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_startChanged(int) ), this, TQT_SLOT( startChanged(int) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_restartChanged(bool) ), this, TQT_SLOT( restartChanged(bool) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_depthChanged (int) ), this, TQT_SLOT( depthChanged(int) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_displayLevelsChanged (int) ), this, TQT_SLOT( displayLevelsChanged(int) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_tqalignmentChanged (int) ), this, TQT_SLOT( tqalignmentChanged(int) ) );
+ connect( m_styleWidget, TQT_SIGNAL( changeCustomBullet( const TQString & , TQChar ) ), this, TQT_SLOT( slotChangeCustomBullet( const TQString & , TQChar ) ) );
- connect( m_styleWidget, SIGNAL( sig_numTypeChanged( int ) ), this, SLOT( numTypeChanged(int ) ) );
- connect( m_styleWidget, SIGNAL( changeStyle( KoParagCounter::Style ) ), this, SLOT( styleChanged (KoParagCounter::Style ) ) );
+ connect( m_styleWidget, TQT_SIGNAL( sig_numTypeChanged( int ) ), this, TQT_SLOT( numTypeChanged(int ) ) );
+ connect( m_styleWidget, TQT_SIGNAL( changeStyle( KoParagCounter::Style ) ), this, TQT_SLOT( styleChanged (KoParagCounter::Style ) ) );
Form1Layout->addWidget( m_styleWidget );
@@ -1652,7 +1656,7 @@ KoParagCounterWidget::KoParagCounterWidget( bool disableAll, QWidget * parent, c
preview->setEnabled( false );
}
- QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
+ TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding);
Form1Layout->addItem( spacer );
}
@@ -1662,14 +1666,14 @@ void KoParagCounterWidget::styleChanged( KoParagCounter::Style st )
updatePreview();
}
-void KoParagCounterWidget::slotChangeCustomBullet( const QString & f, QChar c)
+void KoParagCounterWidget::slotChangeCustomBullet( const TQString & f, TQChar c)
{
m_counter.setCustomBulletFont( f );
m_counter.setCustomBulletCharacter( c );
preview->setCounter( m_counter );
}
-QString KoParagCounterWidget::tabName() {
+TQString KoParagCounterWidget::tabName() {
return i18n( "B&ullets/Numbers" );
}
@@ -1701,7 +1705,7 @@ void KoParagCounterWidget::display( const KoParagLayout & lay ) {
void KoParagCounterWidget::updatePreview() {
preview->setCounter(m_counter);
- preview->repaint(true);
+ preview->tqrepaint(true);
}
void KoParagCounterWidget::save( KoParagLayout & lay ) {
@@ -1716,16 +1720,16 @@ void KoParagCounterWidget::save( KoParagLayout & lay ) {
lay.counter = new KoParagCounter( m_counter );
}
-KoTabulatorsLineEdit::KoTabulatorsLineEdit( QWidget *parent, double lower, double upper, double step, double value /*= 0.0*/, KoUnit::Unit unit /*= KoUnit::U_PT*/, unsigned int precision /*= 2*/, const char *name /*= 0*/ )
- : KoUnitDoubleSpinBox ( parent, lower, upper, step, value, unit, precision, name )
+KoTabulatorsLineEdit::KoTabulatorsLineEdit( TQWidget *tqparent, double lower, double upper, double step, double value /*= 0.0*/, KoUnit::Unit unit /*= KoUnit::U_PT*/, unsigned int precision /*= 2*/, const char *name /*= 0*/ )
+ : KoUnitDoubleSpinBox ( tqparent, lower, upper, step, value, unit, precision, name )
{
setRange( 0, 9999, 1, false);
}
-void KoTabulatorsLineEdit::keyPressEvent ( QKeyEvent *ke )
+void KoTabulatorsLineEdit::keyPressEvent ( TQKeyEvent *ke )
{
- if( ke->key() == QKeyEvent::Key_Return ||
- ke->key() == QKeyEvent::Key_Enter )
+ if( ke->key() == Qt::Key_Return ||
+ ke->key() == Qt::Key_Enter )
{
emit keyReturnPressed();
return;
@@ -1733,123 +1737,123 @@ void KoTabulatorsLineEdit::keyPressEvent ( QKeyEvent *ke )
KoUnitDoubleSpinBox::keyPressEvent (ke);
}
-KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double frameWidth,QWidget * parent, const char * name )
- : KoParagLayoutWidget( KoParagDia::PD_TABS, parent, name ), m_unit(unit) {
- QString length;
+KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double frameWidth,TQWidget * tqparent, const char * name )
+ : KoParagLayoutWidget( KoParagDia::PD_TABS, tqparent, name ), m_unit(unit) {
+ TQString length;
if(frameWidth==-1) {
frameWidth=9999;
m_toplimit=9999;
} else {
m_toplimit=frameWidth;
length=i18n("Frame width: %1 %2")
- .arg(KoUnit::toUserStringValue(frameWidth,m_unit))
- .arg(KoUnit::unitName(m_unit));
+ .tqarg(KoUnit::toUserStringValue(frameWidth,m_unit))
+ .tqarg(KoUnit::unitName(m_unit));
frameWidth=KoUnit::toUserValue(frameWidth,m_unit);
}
- QVBoxLayout* Form1Layout = new QVBoxLayout( this );
+ TQVBoxLayout* Form1Layout = new TQVBoxLayout( this );
Form1Layout->setSpacing( KDialog::spacingHint() );
Form1Layout->setMargin( KDialog::marginHint() );
- QHBoxLayout* Layout13 = new QHBoxLayout;
+ TQHBoxLayout* Layout13 = new TQHBoxLayout;
Layout13->setSpacing( KDialog::spacingHint() );
Layout13->setMargin( 0 ); //?
- lstTabs = new QListBox( this);
+ lstTabs = new TQListBox( this);
lstTabs->insertItem( "mytabvalue" );
- lstTabs->setMaximumSize( QSize( 300, 32767 ) );
+ lstTabs->setMaximumSize( TQSize( 300, 32767 ) );
Layout13->addWidget( lstTabs );
- editLayout = new QVBoxLayout;
+ editLayout = new TQVBoxLayout;
editLayout->setSpacing( KDialog::spacingHint() );
editLayout->setMargin( 0 ); //?
- gPosition = new QGroupBox( this, "gPosition" );
+ gPosition = new TQGroupBox( this, "gPosition" );
gPosition->setTitle( i18n( "Po&sition" ) );
gPosition->setColumnLayout(0, Qt::Vertical );
- gPosition->layout()->setSpacing( 0 );
- gPosition->layout()->setMargin( 0 );
- QVBoxLayout* GroupBox2Layout = new QVBoxLayout( gPosition->layout() );
- GroupBox2Layout->setAlignment( Qt::AlignTop );
+ gPosition->tqlayout()->setSpacing( 0 );
+ gPosition->tqlayout()->setMargin( 0 );
+ TQVBoxLayout* GroupBox2Layout = new TQVBoxLayout( gPosition->tqlayout() );
+ GroupBox2Layout->tqsetAlignment( TQt::AlignTop );
GroupBox2Layout->setSpacing( KDialog::spacingHint() );
GroupBox2Layout->setMargin( KDialog::marginHint() );
- QHBoxLayout* Layout5 = new QHBoxLayout;
+ TQHBoxLayout* Layout5 = new TQHBoxLayout;
Layout5->setSpacing( KDialog::spacingHint() );
Layout5->setMargin( 0 ); //?
sTabPos = new KoTabulatorsLineEdit( gPosition, 0, 9999, 1, 0.0, m_unit );
sTabPos->setRange( 0, 9999, 1 );
- sTabPos->setMaximumSize( QSize( 100, 32767 ) );
+ sTabPos->setMaximumSize( TQSize( 100, 32767 ) );
Layout5->addWidget( sTabPos );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout5->addItem( spacer );
GroupBox2Layout->addLayout( Layout5 );
editLayout->addWidget( gPosition );
- QLabel* TextLabel1 = new QLabel( gPosition );
- QString unitDescription = KoUnit::unitDescription( m_unit );
+ TQLabel* TextLabel1 = new TQLabel( gPosition );
+ TQString unitDescription = KoUnit::unitDescription( m_unit );
TextLabel1->setText( length );
GroupBox2Layout->addWidget( TextLabel1 );
- bgAlign = new QButtonGroup( this );
+ bgAlign = new TQButtonGroup( this );
bgAlign->setTitle( i18n( "Alignment" ) );
bgAlign->setColumnLayout(0, Qt::Vertical );
- bgAlign->layout()->setSpacing( 0 );
- bgAlign->layout()->setMargin( 0 );
- QVBoxLayout* ButtonGroup1Layout = new QVBoxLayout( bgAlign->layout() );
- ButtonGroup1Layout->setAlignment( Qt::AlignTop );
+ bgAlign->tqlayout()->setSpacing( 0 );
+ bgAlign->tqlayout()->setMargin( 0 );
+ TQVBoxLayout* ButtonGroup1Layout = new TQVBoxLayout( bgAlign->tqlayout() );
+ ButtonGroup1Layout->tqsetAlignment( TQt::AlignTop );
ButtonGroup1Layout->setSpacing( KDialog::spacingHint() );
ButtonGroup1Layout->setMargin( KDialog::marginHint() );
- rAlignLeft = new QRadioButton( bgAlign );
+ rAlignLeft = new TQRadioButton( bgAlign );
rAlignLeft->setText( i18n( "&Left" ) );
ButtonGroup1Layout->addWidget( rAlignLeft );
- rAlignCentre = new QRadioButton( bgAlign );
+ rAlignCentre = new TQRadioButton( bgAlign );
rAlignCentre->setText( i18n( "C&enter" ) );
ButtonGroup1Layout->addWidget( rAlignCentre );
- rAlignRight = new QRadioButton( bgAlign );
+ rAlignRight = new TQRadioButton( bgAlign );
rAlignRight->setText( i18n( "&Right" ) );
ButtonGroup1Layout->addWidget( rAlignRight );
- QHBoxLayout* Layout8 = new QHBoxLayout;
+ TQHBoxLayout* Layout8 = new TQHBoxLayout;
Layout8->setSpacing( KDialog::spacingHint() );
Layout8->setMargin( 0 );
- rAlignVar = new QRadioButton( bgAlign );
+ rAlignVar = new TQRadioButton( bgAlign );
rAlignVar->setText( i18n( "On followin&g character: " ) );
Layout8->addWidget( rAlignVar );
- sAlignChar = new QLineEdit( bgAlign);
- sAlignChar->setMaximumSize( QSize( 60, 32767 ) );
- sAlignChar->setText(QString(KGlobal::locale()->decimalSymbol()[0]));
+ sAlignChar = new TQLineEdit( bgAlign);
+ sAlignChar->setMaximumSize( TQSize( 60, 32767 ) );
+ sAlignChar->setText(TQString(KGlobal::locale()->decimalSymbol()[0]));
Layout8->addWidget( sAlignChar );
- QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout8->addItem( spacer_2 );
ButtonGroup1Layout->addLayout( Layout8 );
editLayout->addWidget( bgAlign );
- gTabLeader = new QGroupBox( this, "gTabLeader" );
+ gTabLeader = new TQGroupBox( this, "gTabLeader" );
gTabLeader->setTitle( i18n( "Tab Leader" ) );
- QVBoxLayout* GroupBox5Layout = new QVBoxLayout( gTabLeader );
- GroupBox5Layout->setAlignment( Qt::AlignTop );
+ TQVBoxLayout* GroupBox5Layout = new TQVBoxLayout( gTabLeader );
+ GroupBox5Layout->tqsetAlignment( TQt::AlignTop );
GroupBox5Layout->setSpacing( KDialog::spacingHint() );
GroupBox5Layout->setMargin( KDialog::marginHint() );
GroupBox5Layout->addSpacing( fontMetrics().height() / 2 ); // groupbox title
- QLabel* TextLabel1_2 = new QLabel( gTabLeader );
+ TQLabel* TextLabel1_2 = new TQLabel( gTabLeader );
TextLabel1_2->setText( i18n( "The space a tab uses can be filled with a pattern." ) );
GroupBox5Layout->addWidget( TextLabel1_2 );
- QGridLayout *fillingGrid = new QGridLayout( 0L, 2, 2, 0, KDialog::spacingHint() );
+ TQGridLayout *fillingGrid = new TQGridLayout( 0L, 2, 2, 0, KDialog::spacingHint() );
- QLabel* TextLabel2 = new QLabel( gTabLeader);
+ TQLabel* TextLabel2 = new TQLabel( gTabLeader);
TextLabel2->setText( i18n( "&Filling:" ) );
- TextLabel2->setAlignment( AlignRight );
+ TextLabel2->tqsetAlignment( AlignRight );
fillingGrid->addWidget( TextLabel2, 0, 0 );
- cFilling = new QComboBox( FALSE, gTabLeader);
+ cFilling = new TQComboBox( FALSE, gTabLeader);
cFilling->insertItem( i18n( "Blank" ) );
cFilling->insertItem( "_ _ _ _ _ _"); // DOT
cFilling->insertItem( "_________"); // SOLID
@@ -1859,8 +1863,8 @@ KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double fram
TextLabel2->setBuddy( cFilling );
fillingGrid->addWidget( cFilling, 0, 1 );
- QLabel * TextLabel3 = new QLabel( i18n("&Width:"), gTabLeader );
- TextLabel3->setAlignment( AlignRight );
+ TQLabel * TextLabel3 = new TQLabel( i18n("&Width:"), gTabLeader );
+ TextLabel3->tqsetAlignment( AlignRight );
fillingGrid->addWidget( TextLabel3, 1, 0 );
eWidth = new KoUnitDoubleSpinBox( gTabLeader );
@@ -1871,43 +1875,43 @@ KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double fram
GroupBox5Layout->addLayout( fillingGrid );
editLayout->addWidget( gTabLeader );
- QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_4 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
editLayout->addItem( spacer_4 );
Layout13->addLayout( editLayout );
Form1Layout->addLayout( Layout13 );
- QHBoxLayout* Layout4 = new QHBoxLayout;
+ TQHBoxLayout* Layout4 = new TQHBoxLayout;
Layout4->setSpacing( KDialog::spacingHint() );
Layout4->setMargin( 0 );
- bNew = new QPushButton( this);
+ bNew = new TQPushButton( this);
bNew->setText( i18n( "&New" ) );
Layout4->addWidget( bNew );
- bDelete = new QPushButton( this);
+ bDelete = new TQPushButton( this);
bDelete->setText( i18n( "&Delete" ) );
Layout4->addWidget( bDelete );
- bDeleteAll = new QPushButton( this);
+ bDeleteAll = new TQPushButton( this);
bDeleteAll->setText( i18n( "Delete All" ) );
Layout4->addWidget( bDeleteAll );
- QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_5 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout4->addItem( spacer_5 );
Form1Layout->addLayout( Layout4 );
//signal valueChanged passes value which the user see (unlike the value() function)
//so fromUserValue has to be used in slotTabValueChanged
- connect(sTabPos,SIGNAL(valueChanged(double)), this, SLOT(slotTabValueChanged(double )));
- connect(sTabPos,SIGNAL( keyReturnPressed()),this,SLOT(newClicked()));
- connect(sAlignChar,SIGNAL(textChanged( const QString & )), this, SLOT(slotAlignCharChanged( const QString & )));
- connect(bNew,SIGNAL(clicked ()),this,SLOT(newClicked()));
- connect(bDelete,SIGNAL(clicked ()),this,SLOT(deleteClicked()));
- connect(bDeleteAll,SIGNAL(clicked ()),this,SLOT(deleteAllClicked()));
- connect(bgAlign,SIGNAL(clicked (int)),this,SLOT(updateAlign(int)));
- connect(cFilling,SIGNAL(activated (int)),this,SLOT(updateFilling(int)));
- connect(eWidth,SIGNAL(valueChangedPt( double ) ),this,SLOT(updateWidth()));
- connect(lstTabs,SIGNAL(highlighted (int)),this,SLOT(setActiveItem(int)));
+ connect(sTabPos,TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(slotTabValueChanged(double )));
+ connect(sTabPos,TQT_SIGNAL( keyReturnPressed()),this,TQT_SLOT(newClicked()));
+ connect(sAlignChar,TQT_SIGNAL(textChanged( const TQString & )), this, TQT_SLOT(slotAlignCharChanged( const TQString & )));
+ connect(bNew,TQT_SIGNAL(clicked ()),this,TQT_SLOT(newClicked()));
+ connect(bDelete,TQT_SIGNAL(clicked ()),this,TQT_SLOT(deleteClicked()));
+ connect(bDeleteAll,TQT_SIGNAL(clicked ()),this,TQT_SLOT(deleteAllClicked()));
+ connect(bgAlign,TQT_SIGNAL(clicked (int)),this,TQT_SLOT(updateAlign(int)));
+ connect(cFilling,TQT_SIGNAL(activated (int)),this,TQT_SLOT(updateFilling(int)));
+ connect(eWidth,TQT_SIGNAL(valueChangedPt( double ) ),this,TQT_SLOT(updateWidth()));
+ connect(lstTabs,TQT_SIGNAL(highlighted (int)),this,TQT_SLOT(setActiveItem(int)));
noSignals=false;
}
@@ -1923,7 +1927,7 @@ void KoParagTabulatorsWidget::slotTabValueChanged( double val ) {
noSignals=false;
}
-void KoParagTabulatorsWidget::slotAlignCharChanged( const QString &/*_text*/ ) {
+void KoParagTabulatorsWidget::slotAlignCharChanged( const TQString &/*_text*/ ) {
// select align 3 and update data structures.
bgAlign->setButton(3);
m_tabList[lstTabs->currentItem()].alignChar=sAlignChar->text()[0];
@@ -1956,7 +1960,7 @@ void KoParagTabulatorsWidget::newClicked() {
newTab.ptWidth=m_tabList[selected].ptWidth;
m_tabList.insert(m_tabList.at(selected), newTab);
lstTabs->insertItem( tabToString(newTab), selected);
- lstTabs->setCurrentItem(lstTabs->findItem(tabToString(newTab)));
+ lstTabs->setCurrentItem(lstTabs->tqfindItem(tabToString(newTab)));
sortLists();
}
}
@@ -1971,7 +1975,7 @@ void KoParagTabulatorsWidget::deleteClicked() {
lstTabs->removeItem(selected);
m_tabList.remove(m_tabList[selected]);
if(lstTabs->count() >0) {
- lstTabs->setCurrentItem(QMIN(static_cast<unsigned int>(selected), lstTabs->count()-1 ));
+ lstTabs->setCurrentItem(TQMIN(static_cast<unsigned int>(selected), lstTabs->count()-1 ));
} else {
bDeleteAll->setEnabled(false);
bDelete->setEnabled(false);
@@ -2007,7 +2011,7 @@ void KoParagTabulatorsWidget::setActiveItem(int selected) {
bgAlign->setButton(2); break;
case T_DEC_PNT:
bgAlign->setButton(3);
- sAlignChar->setText(QString(selectedTab->alignChar));
+ sAlignChar->setText(TQString(selectedTab->alignChar));
break;
case T_LEFT:
default:
@@ -2049,7 +2053,7 @@ void KoParagTabulatorsWidget::setCurrentTab( double tabPos ) {
kdWarning() << "KoParagTabulatorsWidget::setCurrentTab: no tab found at pos=" << tabPos << endl;
}
-QString KoParagTabulatorsWidget::tabToString(const KoTabulator &tab) {
+TQString KoParagTabulatorsWidget::tabToString(const KoTabulator &tab) {
return KoUnit::toUserStringValue( tab.ptPos, m_unit);
}
@@ -2093,7 +2097,7 @@ void KoParagTabulatorsWidget::updateFilling(int selected) {
void KoParagTabulatorsWidget::updateWidth() {
KoTabulator *selectedTab = &m_tabList[lstTabs->currentItem()];
- selectedTab->ptWidth = QMAX( 0, eWidth->value() );
+ selectedTab->ptWidth = TQMAX( 0, eWidth->value() );
}
void KoParagTabulatorsWidget::sortLists() {
@@ -2103,13 +2107,13 @@ void KoParagTabulatorsWidget::sortLists() {
// we could just sort the listView, but to make sure we never have any problems with
// inconsistent lists, just re-add..
- QString curValue=lstTabs->currentText();
+ TQString curValue=lstTabs->currentText();
lstTabs->clear();
KoTabulatorList::ConstIterator it = m_tabList.begin();
for ( ; it != m_tabList.end(); ++it )
lstTabs->insertItem( KoUnit::toUserStringValue( (*it).ptPos, m_unit ) );
- lstTabs->setCurrentItem(lstTabs->findItem(curValue));
+ lstTabs->setCurrentItem(lstTabs->tqfindItem(curValue));
noSignals=false;
}
@@ -2136,16 +2140,16 @@ void KoParagTabulatorsWidget::save( KoParagLayout & lay ) {
lay.setTabList( m_tabList );
}
-QString KoParagTabulatorsWidget::tabName() {
+TQString KoParagTabulatorsWidget::tabName() {
return i18n( "&Tabulators" );
}
/******************************************************************/
/* Class: KoParagDia */
/******************************************************************/
-KoParagDia::KoParagDia( QWidget* parent, const char* name,
+KoParagDia::KoParagDia( TQWidget* tqparent, const char* name,
int flags, KoUnit::Unit unit, double _frameWidth, bool breakLine, bool disableAll )
- : KDialogBase(Tabbed, QString::null, Ok | Cancel | User1 | Apply, Ok, parent, name, true )
+ : KDialogBase(Tabbed, TQString(), Ok | Cancel | User1 | Apply, Ok, tqparent, name, true )
{
m_decorationsWidget = 0;
m_flags = flags;
@@ -2153,37 +2157,37 @@ KoParagDia::KoParagDia( QWidget* parent, const char* name,
if ( m_flags & PD_SPACING )
{
- QVBox * page = addVBoxPage( i18n( "Indent && S&pacing" ) );
+ TQVBox * page = addVBoxPage( i18n( "Indent && S&pacing" ) );
m_indentSpacingWidget = new KoIndentSpacingWidget( unit,_frameWidth,page, "indent-spacing" );
- m_indentSpacingWidget->layout()->setMargin(0);
+ m_indentSpacingWidget->tqlayout()->setMargin(0);
}
if ( m_flags & PD_ALIGN )
{
- QVBox * page = addVBoxPage( i18n( "General &Layout" ) );
+ TQVBox * page = addVBoxPage( i18n( "General &Layout" ) );
m_alignWidget = new KoParagAlignWidget( breakLine, page, "align" );
- m_alignWidget->layout()->setMargin(0);
+ m_alignWidget->tqlayout()->setMargin(0);
}
if ( m_flags & PD_DECORATION )
{
- QVBox * page = addVBoxPage( i18n( "D&ecorations" ) );
+ TQVBox * page = addVBoxPage( i18n( "D&ecorations" ) );
m_decorationsWidget = new KoParagDecorationWidget( page, "decorations");
- m_decorationsWidget->layout()->setMargin(0);
+ m_decorationsWidget->tqlayout()->setMargin(0);
}
if ( m_flags & PD_NUMBERING )
{
- QVBox * page = addVBoxPage( i18n( "B&ullets/Numbers" ) );
+ TQVBox * page = addVBoxPage( i18n( "B&ullets/Numbers" ) );
m_counterWidget = new KoParagCounterWidget( disableAll , page, "numbers" );
- m_counterWidget->layout()->setMargin(0);
+ m_counterWidget->tqlayout()->setMargin(0);
}
if ( m_flags & PD_TABS )
{
- QVBox * page = addVBoxPage( i18n( "&Tabulators" ) );
+ TQVBox * page = addVBoxPage( i18n( "&Tabulators" ) );
m_tabulatorsWidget = new KoParagTabulatorsWidget( unit,_frameWidth, page, "tabs");
- m_tabulatorsWidget->layout()->setMargin(0);
+ m_tabulatorsWidget->tqlayout()->setMargin(0);
}
- connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotReset()));
- setInitialSize( QSize(630, 500) );
+ connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotReset()));
+ setInitialSize( TQSize(630, 500) );
}
KoParagDia::~KoParagDia()
@@ -2206,19 +2210,19 @@ void KoParagDia::setCurrentPage( int page )
switch( page )
{
case PD_SPACING:
- showPage( pageIndex( m_indentSpacingWidget->parentWidget() ) );
+ showPage( pageIndex( m_indentSpacingWidget->tqparentWidget() ) );
break;
case PD_ALIGN:
- showPage( pageIndex( m_alignWidget->parentWidget() ) );
+ showPage( pageIndex( m_alignWidget->tqparentWidget() ) );
break;
case PD_DECORATION:
- showPage( pageIndex( m_decorationsWidget->parentWidget() ) );
+ showPage( pageIndex( m_decorationsWidget->tqparentWidget() ) );
break;
case PD_NUMBERING:
- showPage( pageIndex( m_counterWidget->parentWidget() ) );
+ showPage( pageIndex( m_counterWidget->tqparentWidget() ) );
break;
case PD_TABS:
- showPage( pageIndex( m_tabulatorsWidget->parentWidget() ) );
+ showPage( pageIndex( m_tabulatorsWidget->tqparentWidget() ) );
break;
default:
break;
@@ -2268,12 +2272,12 @@ KoParagLayout KoParagDia::paragLayout() const
newLayout.setLineSpacingValue( lineSpacing() );
newLayout.lineSpacingType = lineSpacingType();
newLayout.setTabList( tabListTabulator() );
- newLayout.alignment = align();
- newLayout.margins[QStyleSheetItem::MarginFirstLine] = firstLineIndent();
- newLayout.margins[QStyleSheetItem::MarginLeft] = leftIndent();
- newLayout.margins[QStyleSheetItem::MarginRight] = rightIndent();
- newLayout.margins[QStyleSheetItem::MarginTop] = spaceBeforeParag();
- newLayout.margins[QStyleSheetItem::MarginBottom] = spaceAfterParag();
+ newLayout.tqalignment = align();
+ newLayout.margins[TQStyleSheetItem::MarginFirstLine] = firstLineIndent();
+ newLayout.margins[TQStyleSheetItem::MarginLeft] = leftIndent();
+ newLayout.margins[TQStyleSheetItem::MarginRight] = rightIndent();
+ newLayout.margins[TQStyleSheetItem::MarginTop] = spaceBeforeParag();
+ newLayout.margins[TQStyleSheetItem::MarginBottom] = spaceAfterParag();
newLayout.pageBreaking = pageBreaking();
newLayout.leftBorder = leftBorder();
newLayout.rightBorder = rightBorder();
diff --git a/lib/kotext/KoParagDia.h b/lib/kotext/KoParagDia.h
index 32e75c26..1c776af6 100644
--- a/lib/kotext/KoParagDia.h
+++ b/lib/kotext/KoParagDia.h
@@ -22,19 +22,19 @@
#define paragdia_h
#include <kdialogbase.h>
-#include <qstringlist.h>
-#include <qptrlist.h>
-#include <qstylesheet.h>
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqstylesheet.h>
#include <KoRuler.h>
#include <KoUnit.h>
#include <KoUnitWidgets.h>
-#include <qdict.h>
-#include <qlineedit.h>
+#include <tqdict.h>
+#include <tqlineedit.h>
#include "KoParagLayout.h"
#include "KoParagCounter.h"
#include <knuminput.h>
-#include <qgroupbox.h>
-#include <qvgroupbox.h>
+#include <tqgroupbox.h>
+#include <tqvgroupbox.h>
#include <koffice_export.h>
class KoTextZoomHandler;
class KButtonBox;
@@ -46,21 +46,21 @@ class KoStylePreview;
class KPagePreview2;
class KPagePreview;
class KoSpinBox;
-class QButtonGroup;
-class QCheckBox;
-class QComboBox;
-class QGridLayout;
-class QGroupBox;
-class QLabel;
-class QListBox;
-class QPushButton;
-class QRadioButton;
-class QWidget;
-class QWidgetStack;
+class TQButtonGroup;
+class TQCheckBox;
+class TQComboBox;
+class TQGridLayout;
+class TQGroupBox;
+class TQLabel;
+class TQListBox;
+class TQPushButton;
+class TQRadioButton;
+class TQWidget;
+class TQWidgetStack;
class KIntNumInput;
class KDoubleNumInput;
class KComboBox;
-class QVBoxLayout;
+class TQVBoxLayout;
class KoUnitDoubleSpinBox;
class KoParagDecorationTab; // From KoParagDecorationTab.ui
@@ -69,13 +69,14 @@ class KoParagDecorationTab; // From KoParagDecorationTab.ui
* that handles modifying a part of a KoParagLayout.
* Used by the paragraph dialog (this file) and by the style editor.
*/
-class KOTEXT_EXPORT KoParagLayoutWidget : public QWidget
+class KOTEXT_EXPORT KoParagLayoutWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- // Constructor: parent widget, flag (PD_SOMETHING) and name
- KoParagLayoutWidget( int flag, QWidget * parent, const char * name = 0 )
- : QWidget( parent, name ), m_flag( flag )
+ // Constructor: tqparent widget, flag (PD_SOMETHING) and name
+ KoParagLayoutWidget( int flag, TQWidget * tqparent, const char * name = 0 )
+ : TQWidget( tqparent, name ), m_flag( flag )
{
}
virtual ~KoParagLayoutWidget() {}
@@ -92,9 +93,9 @@ public:
//virtual bool isModified() = 0;
/** return the (i18n-ed) name of the tab */
- virtual QString tabName() = 0;
+ virtual TQString tabName() = 0;
- // Return the part of the paraglayout that this widget cares about
+ // Return the part of the paragtqlayout that this widget cares about
int flag() const { return m_flag; }
private:
@@ -107,14 +108,15 @@ private:
class KOTEXT_EXPORT KoIndentSpacingWidget : public KoParagLayoutWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth, QWidget * parent,const char * name = 0 );
+ KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth, TQWidget * tqparent,const char * name = 0 );
virtual ~KoIndentSpacingWidget() {}
virtual void display( const KoParagLayout & lay );
virtual void save( KoParagLayout & lay );
//virtual bool isModified();
- virtual QString tabName();
+ virtual TQString tabName();
double leftIndent() const;
double rightIndent() const;
@@ -135,29 +137,30 @@ private slots:
private:
void updateLineSpacing( KoParagLayout::SpacingType _type );
- QWidgetStack *sSpacingStack;
+ TQWidgetStack *sSpacingStack;
KIntNumInput *eSpacingPercent;
KoUnitDoubleSpinBox *eBefore, *eAfter, *eSpacing;
KoUnitDoubleSpinBox *eLeft, *eRight, *eFirstLine;
- QComboBox *cSpacing;
+ TQComboBox *cSpacing;
KPagePreview *prev1;
KoUnit::Unit m_unit;
};
/**
- * The widget for editing paragraph alignment (tab 2)
+ * The widget for editing paragraph tqalignment (tab 2)
*/
class KOTEXT_EXPORT KoParagAlignWidget : public KoParagLayoutWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoParagAlignWidget(bool breakLine, QWidget * parent, const char * name = 0 );
+ KoParagAlignWidget(bool breakLine, TQWidget * tqparent, const char * name = 0 );
virtual ~KoParagAlignWidget() {}
virtual void display( const KoParagLayout & lay );
virtual void save( KoParagLayout & lay );
//virtual bool isModified();
- virtual QString tabName();
+ virtual TQString tabName();
int pageBreaking() const;
int align() const;
@@ -172,8 +175,8 @@ protected:
void clearAligns();
private:
- QRadioButton *rLeft, *rCenter, *rRight, *rJustify;
- QCheckBox *cKeepLinesTogether, *cHardBreakBefore, *cHardBreakAfter;
+ TQRadioButton *rLeft, *rCenter, *rRight, *rJustify;
+ TQCheckBox *cKeepLinesTogether, *cHardBreakBefore, *cHardBreakAfter;
KPagePreview2 *prev2;
};
@@ -183,14 +186,15 @@ private:
class KOTEXT_EXPORT KoParagDecorationWidget : public KoParagLayoutWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoParagDecorationWidget( QWidget * parent, const char * name = 0 );
+ KoParagDecorationWidget( TQWidget * tqparent, const char * name = 0 );
virtual ~KoParagDecorationWidget() {}
virtual void display( const KoParagLayout & lay );
virtual void save( KoParagLayout & lay );
//virtual bool isModified();
- virtual QString tabName();
+ virtual TQString tabName();
// Borders
KoBorder leftBorder() const { return m_leftBorder; }
@@ -200,7 +204,7 @@ public:
bool joinBorder() const { return m_joinBorder; }
// Background color
- QColor backgroundColor() const;
+ TQColor backgroundColor() const;
protected slots:
void brdLeftToggled( bool );
@@ -208,7 +212,7 @@ protected slots:
void brdTopToggled( bool );
void brdBottomToggled( bool );
void brdJoinToggled( bool );
- void slotPressEvent(QMouseEvent *_ev);
+ void slotPressEvent(TQMouseEvent *_ev);
protected:
void updateBorders();
@@ -223,7 +227,7 @@ private:
//! Get the currently selected border width
unsigned int curBorderWidth() const;
//! Get the currently selected border color
- QColor curBorderColor() const;
+ TQColor curBorderColor() const;
// Borders
KoBorder m_leftBorder, m_rightBorder, m_topBorder, m_bottomBorder;
@@ -256,30 +260,31 @@ private:
};
-class KOTEXT_EXPORT KoCounterStyleWidget : public QWidget
+class KOTEXT_EXPORT KoCounterStyleWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoCounterStyleWidget( bool displayDepth= true, bool onlyStyleTypeLetter = false, bool disableAll=false, QWidget* parent = 0, const char* name = 0 );
+ KoCounterStyleWidget( bool displayDepth= true, bool onlyStyleTypeLetter = false, bool disableAll=false, TQWidget* tqparent = 0, const char* name = 0 );
class StyleRepresenter {
public:
- StyleRepresenter (const QString name, KoParagCounter::Style style, bool bullet=false) {
+ StyleRepresenter (const TQString name, KoParagCounter::Style style, bool bullet=false) {
m_name=name;
m_style=style;
m_bullet=bullet;
}
- QString name() const { return m_name; }
+ TQString name() const { return m_name; }
KoParagCounter::Style style() const { return m_style; }
bool isBullet() const { return m_bullet; }
private:
- QString m_name;
+ TQString m_name;
KoParagCounter::Style m_style;
bool m_bullet;
};
- static void makeCounterRepresenterList( QPtrList<StyleRepresenter>& stylesList , bool onlyStyleTypeLetter = false );
+ static void makeCounterRepresenterList( TQPtrList<StyleRepresenter>& stylesList , bool onlyStyleTypeLetter = false );
void fillStyleCombo(KoParagCounter::Numbering type = KoParagCounter::NUM_LIST);
void display( const KoParagLayout & lay );
void changeKWSpinboxType(KoParagCounter::Style st);
@@ -294,20 +299,20 @@ signals:
void sig_restartChanged(bool);
void sig_depthChanged(int);
void sig_displayLevelsChanged(int);
- void sig_suffixChanged(const QString &);
- void sig_prefixChanged(const QString &);
+ void sig_suffixChanged(const TQString &);
+ void sig_prefixChanged(const TQString &);
void sig_numTypeChanged( int );
- void sig_alignmentChanged( int );
- void changeCustomBullet( const QString & , QChar );
+ void sig_tqalignmentChanged( int );
+ void changeCustomBullet( const TQString & , TQChar );
void changeStyle( KoParagCounter::Style );
protected slots:
void startChanged(int i) {m_counter.setStartNumber(i);emit sig_startChanged(i);}
void restartChanged(bool b) {m_counter.setRestartCounter(b);emit sig_restartChanged(b);}
void depthChanged(int i) {m_counter.setDepth(i);emit sig_depthChanged(i);}
void displayLevelsChanged(int i) {m_counter.setDisplayLevels(i);emit sig_displayLevelsChanged(i);}
- void alignmentChanged(const QString& s);
- void suffixChanged(const QString & txt) {m_counter.setSuffix(txt);emit sig_suffixChanged(txt); }
- void prefixChanged(const QString & txt) {m_counter.setPrefix(txt);emit sig_prefixChanged(txt); }
+ void tqalignmentChanged(const TQString& s);
+ void suffixChanged(const TQString & txt) {m_counter.setSuffix(txt);emit sig_suffixChanged(txt); }
+ void prefixChanged(const TQString & txt) {m_counter.setPrefix(txt);emit sig_prefixChanged(txt); }
void numStyleChanged();
void selectCustomBullet();
@@ -316,20 +321,20 @@ protected:
void displayStyle( KoParagCounter::Style style );
private:
- QGroupBox *gStyle;
- QPtrList <StyleRepresenter> stylesList;
- QListBox *lstStyle;
+ TQGroupBox *gStyle;
+ TQPtrList <StyleRepresenter> stylesList;
+ TQListBox *lstStyle;
KoParagCounter m_counter;
- QLineEdit *sSuffix, *sPrefix;
- QPushButton *bCustom;
+ TQLineEdit *sSuffix, *sPrefix;
+ TQPushButton *bCustom;
KoSpinBox *spnStart;
- QSpinBox *spnDepth;
- QSpinBox *spnDisplayLevels;
- QLabel *lStart;
- QLabel *lCustom;
- QCheckBox *cbRestart;
+ TQSpinBox *spnDepth;
+ TQSpinBox *spnDisplayLevels;
+ TQLabel *lStart;
+ TQLabel *lCustom;
+ TQCheckBox *cbRestart;
KComboBox *cbAlignment;
- QLabel *lAlignment;
+ TQLabel *lAlignment;
unsigned int styleBuffer;
bool noSignals;
};
@@ -340,15 +345,16 @@ private:
class KOTEXT_EXPORT KoParagCounterWidget : public KoParagLayoutWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoParagCounterWidget( bool disableAll=false ,QWidget * parent=0L, const char * name = 0 );
+ KoParagCounterWidget( bool disableAll=false ,TQWidget * tqparent=0L, const char * name = 0 );
virtual ~KoParagCounterWidget() {}
virtual void display( const KoParagLayout & lay );
virtual void save( KoParagLayout & lay );
//virtual bool isModified();
- virtual QString tabName();
+ virtual TQString tabName();
const KoParagCounter & counter() const { return m_counter; }
@@ -357,20 +363,20 @@ protected slots:
//void numStyleChanged(); // selected another style from the combobox
void numTypeChanged( int ); // selected another type radiobutton.
- void suffixChanged(const QString & txt) {m_counter.setSuffix(txt); updatePreview(); }
- void prefixChanged(const QString & txt) {m_counter.setPrefix(txt); updatePreview();}
+ void suffixChanged(const TQString & txt) {m_counter.setSuffix(txt); updatePreview(); }
+ void prefixChanged(const TQString & txt) {m_counter.setPrefix(txt); updatePreview();}
void startChanged(int i) {m_counter.setStartNumber(i); updatePreview();}
void restartChanged(bool b) {m_counter.setRestartCounter(b); }
void depthChanged(int i) {m_counter.setDepth(i); updatePreview();}
void displayLevelsChanged(int i) {m_counter.setDisplayLevels(i); updatePreview();}
- void alignmentChanged(int i) {m_counter.setAlignment(i); updatePreview();}
- void slotChangeCustomBullet( const QString & f, QChar c);
+ void tqalignmentChanged(int i) {m_counter.tqsetAlignment(i); updatePreview();}
+ void slotChangeCustomBullet( const TQString & f, TQChar c);
void styleChanged (KoParagCounter::Style st );
private:
void updatePreview();
- QButtonGroup *gNumbering;
+ TQButtonGroup *gNumbering;
KoParagCounter m_counter;
KoStylePreview *preview;
KoCounterStyleWidget *m_styleWidget;
@@ -384,12 +390,13 @@ private:
class KoTabulatorsLineEdit : public KoUnitDoubleSpinBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoTabulatorsLineEdit( QWidget *parent, double lower, double upper, double step, double value = 0.0,
+ KoTabulatorsLineEdit( TQWidget *tqparent, double lower, double upper, double step, double value = 0.0,
KoUnit::Unit unit = KoUnit::U_PT, unsigned int precision = 2, const char *name = 0 );
protected:
- virtual void keyPressEvent ( QKeyEvent * );
+ virtual void keyPressEvent ( TQKeyEvent * );
signals:
void keyReturnPressed();
};
@@ -400,13 +407,14 @@ protected:
class KOTEXT_EXPORT KoParagTabulatorsWidget : public KoParagLayoutWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoParagTabulatorsWidget( KoUnit::Unit unit, double _frameWidth, QWidget * parent, const char * name = 0 );
+ KoParagTabulatorsWidget( KoUnit::Unit unit, double _frameWidth, TQWidget * tqparent, const char * name = 0 );
virtual ~KoParagTabulatorsWidget() {}
virtual void display( const KoParagLayout & lay );
virtual void save( KoParagLayout & lay );
- virtual QString tabName();
+ virtual TQString tabName();
KoTabulatorList tabList() const { return m_tabList; }
@@ -414,7 +422,7 @@ public:
protected slots:
void slotTabValueChanged( double );
- void slotAlignCharChanged( const QString &_text );
+ void slotAlignCharChanged( const TQString &_text );
void newClicked();
void deleteClicked();
void deleteAllClicked();
@@ -426,25 +434,25 @@ protected slots:
private:
void sortLists();
- QString tabToString(const KoTabulator &tab);
+ TQString tabToString(const KoTabulator &tab);
- QVBoxLayout* editLayout;
+ TQVBoxLayout* editLayout;
- QListBox* lstTabs;
- QGroupBox* gPosition;
+ TQListBox* lstTabs;
+ TQGroupBox* gPosition;
KoTabulatorsLineEdit* sTabPos;
- QButtonGroup* bgAlign;
- QRadioButton* rAlignLeft;
- QRadioButton* rAlignCentre;
- QRadioButton* rAlignRight;
- QRadioButton* rAlignVar;
- QLineEdit* sAlignChar;
- QGroupBox* gTabLeader;
- QComboBox* cFilling;
+ TQButtonGroup* bgAlign;
+ TQRadioButton* rAlignLeft;
+ TQRadioButton* rAlignCentre;
+ TQRadioButton* rAlignRight;
+ TQRadioButton* rAlignVar;
+ TQLineEdit* sAlignChar;
+ TQGroupBox* gTabLeader;
+ TQComboBox* cFilling;
KoUnitDoubleSpinBox* eWidth;
- QPushButton* bNew;
- QPushButton* bDelete;
- QPushButton* bDeleteAll;
+ TQPushButton* bNew;
+ TQPushButton* bDelete;
+ TQPushButton* bDeleteAll;
KoTabulatorList m_tabList;
KoUnit::Unit m_unit;
@@ -457,12 +465,13 @@ private:
* Used in the parag bullet/number tab of the parag dia,
* and in the main tab of the stylist.
*/
-class KoStylePreview : public QGroupBox
+class KoStylePreview : public TQGroupBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoStylePreview( const QString &title, const QString &text, QWidget *parent, const char* name = 0 );
+ KoStylePreview( const TQString &title, const TQString &text, TQWidget *tqparent, const char* name = 0 );
virtual ~KoStylePreview();
/** Apply the given @p style to the preview.
@@ -473,7 +482,7 @@ public:
void setCounter( const KoParagCounter & counter );
protected:
- void drawContents( QPainter *painter );
+ void drawContents( TQPainter *painter );
KoTextDocument *m_textdoc;
KoTextZoomHandler *m_zoomHandler;
@@ -489,6 +498,7 @@ protected:
class KOTEXT_EXPORT KoParagDia : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
enum { PD_SPACING = 1, PD_ALIGN = 2, PD_DECORATION = 4, PD_NUMBERING = 8,
@@ -497,7 +507,7 @@ public:
/**
* breakLine : kpresenter didn't used this attibute, kword use it.
*/
- KoParagDia( QWidget*, const char*, int flags, KoUnit::Unit unit, double _frameWidth=-1,bool breakLine=true, bool disableAll = false);
+ KoParagDia( TQWidget*, const char*, int flags, KoUnit::Unit unit, double _frameWidth=-1,bool breakLine=true, bool disableAll = false);
~KoParagDia();
/** Flags passed to constructor */
@@ -536,28 +546,28 @@ public:
KoTabulatorList tabListTabulator() const { return m_tabulatorsWidget->tabList(); }
KoParagTabulatorsWidget * tabulatorsWidget() const { return m_tabulatorsWidget; }
- QColor backgroundColor() const { return m_decorationsWidget->backgroundColor(); }
+ TQColor backgroundColor() const { return m_decorationsWidget->backgroundColor(); }
// Support for "what has changed?"
- bool isAlignChanged() const {return oldLayout.alignment!=align();}
+ bool isAlignChanged() const {return oldLayout.tqalignment!=align();}
bool isLineSpacingChanged() const {
return (oldLayout.lineSpacingValue() !=lineSpacing() ||
oldLayout.lineSpacingType != lineSpacingType());
}
bool isLeftMarginChanged() const {
- return oldLayout.margins[QStyleSheetItem::MarginLeft]!=leftIndent();
+ return oldLayout.margins[TQStyleSheetItem::MarginLeft]!=leftIndent();
}
bool isRightMarginChanged() const {
- return oldLayout.margins[QStyleSheetItem::MarginRight]!=rightIndent();
+ return oldLayout.margins[TQStyleSheetItem::MarginRight]!=rightIndent();
}
bool isFirstLineChanged() const {
- return oldLayout.margins[ QStyleSheetItem::MarginFirstLine]!=firstLineIndent();
+ return oldLayout.margins[ TQStyleSheetItem::MarginFirstLine]!=firstLineIndent();
}
bool isSpaceBeforeChanged() const {
- return oldLayout.margins[QStyleSheetItem::MarginTop]!=spaceBeforeParag();
+ return oldLayout.margins[TQStyleSheetItem::MarginTop]!=spaceBeforeParag();
}
bool isSpaceAfterChanged() const {
- return oldLayout.margins[QStyleSheetItem::MarginBottom]!=spaceAfterParag();
+ return oldLayout.margins[TQStyleSheetItem::MarginBottom]!=spaceAfterParag();
}
bool isPageBreakingChanged() const {
return oldLayout.pageBreaking!=pageBreaking();
diff --git a/lib/kotext/KoParagDia_p.h b/lib/kotext/KoParagDia_p.h
index 8d1839eb..18b75a94 100644
--- a/lib/kotext/KoParagDia_p.h
+++ b/lib/kotext/KoParagDia_p.h
@@ -23,28 +23,29 @@
// This file hides those definitions from "users" of koParagDia.h
// to reduce compile-time dependencies.
-#include <qgroupbox.h>
+#include <tqgroupbox.h>
#include <KoParagCounter.h>
-#include <qspinbox.h>
-class QWidget;
-class QPainter;
+#include <tqspinbox.h>
+class TQWidget;
+class TQPainter;
/******************************************************************/
/* Class: KoSpinBox */
/******************************************************************/
-class KoSpinBox : public QSpinBox
+class KoSpinBox : public TQSpinBox
{
Q_OBJECT
+ TQ_OBJECT
public:
enum counterType{ NONE,NUM,ALPHAB_L,ALPHAB_U,ROM_NUM_L,ROM_NUM_U};
KoSpinBox( int minValue, int maxValue, int step = 1,
- QWidget * parent = 0, const char * name = 0 );
- KoSpinBox( QWidget * parent = 0, const char * name = 0 );
+ TQWidget * tqparent = 0, const char * name = 0 );
+ KoSpinBox( TQWidget * tqparent = 0, const char * name = 0 );
virtual ~KoSpinBox();
- virtual QString mapValueToText( int value );
+ virtual TQString mapValueToText( int value );
virtual int mapTextToValue( bool * ok );
void setCounterType(counterType _type);
private:
@@ -55,29 +56,30 @@ public:
/******************************************************************/
/* class KPagePreview */
/******************************************************************/
-class KPagePreview : public QGroupBox
+class KPagePreview : public TQGroupBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KPagePreview( QWidget*, const char* = 0L );
+ KPagePreview( TQWidget*, const char* = 0L );
~KPagePreview() {}
void setLeft( double _left )
- { left = _left; repaint( false ); }
+ { left = _left; tqrepaint( false ); }
void setRight( double _right )
- { right = _right; repaint( false ); }
+ { right = _right; tqrepaint( false ); }
void setFirst( double _first )
- { first = _first; repaint( false ); }
+ { first = _first; tqrepaint( false ); }
void setSpacing( double _spacing )
- { spacing = _spacing; repaint( false ); }
+ { spacing = _spacing; tqrepaint( false ); }
void setBefore( double _before )
- { before = _before; repaint( false ); }
+ { before = _before; tqrepaint( false ); }
void setAfter( double _after )
- { after = _after; repaint( false ); }
+ { after = _after; tqrepaint( false ); }
protected:
- void drawContents( QPainter* );
+ void drawContents( TQPainter* );
int convert(double input);
double left, right, first, spacing, before, after;
@@ -88,19 +90,20 @@ protected:
/* class KPagePreview2 */
/******************************************************************/
-class KPagePreview2 : public QGroupBox
+class KPagePreview2 : public TQGroupBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KPagePreview2( QWidget*, const char* = 0L );
+ KPagePreview2( TQWidget*, const char* = 0L );
~KPagePreview2() {}
void setAlign( int _align )
- { align = _align; repaint( false ); }
+ { align = _align; tqrepaint( false ); }
protected:
- void drawContents( QPainter* );
+ void drawContents( TQPainter* );
int align;
@@ -110,37 +113,38 @@ protected:
/* class KoBorderPreview */
/******************************************************************/
-class KoBorderPreview : public QFrame/*QGroupBox*/
+class KoBorderPreview : public TQFrame/*TQGroupBox*/
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoBorderPreview( QWidget*, const char* = 0L );
+ KoBorderPreview( TQWidget*, const char* = 0L );
~KoBorderPreview() {}
KoBorder leftBorder()const { return m_leftBorder; }
void setLeftBorder( const KoBorder& _leftBorder )
- { m_leftBorder = _leftBorder; repaint( true ); }
+ { m_leftBorder = _leftBorder; tqrepaint( true ); }
KoBorder rightBorder() const { return m_rightBorder; }
void setRightBorder( const KoBorder& _rightBorder )
- { m_rightBorder = _rightBorder; repaint( true ); }
+ { m_rightBorder = _rightBorder; tqrepaint( true ); }
KoBorder topBorder()const { return m_topBorder; }
void setTopBorder( const KoBorder& _topBorder )
- { m_topBorder = _topBorder; repaint( true ); }
+ { m_topBorder = _topBorder; tqrepaint( true ); }
KoBorder bottomBorder()const { return m_bottomBorder; }
void setBottomBorder( const KoBorder& _bottomBorder )
- { m_bottomBorder = _bottomBorder; repaint( true ); }
+ { m_bottomBorder = _bottomBorder; tqrepaint( true ); }
void setBorder( KoBorder::BorderType which, const KoBorder& border);
protected:
- virtual void mousePressEvent( QMouseEvent* _ev );
- void drawContents( QPainter* );
- QPen setBorderPen( KoBorder _brd );
+ virtual void mousePressEvent( TQMouseEvent* _ev );
+ void drawContents( TQPainter* );
+ TQPen setBorderPen( KoBorder _brd );
KoBorder m_leftBorder, m_rightBorder, m_topBorder, m_bottomBorder;
signals:
- void choosearea(QMouseEvent * _ev);
+ void choosearea(TQMouseEvent * _ev);
};
diff --git a/lib/kotext/KoParagLayout.cpp b/lib/kotext/KoParagLayout.cpp
index b3c3cf2c..8cb9682f 100644
--- a/lib/kotext/KoParagLayout.cpp
+++ b/lib/kotext/KoParagLayout.cpp
@@ -30,13 +30,13 @@
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
-#include <qdom.h>
-#include <qbuffer.h>
-#include <qcolor.h>
+#include <tqdom.h>
+#include <tqbuffer.h>
+#include <tqcolor.h>
#include <float.h>
-QString* KoParagLayout::shadowCssCompat = 0L;
+TQString* KoParagLayout::shadowCssCompat = 0L;
// Create a default KoParagLayout.
KoParagLayout::KoParagLayout()
@@ -44,72 +44,72 @@ KoParagLayout::KoParagLayout()
initialise();
}
-void KoParagLayout::operator=( const KoParagLayout &layout )
+void KoParagLayout::operator=( const KoParagLayout &tqlayout )
{
- alignment = layout.alignment;
+ tqalignment = tqlayout.tqalignment;
for ( int i = 0 ; i < 5 ; ++i )
- margins[i] = layout.margins[i];
- pageBreaking = layout.pageBreaking;
- leftBorder = layout.leftBorder;
- rightBorder = layout.rightBorder;
- topBorder = layout.topBorder;
- bottomBorder = layout.bottomBorder;
- joinBorder = layout.joinBorder;
- backgroundColor = layout.backgroundColor;
- if ( layout.counter )
- counter = new KoParagCounter( *layout.counter );
+ margins[i] = tqlayout.margins[i];
+ pageBreaking = tqlayout.pageBreaking;
+ leftBorder = tqlayout.leftBorder;
+ rightBorder = tqlayout.rightBorder;
+ topBorder = tqlayout.topBorder;
+ bottomBorder = tqlayout.bottomBorder;
+ joinBorder = tqlayout.joinBorder;
+ backgroundColor = tqlayout.backgroundColor;
+ if ( tqlayout.counter )
+ counter = new KoParagCounter( *tqlayout.counter );
else
counter = 0L;
- lineSpacing = layout.lineSpacing;
- lineSpacingType = layout.lineSpacingType;
- style = layout.style;
- direction = layout.direction;
- setTabList( layout.tabList() );
+ lineSpacing = tqlayout.lineSpacing;
+ lineSpacingType = tqlayout.lineSpacingType;
+ style = tqlayout.style;
+ direction = tqlayout.direction;
+ setTabList( tqlayout.tabList() );
}
-int KoParagLayout::compare( const KoParagLayout & layout ) const
+int KoParagLayout::compare( const KoParagLayout & tqlayout ) const
{
int flags = 0;
- if ( alignment != layout.alignment )
+ if ( tqalignment != tqlayout.tqalignment )
flags |= Alignment;
for ( int i = 0 ; i < 5 ; ++i )
- if ( margins[i] != layout.margins[i] )
+ if ( margins[i] != tqlayout.margins[i] )
{
flags |= Margins;
break;
}
- if ( pageBreaking != layout.pageBreaking )
+ if ( pageBreaking != tqlayout.pageBreaking )
flags |= PageBreaking;
- if ( leftBorder != layout.leftBorder
- || rightBorder != layout.rightBorder
- || topBorder != layout.topBorder
- || bottomBorder != layout.bottomBorder
- || joinBorder != layout.joinBorder )
+ if ( leftBorder != tqlayout.leftBorder
+ || rightBorder != tqlayout.rightBorder
+ || topBorder != tqlayout.topBorder
+ || bottomBorder != tqlayout.bottomBorder
+ || joinBorder != tqlayout.joinBorder )
flags |= Borders;
- if ( layout.counter )
+ if ( tqlayout.counter )
{
if ( counter )
{
- if ( ! ( *layout.counter == *counter ) )
+ if ( ! ( *tqlayout.counter == *counter ) )
flags |= BulletNumber;
} else
- if ( layout.counter->numbering() != KoParagCounter::NUM_NONE )
+ if ( tqlayout.counter->numbering() != KoParagCounter::NUM_NONE )
flags |= BulletNumber;
}
else
if ( counter && counter->numbering() != KoParagCounter::NUM_NONE )
flags |= BulletNumber;
- if ( lineSpacing != layout.lineSpacing
- || lineSpacingType != layout.lineSpacingType )
+ if ( lineSpacing != tqlayout.lineSpacing
+ || lineSpacingType != tqlayout.lineSpacingType )
flags |= LineSpacing;
- //if ( style != layout.style )
+ //if ( style != tqlayout.style )
// flags |= Style;
- if ( m_tabList != layout.m_tabList )
+ if ( m_tabList != tqlayout.m_tabList )
flags |= Tabulator;
- if ( backgroundColor != layout.backgroundColor)
+ if ( backgroundColor != tqlayout.backgroundColor)
flags |= BackgroundColor;
// This method is used for the GUI stuff only, so we don't have a flag
@@ -119,7 +119,7 @@ int KoParagLayout::compare( const KoParagLayout & layout ) const
void KoParagLayout::initialise()
{
- alignment = Qt::AlignAuto;
+ tqalignment = TQt::AlignAuto;
for ( int i = 0 ; i < 5 ; ++i ) // use memset ?
margins[i] = 0;
lineSpacingType = LS_SINGLE;
@@ -132,7 +132,7 @@ void KoParagLayout::initialise()
joinBorder = true;
pageBreaking = 0;
style = 0L;
- direction = QChar::DirON;
+ direction = TQChar::DirON;
m_tabList.clear();
}
@@ -141,18 +141,18 @@ KoParagLayout::~KoParagLayout()
delete counter;
}
-void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& parentElem, int docVersion )
+void KoParagLayout::loadParagLayout( KoParagLayout& tqlayout, const TQDomElement& tqparentElem, int docVersion )
{
- // layout is an input and output parameter
+ // tqlayout is an input and output parameter
// It can have been initialized already, e.g. by copying from a style
// (we don't do that anymore though).
- // Load the paragraph tabs - we load into a clean list, not mixing with those already in "layout"
+ // Load the paragraph tabs - we load into a clean list, not mixing with those already in "tqlayout"
// We can't apply the 'default comes from the style' in this case, because
// there is no way to differentiate between "I want no tabs in the parag"
// and "use default from style".
KoTabulatorList tabList;
- QDomElement element = parentElem.firstChild().toElement();
+ TQDomElement element = tqparentElem.firstChild().toElement();
for ( ; !element.isNull() ; element = element.nextSibling().toElement() )
{
if ( element.tagName() == "TABULATOR" )
@@ -162,7 +162,7 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& p
tab.ptPos = getAttribute( element, "ptpos", 0.0 );
tab.filling = static_cast<KoTabulatorFilling>( getAttribute( element, "filling", TF_BLANK ) );
tab.ptWidth = getAttribute( element, "width", 0.5 );
- QString alignCharStr = element.attribute("alignchar");
+ TQString alignCharStr = element.attribute("alignchar");
if ( alignCharStr.isEmpty() )
tab.alignChar = KGlobal::locale()->decimalSymbol()[0];
else
@@ -171,143 +171,143 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& p
}
}
qHeapSort( tabList );
- layout.setTabList( tabList );
- layout.alignment = Qt::AlignAuto;
- element = parentElem.namedItem( "FLOW" ).toElement(); // Flow is what is now called alignment internally
+ tqlayout.setTabList( tabList );
+ tqlayout.tqalignment = TQt::AlignAuto;
+ element = tqparentElem.namedItem( "FLOW" ).toElement(); // Flow is what is now called tqalignment internally
if ( !element.isNull() )
{
- QString flow = element.attribute( "align" ); // KWord-1.0 DTD
+ TQString flow = element.attribute( "align" ); // KWord-1.0 DTD
if ( !flow.isEmpty() )
{
- layout.alignment = flow=="right" ? Qt::AlignRight :
- flow=="center" ? Qt::AlignHCenter :
- flow=="justify" ? Qt::AlignJustify :
- flow=="left" ? Qt::AlignLeft : Qt::AlignAuto;
+ tqlayout.tqalignment = flow=="right" ? TQt::AlignRight :
+ flow=="center" ? TQt::AlignHCenter :
+ flow=="justify" ? TQt::AlignJustify :
+ flow=="left" ? TQt::AlignLeft : TQt::AlignAuto;
- QString dir = element.attribute( "dir" ); // KWord-1.2
+ TQString dir = element.attribute( "dir" ); // KWord-1.2
if ( !dir.isEmpty() ) {
if ( dir == "L" )
- layout.direction = QChar::DirL;
+ tqlayout.direction = TQChar::DirL;
else if ( dir == "R" )
- layout.direction = QChar::DirR;
+ tqlayout.direction = TQChar::DirR;
else
kdWarning() << "Unexpected value for paragraph direction: " << dir << endl;
}
} else {
flow = element.attribute( "value" ); // KWord-0.8
- static const int flow2align[] = { Qt::AlignAuto, Qt::AlignRight, Qt::AlignHCenter, Qt::AlignJustify };
+ static const int flow2align[] = { TQt::AlignAuto, TQt::AlignRight, TQt::AlignHCenter, TQt::AlignJustify };
if ( !flow.isEmpty() && flow.toInt() < 4 )
- layout.alignment = flow2align[flow.toInt()];
+ tqlayout.tqalignment = flow2align[flow.toInt()];
}
}
if ( docVersion < 2 )
{
- element = parentElem.namedItem( "OHEAD" ).toElement(); // used by KWord-0.8
+ element = tqparentElem.namedItem( "OHEAD" ).toElement(); // used by KWord-0.8
if ( !element.isNull() )
- layout.margins[QStyleSheetItem::MarginTop] = getAttribute( element, "pt", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "pt", 0.0 );
- element = parentElem.namedItem( "OFOOT" ).toElement(); // used by KWord-0.8
+ element = tqparentElem.namedItem( "OFOOT" ).toElement(); // used by KWord-0.8
if ( !element.isNull() )
- layout.margins[QStyleSheetItem::MarginBottom] = getAttribute( element, "pt", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "pt", 0.0 );
- element = parentElem.namedItem( "IFIRST" ).toElement(); // used by KWord-0.8
+ element = tqparentElem.namedItem( "IFIRST" ).toElement(); // used by KWord-0.8
if ( !element.isNull() )
- layout.margins[QStyleSheetItem::MarginFirstLine] = getAttribute( element, "pt", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "pt", 0.0 );
- element = parentElem.namedItem( "ILEFT" ).toElement(); // used by KWord-0.8
+ element = tqparentElem.namedItem( "ILEFT" ).toElement(); // used by KWord-0.8
if ( !element.isNull() )
- layout.margins[QStyleSheetItem::MarginLeft] = getAttribute( element, "pt", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "pt", 0.0 );
}
// KWord-1.0 DTD
- element = parentElem.namedItem( "INDENTS" ).toElement();
+ element = tqparentElem.namedItem( "INDENTS" ).toElement();
if ( !element.isNull() )
{
- layout.margins[QStyleSheetItem::MarginFirstLine] = getAttribute( element, "first", 0.0 );
- layout.margins[QStyleSheetItem::MarginLeft] = getAttribute( element, "left", 0.0 );
- layout.margins[QStyleSheetItem::MarginRight] = getAttribute( element, "right", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "first", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "left", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginRight] = getAttribute( element, "right", 0.0 );
}
- element = parentElem.namedItem( "OFFSETS" ).toElement();
+ element = tqparentElem.namedItem( "OFFSETS" ).toElement();
if ( !element.isNull() )
{
- layout.margins[QStyleSheetItem::MarginTop] = getAttribute( element, "before", 0.0 );
- layout.margins[QStyleSheetItem::MarginBottom] = getAttribute( element, "after", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "before", 0.0 );
+ tqlayout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "after", 0.0 );
}
if ( docVersion < 2 )
{
- element = parentElem.namedItem( "LINESPACE" ).toElement(); // used by KWord-0.8
+ element = tqparentElem.namedItem( "LINESPACE" ).toElement(); // used by KWord-0.8
if ( !element.isNull() )
{
- layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
- layout.lineSpacing = getAttribute( element, "pt", 0.0 );
+ tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ tqlayout.lineSpacing = getAttribute( element, "pt", 0.0 );
}
}
- element = parentElem.namedItem( "LINESPACING" ).toElement(); // KWord-1.0 DTD
+ element = tqparentElem.namedItem( "LINESPACING" ).toElement(); // KWord-1.0 DTD
if ( !element.isNull() )
{
//compatibility with koffice 1.1
if ( element.hasAttribute( "value" ))
{
- QString value = element.attribute( "value" );
+ TQString value = element.attribute( "value" );
if ( value == "oneandhalf" )
{
- layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
- layout.lineSpacing = 0;
+ tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
+ tqlayout.lineSpacing = 0;
}
else if ( value == "double" )
{
- layout.lineSpacingType = KoParagLayout::LS_DOUBLE;
- layout.lineSpacing = 0;
+ tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE;
+ tqlayout.lineSpacing = 0;
}
else
{
- layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
- layout.lineSpacing = value.toDouble();
+ tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ tqlayout.lineSpacing = value.toDouble();
}
}
else
{
- QString type = element.attribute( "type" );
+ TQString type = element.attribute( "type" );
if ( type == "oneandhalf" )
{
- layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
- layout.lineSpacing = 0;
+ tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
+ tqlayout.lineSpacing = 0;
}
else if ( type == "double" )
{
- layout.lineSpacingType = KoParagLayout::LS_DOUBLE;
- layout.lineSpacing = 0;
+ tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE;
+ tqlayout.lineSpacing = 0;
}
else if ( type == "custom" )
{
- layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
- layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
+ tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
}
else if ( type == "atleast" )
{
- layout.lineSpacingType = KoParagLayout::LS_AT_LEAST;
- layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
+ tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST;
+ tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
}
else if ( type == "multiple" )
{
- layout.lineSpacingType = KoParagLayout::LS_MULTIPLE;
- layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
+ tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE;
+ tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
}
else if ( type == "fixed" )
{
- layout.lineSpacingType = KoParagLayout::LS_FIXED;
- layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
+ tqlayout.lineSpacingType = KoParagLayout::LS_FIXED;
+ tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble();
}
else if ( type == "single" ) // not used; just in case future versions use it.
- layout.lineSpacingType = KoParagLayout::LS_SINGLE;
+ tqlayout.lineSpacingType = KoParagLayout::LS_SINGLE;
}
}
int pageBreaking = 0;
- element = parentElem.namedItem( "PAGEBREAKING" ).toElement();
+ element = tqparentElem.namedItem( "PAGEBREAKING" ).toElement();
if ( !element.isNull() )
{
if ( element.attribute( "linesTogether" ) == "true" )
@@ -319,50 +319,50 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& p
}
if ( docVersion < 2 )
{
- element = parentElem.namedItem( "HARDBRK" ).toElement(); // KWord-0.8
+ element = tqparentElem.namedItem( "HARDBRK" ).toElement(); // KWord-0.8
if ( !element.isNull() )
pageBreaking |= KoParagLayout::HardFrameBreakBefore;
}
- layout.pageBreaking = pageBreaking;
+ tqlayout.pageBreaking = pageBreaking;
- element = parentElem.namedItem( "LEFTBORDER" ).toElement();
+ element = tqparentElem.namedItem( "LEFTBORDER" ).toElement();
if ( !element.isNull() )
- layout.leftBorder = KoBorder::loadBorder( element );
+ tqlayout.leftBorder = KoBorder::loadBorder( element );
else
- layout.leftBorder.setPenWidth(0);
+ tqlayout.leftBorder.setPenWidth(0);
- element = parentElem.namedItem( "RIGHTBORDER" ).toElement();
+ element = tqparentElem.namedItem( "RIGHTBORDER" ).toElement();
if ( !element.isNull() )
- layout.rightBorder = KoBorder::loadBorder( element );
+ tqlayout.rightBorder = KoBorder::loadBorder( element );
else
- layout.rightBorder.setPenWidth(0);
+ tqlayout.rightBorder.setPenWidth(0);
- element = parentElem.namedItem( "TOPBORDER" ).toElement();
+ element = tqparentElem.namedItem( "TOPBORDER" ).toElement();
if ( !element.isNull() )
- layout.topBorder = KoBorder::loadBorder( element );
+ tqlayout.topBorder = KoBorder::loadBorder( element );
else
- layout.topBorder.setPenWidth(0);
+ tqlayout.topBorder.setPenWidth(0);
- element = parentElem.namedItem( "BOTTOMBORDER" ).toElement();
+ element = tqparentElem.namedItem( "BOTTOMBORDER" ).toElement();
if ( !element.isNull() )
- layout.bottomBorder = KoBorder::loadBorder( element );
+ tqlayout.bottomBorder = KoBorder::loadBorder( element );
else
- layout.bottomBorder.setPenWidth(0);
+ tqlayout.bottomBorder.setPenWidth(0);
- element = parentElem.namedItem( "COUNTER" ).toElement();
+ element = tqparentElem.namedItem( "COUNTER" ).toElement();
if ( !element.isNull() )
{
- layout.counter = new KoParagCounter;
- layout.counter->load( element );
+ tqlayout.counter = new KoParagCounter;
+ tqlayout.counter->load( element );
}
// Compatibility with KOffice-1.2
- element = parentElem.namedItem( "SHADOW" ).toElement();
+ element = tqparentElem.namedItem( "SHADOW" ).toElement();
if ( !element.isNull() && element.hasAttribute("direction") )
{
int shadowDistance = element.attribute("distance").toInt();
int shadowDirection = element.attribute("direction").toInt();
- QColor shadowColor;
+ TQColor shadowColor;
if ( element.hasAttribute("red") )
{
int r = element.attribute("red").toInt();
@@ -399,7 +399,7 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& p
break;
}
if ( !shadowCssCompat )
- shadowCssCompat = new QString;
+ shadowCssCompat = new TQString;
*shadowCssCompat = KoTextFormat::shadowAsCss( distanceX, distanceY, shadowColor );
kdDebug(32500) << "setting shadow compat to " << ( *shadowCssCompat ) << endl;
}
@@ -411,52 +411,52 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const QDomElement& p
}
//static
-Qt::AlignmentFlags KoParagLayout::loadOasisAlignment( const QCString& str )
+TQt::AlignmentFlags KoParagLayout::loadOasisAlignment( const TQCString& str )
{
return
- str == "left" ? Qt::AlignLeft :
- str == "right" ? Qt::AlignRight :
- str == "start" ? Qt::AlignLeft :
- str == "end" ? Qt::AlignRight :
- str == "center" ? Qt::AlignHCenter :
- str == "justify" ? Qt::AlignJustify :
- str == "start" ? Qt::AlignAuto // i.e. direction-dependent
- : Qt::AlignAuto; // default (can't happen unless spec is extended)
+ str == "left" ? TQt::AlignLeft :
+ str == "right" ? TQt::AlignRight :
+ str == "start" ? TQt::AlignLeft :
+ str == "end" ? TQt::AlignRight :
+ str == "center" ? TQt::AlignHCenter :
+ str == "justify" ? TQt::AlignJustify :
+ str == "start" ? TQt::AlignAuto // i.e. direction-dependent
+ : TQt::AlignAuto; // default (can't happen unless spec is extended)
}
//static
-QCString KoParagLayout::saveOasisAlignment( Qt::AlignmentFlags alignment )
+TQCString KoParagLayout::saveOasisAlignment( TQt::AlignmentFlags tqalignment )
{
- return alignment == Qt::AlignLeft ? "left" :
- alignment == Qt::AlignRight ? "right" :
- alignment == Qt::AlignHCenter ? "center" :
- alignment == Qt::AlignJustify ? "justify" :
+ return tqalignment == TQt::AlignLeft ? "left" :
+ tqalignment == TQt::AlignRight ? "right" :
+ tqalignment == TQt::AlignHCenter ? "center" :
+ tqalignment == TQt::AlignJustify ? "justify" :
"start"; // i.e. direction-dependent
}
-void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& context )
+void KoParagLayout::loadOasisParagLayout( KoParagLayout& tqlayout, KoOasisContext& context )
{
context.styleStack().setTypeProperties( "paragraph" );
- // layout is an input and output parameter
+ // tqlayout is an input and output parameter
// It can have been initialized already, e.g. by copying from a style
// code from OoWriterImport::writeLayout
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "text-align" ) ) {
- QCString align = context.styleStack().attributeNS( KoXmlNS::fo, "text-align" ).latin1();
- layout.alignment = loadOasisAlignment( align );
+ TQCString align = context.styleStack().attributeNS( KoXmlNS::fo, "text-align" ).latin1();
+ tqlayout.tqalignment = loadOasisAlignment( align );
}
if ( context.styleStack().hasAttributeNS( KoXmlNS::style, "writing-mode" ) ) { // http://web4.w3.org/TR/xsl/slice7.html#writing-mode
// LTR is lr-tb. RTL is rl-tb
- QString writingMode = context.styleStack().attributeNS( KoXmlNS::style, "writing-mode" );
- layout.direction = ( writingMode=="rl-tb" || writingMode=="rl" ) ? QChar::DirR : QChar::DirL;
+ TQString writingMode = context.styleStack().attributeNS( KoXmlNS::style, "writing-mode" );
+ tqlayout.direction = ( writingMode=="rl-tb" || writingMode=="rl" ) ? TQChar::DirR : TQChar::DirL;
}
// Indentation (margins)
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-left" ) || // 3.11.19
context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-right" ) ) {
- layout.margins[QStyleSheetItem::MarginLeft] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-left" ) );
- layout.margins[QStyleSheetItem::MarginRight] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-right" ) );
+ tqlayout.margins[TQStyleSheetItem::MarginLeft] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-left" ) );
+ tqlayout.margins[TQStyleSheetItem::MarginRight] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-right" ) );
// *text-indent must always be bound to either margin-left or margin-right
double first = 0;
if ( context.styleStack().attributeNS( KoXmlNS::style, "auto-text-indent") == "true" ) // style:auto-text-indent takes precedence
@@ -467,53 +467,53 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext&
else if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "text-indent") )
first = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "text-indent") );
- layout.margins[QStyleSheetItem::MarginFirstLine] = first;
+ tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = first;
}
// Offset before and after paragraph
if( context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-top") || // 3.11.22
context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-bottom")) {
- layout.margins[QStyleSheetItem::MarginTop] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-top" ) );
- layout.margins[QStyleSheetItem::MarginBottom] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-bottom" ) );
+ tqlayout.margins[TQStyleSheetItem::MarginTop] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-top" ) );
+ tqlayout.margins[TQStyleSheetItem::MarginBottom] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-bottom" ) );
}
// Line spacing
if( context.styleStack().hasAttributeNS( KoXmlNS::fo, "line-height") ) { // 3.11.1
// Fixed line height
- QString value = context.styleStack().attributeNS( KoXmlNS::fo, "line-height" );
+ TQString value = context.styleStack().attributeNS( KoXmlNS::fo, "line-height" );
if ( value != "normal" ) {
if ( value == "100%" )
- layout.lineSpacingType = KoParagLayout::LS_SINGLE;
+ tqlayout.lineSpacingType = KoParagLayout::LS_SINGLE;
else if( value=="150%")
- layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
+ tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
else if( value=="200%")
- layout.lineSpacingType = KoParagLayout::LS_DOUBLE;
- else if ( value.find('%') > -1 )
+ tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE;
+ else if ( value.tqfind('%') > -1 )
{
value = value.remove( '%' );
double percent = value.toDouble();
- layout.lineSpacingType = KoParagLayout::LS_MULTIPLE;
- layout.lineSpacing = percent / 100.0;
- kdDebug(33001) << "line-height =" << percent << ", " << layout.lineSpacing << ", " << percent/100 << endl;
+ tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE;
+ tqlayout.lineSpacing = percent / 100.0;
+ kdDebug(33001) << "line-height =" << percent << ", " << tqlayout.lineSpacing << ", " << percent/100 << endl;
}
else // fixed value
{
- layout.lineSpacingType = KoParagLayout::LS_FIXED;
- layout.lineSpacing = KoUnit::parseValue( value );
+ tqlayout.lineSpacingType = KoParagLayout::LS_FIXED;
+ tqlayout.lineSpacing = KoUnit::parseValue( value );
}
}
}
// Line-height-at-least is mutually exclusive with line-height
else if ( context.styleStack().hasAttributeNS( KoXmlNS::style, "line-height-at-least") ) // 3.11.2
{
- QString value = context.styleStack().attributeNS( KoXmlNS::style, "line-height-at-least" );
+ TQString value = context.styleStack().attributeNS( KoXmlNS::style, "line-height-at-least" );
// kotext has "at least" but that's for the linespacing, not for the entire line height!
// Strange. kotext also has "at least" for the whole line height....
// Did we make the wrong choice in kotext?
//kdWarning() << "Unimplemented support for style:line-height-at-least: " << value << endl;
// Well let's see if this makes a big difference.
- layout.lineSpacingType = KoParagLayout::LS_AT_LEAST;
- layout.lineSpacing = KoUnit::parseValue( value );
+ tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST;
+ tqlayout.lineSpacing = KoUnit::parseValue( value );
}
// Line-spacing is mutually exclusive with line-height and line-height-at-least
else if ( context.styleStack().hasAttributeNS( KoXmlNS::style, "line-spacing") ) // 3.11.3
@@ -521,45 +521,45 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext&
double value = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::style, "line-spacing" ) );
if ( value != 0.0 )
{
- layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
- layout.lineSpacing = value;
+ tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ tqlayout.lineSpacing = value;
}
}
// Tabulators
KoTabulatorList tabList;
if ( context.styleStack().hasChildNodeNS( KoXmlNS::style, "tab-stops" ) ) { // 3.11.10
- QDomElement tabStops = context.styleStack().childNodeNS( KoXmlNS::style, "tab-stops" );
- //kdDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in layout." << endl;
- QDomElement tabStop;
+ TQDomElement tabStops = context.styleStack().childNodeNS( KoXmlNS::style, "tab-stops" );
+ //kdDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in tqlayout." << endl;
+ TQDomElement tabStop;
forEachElement( tabStop, tabStops )
{
Q_ASSERT( tabStop.localName() == "tab-stop" );
- const QString type = tabStop.attributeNS( KoXmlNS::style, "type", QString::null ); // left, right, center or char
+ const TQString type = tabStop.attributeNS( KoXmlNS::style, "type", TQString() ); // left, right, center or char
KoTabulator tab;
- tab.ptPos = KoUnit::parseValue( tabStop.attributeNS( KoXmlNS::style, "position", QString::null ) );
+ tab.ptPos = KoUnit::parseValue( tabStop.attributeNS( KoXmlNS::style, "position", TQString() ) );
// Tab stop positions in the XML are relative to the left-margin
- tab.ptPos += layout.margins[QStyleSheetItem::MarginLeft];
+ tab.ptPos += tqlayout.margins[TQStyleSheetItem::MarginLeft];
if ( type == "center" )
tab.type = T_CENTER;
else if ( type == "right" )
tab.type = T_RIGHT;
else if ( type == "char" ) {
- QString delimiterChar = tabStop.attributeNS( KoXmlNS::style, "char", QString::null ); // single character
+ TQString delimiterChar = tabStop.attributeNS( KoXmlNS::style, "char", TQString() ); // single character
if ( !delimiterChar.isEmpty() )
tab.alignChar = delimiterChar[0];
- tab.type = T_DEC_PNT; // "alignment on decimal point"
+ tab.type = T_DEC_PNT; // "tqalignment on decimal point"
}
else //if ( type == "left" )
tab.type = T_LEFT;
- tab.ptWidth = KoUnit::parseValue( tabStop.attributeNS( KoXmlNS::style, "leader-width", QString::null ), 0.5 );
+ tab.ptWidth = KoUnit::parseValue( tabStop.attributeNS( KoXmlNS::style, "leader-width", TQString() ), 0.5 );
tab.filling = TF_BLANK;
- if ( tabStop.attributeNS( KoXmlNS::style, "leader-type", QString::null ) == "single" )
+ if ( tabStop.attributeNS( KoXmlNS::style, "leader-type", TQString() ) == "single" )
{
- QString leaderStyle = tabStop.attributeNS( KoXmlNS::style, "leader-style", QString::null );
+ TQString leaderStyle = tabStop.attributeNS( KoXmlNS::style, "leader-style", TQString() );
if ( leaderStyle == "solid" )
tab.filling = TF_LINE;
else if ( leaderStyle == "dotted" )
@@ -573,11 +573,11 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext&
}
else
{
- // Fallback: convert leaderChar's unicode value
- QString leaderChar = tabStop.attributeNS( KoXmlNS::style, "leader-text", QString::null );
+ // Fallback: convert leaderChar's tqunicode value
+ TQString leaderChar = tabStop.attributeNS( KoXmlNS::style, "leader-text", TQString() );
if ( !leaderChar.isEmpty() )
{
- QChar ch = leaderChar[0];
+ TQChar ch = leaderChar[0];
switch (ch.latin1()) {
case '.':
tab.filling = TF_DOTS; break;
@@ -594,27 +594,27 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext&
} //for
}
qHeapSort( tabList );
- layout.setTabList( tabList );
+ tqlayout.setTabList( tabList );
- layout.joinBorder = !( context.styleStack().attributeNS( KoXmlNS::style, "join-border") == "false" );
+ tqlayout.joinBorder = !( context.styleStack().attributeNS( KoXmlNS::style, "join-border") == "false" );
// Borders
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","left") )
- layout.leftBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","left") );
+ tqlayout.leftBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","left") );
else
- layout.leftBorder.setPenWidth(0);
+ tqlayout.leftBorder.setPenWidth(0);
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","right") )
- layout.rightBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","right") );
+ tqlayout.rightBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","right") );
else
- layout.rightBorder.setPenWidth(0);
+ tqlayout.rightBorder.setPenWidth(0);
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","top") )
- layout.topBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","top") );
+ tqlayout.topBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","top") );
else
- layout.topBorder.setPenWidth(0);
+ tqlayout.topBorder.setPenWidth(0);
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","bottom") )
- layout.bottomBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","bottom") );
+ tqlayout.bottomBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","bottom") );
else
- layout.bottomBorder.setPenWidth(0);
+ tqlayout.bottomBorder.setPenWidth(0);
// Page breaking
@@ -642,180 +642,180 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext&
}
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "keep-with-next" ) ) {
// OASIS spec says it's "auto"/"always", not a boolean.
- QString val = context.styleStack().attributeNS( KoXmlNS::fo, "keep-with-next" );
+ TQString val = context.styleStack().attributeNS( KoXmlNS::fo, "keep-with-next" );
if ( val == "true" || val == "always" )
pageBreaking |= KoParagLayout::KeepWithNext;
}
}
- layout.pageBreaking = pageBreaking;
+ tqlayout.pageBreaking = pageBreaking;
// Paragraph background color - fo:background-color
// The background color for parts of a paragraph that have no text underneath
if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "background-color" ) ) {
- QString bgColor = context.styleStack().attributeNS( KoXmlNS::fo, "background-color");
+ TQString bgColor = context.styleStack().attributeNS( KoXmlNS::fo, "background-color");
if (bgColor != "transparent")
- layout.backgroundColor.setNamedColor( bgColor );
+ tqlayout.backgroundColor.setNamedColor( bgColor );
}
}
-void KoParagLayout::saveParagLayout( QDomElement & parentElem, int alignment ) const
+void KoParagLayout::saveParagLayout( TQDomElement & tqparentElem, int tqalignment ) const
{
- const KoParagLayout& layout = *this; // code moved from somewhere else;)
- QDomDocument doc = parentElem.ownerDocument();
- QDomElement element = doc.createElement( "NAME" );
- parentElem.appendChild( element );
- if ( layout.style )
- element.setAttribute( "value", layout.style->displayName() );
+ const KoParagLayout& tqlayout = *this; // code moved from somewhere else;)
+ TQDomDocument doc = tqparentElem.ownerDocument();
+ TQDomElement element = doc.createElement( "NAME" );
+ tqparentElem.appendChild( element );
+ if ( tqlayout.style )
+ element.setAttribute( "value", tqlayout.style->displayName() );
//else
// kdWarning() << "KoParagLayout::saveParagLayout: style==0!" << endl;
element = doc.createElement( "FLOW" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
- element.setAttribute( "align", alignment==Qt::AlignRight ? "right" :
- alignment==Qt::AlignHCenter ? "center" :
- alignment==Qt::AlignJustify ? "justify" :
- alignment==Qt::AlignAuto ? "auto" : "left" ); // Note: styles can have AlignAuto. Not paragraphs.
+ element.setAttribute( "align", tqalignment==TQt::AlignRight ? "right" :
+ tqalignment==TQt::AlignHCenter ? "center" :
+ tqalignment==TQt::AlignJustify ? "justify" :
+ tqalignment==TQt::AlignAuto ? "auto" : "left" ); // Note: styles can have AlignAuto. Not paragraphs.
- if ( static_cast<QChar::Direction>(layout.direction) == QChar::DirR )
+ if ( static_cast<TQChar::Direction>(tqlayout.direction) == TQChar::DirR )
element.setAttribute( "dir", "R" );
else
- if ( static_cast<QChar::Direction>(layout.direction) == QChar::DirL )
+ if ( static_cast<TQChar::Direction>(tqlayout.direction) == TQChar::DirL )
element.setAttribute( "dir", "L" );
- if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 ||
- layout.margins[QStyleSheetItem::MarginLeft] != 0 ||
- layout.margins[QStyleSheetItem::MarginRight] != 0 )
+ if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 ||
+ tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 ||
+ tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 )
{
element = doc.createElement( "INDENTS" );
- parentElem.appendChild( element );
- if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 )
- element.setAttribute( "first", layout.margins[QStyleSheetItem::MarginFirstLine] );
- if ( layout.margins[QStyleSheetItem::MarginLeft] != 0 )
- element.setAttribute( "left", layout.margins[QStyleSheetItem::MarginLeft] );
- if ( layout.margins[QStyleSheetItem::MarginRight] != 0 )
- element.setAttribute( "right", layout.margins[QStyleSheetItem::MarginRight] );
+ tqparentElem.appendChild( element );
+ if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 )
+ element.setAttribute( "first", tqlayout.margins[TQStyleSheetItem::MarginFirstLine] );
+ if ( tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 )
+ element.setAttribute( "left", tqlayout.margins[TQStyleSheetItem::MarginLeft] );
+ if ( tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 )
+ element.setAttribute( "right", tqlayout.margins[TQStyleSheetItem::MarginRight] );
}
- if ( layout.margins[QStyleSheetItem::MarginTop] != 0 ||
- layout.margins[QStyleSheetItem::MarginBottom] != 0 )
+ if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 ||
+ tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 )
{
element = doc.createElement( "OFFSETS" );
- parentElem.appendChild( element );
- if ( layout.margins[QStyleSheetItem::MarginTop] != 0 )
- element.setAttribute( "before", layout.margins[QStyleSheetItem::MarginTop] );
- if ( layout.margins[QStyleSheetItem::MarginBottom] != 0 )
- element.setAttribute( "after", layout.margins[QStyleSheetItem::MarginBottom] );
+ tqparentElem.appendChild( element );
+ if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 )
+ element.setAttribute( "before", tqlayout.margins[TQStyleSheetItem::MarginTop] );
+ if ( tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 )
+ element.setAttribute( "after", tqlayout.margins[TQStyleSheetItem::MarginBottom] );
}
- if ( layout.lineSpacingType != LS_SINGLE )
+ if ( tqlayout.lineSpacingType != LS_SINGLE )
{
element = doc.createElement( "LINESPACING" );
- parentElem.appendChild( element );
- if ( layout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) {
+ tqparentElem.appendChild( element );
+ if ( tqlayout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) {
element.setAttribute( "type", "oneandhalf" );
element.setAttribute( "value", "oneandhalf" ); //compatibility with koffice 1.2
}
- else if ( layout.lineSpacingType == KoParagLayout::LS_DOUBLE ) {
+ else if ( tqlayout.lineSpacingType == KoParagLayout::LS_DOUBLE ) {
element.setAttribute( "type", "double" );
element.setAttribute( "value", "double" ); //compatibility with koffice 1.2
}
- else if ( layout.lineSpacingType == KoParagLayout::LS_CUSTOM )
+ else if ( tqlayout.lineSpacingType == KoParagLayout::LS_CUSTOM )
{
element.setAttribute( "type", "custom" );
- element.setAttribute( "spacingvalue", layout.lineSpacing);
- element.setAttribute( "value", layout.lineSpacing ); //compatibility with koffice 1.2
+ element.setAttribute( "spacingvalue", tqlayout.lineSpacing);
+ element.setAttribute( "value", tqlayout.lineSpacing ); //compatibility with koffice 1.2
}
- else if ( layout.lineSpacingType == KoParagLayout::LS_AT_LEAST )
+ else if ( tqlayout.lineSpacingType == KoParagLayout::LS_AT_LEAST )
{
element.setAttribute( "type", "atleast" );
- element.setAttribute( "spacingvalue", layout.lineSpacing);
+ element.setAttribute( "spacingvalue", tqlayout.lineSpacing);
}
- else if ( layout.lineSpacingType == KoParagLayout::LS_MULTIPLE )
+ else if ( tqlayout.lineSpacingType == KoParagLayout::LS_MULTIPLE )
{
element.setAttribute( "type", "multiple" );
- element.setAttribute( "spacingvalue", layout.lineSpacing);
+ element.setAttribute( "spacingvalue", tqlayout.lineSpacing);
}
- else if ( layout.lineSpacingType == KoParagLayout::LS_FIXED )
+ else if ( tqlayout.lineSpacingType == KoParagLayout::LS_FIXED )
{
element.setAttribute( "type", "fixed" );
- element.setAttribute( "spacingvalue", layout.lineSpacing);
+ element.setAttribute( "spacingvalue", tqlayout.lineSpacing);
}
else
kdDebug()<<" error in lineSpacing Type\n";
}
- if ( layout.pageBreaking != 0 )
+ if ( tqlayout.pageBreaking != 0 )
{
element = doc.createElement( "PAGEBREAKING" );
- parentElem.appendChild( element );
- if ( layout.pageBreaking & KoParagLayout::KeepLinesTogether )
+ tqparentElem.appendChild( element );
+ if ( tqlayout.pageBreaking & KoParagLayout::KeepLinesTogether )
element.setAttribute( "linesTogether", "true" );
- if ( layout.pageBreaking & KoParagLayout::HardFrameBreakBefore )
+ if ( tqlayout.pageBreaking & KoParagLayout::HardFrameBreakBefore )
element.setAttribute( "hardFrameBreak", "true" );
- if ( layout.pageBreaking & KoParagLayout::HardFrameBreakAfter )
+ if ( tqlayout.pageBreaking & KoParagLayout::HardFrameBreakAfter )
element.setAttribute( "hardFrameBreakAfter", "true" );
}
- if ( layout.leftBorder.penWidth() > 0 )
+ if ( tqlayout.leftBorder.penWidth() > 0 )
{
element = doc.createElement( "LEFTBORDER" );
- parentElem.appendChild( element );
- layout.leftBorder.save( element );
+ tqparentElem.appendChild( element );
+ tqlayout.leftBorder.save( element );
}
- if ( layout.rightBorder.penWidth() > 0 )
+ if ( tqlayout.rightBorder.penWidth() > 0 )
{
element = doc.createElement( "RIGHTBORDER" );
- parentElem.appendChild( element );
- layout.rightBorder.save( element );
+ tqparentElem.appendChild( element );
+ tqlayout.rightBorder.save( element );
}
- if ( layout.topBorder.penWidth() > 0 )
+ if ( tqlayout.topBorder.penWidth() > 0 )
{
element = doc.createElement( "TOPBORDER" );
- parentElem.appendChild( element );
- layout.topBorder.save( element );
+ tqparentElem.appendChild( element );
+ tqlayout.topBorder.save( element );
}
- if ( layout.bottomBorder.penWidth() > 0 )
+ if ( tqlayout.bottomBorder.penWidth() > 0 )
{
element = doc.createElement( "BOTTOMBORDER" );
- parentElem.appendChild( element );
- layout.bottomBorder.save( element );
+ tqparentElem.appendChild( element );
+ tqlayout.bottomBorder.save( element );
}
- if ( layout.counter && layout.counter->numbering() != KoParagCounter::NUM_NONE )
+ if ( tqlayout.counter && tqlayout.counter->numbering() != KoParagCounter::NUM_NONE )
{
element = doc.createElement( "COUNTER" );
- parentElem.appendChild( element );
- if ( layout.counter )
- layout.counter->save( element );
+ tqparentElem.appendChild( element );
+ if ( tqlayout.counter )
+ tqlayout.counter->save( element );
}
- KoTabulatorList tabList = layout.tabList();
+ KoTabulatorList tabList = tqlayout.tabList();
KoTabulatorList::ConstIterator it = tabList.begin();
for ( ; it != tabList.end() ; it++ )
{
element = doc.createElement( "TABULATOR" );
- parentElem.appendChild( element );
+ tqparentElem.appendChild( element );
element.setAttribute( "type", (*it).type );
element.setAttribute( "ptpos", (*it).ptPos );
element.setAttribute( "filling", (*it).filling );
if ( (*it).filling != TF_BLANK )
- element.setAttribute( "width", QString::number( (*it).ptWidth, 'g', DBL_DIG ) );
+ element.setAttribute( "width", TQString::number( (*it).ptWidth, 'g', DBL_DIG ) );
if ( (*it).type == T_DEC_PNT && !(*it).alignChar.isNull() )
- element.setAttribute( "alignchar", QString((*it).alignChar) );
+ element.setAttribute( "alignchar", TQString((*it).alignChar) );
}
}
void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool savingStyle ) const
{
- gs.addProperty( "fo:text-align", saveOasisAlignment( (Qt::AlignmentFlags)alignment ).data() );
+ gs.addProperty( "fo:text-align", saveOasisAlignment( (TQt::AlignmentFlags)tqalignment ).data() );
// Don't save the direction for a style, if "auto", so that the
// auto-determination of direction based on first char, works.
- if ( !savingStyle || (QChar::Direction) direction != QChar::DirON )
- gs.addProperty( "style:writing-mode", (QChar::Direction)direction == QChar::DirR ? "rl-tb" : "lr-tb" );
- gs.addPropertyPt( "fo:margin-left", margins[QStyleSheetItem::MarginLeft] );
- gs.addPropertyPt( "fo:margin-right", margins[QStyleSheetItem::MarginRight] );
- gs.addPropertyPt( "fo:text-indent", margins[QStyleSheetItem::MarginFirstLine] );
- gs.addPropertyPt( "fo:margin-top", margins[QStyleSheetItem::MarginTop] );
- gs.addPropertyPt( "fo:margin-bottom", margins[QStyleSheetItem::MarginBottom] );
+ if ( !savingStyle || (TQChar::Direction) direction != TQChar::DirON )
+ gs.addProperty( "style:writing-mode", (TQChar::Direction)direction == TQChar::DirR ? "rl-tb" : "lr-tb" );
+ gs.addPropertyPt( "fo:margin-left", margins[TQStyleSheetItem::MarginLeft] );
+ gs.addPropertyPt( "fo:margin-right", margins[TQStyleSheetItem::MarginRight] );
+ gs.addPropertyPt( "fo:text-indent", margins[TQStyleSheetItem::MarginFirstLine] );
+ gs.addPropertyPt( "fo:margin-top", margins[TQStyleSheetItem::MarginTop] );
+ gs.addPropertyPt( "fo:margin-bottom", margins[TQStyleSheetItem::MarginBottom] );
switch ( lineSpacingType ) {
case KoParagLayout::LS_SINGLE:
@@ -828,7 +828,7 @@ void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool sa
gs.addProperty( "fo:line-height", "200%" );
break;
case KoParagLayout::LS_MULTIPLE:
- gs.addProperty( "fo:line-height", QString::number( lineSpacing * 100.0 ) + '%' );
+ gs.addProperty( "fo:line-height", TQString::number( lineSpacing * 100.0 ) + '%' );
break;
case KoParagLayout::LS_FIXED:
gs.addPropertyPt( "fo:line-height", lineSpacing );
@@ -841,16 +841,16 @@ void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool sa
break;
}
- QBuffer buffer;
+ TQBuffer buffer;
buffer.open( IO_WriteOnly );
- KoXmlWriter tabsWriter( &buffer, 4 ); // indent==4: root,autostyle,style,parag-props
+ KoXmlWriter tabsWriter( TQT_TQIODEVICE(&buffer), 4 ); // indent==4: root,autostyle,style,parag-props
tabsWriter.startElement( "style:tab-stops" );
KoTabulatorList::ConstIterator it = m_tabList.begin();
for ( ; it != m_tabList.end() ; it++ )
{
tabsWriter.startElement( "style:tab-stop" );
// Tab stop positions in the XML are relative to the left-margin
- double pos = (*it).ptPos - margins[QStyleSheetItem::MarginLeft];
+ double pos = (*it).ptPos - margins[TQStyleSheetItem::MarginLeft];
tabsWriter.addAttributePt( "style:position", pos );
switch ( (*it).type ) {
@@ -863,10 +863,10 @@ void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool sa
case T_RIGHT:
tabsWriter.addAttribute( "style:type", "right" );
break;
- case T_DEC_PNT: // "alignment on decimal point"
+ case T_DEC_PNT: // "tqalignment on decimal point"
tabsWriter.addAttribute( "style:type", "char" );
if ( !(*it).alignChar.isNull() )
- tabsWriter.addAttribute( "style:char", QString( (*it).alignChar ) );
+ tabsWriter.addAttribute( "style:char", TQString( (*it).alignChar ) );
break;
case T_INVALID: // keep compiler happy, this can't happen
break;
@@ -913,7 +913,7 @@ void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool sa
}
tabsWriter.endElement();
buffer.close();
- QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
+ TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
gs.addChildElement( "style:tab-stops", elementContents );
if ( !joinBorder )
diff --git a/lib/kotext/KoParagLayout.h b/lib/kotext/KoParagLayout.h
index e3098f59..a60d3934 100644
--- a/lib/kotext/KoParagLayout.h
+++ b/lib/kotext/KoParagLayout.h
@@ -17,11 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef koparaglayout_h
-#define koparaglayout_h
+#ifndef koparagtqlayout_h
+#define koparagtqlayout_h
#include <KoRuler.h> // for KoTabulatorList
-#include <qdom.h>
+#include <tqdom.h>
#include "KoBorder.h"
#include <koffice_export.h>
class KoSavingContext;
@@ -29,7 +29,7 @@ class KoGenStyle;
class KoParagCounter;
class KoParagStyle;
class KoOasisContext;
-class QColor;
+class TQColor;
/**
* This class holds the paragraph-specific formatting information
@@ -40,7 +40,7 @@ class KOTEXT_EXPORT KoParagLayout
{
public:
KoParagLayout();
- KoParagLayout( const KoParagLayout &layout ) { operator=( layout ); }
+ KoParagLayout( const KoParagLayout &tqlayout ) { operator=( tqlayout ); }
~KoParagLayout();
@@ -89,14 +89,14 @@ public:
double lineSpacingValue() const { return lineSpacing;}
void setLineSpacingValue(double _value) { lineSpacing = _value;}
- static QString* shadowCssCompat; // used for compat with koffice-1.2 when loading
+ static TQString* shadowCssCompat; // used for compat with koffice-1.2 when loading
bool joinBorder:1;
bool unused:7; // for future use
char pageBreaking; // Page breaking flags
- char direction; // QChar::Direction
+ char direction; // TQChar::Direction
/// Alignment flag (AlignAuto/AlignLeft/AlignRight/AlignJustify)
- char alignment; // Qt::AlignmentFlags
+ char tqalignment; // TQt::AlignmentFlags
KoBorder leftBorder, rightBorder, topBorder, bottomBorder;
/// The background color of the paragraph
@@ -106,7 +106,7 @@ public:
* In theory anyway: the background colour isn't used in rendering text
* yet, but it's nice to preserve the value.
*/
- QColor backgroundColor;
+ TQColor backgroundColor;
/** can be 0 if no counter set */
KoParagCounter* counter;
@@ -122,48 +122,48 @@ public:
const KoTabulatorList& tabList() const { return m_tabList; }
//! Assignment operator for KoParagLayout
- /** Copy a paragraph layout.
+ /** Copy a paragraph tqlayout.
*
* If you're modifying this, you might also need to modify
* KoTextParag::setParagLayout
*/
void operator=( const KoParagLayout & );
- /** Return a set of flags showing the differences between this and 'layout' */
- int compare( const KoParagLayout & layout ) const;
+ /** Return a set of flags showing the differences between this and 'tqlayout' */
+ int compare( const KoParagLayout & tqlayout ) const;
- /** Save this parag layout to XML.
+ /** Save this parag tqlayout to XML.
* This format is used by KWord for paragraphs, and by KPresenter+KWord for styles.
*/
- void saveParagLayout( QDomElement & parentElem, int alignment ) const;
+ void saveParagLayout( TQDomElement & tqparentElem, int tqalignment ) const;
- /** Load this parag layout from XML.
+ /** Load this parag tqlayout from XML.
* This format is used by KWord for paragraphs, and by KPresenter+KWord for styles.
*/
- static void loadParagLayout( KoParagLayout& layout, const QDomElement& parentElem, int docVersion = 2 );
+ static void loadParagLayout( KoParagLayout& tqlayout, const TQDomElement& tqparentElem, int docVersion = 2 );
- /// Load this parag layout from Oasis XML
- static void loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& context );
- /// Save this parag layout to Oasis XML
+ /// Load this parag tqlayout from Oasis XML
+ static void loadOasisParagLayout( KoParagLayout& tqlayout, KoOasisContext& context );
+ /// Save this parag tqlayout to Oasis XML
/// @param savingStyle true if this is saved as part of a user style,
/// false when saving a paragraph
/// @param gs the style where all the properties will be saved to
/// @param context the current context
void saveOasis( KoGenStyle& gs, KoSavingContext& context, bool savingStyle ) const;
- /// Convert an alignment string into an alignment flag (load)
- static Qt::AlignmentFlags loadOasisAlignment( const QCString& str );
- /// Convert an alignment flag into an alignment string (save)
- static QCString saveOasisAlignment( Qt::AlignmentFlags alignment );
+ /// Convert an tqalignment string into an tqalignment flag (load)
+ static TQt::AlignmentFlags loadOasisAlignment( const TQCString& str );
+ /// Convert an tqalignment flag into an tqalignment string (save)
+ static TQCString saveOasisAlignment( TQt::AlignmentFlags tqalignment );
private:
- static int getAttribute(const QDomElement &element, const char *attributeName, int defaultValue) {
- QString value = element.attribute( attributeName );
+ static int getAttribute(const TQDomElement &element, const char *attributeName, int defaultValue) {
+ TQString value = element.attribute( attributeName );
return value.isNull() ? defaultValue : value.toInt();
}
- static double getAttribute(const QDomElement &element, const char *attributeName, double defaultValue) {
- QString value = element.attribute( attributeName );
+ static double getAttribute(const TQDomElement &element, const char *attributeName, double defaultValue) {
+ TQString value = element.attribute( attributeName );
return value.isNull() ? defaultValue : value.toDouble();
}
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
diff --git a/lib/kotext/KoParagStyle.h b/lib/kotext/KoParagStyle.h
index 5b070825..46e4f242 100644
--- a/lib/kotext/KoParagStyle.h
+++ b/lib/kotext/KoParagStyle.h
@@ -23,7 +23,7 @@
#include "KoParagLayout.h"
#include "KoUserStyle.h"
class KoGenStyles;
-class QDomElement;
+class TQDomElement;
/**
* A KoCharStyle is a set of formatting attributes (font, color, etc.)
@@ -33,10 +33,10 @@ class KOTEXT_EXPORT KoCharStyle : public KoUserStyle
{
public:
/** Create a blank style (with default attributes) */
- KoCharStyle( const QString & name );
+ KoCharStyle( const TQString & name );
/** Copy another style */
- KoCharStyle( const KoCharStyle & rhs ) : KoUserStyle( QString::null ) { *this = rhs; }
+ KoCharStyle( const KoCharStyle & rhs ) : KoUserStyle( TQString() ) { *this = rhs; }
/** Return a format. Don't forget to use the format collection
* of your KoTextDocument from the result of that method. */
@@ -49,13 +49,13 @@ protected:
/**
* A paragraph style is a combination of a character style
- * and paragraph-layout attributes, all grouped under a name.
+ * and paragraph-tqlayout attributes, all grouped under a name.
*/
class KOTEXT_EXPORT KoParagStyle : public KoCharStyle
{
public:
/** Create a blank style (with default attributes) */
- KoParagStyle( const QString & name );
+ KoParagStyle( const TQString & name );
/** Copy another style */
KoParagStyle( const KoParagStyle & rhs );
@@ -71,20 +71,20 @@ public:
KoParagStyle *followingStyle() const { return m_followingStyle; }
void setFollowingStyle( KoParagStyle *fst );
- /// Saves the name, layout, the following style and the outline bool. Not the format.
+ /// Saves the name, tqlayout, the following style and the outline bool. Not the format.
/// @deprecated (1.3 format)
- void saveStyle( QDomElement & parentElem );
- /// Loads the name, layout and the outline bool. Not the "following style" nor the format.
+ void saveStyle( TQDomElement & tqparentElem );
+ /// Loads the name, tqlayout and the outline bool. Not the "following style" nor the format.
/// (1.3 format)
- void loadStyle( QDomElement & parentElem, int docVersion = 2 );
+ void loadStyle( TQDomElement & tqparentElem, int docVersion = 2 );
/// Load the style from OASIS
- void loadStyle( QDomElement & styleElem, KoOasisContext& context );
+ void loadStyle( TQDomElement & styleElem, KoOasisContext& context );
/// Save the style to OASIS
/// Don't use, use the method in KoStyleCollection instead
- QString saveStyle( KoGenStyles& genStyles, int styleType, const QString& parentStyleName, KoSavingContext& context ) const;
+ TQString saveStyle( KoGenStyles& genStyles, int styleType, const TQString& tqparentStyleName, KoSavingContext& context ) const;
- KoParagStyle * parentStyle() const {return m_parentStyle;}
+ KoParagStyle * tqparentStyle() const {return m_parentStyle;}
void setParentStyle( KoParagStyle *_style){ m_parentStyle = _style;}
int inheritedParagLayoutFlag() const { return m_inheritedParagLayoutFlag; }
diff --git a/lib/kotext/KoRichText.cpp b/lib/kotext/KoRichText.cpp
index f8500ec9..dc6c6922 100644
--- a/lib/kotext/KoRichText.cpp
+++ b/lib/kotext/KoRichText.cpp
@@ -1,31 +1,31 @@
/****************************************************************************
-** Implementation of the internal Qt classes dealing with rich text
+** Implementation of the internal TQt classes dealing with rich text
**
** Created : 990101
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
-** This file is part of the kernel module of the Qt GUI Toolkit.
+** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -37,8 +37,8 @@
#include "KoTextFormat.h"
#include "KoTextParag.h"
-#include <qpaintdevicemetrics.h>
-#include "qdrawutil.h" // for KoTextHorizontalLine
+#include <tqpaintdevicemetrics.h>
+#include "tqdrawutil.h" // for KoTextHorizontalLine
#include <stdlib.h>
#include "KoParagCounter.h"
@@ -47,7 +47,7 @@
#include <kdeversion.h>
#include <kglobal.h>
#include <klocale.h>
-#include <private/qtextengine_p.h>
+#include <tqtextengine_p.h>
//#define DEBUG_COLLECTION
//#define DEBUG_TABLE_RENDERING
@@ -59,7 +59,7 @@
void KoTextDocCommandHistory::addCommand( KoTextDocCommand *cmd )
{
if ( current < (int)history.count() - 1 ) {
- QPtrList<KoTextDocCommand> commands;
+ TQPtrList<KoTextDocCommand> commands;
commands.setAutoDelete( FALSE );
for( int i = 0; i <= current; ++i ) {
@@ -119,7 +119,7 @@ bool KoTextDocCommandHistory::isRedoAvailable()
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str )
+KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocCommand( d ), id( i ), index( idx ), parag( 0 ), text( str )
{
for ( int j = 0; j < (int)text.size(); ++j ) {
@@ -128,7 +128,7 @@ KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int id
}
}
-/*KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextParag *p, int idx, const QMemArray<KoTextStringChar> &str )
+/*KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextParag *p, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocCommand( 0 ), id( -1 ), index( idx ), parag( p ), text( str )
{
for ( int i = 0; i < (int)text.size(); ++i ) {
@@ -186,7 +186,7 @@ KoTextCursor *KoTextDocDeleteCommand::unexecute( KoTextCursor *c )
cursor.setParag( s );
cursor.setIndex( index );
- QString str = KoTextString::toString( text );
+ TQString str = KoTextString::toString( text );
cursor.insert( str, TRUE, &text );
cursor.setParag( s );
cursor.setIndex( index );
@@ -210,7 +210,7 @@ KoTextCursor *KoTextDocDeleteCommand::unexecute( KoTextCursor *c )
}
KoTextDocFormatCommand::KoTextDocFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx,
- const QMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
+ const TQMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
: KoTextDocCommand( d ), startId( sid ), startIndex( sidx ), endId( eid ), endIndex( eidx ), oldFormats( old ), flags( fl )
{
format = d->formatCollection()->format( f );
@@ -247,7 +247,7 @@ KoTextCursor *KoTextDocFormatCommand::execute( KoTextCursor *c )
doc->setSelectionEnd( KoTextDocument::Temp, &end );
doc->setFormat( KoTextDocument::Temp, format, flags );
doc->removeSelection( KoTextDocument::Temp );
- if ( endIndex == ep->length() ) // ### Not in QRT - report sent. Description at http://bugs.kde.org/db/34/34556.html
+ if ( endIndex == ep->length() ) // ### Not in TQRT - report sent. Description at http://bugs.kde.org/db/34/34556.html
end.gotoLeft();
*c = end;
return c;
@@ -262,7 +262,7 @@ KoTextCursor *KoTextDocFormatCommand::unexecute( KoTextCursor *c )
int idx = startIndex;
int fIndex = 0;
- if( !oldFormats.isEmpty()) // ## not in QRT. Not sure how it can happen.
+ if( !oldFormats.isEmpty()) // ## not in TQRT. Not sure how it can happen.
{
for ( ;; ) {
if ( oldFormats.at( fIndex ).c == '\n' ) {
@@ -299,7 +299,7 @@ KoTextCursor *KoTextDocFormatCommand::unexecute( KoTextCursor *c )
return c;
}
-KoTextAlignmentCommand::KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const QMemArray<int> &oa )
+KoTextAlignmentCommand::KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const TQMemArray<int> &oa )
: KoTextDocCommand( d ), firstParag( fParag ), lastParag( lParag ), newAlign( na ), oldAligns( oa )
{
}
@@ -310,7 +310,7 @@ KoTextCursor *KoTextAlignmentCommand::execute( KoTextCursor *c )
if ( !p )
return c;
while ( p ) {
- p->setAlignment( newAlign );
+ p->tqsetAlignment( newAlign );
if ( p->paragId() == lastParag )
break;
p = p->next();
@@ -326,7 +326,7 @@ KoTextCursor *KoTextAlignmentCommand::unexecute( KoTextCursor *c )
int i = 0;
while ( p ) {
if ( i < (int)oldAligns.size() )
- p->setAlignment( oldAligns.at( i ) );
+ p->tqsetAlignment( oldAligns.at( i ) );
if ( p->paragId() == lastParag )
break;
p = p->next();
@@ -373,18 +373,18 @@ bool KoTextCursor::operator==( const KoTextCursor &c ) const
return doc == c.doc && string == c.string && idx == c.idx;
}
-void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTextStringChar> *formatting )
+void KoTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<KoTextStringChar> *formatting )
{
- string->invalidate( idx );
+ string->tqinvalidate( idx );
tmpIndex = -1;
bool justInsert = TRUE;
- QString s( str );
-#if defined(Q_WS_WIN)
+ TQString s( str );
+#if defined(TQ_WS_WIN)
if ( checkNewLine )
- s = s.replace( QRegExp( "\\r" ), "" );
+ s = s.tqreplace( TQRegExp( "\\r" ), "" );
#endif
if ( checkNewLine )
- justInsert = s.find( '\n' ) == -1;
+ justInsert = s.tqfind( '\n' ) == -1;
if ( justInsert ) {
string->insert( idx, s );
if ( formatting ) {
@@ -397,8 +397,8 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
}
idx += s.length();
} else {
- QStringList lst = QStringList::split( '\n', s, TRUE );
- QStringList::Iterator it = lst.begin();
+ TQStringList lst = TQStringList::split( '\n', s, TRUE );
+ TQStringList::Iterator it = lst.begin();
//int y = string->rect().y() + string->rect().height();
int lastIndex = 0;
KoTextFormat *lastFormat = 0;
@@ -415,12 +415,12 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
}
}
lastFormat = 0;
- QString s = *it;
+ TQString s = *it;
++it;
if ( !s.isEmpty() )
string->insert( idx, s );
else
- string->invalidate( 0 );
+ string->tqinvalidate( 0 );
if ( formatting ) {
int len = s.length();
@@ -448,7 +448,7 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
while ( p ) {
p->setParagId( p->prev()->paragId() + 1 );
//p->move( dy );
- p->invalidate( 0 );
+ p->tqinvalidate( 0 );
p = p->next();
}
}
@@ -482,17 +482,17 @@ void KoTextCursor::gotoPreviousLetter()
}
}
-bool KoTextCursor::place( const QPoint &p, KoTextParag *s, bool link, int *customItemIndex )
+bool KoTextCursor::place( const TQPoint &p, KoTextParag *s, bool link, int *customItemIndex )
{
if ( customItemIndex )
*customItemIndex = -1;
- QPoint pos( p );
- QRect r;
+ TQPoint pos( p );
+ TQRect r;
if ( pos.y() < s->rect().y() )
pos.setY( s->rect().y() );
while ( s ) {
r = s->rect();
- r.setWidth( doc ? doc->width() : QWIDGETSIZE_MAX );
+ r.setWidth( doc ? doc->width() : TQWIDGETSIZE_MAX );
if ( !s->next() || ( pos.y() >= r.y() && pos.y() < s->next()->rect().y() ) )
break;
s = s->next();
@@ -545,8 +545,8 @@ bool KoTextCursor::place( const QPoint &p, KoTextParag *s, bool link, int *custo
cpos += cw;
int d = cpos - pos.x();
bool dm = d < 0 ? !chr->rightToLeft : chr->rightToLeft;
- if ( (QABS( d ) < dist || (dist == d && dm == TRUE )) && string->string()->validCursorPosition( i ) ) {
- dist = QABS( d );
+ if ( (TQABS( d ) < dist || (dist == d && dm == TRUE )) && string->string()->validCursorPosition( i ) ) {
+ dist = TQABS( d );
if ( !link || pos.x() >= x + chr->x ) {
curpos = i;
}
@@ -589,7 +589,7 @@ void KoTextCursor::gotoUp()
if ( !c )
return;
- tmpIndex = QMAX( tmpIndex, idx - indexOfLineStart );
+ tmpIndex = TQMAX( tmpIndex, idx - indexOfLineStart );
if ( indexOfLineStart == 0 ) {
if ( !string->prev() ) {
return;
@@ -625,7 +625,7 @@ void KoTextCursor::gotoDown()
if ( !c )
return;
- tmpIndex = QMAX( tmpIndex, idx - indexOfLineStart );
+ tmpIndex = TQMAX( tmpIndex, idx - indexOfLineStart );
if ( line == string->lines() - 1 ) {
if ( !string->next() ) {
return;
@@ -887,7 +887,7 @@ void KoTextCursor::splitAndInsertEmptyParag( bool ind, bool updateIds )
string->format();
}
} else {
- QString str = string->string()->toString().mid( idx, 0xFFFFFF );
+ TQString str = string->string()->toString().mid( idx, 0xFFFFFF );
KoTextParag *n = string->next();
KoTextParag *s = doc->createParag( doc, string, n, updateIds );
s->copyParagData( string );
@@ -933,13 +933,13 @@ bool KoTextCursor::removePreviousChar()
// shouldn't be needed, just to make sure.
fixCursorPosition();
string->format( -1, TRUE );
- //else if ( string->document() && string->document()->parent() )
+ //else if ( string->document() && string->document()->tqparent() )
// string->document()->nextDoubleBuffered = TRUE;
return FALSE;
} else if ( string->prev() ) {
string = string->prev();
string->join( string->next() );
- string->invalidateCounters();
+ string->tqinvalidateCounters();
return TRUE;
}
return FALSE;
@@ -952,7 +952,7 @@ bool KoTextCursor::remove()
int next = string->string()->nextCursorPosition( idx );
string->remove( idx, next-idx );
string->format( -1, TRUE );
- //else if ( doc && doc->parent() )
+ //else if ( doc && doc->tqparent() )
// doc->nextDoubleBuffered = TRUE;
return FALSE;
} else if ( string->next() ) {
@@ -963,9 +963,9 @@ bool KoTextCursor::remove()
KoTextParag *p = string->next();
delete string;
string = p;
- string->invalidate( 0 );
+ string->tqinvalidate( 0 );
//// kotext
- string->invalidateCounters();
+ string->tqinvalidateCounters();
////
KoTextParag *s = string;
while ( s ) {
@@ -990,7 +990,7 @@ void KoTextCursor::killLine()
return;
string->remove( idx, string->length() - idx - 1 );
string->format( -1, TRUE );
- //else if ( doc && doc->parent() )
+ //else if ( doc && doc->tqparent() )
//doc->nextDoubleBuffered = TRUE;
}
@@ -1044,7 +1044,7 @@ void KoTextCursor::fixCursorPosition()
int lineIdx;
KoTextStringChar *start = string->lineStartOfChar( idx, &lineIdx, 0 );
int x = string->string()->at( idx ).x;
- int diff = QABS(start->x - x);
+ int diff = TQABS(start->x - x);
int best = lineIdx;
KoTextStringChar *c = start;
@@ -1055,7 +1055,7 @@ void KoTextCursor::fixCursorPosition()
int xp = c->x;
if ( c->rightToLeft )
xp += c->pixelwidth; //string->string()->width( lineIdx + (c-start) );
- int ndiff = QABS(xp - x);
+ int ndiff = TQABS(xp - x);
if ( ndiff < diff && string->string()->validCursorPosition(lineIdx + (c-start)) ) {
diff = ndiff;
best = lineIdx + (c-start);
@@ -1073,7 +1073,7 @@ KoTextString::KoTextString()
bNeedsSpellCheck = true;
bidi = FALSE;
rightToLeft = FALSE;
- dir = QChar::DirON;
+ dir = TQChar::DirON;
}
KoTextString::KoTextString( const KoTextString &s )
@@ -1092,7 +1092,7 @@ KoTextString::KoTextString( const KoTextString &s )
}
}
-void KoTextString::insert( int index, const QString &s, KoTextFormat *f )
+void KoTextString::insert( int index, const TQString &s, KoTextFormat *f )
{
int os = data.size();
data.resize( data.size() + s.length() );
@@ -1151,8 +1151,8 @@ void KoTextString::insert( int index, KoTextStringChar *c )
void KoTextString::truncate( int index )
{
- index = QMAX( index, 0 );
- index = QMIN( index, (int)data.size() - 1 );
+ index = TQMAX( index, 0 );
+ index = TQMIN( index, (int)data.size() - 1 );
if ( index < (int)data.size() ) {
for ( int i = index + 1; i < (int)data.size(); ++i ) {
KoTextStringChar &ch = data[ i ];
@@ -1188,7 +1188,7 @@ void KoTextString::remove( int index, int len )
}
memmove( data.data() + index, data.data() + index + len,
sizeof( KoTextStringChar ) * ( data.size() - index - len ) );
- data.resize( data.size() - len, QGArray::SpeedOptim );
+ data.resize( data.size() - len, TQGArray::SpeedOptim );
bidiDirty = TRUE;
bNeedsSpellCheck = true;
}
@@ -1236,19 +1236,24 @@ void KoTextString::checkBidi() const
int length = data.size();
if ( !length ) {
that->bidi = FALSE;
- that->rightToLeft = dir == QChar::DirR;
+ that->rightToLeft = dir == TQChar::DirR;
return;
}
const KoTextStringChar *start = data.data();
const KoTextStringChar *end = start + length;
- // determines the properties we need for layouting
- QTextEngine textEngine( toString(), 0 );
- textEngine.direction = (QChar::Direction) dir;
- textEngine.itemize(QTextEngine::SingleLine);
- const QCharAttributes *ca = textEngine.attributes() + length-1;
+ // determines the properties we need for tqlayouting
+#ifdef USE_QT4
+ #warning "KoTextString::checkBidi() for Qt4 partially implemented"
+ printf("[WARNING] KoTextString::checkBidi() partially implemented\n\r");
+ fflush(stdout);
+#else
+ TQTextEngine textEngine( toString(), 0 );
+ textEngine.direction = (TQChar::Direction) dir;
+ textEngine.itemize(TQTextEngine::SingleLine);
+ const TQCharAttributes *ca = textEngine.attributes() + length-1;
KoTextStringChar *ch = (KoTextStringChar *)end - 1;
- QScriptItem *item = &textEngine.items[textEngine.items.size()-1];
+ TQScriptItem *item = &textEngine.items[textEngine.items.size()-1];
unsigned char bidiLevel = item->analysis.bidiLevel;
if ( bidiLevel )
that->bidi = TRUE;
@@ -1273,21 +1278,22 @@ void KoTextString::checkBidi() const
--pos;
}
- if ( dir == QChar::DirR ) {
+ if ( dir == TQChar::DirR ) {
that->bidi = TRUE;
that->rightToLeft = TRUE;
- } else if ( dir == QChar::DirL ) {
+ } else if ( dir == TQChar::DirL ) {
that->rightToLeft = FALSE;
} else {
- that->rightToLeft = (textEngine.direction == QChar::DirR);
+ that->rightToLeft = (textEngine.direction == TQChar::DirR);
}
+#endif // USE_QT4
}
-QMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
+TQMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
{
if ( len == 0xFFFFFF )
len = data.size();
- QMemArray<KoTextStringChar> a;
+ TQMemArray<KoTextStringChar> a;
a.resize( len );
for ( int i = 0; i < len; ++i ) {
KoTextStringChar *c = &data[ i + start ];
@@ -1307,11 +1313,11 @@ QMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
return a;
}
-QString KoTextString::mid( int start, int len ) const
+TQString KoTextString::mid( int start, int len ) const
{
if ( len == 0xFFFFFF )
len = data.size();
- QString res;
+ TQString res;
res.setLength( len );
for ( int i = 0; i < len; ++i ) {
KoTextStringChar *c = &data[ i + start ];
@@ -1320,13 +1326,13 @@ QString KoTextString::mid( int start, int len ) const
return res;
}
-QString KoTextString::toString( const QMemArray<KoTextStringChar> &data )
+TQString KoTextString::toString( const TQMemArray<KoTextStringChar> &data )
{
- QString s;
+ TQString s;
int l = data.size();
s.setUnicode( 0, l );
KoTextStringChar *c = data.data();
- QChar *uc = (QChar *)s.unicode();
+ TQChar *uc = (TQChar *)s.tqunicode();
while ( l-- ) {
*uc = c->c;
uc++;
@@ -1336,13 +1342,13 @@ QString KoTextString::toString( const QMemArray<KoTextStringChar> &data )
return s;
}
-QString KoTextString::toReverseString() const
+TQString KoTextString::toReverseString() const
{
- QString s;
+ TQString s;
int l = length();
s.setUnicode(0, l);
KoTextStringChar *c = data.data() + (l-1);
- QChar *uc = (QChar *)s.unicode();
+ TQChar *uc = (TQChar *)s.tqunicode();
while ( l-- ) {
*uc = c->c;
uc++;
@@ -1352,16 +1358,16 @@ QString KoTextString::toReverseString() const
return s;
}
-QString KoTextString::stringToSpellCheck()
+TQString KoTextString::stringToSpellCheck()
{
if ( !bNeedsSpellCheck )
- return QString::null;
+ return TQString();
bNeedsSpellCheck = false;
if ( length() <= 1 )
- return QString::null;
+ return TQString();
- QString str = toString();
+ TQString str = toString();
str.truncate( str.length() - 1 ); // remove trailing space
return str;
}
@@ -1495,11 +1501,11 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
//kdDebug(32500) << "doing BiDi reordering from " << start << " to " << last << "!" << endl;
KoBidiControl *control = new KoBidiControl( line->context(), line->status );
- QString str;
+ TQString str;
str.setUnicode( 0, last - start + 1 );
// fill string with logically ordered chars.
KoTextStringChar *ch = startChar;
- QChar *qch = (QChar *)str.unicode();
+ TQChar *qch = (TQChar *)str.tqunicode();
while ( ch <= lastChar ) {
*qch = ch->c;
qch++;
@@ -1507,25 +1513,25 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
}
int x = startChar->x;
- QPtrList<KoTextRun> *runs;
+ TQPtrList<KoTextRun> *runs;
runs = KoComplexText::bidiReorderLine(control, str, 0, last - start + 1,
- (text->isRightToLeft() ? QChar::DirR : QChar::DirL) );
+ (text->isRightToLeft() ? TQChar::DirR : TQChar::DirL) );
// now construct the reordered string out of the runs...
int numSpaces = 0;
- // set the correct alignment. This is a bit messy....
- if( align == Qt::AlignAuto ) {
+ // set the correct tqalignment. This is a bit messy....
+ if( align == TQt::AlignAuto ) {
// align according to directionality of the paragraph...
if ( text->isRightToLeft() )
- align = Qt::AlignRight;
+ align = TQt::AlignRight;
}
- if ( align & Qt::AlignHCenter )
+ if ( align & TQt::AlignHCenter )
x += space/2;
- else if ( align & Qt::AlignRight )
+ else if ( align & TQt::AlignRight )
x += space;
- else if ( align & Qt::AlignJustify ) {
+ else if ( align & TQt::AlignJustify ) {
for ( int j = start; j < last; ++j ) {
if( isBreakable( text, j ) ) {
numSpaces++;
@@ -1556,7 +1562,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
c->rightToLeft = TRUE;
c->startOfRun = FALSE;
int ww = 0;
- if ( c->c.unicode() >= 32 || c->c == '\t' || c->c == '\n' || c->isCustom() ) {
+ if ( c->c.tqunicode() >= 32 || c->c == '\t' || c->c == '\n' || c->isCustom() ) {
ww = c->width;
} else {
ww = c->format()->width( ' ' );
@@ -1583,7 +1589,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
c->rightToLeft = FALSE;
c->startOfRun = FALSE;
int ww = 0;
- if ( c->c.unicode() >= 32 || c->c == '\t' || c->isCustom() ) {
+ if ( c->c.tqunicode() >= 32 || c->c == '\t' || c->isCustom() ) {
ww = c->width;
} else {
ww = c->format()->width( ' ' );
@@ -1607,7 +1613,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
bool KoTextFormatterBase::isStretchable( KoTextString *string, int pos ) const
{
- if ( string->at( pos ).c == QChar(160) ) //non-breaking space
+ if ( string->at( pos ).c == TQChar(160) ) //non-breaking space
return true;
KoTextStringChar& chr = string->at( pos );
return chr.whiteSpace;
@@ -1628,8 +1634,8 @@ void KoTextParag::insertLineStart( int index, KoTextParagLineStart *ls )
// However this shouldn't happen, KoTextFormatter prevents it, otherwise
// we could loop forever (e.g. if one char is wider than the page...)
#ifndef NDEBUG
- QMap<int, KoTextParagLineStart*>::Iterator it;
- if ( ( it = lineStarts.find( index ) ) == lineStarts.end() ) {
+ TQMap<int, KoTextParagLineStart*>::Iterator it;
+ if ( ( it = lineStarts.tqfind( index ) ) == lineStarts.end() ) {
lineStarts.insert( index, ls );
} else {
kdWarning(32500) << "insertLineStart: there's already a line for char index=" << index << endl;
@@ -1649,8 +1655,8 @@ void KoTextParag::insertLineStart( int index, KoTextParagLineStart *ls )
int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* parag )
{
int oldHeight = parag->rect().height();
- QMap<int, KoTextParagLineStart*>& lineStarts = parag->lineStartList();
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>& lineStarts = parag->lineStartList();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
int h = doc->addMargins() ? parag->topMargin() : 0;
for ( ; it != lineStarts.end() ; ++it ) {
KoTextParagLineStart * ls = it.data();
@@ -1673,7 +1679,7 @@ int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* par
}
int m = parag->bottomMargin();
if ( parag->next() && doc && !doc->addMargins() )
- m = QMAX( m, parag->next()->topMargin() );
+ m = TQMAX( m, parag->next()->topMargin() );
//if ( parag->next() && parag->next()->isLineBreak() )
// m = 0;
h += m;
@@ -1684,7 +1690,7 @@ int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* par
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
KoTextCustomItem::KoTextCustomItem( KoTextDocument *p )
- : width(-1), height(0), parent(p), xpos(0), ypos(-1), parag(0)
+ : width(-1), height(0), tqparent(p), xpos(0), ypos(-1), parag(0)
{
m_deleted = false; // added for kotext
}
@@ -1736,10 +1742,10 @@ void KoTextFlow::unregisterFloatingItem( KoTextCustomItem* item )
void KoTextFlow::registerFloatingItem( KoTextCustomItem* item )
{
if ( item->placement() == KoTextCustomItem::PlaceRight ) {
- if ( !rightItems.contains( item ) )
+ if ( !rightItems.tqcontains( item ) )
rightItems.append( item );
} else if ( item->placement() == KoTextCustomItem::PlaceLeft &&
- !leftItems.contains( item ) ) {
+ !leftItems.tqcontains( item ) ) {
leftItems.append( item );
}
}
@@ -1749,7 +1755,7 @@ int KoTextFlow::availableHeight() const
return -1; // no limit
}
-void KoTextFlow::drawFloatingItems( QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected )
+void KoTextFlow::drawFloatingItems( TQPainter* p, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected )
{
KoTextCustomItem *item;
for ( item = leftItems.first(); item; item = leftItems.next() ) {
diff --git a/lib/kotext/KoRichText.h b/lib/kotext/KoRichText.h
index 94954b93..e161b2fe 100644
--- a/lib/kotext/KoRichText.h
+++ b/lib/kotext/KoRichText.h
@@ -6,27 +6,27 @@
**
** Copyright (C) 1999-2000 Trolltech AS. All rights reserved.
**
-** This file is part of the kernel module of the Qt GUI Toolkit.
+** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as publish by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -37,16 +37,16 @@
#ifndef KORICHTEXT_H
#define KORICHTEXT_H
-#include <qptrlist.h>
-#include <qrect.h>
-#include <qmap.h>
-#include <qstringlist.h>
-#include <qcolor.h>
-#include <qsize.h>
-#include <qvaluelist.h>
-#include <qobject.h>
-#include <qstylesheet.h>
-#include <qpainter.h>
+#include <tqptrlist.h>
+#include <tqrect.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqcolor.h>
+#include <tqsize.h>
+#include <tqvaluelist.h>
+#include <tqobject.h>
+#include <tqstylesheet.h>
+#include <tqpainter.h>
#include "KoComplexText.h"
#include <koffice_export.h>
@@ -66,7 +66,7 @@ struct KoBidiContext;
//// kotext additions (needed by the #included headers)
class KCommand;
-class QDomElement;
+class TQDomElement;
class KoTextZoomHandler;
class KoTextFormatter;
class KoParagVisitor;
@@ -74,7 +74,7 @@ class KoTextDocCommand;
class KoXmlWriter;
class KoSavingContext;
-#include <qmemarray.h>
+#include <tqmemarray.h>
#include "KoParagLayout.h"
////
@@ -89,11 +89,11 @@ public:
KoTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0; }
~KoTextStringChar();
- QChar c;
+ TQChar c;
// this is the same struct as in qtextengine_p.h. Don't change!
uchar softBreak :1; // Potential linebreak point
- uchar whiteSpace :1; // A unicode whitespace character, except NBSP, ZWNBSP
+ uchar whiteSpace :1; // A tqunicode whitespace character, except NBSP, ZWNBSP
uchar charStop :1; // Valid cursor position (for left/right arrow)
uchar wordStop :1; // Valid cursor position (for ctrl + left/right arrow) (TODO: use)
//uchar nobreak :1;
@@ -105,7 +105,7 @@ public:
uint rightToLeft : 1;
// --- added for WYSIWYG ---
- Q_INT8 pixelxadj; // adjustment to apply to lu2pixel(x)
+ TQ_INT8 pixelxadj; // adjustment to apply to lu2pixel(x)
short int pixelwidth; // width in pixels
short int width; // width in LU
@@ -140,10 +140,10 @@ private:
friend class KoTextParag;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QMemArray<KoTextStringChar>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQMemArray<KoTextStringChar>;
+// TQMOC_SKIP_END
#endif
class KOTEXT_EXPORT KoTextString
@@ -154,18 +154,18 @@ public:
KoTextString( const KoTextString &s );
virtual ~KoTextString();
- QString toString() const;
- static QString toString( const QMemArray<KoTextStringChar> &data );
- QString toReverseString() const;
+ TQString toString() const;
+ static TQString toString( const TQMemArray<KoTextStringChar> &data );
+ TQString toReverseString() const;
- QString stringToSpellCheck();
+ TQString stringToSpellCheck();
KoTextStringChar &at( int i ) const;
int length() const;
//int width( int idx ) const; // moved to KoTextFormat
- void insert( int index, const QString &s, KoTextFormat *f );
+ void insert( int index, const TQString &s, KoTextFormat *f );
void insert( int index, KoTextStringChar *c );
void truncate( int index );
void remove( int index, int len );
@@ -176,20 +176,20 @@ public:
void setBidi( bool b ) { bidi = b; }
bool isBidi() const;
bool isRightToLeft() const;
- QChar::Direction direction() const;
- void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; }
+ TQChar::Direction direction() const;
+ void setDirection( TQChar::Direction d ) { dir = d; bidiDirty = TRUE; }
/** Set dirty flag for background spell-checking */
void setNeedsSpellCheck( bool b ) { bNeedsSpellCheck = b; }
bool needsSpellCheck() const { return bNeedsSpellCheck; }
- QMemArray<KoTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const;
- QString mid( int start = 0, int len = 0xFFFFFF ) const; // kotext addition
- QMemArray<KoTextStringChar> rawData() const { return data.copy(); }
+ TQMemArray<KoTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const;
+ TQString mid( int start = 0, int len = 0xFFFFFF ) const; // kotext addition
+ TQMemArray<KoTextStringChar> rawData() const { return data.copy(); }
- void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); }
- void operator+=( const QString &s );
- void prepend( const QString &s ) { insert( 0, s, 0 ); }
+ void operator=( const TQString &s ) { clear(); insert( 0, s, 0 ); }
+ void operator+=( const TQString &s );
+ void prepend( const TQString &s ) { insert( 0, s, 0 ); }
// return next and previous valid cursor positions.
bool validCursorPosition( int idx );
@@ -199,7 +199,7 @@ public:
private:
void checkBidi() const;
- QMemArray<KoTextStringChar> data;
+ TQMemArray<KoTextStringChar> data;
uint bidiDirty : 1;
uint bidi : 1; // true when the paragraph has right to left characters
uint rightToLeft : 1;
@@ -221,9 +221,9 @@ inline bool KoTextString::isRightToLeft() const
return rightToLeft;
}
-inline QChar::Direction KoTextString::direction() const
+inline TQChar::Direction KoTextString::direction() const
{
- return (QChar::Direction) dir;
+ return (TQChar::Direction) dir;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -264,7 +264,7 @@ public:
void gotoWordLeft();
void gotoWordRight();
- void insert( const QString &s, bool checkNewLine, QMemArray<KoTextStringChar> *formatting = 0 );
+ void insert( const TQString &s, bool checkNewLine, TQMemArray<KoTextStringChar> *formatting = 0 );
void splitAndInsertEmptyParag( bool ind = TRUE, bool updateIds = TRUE );
bool remove();
bool removePreviousChar();
@@ -281,7 +281,7 @@ public:
//int offsetX() const { return ox; }
//int offsetY() const { return oy; }
- bool place( const QPoint &pos, KoTextParag *s, bool link = false, int *customItemIndex = 0 );
+ bool place( const TQPoint &pos, KoTextParag *s, bool link = false, int *customItemIndex = 0 );
int x() const;
int y() const;
@@ -314,10 +314,10 @@ protected:
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QPtrList<KoTextDocCommand>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQPtrList<KoTextDocCommand>;
+// TQMOC_SKIP_END
#endif
class KoTextDocCommandHistory
@@ -342,7 +342,7 @@ public:
int currentPosition() const { return current; }
private:
- QPtrList<KoTextDocCommand> history;
+ TQPtrList<KoTextDocCommand> history;
int current, steps;
};
@@ -351,36 +351,36 @@ private:
#include "KoTextCustomItem.h"
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QMap<QString, QString>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQMap<TQString, TQString>;
+// TQMOC_SKIP_END
#endif
#if 0
class KoTextImage : public KoTextCustomItem
{
public:
- KoTextImage( KoTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
- QMimeSourceFactory &factory );
+ KoTextImage( KoTextDocument *p, const TQMap<TQString, TQString> &attr, const TQString& context,
+ TQMimeSourceFactory &factory );
virtual ~KoTextImage();
Placement placement() const { return place; }
- //void setPainter( QPainter*, bool );
+ //void setPainter( TQPainter*, bool );
int widthHint() const { return width; }
int minimumWidth() const { return width; }
- QString richText() const;
+ TQString richText() const;
- void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
+ void draw( TQPainter* p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected );
private:
- QRegion* reg;
- QPixmap pm;
+ TQRegion* reg;
+ TQPixmap pm;
Placement place;
int tmpwidth, tmpheight;
- QMap<QString, QString> attributes;
- QString imgId;
+ TQMap<TQString, TQString> attributes;
+ TQString imgId;
};
#endif
@@ -388,26 +388,26 @@ private:
class KoTextHorizontalLine : public KoTextCustomItem
{
public:
- KoTextHorizontalLine( KoTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
- QMimeSourceFactory &factory );
+ KoTextHorizontalLine( KoTextDocument *p, const TQMap<TQString, TQString> &attr, const TQString& context,
+ TQMimeSourceFactory &factory );
virtual ~KoTextHorizontalLine();
- //void setPainter( QPainter*, bool );
- void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
- QString richText() const;
+ //void setPainter( TQPainter*, bool );
+ void draw(TQPainter* p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected );
+ TQString richText() const;
bool ownLine() const { return TRUE; }
private:
int tmpheight;
- QColor color;
+ TQColor color;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QPtrList<KoTextCustomItem>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQPtrList<KoTextCustomItem>;
+// TQMOC_SKIP_END
#endif
class KOTEXT_EXPORT KoTextFlow
@@ -433,17 +433,17 @@ public:
* @param leftMargin returns the left margin
* @param rightMargin returns the right margin (from the page width)
* @param pageWidth returns the page width at that point
- * This method merges QRichText's adjustLMargin and adjustRMargin for efficiency reasons
+ * This method merges TQRichText's adjustLMargin and adjustRMargin for efficiency reasons
*/
virtual void adjustMargins( int yp, int h, int reqMinWidth, int& leftMargin, int& rightMargin, int& pageWidth, KoTextParag* parag );
virtual void registerFloatingItem( KoTextCustomItem* item );
virtual void unregisterFloatingItem( KoTextCustomItem* item );
- //virtual QRect boundingRect() const;
+ //virtual TQRect boundingRect() const;
/// kotext addition. Allows the textformatter to stop when it goes too far.
virtual int availableHeight() const;
- virtual void drawFloatingItems(QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
+ virtual void drawFloatingItems(TQPainter* p, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected );
virtual int adjustFlow( int y, int w, int h ); // adjusts y according to the defined pagesize. Returns the shift.
@@ -455,40 +455,40 @@ private:
int w;
//int pagesize;
- QPtrList<KoTextCustomItem> leftItems;
- QPtrList<KoTextCustomItem> rightItems;
+ TQPtrList<KoTextCustomItem> leftItems;
+ TQPtrList<KoTextCustomItem> rightItems;
};
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
class KoTextTable;
-class KoTextTableCell : public QLayoutItem
+class KoTextTableCell : public TQLayoutItem
{
friend class KoTextTable;
public:
KoTextTableCell( KoTextTable* table,
int row, int column,
- const QMap<QString, QString> &attr,
- const QStyleSheetItem* style,
- const KoTextFormat& fmt, const QString& context,
- QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc );
+ const TQMap<TQString, TQString> &attr,
+ const TQStyleSheetItem* style,
+ const KoTextFormat& fmt, const TQString& context,
+ TQMimeSourceFactory &factory, TQStyleSheet *sheet, const TQString& doc );
KoTextTableCell( KoTextTable* table, int row, int column );
virtual ~KoTextTableCell();
- QSize sizeHint() const ;
- QSize minimumSize() const ;
- QSize maximumSize() const ;
- QSizePolicy::ExpandData expanding() const;
+ TQSize tqsizeHint() const ;
+ TQSize tqminimumSize() const ;
+ TQSize tqmaximumSize() const ;
+ TQSizePolicy::ExpandData expanding() const;
bool isEmpty() const;
- void setGeometry( const QRect& ) ;
- QRect geometry() const;
+ void setGeometry( const TQRect& ) ;
+ TQRect tqgeometry() const;
bool hasHeightForWidth() const;
int heightForWidth( int ) const;
- void setPainter( QPainter*, bool );
+ void setPainter( TQPainter*, bool );
int row() const { return row_; }
int column() const { return col_; }
@@ -497,20 +497,20 @@ public:
int stretch() const { return stretch_; }
KoTextDocument* richText() const { return richtext; }
- KoTextTable* table() const { return parent; }
+ KoTextTable* table() const { return tqparent; }
- void draw( int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
+ void draw( int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected );
- QBrush *backGround() const { return background; }
- virtual void invalidate();
+ TQBrush *backGround() const { return background; }
+ virtual void tqinvalidate();
int verticalAlignmentOffset() const;
int horizontalAlignmentOffset() const;
private:
- QPainter* painter() const;
- QRect geom;
- KoTextTable* parent;
+ TQPainter* painter() const;
+ TQRect geom;
+ KoTextTable* tqparent;
KoTextDocument* richtext;
int row_;
int col_;
@@ -520,18 +520,18 @@ private:
int maxw;
int minw;
bool hasFixedWidth;
- QBrush *background;
+ TQBrush *background;
int cached_width;
int cached_sizehint;
- QMap<QString, QString> attributes;
+ TQMap<TQString, TQString> attributes;
int align;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QPtrList<KoTextTableCell>;
-template class QMap<KoTextCursor*, int>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQPtrList<KoTextTableCell>;
+template class TQMap<KoTextCursor*, int>;
+// TQMOC_SKIP_END
#endif
class KoTextTable: public KoTextCustomItem
@@ -539,37 +539,37 @@ class KoTextTable: public KoTextCustomItem
friend class KoTextTableCell;
public:
- KoTextTable( KoTextDocument *p, const QMap<QString, QString> &attr );
+ KoTextTable( KoTextDocument *p, const TQMap<TQString, TQString> &attr );
virtual ~KoTextTable();
- void setPainter( QPainter *p, bool adjust );
+ void setPainter( TQPainter *p, bool adjust );
void pageBreak( int y, KoTextFlow* flow );
- void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch,
- const QColorGroup& cg, bool selected );
+ void draw( TQPainter* p, int x, int y, int cx, int cy, int cw, int ch,
+ const TQColorGroup& cg, bool selected );
bool noErase() const { return TRUE; }
bool ownLine() const { return TRUE; }
Placement placement() const { return place; }
bool isNested() const { return TRUE; }
void resize( int nwidth );
- virtual void invalidate();
- /// ## QString anchorAt( QPainter* p, int x, int y );
+ virtual void tqinvalidate();
+ /// ## TQString anchorAt( TQPainter* p, int x, int y );
virtual bool enter( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
- virtual bool enterAt( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const QPoint &pos );
+ virtual bool enterAt( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const TQPoint &pos );
virtual bool next( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
virtual bool prev( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
virtual bool down( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
virtual bool up( KoTextCursor *c, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
- QString richText() const;
+ TQString richText() const;
- int minimumWidth() const { return layout ? layout->minimumSize().width() : 0; }
- int widthHint() const { return ( layout ? layout->sizeHint().width() : 0 ) + 2 * outerborder; }
+ int minimumWidth() const { return tqlayout ? tqlayout->tqminimumSize().width() : 0; }
+ int widthHint() const { return ( tqlayout ? tqlayout->tqsizeHint().width() : 0 ) + 2 * outerborder; }
- QPtrList<KoTextTableCell> tableCells() const { return cells; }
+ TQPtrList<KoTextTableCell> tableCells() const { return cells; }
- QRect geometry() const { return layout ? layout->geometry() : QRect(); }
+ TQRect tqgeometry() const { return tqlayout ? tqlayout->tqgeometry() : TQRect(); }
bool isStretching() const { return stretch; }
private:
@@ -577,9 +577,9 @@ private:
void addCell( KoTextTableCell* cell );
private:
- QGridLayout* layout;
- QPtrList<KoTextTableCell> cells;
- QPainter* painter;
+ TQGridLayout* tqlayout;
+ TQPtrList<KoTextTableCell> cells;
+ TQPainter* painter;
int cachewidth;
int fixwidth;
int cellpadding;
@@ -589,13 +589,13 @@ private:
int stretch;
int innerborder;
int us_cp, us_ib, us_b, us_ob, us_cs;
- QMap<QString, QString> attributes;
- QMap<KoTextCursor*, int> currCell;
+ TQMap<TQString, TQString> attributes;
+ TQMap<KoTextCursor*, int> currCell;
Placement place;
void adjustCells( int y , int shift );
int pageBreakFor;
};
-#endif // QTEXTTABLE_AVAILABLE
+#endif // TQTEXTTABLE_AVAILABLE
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -613,8 +613,8 @@ struct KoTextDocumentSelection
class KOTEXT_EXPORT KoTextDocDeleteCommand : public KoTextDocCommand
{
public:
- KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str );
- //KoTextDocDeleteCommand( KoTextParag *p, int idx, const QMemArray<KoTextStringChar> &str );
+ KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str );
+ //KoTextDocDeleteCommand( KoTextParag *p, int idx, const TQMemArray<KoTextStringChar> &str );
virtual ~KoTextDocDeleteCommand();
Commands type() const { return Delete; }
@@ -624,7 +624,7 @@ public:
protected:
int id, index;
KoTextParag *parag;
- QMemArray<KoTextStringChar> text;
+ TQMemArray<KoTextStringChar> text;
};
@@ -632,9 +632,9 @@ protected:
class KoTextDocInsertCommand : public KoTextDocDeleteCommand
{
public:
- KoTextDocInsertCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str )
+ KoTextDocInsertCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocDeleteCommand( d, i, idx, str ) {}
- KoTextDocInsertCommand( KoTextParag *p, int idx, const QMemArray<KoTextStringChar> &str )
+ KoTextDocInsertCommand( KoTextParag *p, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocDeleteCommand( p, idx, str ) {}
virtual ~KoTextDocInsertCommand() {}
@@ -648,7 +648,7 @@ public:
class KoTextDocFormatCommand : public KoTextDocCommand
{
public:
- KoTextDocFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl );
+ KoTextDocFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx, const TQMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl );
virtual ~KoTextDocFormatCommand();
Commands type() const { return Format; }
@@ -658,7 +658,7 @@ public:
protected:
int startId, startIndex, endId, endIndex;
KoTextFormat *format;
- QMemArray<KoTextStringChar> oldFormats;
+ TQMemArray<KoTextStringChar> oldFormats;
int flags;
};
@@ -666,7 +666,7 @@ protected:
class KoTextAlignmentCommand : public KoTextDocCommand
{
public:
- KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const QMemArray<int> &oa );
+ KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const TQMemArray<int> &oa );
virtual ~KoTextAlignmentCommand() {}
Commands type() const { return Alignment; }
@@ -676,7 +676,7 @@ public:
private:
int firstParag, lastParag;
int newAlign;
- QMemArray<int> oldAligns;
+ TQMemArray<int> oldAligns;
};
@@ -685,32 +685,32 @@ private:
struct KoTextParagLineStart
{
KoTextParagLineStart() : y( 0 ), baseLine( 0 ), h( 0 ), lineSpacing( 0 ), hyphenated( false )
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
, bidicontext( 0 )
#endif
{ }
KoTextParagLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ),
lineSpacing( 0 ), hyphenated( false ),
w( 0 )
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
, bidicontext( 0 )
#endif
{ }
-#ifndef QT_NO_COMPLEXTEXT
- KoTextParagLineStart( KoBidiContext *c, KoBidiStatus s ) : y(0), baseLine(0), h(0),
+#ifndef TQT_NO_COMPLEXTEXT
+ KoTextParagLineStart( KoBidiContext *c, KoBiditqStatus s ) : y(0), baseLine(0), h(0),
lineSpacing( 0 ), hyphenated( false ),
status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); }
#endif
virtual ~KoTextParagLineStart()
{
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
if ( bidicontext && bidicontext->deref() )
delete bidicontext;
#endif
}
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
void setContext( KoBidiContext *c ) {
if ( c == bidicontext )
return;
@@ -727,13 +727,13 @@ public:
ushort y, baseLine, h;
short lineSpacing;
bool hyphenated;
-#ifndef QT_NO_COMPLEXTEXT
- KoBidiStatus status;
+#ifndef TQT_NO_COMPLEXTEXT
+ KoBiditqStatus status;
#endif
int w;
private:
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
KoBidiContext *bidicontext;
#endif
};
@@ -745,7 +745,7 @@ class KOTEXT_EXPORT KoTextFormatterBase
public:
KoTextFormatterBase();
virtual ~KoTextFormatterBase() {}
- virtual bool format( KoTextDocument *doc, KoTextParag *parag, int start, const QMap<int, KoTextParagLineStart*> &oldLineStarts, int& y, int& widthUsed ) = 0;
+ virtual bool format( KoTextDocument *doc, KoTextParag *parag, int start, const TQMap<int, KoTextParagLineStart*> &oldLineStarts, int& y, int& widthUsed ) = 0;
virtual int formatVertically( KoTextDocument* doc, KoTextParag* parag );
// Called after formatting a paragraph
@@ -769,7 +769,7 @@ protected:
// KoTextStringChar *last, int align = AlignAuto, int space = 0 );
//KoTextStringChar
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
virtual KoTextParagLineStart *bidiReorderLine( KoTextParag *parag, KoTextString *string, KoTextParagLineStart *line, KoTextStringChar *start,
KoTextStringChar *last, int align, int space );
#endif
@@ -782,7 +782,7 @@ private:
bool unused; // for future extensions
#ifdef HAVE_THAI_BREAKS
- static QCString *thaiCache;
+ static TQCString *thaiCache;
static KoTextString *cachedString;
static ThBreakIterator *thaiIt;
#endif
@@ -796,7 +796,7 @@ inline int KoTextString::length() const
return data.size();
}
-inline void KoTextString::operator+=( const QString &s )
+inline void KoTextString::operator+=( const TQString &s )
{
insert( length(), s, 0 );
}
@@ -831,7 +831,7 @@ inline KoTextStringChar &KoTextString::at( int i ) const
return data[ i ];
}
-inline QString KoTextString::toString() const
+inline TQString KoTextString::toString() const
{
return toString( data );
}
diff --git a/lib/kotext/KoSearchDia.cpp b/lib/kotext/KoSearchDia.cpp
index 701f4ad2..915ef4f7 100644
--- a/lib/kotext/KoSearchDia.cpp
+++ b/lib/kotext/KoSearchDia.cpp
@@ -33,19 +33,19 @@
#include <klocale.h>
#include <kseparator.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qradiobutton.h>
-#include <qregexp.h>
-#include <qspinbox.h>
-#include <qlayout.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqradiobutton.h>
+#include <tqregexp.h>
+#include <tqspinbox.h>
+#include <tqlayout.h>
KoSearchContext::KoSearchContext()
{
m_family = "times";
- m_color = Qt::black;
- m_backGroundColor = Qt::black;
+ m_color = TQt::black;
+ m_backGroundColor = TQt::black;
m_size = 12;
m_vertAlign = KoTextFormat::AlignNormal;
@@ -54,7 +54,7 @@ KoSearchContext::KoSearchContext()
m_underline = KoTextFormat::U_NONE;
m_strikeOut = KoTextFormat::S_NONE;
m_attribute = KoTextFormat::ATT_NONE;
- m_language = QString::null;
+ m_language = TQString();
}
KoSearchContext::~KoSearchContext()
@@ -62,14 +62,14 @@ KoSearchContext::~KoSearchContext()
}
-KoSearchContextUI::KoSearchContextUI( KoSearchContext *ctx, QWidget *parent )
- : QObject(parent), m_ctx(ctx), m_parent(parent)
+KoSearchContextUI::KoSearchContextUI( KoSearchContext *ctx, TQWidget *tqparent )
+ : TQObject(tqparent), m_ctx(ctx), m_parent(tqparent)
{
m_bOptionsShown = false;
- m_btnShowOptions = new QPushButton( i18n("Show Formatting Options"), parent );
- connect( m_btnShowOptions, SIGNAL( clicked() ), SLOT( slotShowOptions() ) );
+ m_btnShowOptions = new TQPushButton( i18n("Show Formatting Options"), tqparent );
+ connect( m_btnShowOptions, TQT_SIGNAL( clicked() ), TQT_SLOT( slotShowOptions() ) );
- m_grid = new QGridLayout( m_parent, 1, 1, 0, 6 );
+ m_grid = new TQGridLayout( m_parent, 1, 1, 0, 6 );
m_grid->addWidget( m_btnShowOptions, 0, 0 );
m_btnShowOptions->setEnabled( true );
}
@@ -95,16 +95,16 @@ void KoSearchContextUI::setCtxOptions( long options )
m_ctx->m_options = options;
}
-void KoSearchContextUI::setCtxHistory( const QStringList & history )
+void KoSearchContextUI::setCtxHistory( const TQStringList & history )
{
m_ctx->m_strings = history;
}
-KoSearchDia::KoSearchDia( QWidget * parent,const char *name, KoSearchContext *find, bool hasSelection, bool hasCursor )
- : KFindDialog( parent, name, find->m_options, find->m_strings )
+KoSearchDia::KoSearchDia( TQWidget * tqparent,const char *name, KoSearchContext *tqfind, bool hasSelection, bool hasCursor )
+ : KFindDialog( tqparent, name, tqfind->m_options, tqfind->m_strings )
{
// The dialog extension.
- m_findUI = new KoSearchContextUI( find, findExtension() );
+ m_findUI = new KoSearchContextUI( tqfind, findExtension() );
setHasSelection(hasSelection);
setHasCursor(hasCursor);
}
@@ -119,12 +119,12 @@ void KoSearchDia::slotOk()
m_findUI->setCtxHistory( findHistory() );
}
-KoReplaceDia::KoReplaceDia( QWidget *parent, const char *name, KoSearchContext *find, KoSearchContext *replace, bool hasSelection, bool hasCursor )
- : KReplaceDialog( parent, name, find->m_options, find->m_strings, replace->m_strings )
+KoReplaceDia::KoReplaceDia( TQWidget *tqparent, const char *name, KoSearchContext *tqfind, KoSearchContext *tqreplace, bool hasSelection, bool hasCursor )
+ : KReplaceDialog( tqparent, name, tqfind->m_options, tqfind->m_strings, tqreplace->m_strings )
{
// The dialog extension.
- m_findUI = new KoSearchContextUI( find, findExtension() );
- m_replaceUI = new KoSearchContextUI( replace, replaceExtension() );
+ m_findUI = new KoSearchContextUI( tqfind, findExtension() );
+ m_replaceUI = new KoSearchContextUI( tqreplace, replaceExtension() );
// Look whether we have a selection, and/or a cursor
setHasSelection(hasSelection);
setHasCursor(hasCursor);
@@ -146,9 +146,9 @@ void KoReplaceDia::slotOk()
-KoFindReplace::KoFindReplace( QWidget * parent, KoSearchDia * dialog, const QValueList<KoTextObject *> & lstObject, KoTextView* textView )
- : m_find( new KoTextFind( dialog->pattern(), dialog->options(), this, parent ) ),
- m_replace( 0L ),
+KoFindReplace::KoFindReplace( TQWidget * tqparent, KoSearchDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView )
+ : m_tqfind( new KoTextFind( dialog->pattern(), dialog->options(), this, tqparent ) ),
+ m_tqreplace( 0L ),
m_searchContext( *dialog->searchContext() ),
m_replaceContext(),
m_searchContextEnabled( dialog->optionSelected() ),
@@ -158,12 +158,12 @@ KoFindReplace::KoFindReplace( QWidget * parent, KoSearchDia * dialog, const QVal
m_textIterator( lstObject, textView, dialog->options() ),
m_lastTextObjectHighlighted( 0 )
{
- connectFind( m_find );
+ connectFind( m_tqfind );
}
-KoFindReplace::KoFindReplace( QWidget * parent, KoReplaceDia * dialog, const QValueList<KoTextObject *> & lstObject, KoTextView* textView )
- : m_find( 0L ),
- m_replace( new KoTextReplace( dialog->pattern(), dialog->replacement(), dialog->options(), this, parent ) ),
+KoFindReplace::KoFindReplace( TQWidget * tqparent, KoReplaceDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView )
+ : m_tqfind( 0L ),
+ m_tqreplace( new KoTextReplace( dialog->pattern(), dialog->replacement(), dialog->options(), this, tqparent ) ),
m_searchContext( *dialog->searchContext() ),
m_replaceContext( *dialog->replaceContext() ),
m_searchContextEnabled( dialog->optionFindSelected() ),
@@ -173,39 +173,39 @@ KoFindReplace::KoFindReplace( QWidget * parent, KoReplaceDia * dialog, const QVa
m_textIterator( lstObject, textView, dialog->options() ),
m_lastTextObjectHighlighted( 0 )
{
- connectFind( m_replace );
- connect( m_replace, SIGNAL( replace( const QString &, int , int, int ) ),
- this, SLOT( replace( const QString &, int , int,int ) ) );
+ connectFind( m_tqreplace );
+ connect( m_tqreplace, TQT_SIGNAL( tqreplace( const TQString &, int , int, int ) ),
+ this, TQT_SLOT( tqreplace( const TQString &, int , int,int ) ) );
}
-void KoFindReplace::connectFind( KFind* find )
+void KoFindReplace::connectFind( KFind* tqfind )
{
- connect( find, SIGNAL( optionsChanged() ),
- this, SLOT( optionsChanged() ) );
- connect( find, SIGNAL( dialogClosed() ),
- this, SLOT( dialogClosed() ) );
+ connect( tqfind, TQT_SIGNAL( optionsChanged() ),
+ this, TQT_SLOT( optionsChanged() ) );
+ connect( tqfind, TQT_SIGNAL( dialogClosed() ),
+ this, TQT_SLOT( dialogClosed() ) );
// Connect highlight signal to code which handles highlighting
// of found text.
- connect( find, SIGNAL( highlight( const QString &, int, int ) ),
- this, SLOT( highlight( const QString &, int, int ) ) );
+ connect( tqfind, TQT_SIGNAL( highlight( const TQString &, int, int ) ),
+ this, TQT_SLOT( highlight( const TQString &, int, int ) ) );
// Connect findNext signal - called when pressing the button in the dialog
- connect( find, SIGNAL( findNext() ),
- this, SLOT( slotFindNext() ) );
+ connect( tqfind, TQT_SIGNAL( findNext() ),
+ this, TQT_SLOT( slotFindNext() ) );
m_bInit = true;
m_currentParagraphModified = false;
m_matchingIndex = -1;
// Also connect to the textiterator
- connect( &m_textIterator, SIGNAL( currentParagraphModified( int, int, int ) ),
- this, SLOT( slotCurrentParagraphModified( int, int, int ) ) );
+ connect( &m_textIterator, TQT_SIGNAL( currentParagraphModified( int, int, int ) ),
+ this, TQT_SLOT( slotCurrentParagraphModified( int, int, int ) ) );
}
KoFindReplace::~KoFindReplace()
{
removeHighlight();
//kdDebug(32500) << "KoFindReplace::~KoFindReplace" << endl;
- delete m_find;
- delete m_replace;
+ delete m_tqfind;
+ delete m_tqreplace;
}
void KoFindReplace::optionsChanged()
@@ -261,7 +261,7 @@ bool KoFindReplace::findNext()
break;
}
m_bInit = false;
- QPair<int, QString> c = m_textIterator.currentTextAndIndex();
+ TQPair<int, TQString> c = m_textIterator.currentTextAndIndex();
m_offset = c.first;
if ( !m_currentParagraphModified )
setData( c.second );
@@ -270,11 +270,11 @@ bool KoFindReplace::findNext()
m_currentParagraphModified = false;
}
- if ( m_find )
+ if ( m_tqfind )
// Let KFind inspect the text fragment, and display a dialog if a match is found
- res = m_find->find();
+ res = m_tqfind->find();
else
- res = m_replace->replace();
+ res = m_tqreplace->replace();
}
//kdDebug(32500) << k_funcinfo << "we're done. res=" << res << endl;
@@ -286,17 +286,17 @@ bool KoFindReplace::findNext()
m_textIterator.setOptions( m_textIterator.options() & ~KFindDialog::FromCursor );
m_textIterator.restart();
m_bInit = true;
- if ( m_find )
- m_find->resetCounts();
+ if ( m_tqfind )
+ m_tqfind->resetCounts();
else
- m_replace->resetCounts();
+ m_tqreplace->resetCounts();
return findNext();
}
else { // done, close the 'find next' dialog
- if ( m_find )
- m_find->closeFindNextDialog();
+ if ( m_tqfind )
+ m_tqfind->closeFindNextDialog();
else
- m_replace->closeReplaceNextDialog();
+ m_tqreplace->closeReplaceNextDialog();
}
return false;
}
@@ -327,15 +327,15 @@ bool KoFindReplace::findPrevious()
long KoFindReplace::options() const
{
- return m_find ? m_find->options() : m_replace->options();
+ return m_tqfind ? m_tqfind->options() : m_tqreplace->options();
}
void KoFindReplace::setOptions(long opt)
{
- if ( m_find )
- m_find->setOptions(opt);
+ if ( m_tqfind )
+ m_tqfind->setOptions(opt);
else
- m_replace->setOptions(opt);
+ m_tqreplace->setOptions(opt);
m_textIterator.setOptions( opt );
}
@@ -347,26 +347,26 @@ void KoFindReplace::slotCurrentParagraphModified( int, int pos, int )
}
// slot connected to the 'highlight' signal
-void KoFindReplace::highlight( const QString &, int matchingIndex, int matchingLength )
+void KoFindReplace::highlight( const TQString &, int matchingIndex, int matchingLength )
{
m_matchingIndex = matchingIndex;
if ( m_lastTextObjectHighlighted )
m_lastTextObjectHighlighted->removeHighlight(true);
m_lastTextObjectHighlighted = m_textIterator.currentTextObject();
//kdDebug(32500) << "KoFindReplace::highlight " << matchingIndex << "," << matchingLength << endl;
- KDialogBase* dialog = m_find ? m_find->findNextDialog() : m_replace->replaceNextDialog();
+ KDialogBase* dialog = m_tqfind ? m_tqfind->findNextDialog() : m_tqreplace->replaceNextDialog();
highlightPortion(m_textIterator.currentParag(), m_offset + matchingIndex, matchingLength, m_lastTextObjectHighlighted->textDocument(), dialog );
}
-// slot connected to the 'replace' signal
-void KoFindReplace::replace( const QString &text, int matchingIndex,
+// slot connected to the 'tqreplace' signal
+void KoFindReplace::tqreplace( const TQString &text, int matchingIndex,
int replacementLength, int matchedLength )
{
//kdDebug(32500) << "KoFindReplace::replace m_offset=" << m_offset << " matchingIndex=" << matchingIndex << " matchedLength=" << matchedLength << " options=" << options() << endl;
m_matchingIndex = matchingIndex;
int index = m_offset + matchingIndex;
- // highlight might not have happened (if 'prompt on replace' is off)
+ // highlight might not have happened (if 'prompt on tqreplace' is off)
if ( (options() & KReplaceDialog::PromptOnReplace) == 0 )
highlight( text, matchingIndex, matchedLength );
@@ -382,23 +382,23 @@ void KoFindReplace::replace( const QString &text, int matchingIndex,
{
replaceWithAttribut( &cursor, index );
}
- // Don't repaint if we're doing batch changes
- bool repaint = options() & KReplaceDialog::PromptOnReplace;
+ // Don't tqrepaint if we're doing batch changes
+ bool tqrepaint = options() & KReplaceDialog::PromptOnReplace;
// Grab replacement string
- QString rep = text.mid( matchingIndex, replacementLength );
+ TQString rep = text.mid( matchingIndex, replacementLength );
// Don't let the replacement set the paragraph to "modified by user"
- disconnect( &m_textIterator, SIGNAL( currentParagraphModified( int, int, int ) ),
- this, SLOT( slotCurrentParagraphModified( int, int, int ) ) );
+ disconnect( &m_textIterator, TQT_SIGNAL( currentParagraphModified( int, int, int ) ),
+ this, TQT_SLOT( slotCurrentParagraphModified( int, int, int ) ) );
KCommand *cmd = currentTextObj->replaceSelectionCommand(
- &cursor, rep, QString::null,
+ &cursor, rep, TQString(),
KoTextDocument::HighlightSelection,
- repaint ? KoTextObject::DefaultInsertFlags : KoTextObject::DoNotRepaint );
+ tqrepaint ? KoTextObject::DefaultInsertFlags : KoTextObject::DoNotRepaint );
- connect( &m_textIterator, SIGNAL( currentParagraphModified( int, int, int ) ),
- this, SLOT( slotCurrentParagraphModified( int, int, int ) ) );
+ connect( &m_textIterator, TQT_SIGNAL( currentParagraphModified( int, int, int ) ),
+ this, TQT_SLOT( slotCurrentParagraphModified( int, int, int ) ) );
if( cmd )
macroCommand()->addCommand(cmd);
@@ -461,9 +461,9 @@ void KoFindReplace::replaceWithAttribut( KoTextCursor * cursor, int index )
flags |= KoTextFormat::ShadowText;
// If shadow has been selected, we set a shadow (any shadow) in the new format
if ( m_replaceContext.m_options & KoSearchContext::Shadow )
- newFormat->setShadow( 1, 1, Qt::gray );
+ newFormat->setShadow( 1, 1, TQt::gray );
else
- newFormat->setShadow( 0, 0, QColor() );
+ newFormat->setShadow( 0, 0, TQColor() );
}
if (m_replaceContext.m_optionsMask & KoSearchContext::WordByWord)
{
@@ -493,25 +493,25 @@ KMacroCommand* KoFindReplace::macroCommand()
void KoFindReplace::setActiveWindow()
{
- KDialogBase* dialog = m_find ? m_find->findNextDialog() : m_replace->replaceNextDialog();
+ KDialogBase* dialog = m_tqfind ? m_tqfind->findNextDialog() : m_tqreplace->replaceNextDialog();
if ( dialog )
dialog->setActiveWindow();
}
/*int KoFindReplace::numMatches() const
{
- return m_find->numMatches();
+ return m_tqfind->numMatches();
}
int KoFindReplace::numReplacements() const
{
- return m_replace->numReplacements();
+ return m_tqreplace->numReplacements();
}*/
////
-KoTextFind::KoTextFind( const QString &pattern, long options, KoFindReplace *_findReplace, QWidget *parent )
- : KFind( pattern, options, parent),
+KoTextFind::KoTextFind( const TQString &pattern, long options, KoFindReplace *_findReplace, TQWidget *tqparent )
+ : KFind( pattern, options, tqparent),
m_findReplace( _findReplace)
{
}
@@ -520,13 +520,13 @@ KoTextFind::~KoTextFind()
{
}
-bool KoTextFind::validateMatch( const QString &text, int index, int matchedlength )
+bool KoTextFind::validateMatch( const TQString &text, int index, int matchedlength )
{
return m_findReplace->validateMatch( text, index, matchedlength );
}
-KoTextReplace::KoTextReplace(const QString &pattern, const QString &replacement, long options, KoFindReplace *_findReplace, QWidget *parent )
- : KReplace( pattern, replacement, options, parent),
+KoTextReplace::KoTextReplace(const TQString &pattern, const TQString &replacement, long options, KoFindReplace *_findReplace, TQWidget *tqparent )
+ : KReplace( pattern, replacement, options, tqparent),
m_findReplace( _findReplace)
{
}
@@ -535,64 +535,64 @@ KoTextReplace::~KoTextReplace()
{
}
-bool KoTextReplace::validateMatch( const QString &text, int index, int matchedlength )
+bool KoTextReplace::validateMatch( const TQString &text, int index, int matchedlength )
{
return m_findReplace->validateMatch( text, index, matchedlength );
}
-KoFormatDia::KoFormatDia( QWidget* parent, const QString & _caption, KoSearchContext *_ctx , const char* name)
- : KDialogBase( parent, name, true, _caption, Ok|Cancel|User1 |User2 ),
+KoFormatDia::KoFormatDia( TQWidget* tqparent, const TQString & _caption, KoSearchContext *_ctx , const char* name)
+ : KDialogBase( tqparent, name, true, _caption, Ok|Cancel|User1 |User2 ),
m_ctx(_ctx)
{
- QWidget *page = new QWidget( this );
+ TQWidget *page = new TQWidget( this );
setMainWidget(page);
setButtonText( KDialogBase::User1, i18n("Reset") );
setButtonText( KDialogBase::User2, i18n("Clear") );
- connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotReset()));
- connect( this, SIGNAL( user2Clicked() ), this, SLOT(slotClear()));
-
- QGridLayout *m_grid = new QGridLayout( page, 15, 2, 0, 6 );
- m_checkFamily = new QCheckBox( i18n( "Family:" ),page );
- m_checkSize = new QCheckBox( i18n( "Size:" ), page );
- m_checkColor = new QCheckBox( i18n( "Color:" ), page );
- m_checkBgColor = new QCheckBox( i18n( "Background color:" ), page );
- m_checkBold = new QCheckBox( i18n( "Bold:" ), page );
- m_checkItalic = new QCheckBox( i18n( "Italic:" ),page );
- m_checkShadow = new QCheckBox( i18n( "Shadow:" ), page );
- m_checkWordByWord = new QCheckBox( i18n( "Word by word:" ), page );
-
- m_checkUnderline = new QCheckBox( i18n( "Underline:" ), page);
- m_underlineItem = new QComboBox( page );
+ connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotReset()));
+ connect( this, TQT_SIGNAL( user2Clicked() ), this, TQT_SLOT(slotClear()));
+
+ TQGridLayout *m_grid = new TQGridLayout( page, 15, 2, 0, 6 );
+ m_checkFamily = new TQCheckBox( i18n( "Family:" ),page );
+ m_checkSize = new TQCheckBox( i18n( "Size:" ), page );
+ m_checkColor = new TQCheckBox( i18n( "Color:" ), page );
+ m_checkBgColor = new TQCheckBox( i18n( "Background color:" ), page );
+ m_checkBold = new TQCheckBox( i18n( "Bold:" ), page );
+ m_checkItalic = new TQCheckBox( i18n( "Italic:" ),page );
+ m_checkShadow = new TQCheckBox( i18n( "Shadow:" ), page );
+ m_checkWordByWord = new TQCheckBox( i18n( "Word by word:" ), page );
+
+ m_checkUnderline = new TQCheckBox( i18n( "Underline:" ), page);
+ m_underlineItem = new TQComboBox( page );
// This has to be the type list, not the style list (we need the "no underline" case).
// Of course we could even have both...
m_underlineItem->insertStringList( KoTextFormat::underlineTypeList() );
m_underlineItem->setCurrentItem( (int)m_ctx->m_underline );
- m_checkStrikeOut= new QCheckBox( i18n( "Strikeout:" ), page);
+ m_checkStrikeOut= new TQCheckBox( i18n( "Strikeout:" ), page);
- m_strikeOutItem = new QComboBox( page );
+ m_strikeOutItem = new TQComboBox( page );
m_strikeOutItem->insertStringList( KoTextFormat::strikeOutTypeList() );
m_strikeOutItem->setCurrentItem( (int)m_ctx->m_strikeOut );
- m_checkFontAttribute = new QCheckBox( i18n( "Capitalization:" ), page);
- m_fontAttributeItem = new QComboBox( page );
+ m_checkFontAttribute = new TQCheckBox( i18n( "Capitalization:" ), page);
+ m_fontAttributeItem = new TQComboBox( page );
m_fontAttributeItem->insertStringList( KoTextFormat::fontAttributeList() );
m_fontAttributeItem->setCurrentItem( (int)m_ctx->m_attribute );
- m_checkLanguage = new QCheckBox( i18n( "Language:" ), page);
- m_languageItem = new QComboBox( page );
+ m_checkLanguage = new TQCheckBox( i18n( "Language:" ), page);
+ m_languageItem = new TQComboBox( page );
m_languageItem->insertStringList( KoGlobal::listOfLanguages() );
m_languageItem->setCurrentText( KoGlobal::languageFromTag( m_ctx->m_language ) );
- m_checkVertAlign = new QCheckBox( i18n( "Vertical alignment:" ), page );
+ m_checkVertAlign = new TQCheckBox( i18n( "Vertical tqalignment:" ), page );
m_familyItem = new KFontCombo(page);
m_familyItem->setCurrentFont(m_ctx->m_family);
- m_sizeItem = new QSpinBox( 4, 100, 1, page );
+ m_sizeItem = new TQSpinBox( 4, 100, 1, page );
m_sizeItem->setValue( m_ctx->m_size );
m_colorItem = new KColorButton( page );
@@ -603,32 +603,32 @@ KoFormatDia::KoFormatDia( QWidget* parent, const QString & _caption, KoSearchCon
- QButtonGroup *grpBold = new QButtonGroup( 1, QGroupBox::Vertical, page );
+ TQButtonGroup *grpBold = new TQButtonGroup( 1, Qt::Vertical, page );
grpBold->setRadioButtonExclusive( TRUE );
- grpBold->layout();
- m_boldYes=new QRadioButton( i18n("Yes"), grpBold );
- m_boldNo=new QRadioButton( i18n("No"), grpBold );
+ grpBold->tqlayout();
+ m_boldYes=new TQRadioButton( i18n("Yes"), grpBold );
+ m_boldNo=new TQRadioButton( i18n("No"), grpBold );
- QButtonGroup *grpItalic = new QButtonGroup( 1, QGroupBox::Vertical, page );
+ TQButtonGroup *grpItalic = new TQButtonGroup( 1, Qt::Vertical, page );
grpItalic->setRadioButtonExclusive( TRUE );
- grpItalic->layout();
- m_italicYes=new QRadioButton( i18n("Yes"), grpItalic );
- m_italicNo=new QRadioButton( i18n("No"), grpItalic );
+ grpItalic->tqlayout();
+ m_italicYes=new TQRadioButton( i18n("Yes"), grpItalic );
+ m_italicNo=new TQRadioButton( i18n("No"), grpItalic );
- QButtonGroup *grpShadow = new QButtonGroup( 1, QGroupBox::Vertical, page );
+ TQButtonGroup *grpShadow = new TQButtonGroup( 1, Qt::Vertical, page );
grpShadow->setRadioButtonExclusive( TRUE );
- grpShadow->layout();
- m_shadowYes=new QRadioButton( i18n("Yes"), grpShadow );
- m_shadowNo=new QRadioButton( i18n("No"), grpShadow );
+ grpShadow->tqlayout();
+ m_shadowYes=new TQRadioButton( i18n("Yes"), grpShadow );
+ m_shadowNo=new TQRadioButton( i18n("No"), grpShadow );
- QButtonGroup *grpWordByWord = new QButtonGroup( 1, QGroupBox::Vertical, page );
+ TQButtonGroup *grpWordByWord = new TQButtonGroup( 1, Qt::Vertical, page );
grpWordByWord->setRadioButtonExclusive( TRUE );
- grpWordByWord->layout();
- m_wordByWordYes=new QRadioButton( i18n("Yes"), grpWordByWord );
- m_wordByWordNo=new QRadioButton( i18n("No"), grpWordByWord );
+ grpWordByWord->tqlayout();
+ m_wordByWordYes=new TQRadioButton( i18n("Yes"), grpWordByWord );
+ m_wordByWordNo=new TQRadioButton( i18n("No"), grpWordByWord );
- m_vertAlignItem = new QComboBox( false, page );
+ m_vertAlignItem = new TQComboBox( false, page );
m_vertAlignItem->insertItem( i18n( "Normal" ), -1 );
m_vertAlignItem->insertItem( i18n( "Subscript" ), -1 );
m_vertAlignItem->insertItem( i18n( "Superscript" ), -1 );
@@ -670,29 +670,29 @@ KoFormatDia::KoFormatDia( QWidget* parent, const QString & _caption, KoSearchCon
m_grid->addMultiCellWidget( tmpSep, 14, 14, 0, 1 );
// signals and slots connections
- QObject::connect( m_checkFamily, SIGNAL( toggled( bool ) ), m_familyItem, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkSize, SIGNAL( toggled( bool ) ), m_sizeItem, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkColor, SIGNAL( toggled( bool ) ), m_colorItem, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkBgColor, SIGNAL( toggled( bool ) ), m_bgColorItem, SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkFamily, TQT_SIGNAL( toggled( bool ) ), m_familyItem, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkSize, TQT_SIGNAL( toggled( bool ) ), m_sizeItem, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkColor, TQT_SIGNAL( toggled( bool ) ), m_colorItem, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkBgColor, TQT_SIGNAL( toggled( bool ) ), m_bgColorItem, TQT_SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkBold, SIGNAL( toggled( bool ) ), m_boldYes, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkItalic, SIGNAL( toggled( bool ) ), m_italicYes, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkStrikeOut, SIGNAL( toggled( bool ) ), m_strikeOutItem, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkShadow, SIGNAL( toggled( bool ) ), m_shadowYes, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkWordByWord, SIGNAL( toggled( bool ) ), m_wordByWordYes, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkFontAttribute, SIGNAL( toggled( bool ) ), m_fontAttributeItem, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkLanguage, SIGNAL( toggled( bool ) ), m_languageItem, SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkBold, TQT_SIGNAL( toggled( bool ) ), m_boldYes, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkItalic, TQT_SIGNAL( toggled( bool ) ), m_italicYes, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkStrikeOut, TQT_SIGNAL( toggled( bool ) ), m_strikeOutItem, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkShadow, TQT_SIGNAL( toggled( bool ) ), m_shadowYes, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkWordByWord, TQT_SIGNAL( toggled( bool ) ), m_wordByWordYes, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkFontAttribute, TQT_SIGNAL( toggled( bool ) ), m_fontAttributeItem, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkLanguage, TQT_SIGNAL( toggled( bool ) ), m_languageItem, TQT_SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkBold, SIGNAL( toggled( bool ) ), m_boldNo, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkItalic, SIGNAL( toggled( bool ) ), m_italicNo, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkShadow, SIGNAL( toggled( bool ) ), m_shadowNo, SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkWordByWord, SIGNAL( toggled( bool ) ), m_wordByWordNo, SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkBold, TQT_SIGNAL( toggled( bool ) ), m_boldNo, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkItalic, TQT_SIGNAL( toggled( bool ) ), m_italicNo, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkShadow, TQT_SIGNAL( toggled( bool ) ), m_shadowNo, TQT_SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkWordByWord, TQT_SIGNAL( toggled( bool ) ), m_wordByWordNo, TQT_SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkVertAlign, SIGNAL( toggled( bool ) ), m_vertAlignItem, SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkVertAlign, TQT_SIGNAL( toggled( bool ) ), m_vertAlignItem, TQT_SLOT( setEnabled( bool ) ) );
- QObject::connect( m_checkUnderline, SIGNAL( toggled( bool ) ), m_underlineItem, SLOT( setEnabled( bool ) ) );
+ TQObject::connect( m_checkUnderline, TQT_SIGNAL( toggled( bool ) ), m_underlineItem, TQT_SLOT( setEnabled( bool ) ) );
slotReset();
}
@@ -831,7 +831,7 @@ void KoFormatDia::ctxOptions( )
}
-bool KoFindReplace::validateMatch( const QString & /*text*/, int index, int matchedlength )
+bool KoFindReplace::validateMatch( const TQString & /*text*/, int index, int matchedlength )
{
if ( !m_searchContextEnabled || !m_searchContext.m_optionsMask )
return true;
@@ -921,10 +921,10 @@ bool KoFindReplace::validateMatch( const QString & /*text*/, int index, int matc
bool KoFindReplace::shouldRestart()
{
- if ( m_find )
- return m_find->shouldRestart( true /*since text is editable*/, m_doCounting );
+ if ( m_tqfind )
+ return m_tqfind->shouldRestart( true /*since text is editable*/, m_doCounting );
else
- return m_replace->shouldRestart( true /*since text is editable*/, m_doCounting );
+ return m_tqreplace->shouldRestart( true /*since text is editable*/, m_doCounting );
}
#include "KoSearchDia.moc"
diff --git a/lib/kotext/KoSearchDia.h b/lib/kotext/KoSearchDia.h
index c83d235d..56570f4d 100644
--- a/lib/kotext/KoSearchDia.h
+++ b/lib/kotext/KoSearchDia.h
@@ -29,17 +29,17 @@
#include "KoTextIterator.h"
#include "KoTextFormat.h"
-#include <qcolor.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqcolor.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include <koffice_export.h>
-class QPushButton;
-class QRadioButton;
-class QGridLayout;
-class QCheckBox;
-class QComboBox;
-class QSpinBox;
+class TQPushButton;
+class TQRadioButton;
+class TQGridLayout;
+class TQCheckBox;
+class TQComboBox;
+class TQSpinBox;
class KColorButton;
class KMacroCommand;
class KoTextView;
@@ -79,31 +79,32 @@ public:
KoSearchContext();
~KoSearchContext();
- QString m_family;
- QColor m_color;
- QColor m_backGroundColor;
+ TQString m_family;
+ TQColor m_color;
+ TQColor m_backGroundColor;
int m_size;
KoTextFormat::VerticalAlignment m_vertAlign;
KoTextFormat::UnderlineType m_underline;
KoTextFormat::StrikeOutType m_strikeOut;
KoTextFormat::AttributeStyle m_attribute;
- QStringList m_strings; // history
+ TQStringList m_strings; // history
long m_optionsMask;
long m_options;
- QString m_language;
+ TQString m_language;
};
//
// This class represents the GUI elements that correspond to KWSearchContext.
//
-class KoSearchContextUI : public QObject
+class KoSearchContextUI : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoSearchContextUI( KoSearchContext *ctx, QWidget *parent );
+ KoSearchContextUI( KoSearchContext *ctx, TQWidget *tqparent );
void setCtxOptions( long options );
- void setCtxHistory( const QStringList & history );
+ void setCtxHistory( const TQStringList & history );
KoSearchContext *context() const { return m_ctx;}
bool optionSelected() const { return m_bOptionsShown;}
private slots:
@@ -111,10 +112,10 @@ private slots:
private:
KoSearchContext *m_ctx;
- QGridLayout *m_grid;
+ TQGridLayout *m_grid;
bool m_bOptionsShown;
- QPushButton *m_btnShowOptions;
- QWidget *m_parent;
+ TQPushButton *m_btnShowOptions;
+ TQWidget *m_parent;
};
//
@@ -124,9 +125,10 @@ class KOTEXT_EXPORT KoSearchDia:
public KFindDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoSearchDia( QWidget *parent, const char *name, KoSearchContext *find, bool hasSelection, bool hasCursor );
+ KoSearchDia( TQWidget *tqparent, const char *name, KoSearchContext *tqfind, bool hasSelection, bool hasCursor );
KoSearchContext * searchContext() {
return m_findUI->context();
}
@@ -146,10 +148,11 @@ class KOTEXT_EXPORT KoReplaceDia:
public KReplaceDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoReplaceDia( QWidget *parent, const char *name, KoSearchContext *find, KoSearchContext *replace, bool hasSelection, bool hasCursor );
+ KoReplaceDia( TQWidget *tqparent, const char *name, KoSearchContext *tqfind, KoSearchContext *tqreplace, bool hasSelection, bool hasCursor );
KoSearchContext * searchContext() {
return m_findUI->context();
}
@@ -173,10 +176,11 @@ private:
class KoTextFind : public KFind
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoTextFind(const QString &pattern, long options, KoFindReplace *_findReplace, QWidget *parent = 0);
+ KoTextFind(const TQString &pattern, long options, KoFindReplace *_findReplace, TQWidget *tqparent = 0);
~KoTextFind();
- virtual bool validateMatch( const QString &text, int index, int matchedlength );
+ virtual bool validateMatch( const TQString &text, int index, int matchedlength );
private:
KoFindReplace * m_findReplace;
};
@@ -187,31 +191,33 @@ private:
class KoTextReplace : public KReplace
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoTextReplace(const QString &pattern, const QString &replacement, long options, KoFindReplace *_findReplace, QWidget *parent = 0);
+ KoTextReplace(const TQString &pattern, const TQString &replacement, long options, KoFindReplace *_findReplace, TQWidget *tqparent = 0);
~KoTextReplace();
- virtual bool validateMatch( const QString &text, int index, int matchedlength );
+ virtual bool validateMatch( const TQString &text, int index, int matchedlength );
private:
KoFindReplace * m_findReplace;
};
/**
- * This class implements the 'find' functionality ( the "search next, prompt" loop )
- * and the 'replace' functionality. Same class, to allow centralizing the findNext() code.
+ * This class implements the 'tqfind' functionality ( the "search next, prompt" loop )
+ * and the 'tqreplace' functionality. Same class, to allow centralizing the findNext() code.
*/
-class KOTEXT_EXPORT KoFindReplace : public QObject
+class KOTEXT_EXPORT KoFindReplace : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoFindReplace( QWidget * parent, KoSearchDia * dialog, const QValueList<KoTextObject *> & lstObject, KoTextView* textView );
- KoFindReplace( QWidget * parent, KoReplaceDia * dialog, const QValueList<KoTextObject *> & lstObject, KoTextView* textView );
+ KoFindReplace( TQWidget * tqparent, KoSearchDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView );
+ KoFindReplace( TQWidget * tqparent, KoReplaceDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView );
~KoFindReplace();
KoTextParag *currentParag() {
return m_textIterator.currentParag();
}
- bool isReplace() const { return m_replace != 0L; }
+ bool isReplace() const { return m_tqreplace != 0L; }
bool shouldRestart();
@@ -238,7 +244,7 @@ public:
virtual void highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *textdoc, KDialogBase* dialog) = 0;
/** For KoTextFind and KoTextReplace */
- bool validateMatch( const QString &text, int index, int matchedlength );
+ bool validateMatch( const TQString &text, int index, int matchedlength );
protected:
void replaceWithAttribut( KoTextCursor * cursor, int index );
@@ -246,26 +252,26 @@ protected:
long options() const;
void setOptions(long opt);
void removeHighlight();
- bool needData() const { return m_find ? m_find->needData() : m_replace->needData(); }
- void setData( const QString& data, int startPos = -1 ) {
- if ( m_find ) m_find->setData( data, startPos );
- else m_replace->setData( data, startPos );
+ bool needData() const { return m_tqfind ? m_tqfind->needData() : m_tqreplace->needData(); }
+ void setData( const TQString& data, int startPos = -1 ) {
+ if ( m_tqfind ) m_tqfind->setData( data, startPos );
+ else m_tqreplace->setData( data, startPos );
}
protected slots:
void slotFindNext();
void optionsChanged();
void dialogClosed();
- void highlight( const QString &text, int matchingIndex, int matchingLength );
- void replace( const QString &text, int replacementIndex, int replacedLength, int searchLength );
+ void highlight( const TQString &text, int matchingIndex, int matchingLength );
+ void tqreplace( const TQString &text, int replacementIndex, int replacedLength, int searchLength );
void slotCurrentParagraphModified( int, int, int );
private:
- void connectFind( KFind* find );
+ void connectFind( KFind* tqfind );
// Only one of those two will be set
- KoTextFind * m_find;
- KoTextReplace * m_replace;
+ KoTextFind * m_tqfind;
+ KoTextReplace * m_tqreplace;
KoSearchContext m_searchContext;
KoSearchContext m_replaceContext;
@@ -276,7 +282,7 @@ private:
KMacroCommand *m_macroCmd;
int m_offset;
- int m_matchingIndex; // can be removed once we use kde-3.2 (for kfind::index())
+ int m_matchingIndex; // can be removed once we use kde-3.2 (for ktqfind::index())
KoTextIterator m_textIterator;
@@ -291,8 +297,9 @@ private:
class KoFormatDia: public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoFormatDia( QWidget* parent, const QString & _caption, KoSearchContext *_ctx, const char* name=0L);
+ KoFormatDia( TQWidget* tqparent, const TQString & _caption, KoSearchContext *_ctx, const char* name=0L);
//apply to parameter to context !
void ctxOptions( );
@@ -300,38 +307,38 @@ protected slots:
void slotReset();
void slotClear();
private:
- QCheckBox *m_checkFamily;
- QCheckBox *m_checkSize;
- QCheckBox *m_checkColor;
- QCheckBox *m_checkBgColor;
- QCheckBox *m_checkBold;
- QCheckBox *m_checkItalic;
- QCheckBox *m_checkShadow;
- QCheckBox *m_checkWordByWord;
- QCheckBox *m_checkUnderline;
- QCheckBox *m_checkVertAlign;
- QCheckBox *m_checkStrikeOut;
- QCheckBox *m_checkFontAttribute;
- QCheckBox *m_checkLanguage;
+ TQCheckBox *m_checkFamily;
+ TQCheckBox *m_checkSize;
+ TQCheckBox *m_checkColor;
+ TQCheckBox *m_checkBgColor;
+ TQCheckBox *m_checkBold;
+ TQCheckBox *m_checkItalic;
+ TQCheckBox *m_checkShadow;
+ TQCheckBox *m_checkWordByWord;
+ TQCheckBox *m_checkUnderline;
+ TQCheckBox *m_checkVertAlign;
+ TQCheckBox *m_checkStrikeOut;
+ TQCheckBox *m_checkFontAttribute;
+ TQCheckBox *m_checkLanguage;
KFontCombo *m_familyItem;
- QSpinBox *m_sizeItem;
+ TQSpinBox *m_sizeItem;
KColorButton *m_colorItem;
KColorButton *m_bgColorItem;
- QRadioButton *m_boldYes;
- QRadioButton *m_boldNo;
- QRadioButton *m_italicYes;
- QRadioButton *m_italicNo;
- QRadioButton *m_shadowYes;
- QRadioButton *m_shadowNo;
- QRadioButton *m_wordByWordYes;
- QRadioButton *m_wordByWordNo;
-
- QComboBox *m_vertAlignItem;
- QComboBox *m_underlineItem;
- QComboBox *m_strikeOutItem;
- QComboBox *m_fontAttributeItem;
- QComboBox *m_languageItem;
+ TQRadioButton *m_boldYes;
+ TQRadioButton *m_boldNo;
+ TQRadioButton *m_italicYes;
+ TQRadioButton *m_italicNo;
+ TQRadioButton *m_shadowYes;
+ TQRadioButton *m_shadowNo;
+ TQRadioButton *m_wordByWordYes;
+ TQRadioButton *m_wordByWordNo;
+
+ TQComboBox *m_vertAlignItem;
+ TQComboBox *m_underlineItem;
+ TQComboBox *m_strikeOutItem;
+ TQComboBox *m_fontAttributeItem;
+ TQComboBox *m_languageItem;
KoSearchContext *m_ctx;
};
diff --git a/lib/kotext/KoSpell.cpp b/lib/kotext/KoSpell.cpp
index 63f5a37b..87ef1803 100644
--- a/lib/kotext/KoSpell.cpp
+++ b/lib/kotext/KoSpell.cpp
@@ -33,7 +33,7 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qtimer.h>
+#include <tqtimer.h>
//#define DEBUG_SPELL
@@ -49,9 +49,9 @@ public:
KoTextDocument *lastTxtDocument;
};
-KoSpell::KoSpell( const Broker::Ptr& broker, QObject *parent,
+KoSpell::KoSpell( const Broker::Ptr& broker, TQObject *tqparent,
const char *name )
- : BackgroundChecker( broker, parent, name )
+ : BackgroundChecker( broker, tqparent, name )
{
d = new Private;
d->parag = 0;
@@ -74,7 +74,7 @@ bool KoSpell::check( KoTextIterator *itr, bool dialog )
return ret;
d->itr = itr;
- connect( d->itr, SIGNAL( currentParagraphDeleted() ), SLOT( slotCurrentParagraphDeleted() ) );
+ connect( d->itr, TQT_SIGNAL( currentParagraphDeleted() ), TQT_SLOT( slotCurrentParagraphDeleted() ) );
d->lastTxtDocument = d->itr->currentTextObject()->textDocument();
d->needsIncrement = false;
ret = !d->itr->atEnd();
@@ -97,7 +97,7 @@ bool KoSpell::check( KoTextParag *parag )
}
bool KoSpell::checkWordInParagraph( KoTextParag *parag, int pos,
- QString& foundWord, int& start )
+ TQString& foundWord, int& start )
{
if ( !parag ) {
start = -1;
@@ -106,7 +106,7 @@ bool KoSpell::checkWordInParagraph( KoTextParag *parag, int pos,
d->parag = parag;
d->lastTxtDocument = d->parag->textDocument();
- QString str = parag->string()->stringToSpellCheck();
+ TQString str = parag->string()->stringToSpellCheck();
/// ##### do we really need to create a Filter every time?
Filter filter;
filter.setBuffer( str );
@@ -121,7 +121,7 @@ bool KoSpell::checkWordInParagraph( KoTextParag *parag, int pos,
return checkWord( w.word );
}
-QString KoSpell::getMoreText()
+TQString KoSpell::getMoreText()
{
#ifdef DEBUG_SPELL
kdDebug()<<"getMoreText: dialog = " << d->dialog << ", itr = "
@@ -138,10 +138,10 @@ QString KoSpell::getMoreText()
}
if ( d->itr && d->itr->atEnd() )
- return QString::null;
+ return TQString();
if ( !d->dialog && !d->itr ) {
- QString str = d->parag ? d->parag->string()->stringToSpellCheck() : QString::null;
+ TQString str = d->parag ? d->parag->string()->stringToSpellCheck() : TQString();
if ( !str.isEmpty() )
emit aboutToFeedText();
return str;
@@ -149,7 +149,7 @@ QString KoSpell::getMoreText()
d->needsIncrement = true;
- QString text = d->itr->currentText();
+ TQString text = d->itr->currentText();
d->parag = d->itr->currentParag();
emit aboutToFeedText();
@@ -161,7 +161,7 @@ QString KoSpell::getMoreText()
++(*d->itr);
if ( d->itr->atEnd() ) {
d->needsIncrement = false;
- return QString::null;
+ return TQString();
}
d->parag = d->itr->currentParag();
d->lastTxtDocument = d->parag->textDocument();
diff --git a/lib/kotext/KoSpell.h b/lib/kotext/KoSpell.h
index b359b1aa..4c1ee72c 100644
--- a/lib/kotext/KoSpell.h
+++ b/lib/kotext/KoSpell.h
@@ -19,9 +19,9 @@
#ifndef KOSPELL_H
#define KOSPELL_H
-#include <qobject.h>
-#include <qstringlist.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
+#include <tqstring.h>
#include <kspell2/backgroundchecker.h>
#include <koffice_export.h>
@@ -45,9 +45,10 @@ namespace KSpell2
class KOTEXT_EXPORT KoSpell : public KSpell2::BackgroundChecker
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoSpell( const KSpell2::Broker::Ptr& broker, QObject *parent =0,
+ KoSpell( const KSpell2::Broker::Ptr& broker, TQObject *tqparent =0,
const char *name =0 );
/**
* The destructor instructs ISpell/ASpell to write out the personal
@@ -70,7 +71,7 @@ public:
virtual bool check( KoTextIterator *itr, bool dialog = false );
virtual bool check( KoTextParag *parag );
virtual bool checkWordInParagraph( KoTextParag *parag, int pos,
- QString& word, int& start );
+ TQString& word, int& start );
KoTextParag *currentParag() const;
KoTextObject *currentTextObject() const;
@@ -95,7 +96,7 @@ signals:
void aboutToFeedText();
protected:
- virtual QString getMoreText();
+ virtual TQString getMoreText();
virtual void finishedCurrentFeed();
private:
diff --git a/lib/kotext/KoStyleCollection.cpp b/lib/kotext/KoStyleCollection.cpp
index 39ce4b99..7313e7be 100644
--- a/lib/kotext/KoStyleCollection.cpp
+++ b/lib/kotext/KoStyleCollection.cpp
@@ -29,7 +29,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qdom.h>
+#include <tqdom.h>
KoStyleCollection::KoStyleCollection()
: KoUserStyleCollection( "paragsty" )
@@ -42,16 +42,16 @@ KoStyleCollection::~KoStyleCollection()
int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
{
- QStringList followingStyles;
- QValueVector<QDomElement> userStyles = context.oasisStyles().userStyles();
+ TQStringList followingStyles;
+ TQValueVector<TQDomElement> userStyles = context.oasisStyles().userStyles();
bool defaultStyleDeleted = false;
int stylesLoaded = 0;
const unsigned int nStyles = userStyles.count();
for (unsigned int item = 0; item < nStyles; item++) {
- QDomElement styleElem = userStyles[item];
+ TQDomElement styleElem = userStyles[item];
Q_ASSERT( !styleElem.isNull() );
- if ( styleElem.attributeNS( KoXmlNS::style, "family", QString::null ) != "paragraph" )
+ if ( styleElem.attributeNS( KoXmlNS::style, "family", TQString() ) != "paragraph" )
continue;
if( !defaultStyleDeleted ) { // we are going to import at least one style.
@@ -62,7 +62,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
defaultStyleDeleted = true;
}
- KoParagStyle *sty = new KoParagStyle( QString::null );
+ KoParagStyle *sty = new KoParagStyle( TQString() );
// Load the style
sty->loadStyle( styleElem, context );
// Style created, now let's try to add it
@@ -75,7 +75,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
if ( count() > oldStyleCount )
{
- const QString following = styleElem.attributeNS( KoXmlNS::style, "next-style-name", QString::null );
+ const TQString following = styleElem.attributeNS( KoXmlNS::style, "next-style-name", TQString() );
followingStyles.append( following );
++stylesLoaded;
}
@@ -89,8 +89,8 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
}
unsigned int i=0;
- for( QValueList<QString>::ConstIterator it = followingStyles.begin(); it != followingStyles.end(); ++it, ++i ) {
- const QString followingStyleName = *it;
+ for( TQValueList<TQString>::ConstIterator it = followingStyles.begin(); it != followingStyles.end(); ++it, ++i ) {
+ const TQString followingStyleName = *it;
if ( !followingStyleName.isEmpty() ) {
KoParagStyle * style = findStyle( followingStyleName );
if ( style )
@@ -98,7 +98,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
}
}
- // TODO the same thing for style inheritance (style:parent-style-name) and setParentStyle()
+ // TODO the same thing for style inheritance (style:tqparent-style-name) and setParentStyle()
Q_ASSERT( defaultStyle() );
return stylesLoaded;
@@ -107,12 +107,12 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingContext& context ) const
{
// In order to reduce the bloat, we define that the first style (usually Standard)
- // is the "parent" (reference) for the others.
+ // is the "tqparent" (reference) for the others.
// ## This is mostly a hack due to lack of proper style inheritance.
// Once that's implemented, default to 'styles derive from Standard', but save normally.
- QString refStyleName;
+ TQString refStyleName;
- 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 ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
style->saveStyle( styles, styleType, refStyleName, context );
kdDebug() << k_funcinfo << "Saved style " << style->displayName() << " to OASIS format as " << style->name() << endl;
@@ -123,10 +123,10 @@ void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingC
// because the style's m_name is already unique so there's no risk of
// "two styles being only different due to their following-style"; the
// display-name will also be different, and will ensure they get two kogenstyles.
- 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 ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
if ( style->followingStyle() && style->followingStyle() != style ) {
- const QString fsname = style->followingStyle()->name();
+ const TQString fsname = style->followingStyle()->name();
KoGenStyle* gs = styles.styleForModification( style->name() );
Q_ASSERT( gs );
if ( gs )
@@ -137,9 +137,9 @@ void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingC
void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
{
- const QValueList<KoUserStyle *> styles = styleCollection.styleList();
- QMap<QString, QString> followStyle;
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = styles.begin(), styleEnd = styles.end() ; styleIt != styleEnd ; ++styleIt ) {
+ const TQValueList<KoUserStyle *> styles = styleCollection.styleList();
+ TQMap<TQString, TQString> followStyle;
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = styles.begin(), styleEnd = styles.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* p = static_cast<KoParagStyle *>( *styleIt );
KoParagStyle* style = new KoParagStyle( *p );
if ( style->followingStyle() ) {
@@ -148,11 +148,11 @@ void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
style = addStyle( style );
}
- QMapIterator<QString, QString> itFollow = followStyle.begin();
+ TQMapIterator<TQString, TQString> itFollow = followStyle.begin();
for ( ; itFollow != followStyle.end(); ++itFollow )
{
KoParagStyle * style = findStyle(itFollow.key());
- const QString followingStyleName = followStyle[ itFollow.key() ];
+ const TQString followingStyleName = followStyle[ itFollow.key() ];
KoParagStyle * styleFollow = findStyle(followingStyleName);
//kdDebug() << " " << style << " " << itFollow.key() << ": followed by " << styleFollow << " (" << followingStyleName << ")" << endl;
Q_ASSERT(styleFollow);
@@ -166,7 +166,7 @@ void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
void KoStyleCollection::saveOasisOutlineStyles( KoXmlWriter& writer ) const
{
bool first = true;
- QValueVector<KoParagStyle *> styles = outlineStyles();
+ TQValueVector<KoParagStyle *> styles = outlineStyles();
for ( int i = 0 ; i < 10 ; ++i ) {
if ( styles[i] ) {
if ( first ) {
@@ -182,9 +182,9 @@ void KoStyleCollection::saveOasisOutlineStyles( KoXmlWriter& writer ) const
writer.endElement(); // text:outline-style
}
-QValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
+TQValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
{
- QValueVector<KoParagStyle *> lst( 10, 0 );
+ TQValueVector<KoParagStyle *> lst( 10, 0 );
for ( int i = 0 ; i < 10 ; ++i ) {
KoParagStyle* style = outlineStyleForLevel( i );
if ( style )
@@ -196,7 +196,7 @@ QValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
KoParagStyle* KoStyleCollection::outlineStyleForLevel( int level ) const
{
- 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 ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
if ( style->isOutline() && style->paragLayout().counter )
{
@@ -210,7 +210,7 @@ KoParagStyle* KoStyleCollection::outlineStyleForLevel( int level ) const
KoParagStyle* KoStyleCollection::numberedStyleForLevel( int level ) const
{
- 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 ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
KoParagCounter* counter = style->paragLayout().counter;
if ( !style->isOutline() && counter
@@ -233,7 +233,7 @@ KoParagStyle* KoStyleCollection::defaultStyle() const
#ifndef NDEBUG
void KoStyleCollection::printDebug() const
{
- 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 ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
// short version:
@@ -242,12 +242,12 @@ void KoStyleCollection::printDebug() const
kdDebug() << "Style " << style << " " << style->name() << " isOutline=" << style->isOutline() << endl;
kdDebug() << " format: " << style->format().key() <<endl;
static const char * const s_align[] = { "Auto", "Left", "Right", "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", };
- kdDebug() << " align: " << s_align[(Qt::AlignmentFlags)style->paragLayout().alignment] << endl;
+ kdDebug() << " align: " << s_align[(TQt::AlignmentFlags)style->paragLayout().tqalignment] << endl;
if ( style->paragLayout().counter )
kdDebug() << " counter level=" << style->paragLayout().counter->depth() << endl;
kdDebug() << " following style: " << style->followingStyle() << " "
- << ( style->followingStyle() ? style->followingStyle()->name() : QString::null ) << endl;
+ << ( style->followingStyle() ? style->followingStyle()->name() : TQString() ) << endl;
}
}
diff --git a/lib/kotext/KoStyleCollection.h b/lib/kotext/KoStyleCollection.h
index c3cc7770..66a244e5 100644
--- a/lib/kotext/KoStyleCollection.h
+++ b/lib/kotext/KoStyleCollection.h
@@ -19,8 +19,8 @@
#ifndef kostyle_h
#define kostyle_h
-#include <qdom.h>
-#include <qvaluevector.h>
+#include <tqdom.h>
+#include <tqvaluevector.h>
#include "KoParagStyle.h"
#include "KoUserStyleCollection.h"
@@ -41,7 +41,7 @@ struct KoStyleChangeDef {
int paragLayoutChanged;
int formatChanged;
};
-typedef QMap<KoParagStyle *, KoStyleChangeDef> KoStyleChangeDefMap;
+typedef TQMap<KoParagStyle *, KoStyleChangeDef> KoStyleChangeDefMap;
/// TODO rename to KoParagStyleCollection - or should char styles be part of it too?
class KOTEXT_EXPORT KoStyleCollection : public KoUserStyleCollection
@@ -50,10 +50,10 @@ public:
KoStyleCollection();
~KoStyleCollection();
- //const QPtrList<KoParagStyle> & styleList() const { return m_styleList; }
+ //const TQPtrList<KoParagStyle> & styleList() const { return m_styleList; }
// compat method, TODO: remove
- QStringList translatedStyleNames() const { return displayNameList(); }
+ TQStringList translatedStyleNames() const { return displayNameList(); }
/**
* See KoUserStyleCollection::addStyle.
@@ -67,15 +67,15 @@ public:
* Find style based on the internal name @p name.
* Overloaded for convenience.
*/
- KoParagStyle* findStyle( const QString & name ) const {
- return static_cast<KoParagStyle*>( KoUserStyleCollection::findStyle( name, QString::fromLatin1( "Standard" ) ) );
+ KoParagStyle* findStyle( const TQString & name ) const {
+ return static_cast<KoParagStyle*>( KoUserStyleCollection::findStyle( name, TQString::tqfromLatin1( "Standard" ) ) );
}
/**
* Find style based on the display name @p displayName.
* Overloaded for convenience.
*/
- KoParagStyle* findStyleByDisplayName( const QString & name ) const {
+ KoParagStyle* findStyleByDisplayName( const TQString & name ) const {
return static_cast<KoParagStyle*>( KoUserStyleCollection::findStyleByDisplayName( name ) );
}
@@ -100,7 +100,7 @@ public:
void saveOasisOutlineStyles( KoXmlWriter& writer ) const;
/// @return the list of outline styles
- QValueVector<KoParagStyle *> outlineStyles() const;
+ TQValueVector<KoParagStyle *> outlineStyles() const;
/// @return the [first] outline style for a given level. Can be 0 if not found.
KoParagStyle* outlineStyleForLevel( int level ) const;
diff --git a/lib/kotext/KoStyleManager.cpp b/lib/kotext/KoStyleManager.cpp
index 77162a4e..9017d8a1 100644
--- a/lib/kotext/KoStyleManager.cpp
+++ b/lib/kotext/KoStyleManager.cpp
@@ -28,12 +28,12 @@
#include <kiconloader.h>
#include <kdebug.h>
-#include <qtabwidget.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
+#include <tqtabwidget.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
/******************************************************************/
/* Class: KoStyleManager */
@@ -55,11 +55,11 @@ class KoStyleManagerPrivate
{
public:
KoStylePreview* preview;
- QCheckBox* cbIncludeInTOC;
+ TQCheckBox* cbIncludeInTOC;
};
-KoStyleManager::KoStyleManager( QWidget *_parent, KoUnit::Unit unit,
- const KoStyleCollection& styles, const QString & activeStyleName,
+KoStyleManager::KoStyleManager( TQWidget *_parent, KoUnit::Unit unit,
+ const KoStyleCollection& styles, const TQString & activeStyleName,
int flags )
: KDialogBase( _parent, "Stylist", true,
i18n("Style Manager"),
@@ -86,7 +86,7 @@ KoStyleManager::KoStyleManager( QWidget *_parent, KoUnit::Unit unit,
newTab = new KoStyleParagTab( m_tabs );
KoParagLayoutWidget *decorations = new KoParagDecorationWidget( newTab );
- decorations->layout()->setMargin(KDialog::marginHint());
+ decorations->tqlayout()->setMargin(KDialog::marginHint());
newTab->setWidget( decorations );
addTab( newTab );
@@ -98,12 +98,12 @@ KoStyleManager::KoStyleManager( QWidget *_parent, KoUnit::Unit unit,
newTab->setWidget( new KoParagTabulatorsWidget( unit, -1, newTab ) );
addTab( newTab );
- QListBoxItem * item = m_stylesList->findItem( activeStyleName );
+ TQListBoxItem * item = m_stylesList->tqfindItem( activeStyleName );
m_stylesList->setCurrentItem( item ? m_stylesList->index(item) : 0 );
noSignals=false;
switchStyle();
- setInitialSize( QSize( 600, 570 ) );
+ setInitialSize( TQSize( 600, 570 ) );
}
KoStyleManager::~KoStyleManager()
@@ -122,20 +122,20 @@ void KoStyleManager::addTab( KoStyleManagerTab * tab )
{
m_tabsList.append( tab );
m_tabs->insertTab( tab, tab->tabName() );
- tab->layout()->activate();
+ tab->tqlayout()->activate();
}
void KoStyleManager::setupWidget(const KoStyleCollection& styleCollection)
{
- QFrame * frame1 = makeMainWidget();
- QGridLayout *frame1Layout = new QGridLayout( frame1, 0, 0, // auto
+ TQFrame * frame1 = makeMainWidget();
+ TQGridLayout *frame1Layout = new TQGridLayout( frame1, 0, 0, // auto
0, KDialog::spacingHint() );
numStyles = styleCollection.count();
- m_stylesList = new QListBox( frame1, "stylesList" );
+ m_stylesList = new TQListBox( frame1, "stylesList" );
m_stylesList->insertStringList( styleCollection.displayNameList() );
- const QValueList<KoUserStyle*> styleList = styleCollection.styleList();
- for ( QValueList<KoUserStyle *>::const_iterator it = styleList.begin(), end = styleList.end();
+ const TQValueList<KoUserStyle*> styleList = styleCollection.styleList();
+ for ( TQValueList<KoUserStyle *>::const_iterator it = styleList.begin(), end = styleList.end();
it != end ; ++it )
{
KoParagStyle* style = static_cast<KoParagStyle *>( *it );
@@ -147,79 +147,79 @@ void KoStyleManager::setupWidget(const KoStyleCollection& styleCollection)
frame1Layout->addMultiCellWidget( m_stylesList, 0, 0, 0, 1 );
- m_moveUpButton = new QPushButton( frame1, "moveUpButton" );
+ m_moveUpButton = new TQPushButton( frame1, "moveUpButton" );
m_moveUpButton->setIconSet( SmallIconSet( "up" ) );
- connect( m_moveUpButton, SIGNAL( clicked() ), this, SLOT( moveUpStyle() ) );
+ connect( m_moveUpButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( moveUpStyle() ) );
frame1Layout->addWidget( m_moveUpButton, 1, 1 );
- m_moveDownButton = new QPushButton( frame1, "moveDownButton" );
+ m_moveDownButton = new TQPushButton( frame1, "moveDownButton" );
m_moveDownButton->setIconSet( SmallIconSet( "down" ) );
- connect( m_moveDownButton, SIGNAL( clicked() ), this, SLOT( moveDownStyle() ) );
+ connect( m_moveDownButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( moveDownStyle() ) );
frame1Layout->addWidget( m_moveDownButton, 1, 0 );
- m_deleteButton = new QPushButton( frame1, "deleteButton" );
+ m_deleteButton = new TQPushButton( frame1, "deleteButton" );
m_deleteButton->setText( i18n( "&Delete" ) );
- connect( m_deleteButton, SIGNAL( clicked() ), this, SLOT( deleteStyle() ) );
+ connect( m_deleteButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deleteStyle() ) );
frame1Layout->addWidget( m_deleteButton, 2, 1 );
- m_newButton = new QPushButton( frame1, "newButton" );
+ m_newButton = new TQPushButton( frame1, "newButton" );
m_newButton->setText( i18n( "New" ) );
- connect( m_newButton, SIGNAL( clicked() ), this, SLOT( addStyle() ) );
+ connect( m_newButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addStyle() ) );
frame1Layout->addWidget( m_newButton, 2, 0 );
- m_tabs = new QTabWidget( frame1 );
+ m_tabs = new TQTabWidget( frame1 );
frame1Layout->addMultiCellWidget( m_tabs, 0, 2, 2, 2 );
- connect( m_stylesList, SIGNAL( selectionChanged() ), this, SLOT( switchStyle() ) );
- connect( m_tabs, SIGNAL( currentChanged ( QWidget * ) ), this, SLOT( switchTabs() ) );
+ connect( m_stylesList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( switchStyle() ) );
+ connect( m_tabs, TQT_SIGNAL( currentChanged ( TQWidget * ) ), this, TQT_SLOT( switchTabs() ) );
}
void KoStyleManager::addGeneralTab( int flags ) {
- QWidget *tab = new QWidget( m_tabs );
+ TQWidget *tab = new TQWidget( m_tabs );
- QGridLayout *tabLayout = new QGridLayout( tab );
+ TQGridLayout *tabLayout = new TQGridLayout( tab );
tabLayout->setSpacing( KDialog::spacingHint() );
tabLayout->setMargin( KDialog::marginHint() );
- m_nameString = new QLineEdit( tab );
- m_nameString->resize(m_nameString->sizeHint() );
- connect( m_nameString, SIGNAL( textChanged( const QString &) ), this, SLOT( renameStyle(const QString &) ) );
+ m_nameString = new TQLineEdit( tab );
+ m_nameString->resize(m_nameString->tqsizeHint() );
+ connect( m_nameString, TQT_SIGNAL( textChanged( const TQString &) ), this, TQT_SLOT( renameStyle(const TQString &) ) );
tabLayout->addWidget( m_nameString, 0, 1 );
- QLabel *nameLabel = new QLabel( tab );
+ TQLabel *nameLabel = new TQLabel( tab );
nameLabel->setText( i18n( "Name:" ) );
- nameLabel->resize(nameLabel->sizeHint());
- nameLabel->setAlignment( AlignRight | AlignVCenter );
+ nameLabel->resize(nameLabel->tqsizeHint());
+ nameLabel->tqsetAlignment( AlignRight | AlignVCenter );
tabLayout->addWidget( nameLabel, 0, 0 );
- m_styleCombo = new QComboBox( FALSE, tab, "styleCombo" );
+ m_styleCombo = new TQComboBox( FALSE, tab, "styleCombo" );
tabLayout->addWidget( m_styleCombo, 1, 1 );
- QLabel *nextStyleLabel = new QLabel( tab );
+ TQLabel *nextStyleLabel = new TQLabel( tab );
nextStyleLabel->setText( i18n( "Next style:" ) );
- nextStyleLabel->setAlignment( AlignRight | AlignVCenter );
+ nextStyleLabel->tqsetAlignment( AlignRight | AlignVCenter );
tabLayout->addWidget( nextStyleLabel, 1, 0 );
- m_inheritCombo = new QComboBox( FALSE, tab, "inheritCombo" );
+ m_inheritCombo = new TQComboBox( FALSE, tab, "inheritCombo" );
tabLayout->addWidget( m_inheritCombo, 2, 1 );
- QLabel *inheritStyleLabel = new QLabel( tab );
+ TQLabel *inheritStyleLabel = new TQLabel( tab );
inheritStyleLabel->setText( i18n( "Inherit style:" ) );
- inheritStyleLabel->setAlignment( AlignRight | AlignVCenter );
+ inheritStyleLabel->tqsetAlignment( AlignRight | AlignVCenter );
tabLayout->addWidget( inheritStyleLabel, 2, 0 );
int row = 3;
if ( flags & ShowIncludeInToc ) {
- d->cbIncludeInTOC = new QCheckBox( i18n("Include in table of contents"), tab );
+ d->cbIncludeInTOC = new TQCheckBox( i18n("Include in table of contents"), tab );
tabLayout->addMultiCellWidget( d->cbIncludeInTOC, row, row, 0, 1 );
++row;
} else {
@@ -299,7 +299,7 @@ int KoStyleManager::styleIndex( int pos ) {
// Update the GUI so that it shows m_currentStyle
void KoStyleManager::updateGUI() {
kdDebug(32500) << "KoStyleManager::updateGUI m_currentStyle=" << m_currentStyle << " " << m_currentStyle->name() << endl;
- QPtrListIterator<KoStyleManagerTab> it( m_tabsList );
+ TQPtrListIterator<KoStyleManagerTab> it( m_tabsList );
for ( ; it.current() ; ++it )
{
it.current()->setStyle( m_currentStyle );
@@ -308,7 +308,7 @@ void KoStyleManager::updateGUI() {
m_nameString->setText(m_currentStyle->displayName());
- QString followingName = m_currentStyle->followingStyle() ? m_currentStyle->followingStyle()->displayName() : QString::null;
+ TQString followingName = m_currentStyle->followingStyle() ? m_currentStyle->followingStyle()->displayName() : TQString();
kdDebug(32500) << "KoStyleManager::updateGUI updating combo to " << followingName << endl;
for ( int i = 0; i < m_styleCombo->count(); i++ ) {
if ( m_styleCombo->text( i ) == followingName ) {
@@ -318,7 +318,7 @@ void KoStyleManager::updateGUI() {
}
}
- QString inheritName = m_currentStyle->parentStyle() ? m_currentStyle->parentStyle()->displayName() : QString::null;
+ TQString inheritName = m_currentStyle->tqparentStyle() ? m_currentStyle->tqparentStyle()->displayName() : TQString();
kdDebug(32500) << "KoStyleManager::updateGUI updating combo to " << inheritName << endl;
for ( int i = 0; i < m_inheritCombo->count(); i++ ) {
if ( m_inheritCombo->text( i ) == inheritName ) {
@@ -345,13 +345,13 @@ void KoStyleManager::updateGUI() {
void KoStyleManager::updatePreview()
{
d->preview->setStyle(m_currentStyle);
- d->preview->repaint(true);
+ d->preview->tqrepaint(true);
}
void KoStyleManager::save() {
if(m_currentStyle) {
// save changes from UI to object.
- QPtrListIterator<KoStyleManagerTab> it( m_tabsList );
+ TQPtrListIterator<KoStyleManagerTab> it( m_tabsList );
for ( ; it.current() ; ++it )
it.current()->save();
@@ -370,11 +370,11 @@ void KoStyleManager::save() {
else
{
int indexParentStyle=styleIndex( m_inheritCombo->currentItem()-1 );
- KoParagStyle *parent=m_origStyles.at(indexParentStyle);
- if( parent==0L ) //If not found in the orig list (means its a new Style) look in the changeStyles list
- parent=m_changedStyles.at(indexParentStyle);
+ KoParagStyle *tqparent=m_origStyles.at(indexParentStyle);
+ if( tqparent==0L ) //If not found in the orig list (means its a new Style) look in the changeStyles list
+ tqparent=m_changedStyles.at(indexParentStyle);
- m_currentStyle->setParentStyle( parent );
+ m_currentStyle->setParentStyle( tqparent );
}
if ( d->cbIncludeInTOC )
@@ -382,7 +382,7 @@ void KoStyleManager::save() {
}
}
-KoParagStyle * KoStyleManager::style( const QString & _name )
+KoParagStyle * KoStyleManager::style( const TQString & _name )
{
for(unsigned int i=0; i < m_changedStyles.count(); i++) {
// Skip deleted styles, they're no in m_stylesList anymore
@@ -394,12 +394,12 @@ KoParagStyle * KoStyleManager::style( const QString & _name )
return 0;
}
-QString KoStyleManager::generateUniqueName()
+TQString KoStyleManager::generateUniqueName()
{
int count = 1;
- QString name;
+ TQString name;
do {
- name = "new" + QString::number( count++ );
+ name = "new" + TQString::number( count++ );
} while ( style( name ) );
return name;
}
@@ -408,7 +408,7 @@ QString KoStyleManager::generateUniqueName()
void KoStyleManager::addStyle() {
save();
- QString str = i18n( "New Style Template (%1)" ).arg(numStyles++);
+ TQString str = i18n( "New Style Template (%1)" ).tqarg(numStyles++);
if ( m_currentStyle )
{
m_currentStyle = new KoParagStyle( *m_currentStyle ); // Create a new style, initializing from the current one
@@ -447,9 +447,9 @@ void KoStyleManager::updateInheritStyle( KoParagStyle *s )
for ( KoParagStyle* p = m_changedStyles.first(); p != 0L; p = m_changedStyles.next() )
{
//when we remove style, we must replace inherite style to 0L
- //when parent style was removed.
+ //when tqparent style was removed.
//##########Laurent change inherited style attribute
- if ( p->parentStyle() == s)
+ if ( p->tqparentStyle() == s)
p->setParentStyle(0L);
}
@@ -459,7 +459,7 @@ void KoStyleManager::deleteStyle() {
unsigned int cur = styleIndex( m_stylesList->currentItem() );
unsigned int curItem = m_stylesList->currentItem();
- QString name = m_stylesList->currentText();
+ TQString name = m_stylesList->currentText();
KoParagStyle *s = m_changedStyles.at(cur);
m_styleOrder.remove( s->name());
updateFollowingStyle( s );
@@ -475,7 +475,7 @@ void KoStyleManager::deleteStyle() {
m_stylesList->removeItem(curItem);
m_styleCombo->removeItem(curItem);
- m_inheritCombo->listBox()->removeItem( m_inheritCombo->listBox()->index(m_inheritCombo->listBox()->findItem(name )));
+ m_inheritCombo->listBox()->removeItem( m_inheritCombo->listBox()->index(m_inheritCombo->listBox()->tqfindItem(name )));
numStyles--;
m_stylesList->setSelected( m_stylesList->currentItem(), true );
@@ -486,9 +486,9 @@ void KoStyleManager::moveUpStyle()
Q_ASSERT( m_currentStyle );
if ( m_currentStyle )
save();
- const QString currentStyleName = m_currentStyle->name();
- const QString currentStyleDisplayName = m_stylesList->currentText();
- int pos2 = m_styleOrder.findIndex( currentStyleName );
+ const TQString currentStyleName = m_currentStyle->name();
+ const TQString currentStyleDisplayName = m_stylesList->currentText();
+ int pos2 = m_styleOrder.tqfindIndex( currentStyleName );
if ( pos2 != -1 )
{
m_styleOrder.remove( m_styleOrder.at(pos2));
@@ -514,9 +514,9 @@ void KoStyleManager::moveDownStyle()
Q_ASSERT( m_currentStyle );
if ( m_currentStyle )
save();
- const QString currentStyleName = m_currentStyle->name();
- const QString currentStyleDisplayName = m_stylesList->currentText();
- int pos2 = m_styleOrder.findIndex( currentStyleName );
+ const TQString currentStyleName = m_currentStyle->name();
+ const TQString currentStyleDisplayName = m_stylesList->currentText();
+ int pos2 = m_styleOrder.tqfindIndex( currentStyleName );
if ( pos2 != -1 )
{
m_styleOrder.remove( m_styleOrder.at(pos2));
@@ -550,7 +550,7 @@ void KoStyleManager::slotApply() {
void KoStyleManager::apply() {
noSignals=true;
KoStyleChangeDefMap styleChanged;
- QPtrList<KoParagStyle> removeStyle;
+ TQPtrList<KoParagStyle> removeStyle;
for (unsigned int i =0 ; m_origStyles.count() > i ; i++) {
if(m_origStyles.at(i) == 0L && m_changedStyles.at(i)!=0L) { // newly added style
kdDebug(32500) << "adding new " << m_changedStyles.at(i)->name() << " (" << i << ")" << endl;
@@ -605,7 +605,7 @@ void KoStyleManager::apply() {
noSignals=false;
}
-void KoStyleManager::renameStyle(const QString &theText) {
+void KoStyleManager::renameStyle(const TQString &theText) {
if(noSignals) return;
noSignals=true;
@@ -649,10 +649,10 @@ void KoStyleManager::renameStyle(const QString &theText) {
/////////////
-KoStyleParagTab::KoStyleParagTab( QWidget * parent )
- : KoStyleManagerTab( parent )
+KoStyleParagTab::KoStyleParagTab( TQWidget * tqparent )
+ : KoStyleManagerTab( tqparent )
{
- ( new QVBoxLayout( this ) )->setAutoAdd( true );
+ ( new TQVBoxLayout( this ) )->setAutoAdd( true );
m_widget = 0L;
}
@@ -671,17 +671,17 @@ void KoStyleParagTab::setWidget( KoParagLayoutWidget * widget )
m_widget = widget;
}
-void KoStyleParagTab::resizeEvent( QResizeEvent *e )
+void KoStyleParagTab::resizeEvent( TQResizeEvent *e )
{
- QWidget::resizeEvent( e );
+ TQWidget::resizeEvent( e );
if ( m_widget ) m_widget->resize( size() );
}
-KoStyleFontTab::KoStyleFontTab( QWidget * parent )
- : KoStyleManagerTab( parent )
+KoStyleFontTab::KoStyleFontTab( TQWidget * tqparent )
+ : KoStyleManagerTab( tqparent )
{
- ( new QVBoxLayout( this ) )->setAutoAdd( true );
- QTabWidget *fontTabContainer = new QTabWidget( this );
+ ( new TQVBoxLayout( this ) )->setAutoAdd( true );
+ TQTabWidget *fontTabContainer = new TQTabWidget( this );
m_fontTab = new KoFontTab( KFontChooser::SmoothScalableFonts, this );
m_decorationTab = new KoDecorationTab( this );
@@ -720,13 +720,13 @@ void KoStyleFontTab::update()
#if 0
bool subScript = m_style->format().vAlign() == KoTextFormat::AlignSubScript;
bool superScript = m_style->format().vAlign() == KoTextFormat::AlignSuperScript;
- QFont fn = m_style->format().font();
+ TQFont fn = m_style->format().font();
kdDebug()<<" fn.bold() :"<<fn.bold()<<" fn.italic():"<<fn.italic()<<endl;
kdDebug()<<" fn.family() :"<<fn.family()<<endl;
m_chooser->setFont( fn, subScript, superScript );
m_chooser->setColor( m_style->format().color() );
- QColor col=m_style->format().textBackgroundColor();
- col=col.isValid() ? col : QApplication::palette().color( QPalette::Active, QColorGroup::Base );
+ TQColor col=m_style->format().textBackgroundColor();
+ col=col.isValid() ? col : TQApplication::palette().color( TQPalette::Active, TQColorGroup::Base );
m_chooser->setBackGroundColor(col);
m_chooser->setUnderlineColor( m_style->format().textUnderlineColor());
@@ -769,7 +769,7 @@ void KoStyleFontTab::save()
/*
m_style->format().setFont( m_fontTab->getSelection() );
m_style->format().setColor( m_decorationTab->getTextColor() );
- if( m_decorationTab->getBackGroundColor()!=QApplication::palette().color( QPalette::Active, QColorGroup::Base ))
+ if( m_decorationTab->getBackGroundColor()!=TQApplication::palette().color( TQPalette::Active, TQColorGroup::Base ))
m_style->format().setTextBackgroundColor( m_decorationTab->getBackGroundColor() );
m_style->format().setTextUnderlineColor(m_chooser->underlineColor());
@@ -788,7 +788,7 @@ void KoStyleFontTab::save()
m_style->format().setHyphenation( m_chooser->getHyphenation());
*/}
-QString KoStyleFontTab::tabName()
+TQString KoStyleFontTab::tabName()
{
return i18n("Font");
}
diff --git a/lib/kotext/KoStyleManager.h b/lib/kotext/KoStyleManager.h
index e6f0f57e..10dbf8e6 100644
--- a/lib/kotext/KoStyleManager.h
+++ b/lib/kotext/KoStyleManager.h
@@ -21,7 +21,7 @@
#define kostylist_h
#include <kdialogbase.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <KoParagDia.h>
#include <KoFontTab.h>
@@ -30,21 +30,21 @@
#include <KoLayoutTab.h>
#include <KoLanguageTab.h>
#include <KoUnit.h>
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include <KoStyleCollection.h>
//class KoFontChooser;
class KoParagStyle;
class KoStyleEditor;
class KoStyleManagerTab;
-class QCheckBox;
-class QComboBox;
-class QGridLayout;
-class QLineEdit;
-class QListBox;
-class QPushButton;
-class QTabWidget;
-class QWidget;
+class TQCheckBox;
+class TQComboBox;
+class TQGridLayout;
+class TQLineEdit;
+class TQListBox;
+class TQPushButton;
+class TQTabWidget;
+class TQWidget;
class KoTextDocument;
class KoStyleManagerPrivate;
@@ -54,12 +54,13 @@ class KoStyleManagerPrivate;
class KOTEXT_EXPORT KoStyleManager : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
enum { ShowIncludeInToc = 1 }; // bitfield for flags
- KoStyleManager( QWidget *_parent, KoUnit::Unit unit,
+ KoStyleManager( TQWidget *_parent, KoUnit::Unit unit,
const KoStyleCollection& styleCollection,
- const QString & activeStyleName,
+ const TQString & activeStyleName,
int flags = 0 );
virtual ~KoStyleManager();
@@ -69,7 +70,7 @@ public:
virtual void removeStyleTemplate( KoParagStyle *style )=0;
virtual void updateAllStyleLists()=0;
- virtual void updateStyleListOrder( const QStringList & list)=0;
+ virtual void updateStyleListOrder( const TQStringList & list)=0;
protected:
void updateFollowingStyle( KoParagStyle *s );
@@ -83,22 +84,22 @@ protected:
int styleIndex( int pos );
private:
- QTabWidget *m_tabs;
- QListBox *m_stylesList;
- QLineEdit *m_nameString;
- QComboBox *m_styleCombo;
- QPushButton *m_deleteButton;
- QPushButton *m_newButton;
- QPushButton *m_moveUpButton;
- QPushButton *m_moveDownButton;
- QComboBox *m_inheritCombo;
+ TQTabWidget *m_tabs;
+ TQListBox *m_stylesList;
+ TQLineEdit *m_nameString;
+ TQComboBox *m_styleCombo;
+ TQPushButton *m_deleteButton;
+ TQPushButton *m_newButton;
+ TQPushButton *m_moveUpButton;
+ TQPushButton *m_moveDownButton;
+ TQComboBox *m_inheritCombo;
KoStyleManagerPrivate *d;
KoParagStyle *m_currentStyle;
- QPtrList<KoParagStyle> m_origStyles; // internal list of orig styles we have modified
- QPtrList<KoParagStyle> m_changedStyles; // internal list of changed styles.
- QPtrList<KoStyleManagerTab> m_tabsList;
- QStringList m_styleOrder;
+ TQPtrList<KoParagStyle> m_origStyles; // internal list of orig styles we have modified
+ TQPtrList<KoParagStyle> m_changedStyles; // internal list of changed styles.
+ TQPtrList<KoStyleManagerTab> m_tabsList;
+ TQStringList m_styleOrder;
int numStyles;
bool noSignals;
@@ -111,46 +112,48 @@ protected slots:
void deleteStyle();
void moveUpStyle();
void moveDownStyle();
- void renameStyle(const QString &);
+ void renameStyle(const TQString &);
protected:
- KoParagStyle * style( const QString & _name );
+ KoParagStyle * style( const TQString & _name );
void addTab( KoStyleManagerTab * tab );
- QString generateUniqueName();
+ TQString generateUniqueName();
};
-class KOTEXT_EXPORT KoStyleManagerTab : public QWidget {
+class KOTEXT_EXPORT KoStyleManagerTab : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- KoStyleManagerTab(QWidget *parent) : QWidget(parent) {};
+ KoStyleManagerTab(TQWidget *tqparent) : TQWidget(tqparent) {};
/** the new style which is to be displayed */
void setStyle(KoParagStyle *style) { m_style = style; }
/** update the GUI from the current Style*/
virtual void update() = 0;
/** return the (i18n-ed) name of the tab */
- virtual QString tabName() = 0;
+ virtual TQString tabName() = 0;
/** save the GUI to the style */
virtual void save() = 0;
protected:
KoParagStyle *m_style;
};
-// A tab to edit parts of the parag-layout of the style
+// A tab to edit parts of the parag-tqlayout of the style
// Acts as a wrapper around KoParagLayoutWidget [which doesn't know about styles].
class KOTEXT_EXPORT KoStyleParagTab : public KoStyleManagerTab
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoStyleParagTab( QWidget * parent );
+ KoStyleParagTab( TQWidget * tqparent );
- // not a constructor parameter since 'this' is the parent of the widget
+ // not a constructor parameter since 'this' is the tqparent of the widget
void setWidget( KoParagLayoutWidget * widget );
virtual void update();
virtual void save();
- virtual QString tabName() { return m_widget->tabName(); }
+ virtual TQString tabName() { return m_widget->tabName(); }
protected:
- virtual void resizeEvent( QResizeEvent *e );
+ virtual void resizeEvent( TQResizeEvent *e );
private:
KoParagLayoutWidget * m_widget;
};
@@ -159,11 +162,12 @@ private:
class KOTEXT_EXPORT KoStyleFontTab : public KoStyleManagerTab
{
Q_OBJECT
+ TQ_OBJECT
public:
- KoStyleFontTab( QWidget * parent );
+ KoStyleFontTab( TQWidget * tqparent );
~KoStyleFontTab();
virtual void update();
- virtual QString tabName();
+ virtual TQString tabName();
virtual void save();
private:
KoFontTab *m_fontTab;
@@ -177,7 +181,7 @@ private:
Font simple font dia
Color simple color dia
Spacing and Indents paragraph spacing dia (KWParagDia)
-alignments KoParagDia alignment tab
+tqalignments KoParagDia tqalignment tab
borders KoParagDia borders tab
numbering KoParagDia tab numbering
tabulators KoParagDia tab tabs */
diff --git a/lib/kotext/KoTextBookmark.cpp b/lib/kotext/KoTextBookmark.cpp
index 92a5c09b..c012d35b 100644
--- a/lib/kotext/KoTextBookmark.cpp
+++ b/lib/kotext/KoTextBookmark.cpp
@@ -21,7 +21,7 @@
#include "KoTextBookmark.h"
#include "KoTextParag.h"
-KoTextBookmark::KoTextBookmark( const QString& name )
+KoTextBookmark::KoTextBookmark( const TQString& name )
: m_name( name ),
m_startParag( 0 ),
m_endParag( 0 ),
@@ -30,7 +30,7 @@ KoTextBookmark::KoTextBookmark( const QString& name )
{
}
-KoTextBookmark::KoTextBookmark( const QString &name,
+KoTextBookmark::KoTextBookmark( const TQString &name,
KoTextParag *startParag, KoTextParag *endParag,
int start, int end )
: m_name( name ),
diff --git a/lib/kotext/KoTextBookmark.h b/lib/kotext/KoTextBookmark.h
index 0be20518..eff1a353 100644
--- a/lib/kotext/KoTextBookmark.h
+++ b/lib/kotext/KoTextBookmark.h
@@ -22,9 +22,9 @@
#define KOTEXTBOOKMARK_H
#include <koffice_export.h>
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
class KoTextParag;
class KoTextDocument;
@@ -33,13 +33,13 @@ class KoTextDocument;
*/
class KOTEXT_EXPORT KoTextBookmark {
public:
- KoTextBookmark( const QString& name = QString::null /*for QValueList; remove default value when going Qt4*/ );
- KoTextBookmark( const QString& name,
+ KoTextBookmark( const TQString& name = TQString() /*for TQValueList; remove default value when going TQt4*/ );
+ KoTextBookmark( const TQString& name,
KoTextParag* startParag, KoTextParag* endParag,
int start, int end );
- QString bookmarkName() const { return m_name; }
- void setBookmarkName( const QString &name ) { m_name = name; }
+ TQString bookmarkName() const { return m_name; }
+ void setBookmarkName( const TQString &name ) { m_name = name; }
// Note: the text document always m_startParag->document(), which is also m_endParag->document().
KoTextDocument* textDocument() const;
@@ -59,29 +59,29 @@ public:
bool isSimple() const { return m_startParag == m_endParag && m_startIndex == m_endIndex; }
private:
- QString m_name;
+ TQString m_name;
KoTextParag* m_startParag;
KoTextParag* m_endParag;
int m_startIndex;
int m_endIndex;
};
-class KOTEXT_EXPORT KoTextBookmarkList : public QValueList<KoTextBookmark>
+class KOTEXT_EXPORT KoTextBookmarkList : public TQValueList<KoTextBookmark>
{
public:
- const_iterator findByName( const QString& name ) const {
+ const_iterator findByName( const TQString& name ) const {
for ( const_iterator it = begin(), itend = end(); it != itend; ++it )
if ( (*it).bookmarkName() == name )
return it;
return end();
}
- iterator findByName( const QString& name ) {
+ iterator findByName( const TQString& name ) {
for ( iterator it = begin(), itend = end(); it != itend; ++it )
if ( (*it).bookmarkName() == name )
return it;
return end();
}
- bool removeByName( const QString& name ) {
+ bool removeByName( const TQString& name ) {
for ( iterator it = begin(), itend = end(); it != itend; ++it )
if ( (*it).bookmarkName() == name ) {
remove( it );
@@ -91,8 +91,8 @@ public:
}
/// return a map of bookmarks per paragraph. Note that multi-paragraph bookmarks
/// will be present twice in the map.
- QMap<const KoTextParag*, KoTextBookmarkList> bookmarksPerParagraph() const {
- QMap<const KoTextParag*, KoTextBookmarkList> ret;
+ TQMap<const KoTextParag*, KoTextBookmarkList> bookmarksPerParagraph() const {
+ TQMap<const KoTextParag*, KoTextBookmarkList> ret;
for ( const_iterator it = begin(), itend = end(); it != itend; ++it ) {
ret[ (*it).startParag() ].append( *it );
if ( (*it).startParag() != (*it).endParag() )
diff --git a/lib/kotext/KoTextCommand.cpp b/lib/kotext/KoTextCommand.cpp
index 3a6f5ef3..68f83ad3 100644
--- a/lib/kotext/KoTextCommand.cpp
+++ b/lib/kotext/KoTextCommand.cpp
@@ -37,9 +37,9 @@ void KoTextCommand::unexecute()
}
KoTextDeleteCommand::KoTextDeleteCommand(
- KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str,
+ KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str,
const CustomItemsMap & customItemsMap,
- const QValueList<KoParagLayout> &oldParagLayouts )
+ const TQValueList<KoParagLayout> &oldParagLayouts )
: KoTextDocDeleteCommand( d, i, idx, str ),
m_oldParagLayouts( oldParagLayouts ),
m_customItemsMap( customItemsMap )
@@ -75,7 +75,7 @@ KoTextCursor * KoTextDeleteCommand::execute( KoTextCursor *c )
KoTextCursor * KoTextDeleteCommand::unexecute( KoTextCursor *c )
{
- // Let QRichText re-create the text and formatting
+ // Let TQRichText re-create the text and formatting
KoTextCursor * cr = KoTextDocDeleteCommand::unexecute(c);
KoTextParag *s = doc ? doc->paragAt( id ) : parag;
@@ -88,15 +88,15 @@ KoTextCursor * KoTextDeleteCommand::unexecute( KoTextCursor *c )
// Set any custom item that we had
m_customItemsMap.insertItems( cursor, text.size() );
- // Now restore the parag layouts (i.e. libkotext specific stuff)
- QValueList<KoParagLayout>::Iterator lit = m_oldParagLayouts.begin();
- kdDebug(32500) << "KoTextDeleteCommand::unexecute " << m_oldParagLayouts.count() << " parag layouts. First parag=" << s->paragId() << endl;
+ // Now restore the parag tqlayouts (i.e. libkotext specific stuff)
+ TQValueList<KoParagLayout>::Iterator lit = m_oldParagLayouts.begin();
+ kdDebug(32500) << "KoTextDeleteCommand::unexecute " << m_oldParagLayouts.count() << " parag tqlayouts. First parag=" << s->paragId() << endl;
Q_ASSERT( id == s->paragId() );
KoTextParag *p = s;
while ( p ) {
if ( lit != m_oldParagLayouts.end() )
{
- kdDebug(32500) << "KoTextDeleteCommand::unexecute applying paraglayout to parag " << p->paragId() << endl;
+ kdDebug(32500) << "KoTextDeleteCommand::unexecute applying paragtqlayout to parag " << p->paragId() << endl;
p->setParagLayout( *lit );
}
else
@@ -110,10 +110,10 @@ KoTextCursor * KoTextDeleteCommand::unexecute( KoTextCursor *c )
}
KoTextParagCommand::KoTextParagCommand( KoTextDocument *d, int fParag, int lParag,
- const QValueList<KoParagLayout> &oldParagLayouts,
+ const TQValueList<KoParagLayout> &oldParagLayouts,
KoParagLayout newParagLayout,
int flags,
- QStyleSheetItem::Margin margin )
+ TQStyleSheetItem::Margin margin )
: KoTextDocCommand( d ), firstParag( fParag ), lastParag( lParag ), m_oldParagLayouts( oldParagLayouts ),
m_newParagLayout( newParagLayout ), m_flags( flags ), m_margin( margin )
{
@@ -131,8 +131,8 @@ KoTextCursor * KoTextParagCommand::execute( KoTextCursor *c )
return c;
}
while ( p ) {
- if ( ( m_flags & KoParagLayout::Margins ) && m_margin != (QStyleSheetItem::Margin)-1 ) // all
- p->setMargin( static_cast<QStyleSheetItem::Margin>(m_margin), m_newParagLayout.margins[m_margin] );
+ if ( ( m_flags & KoParagLayout::Margins ) && m_margin != (TQStyleSheetItem::Margin)-1 ) // all
+ p->setMargin( static_cast<TQStyleSheetItem::Margin>(m_margin), m_newParagLayout.margins[m_margin] );
else
{
p->setParagLayout( m_newParagLayout, m_flags );
@@ -157,15 +157,15 @@ KoTextCursor * KoTextParagCommand::unexecute( KoTextCursor *c )
kdDebug(32500) << "KoTextParagCommand::unexecute paragraph " << firstParag << "not found" << endl;
return c;
}
- QValueList<KoParagLayout>::Iterator lit = m_oldParagLayouts.begin();
+ TQValueList<KoParagLayout>::Iterator lit = m_oldParagLayouts.begin();
while ( p ) {
if ( lit == m_oldParagLayouts.end() )
{
kdDebug(32500) << "KoTextParagCommand::unexecute m_oldParagLayouts not big enough!" << endl;
break;
}
- if ( m_flags & KoParagLayout::Margins && m_margin != (QStyleSheetItem::Margin)-1 ) // just one
- p->setMargin( static_cast<QStyleSheetItem::Margin>(m_margin), (*lit).margins[m_margin] );
+ if ( m_flags & KoParagLayout::Margins && m_margin != (TQStyleSheetItem::Margin)-1 ) // just one
+ p->setMargin( static_cast<TQStyleSheetItem::Margin>(m_margin), (*lit).margins[m_margin] );
else
{
p->setParagLayout( *lit, m_flags );
@@ -184,19 +184,19 @@ KoTextCursor * KoTextParagCommand::unexecute( KoTextCursor *c )
//////////
KoParagFormatCommand::KoParagFormatCommand( KoTextDocument *d, int fParag, int lParag,
- const QValueList<KoTextFormat *> &oldFormats,
+ const TQValueList<KoTextFormat *> &oldFormats,
KoTextFormat * newFormat )
: KoTextDocCommand( d ), firstParag( fParag ), lastParag( lParag ), m_oldFormats( oldFormats ),
m_newFormat( newFormat )
{
- QValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
+ TQValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
for ( ; lit != m_oldFormats.end() ; ++lit )
(*lit)->addRef();
}
KoParagFormatCommand::~KoParagFormatCommand()
{
- QValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
+ TQValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
for ( ; lit != m_oldFormats.end() ; ++lit )
(*lit)->removeRef();
}
@@ -211,7 +211,7 @@ KoTextCursor * KoParagFormatCommand::execute( KoTextCursor *c )
}
while ( p ) {
p->setFormat( m_newFormat );
- p->invalidate(0);
+ p->tqinvalidate(0);
if ( p->paragId() == lastParag )
break;
p = p->next();
@@ -228,7 +228,7 @@ KoTextCursor * KoParagFormatCommand::unexecute( KoTextCursor *c )
kdDebug(32500) << "KoParagFormatCommand::unexecute paragraph " << firstParag << "not found" << endl;
return c;
}
- QValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
+ TQValueList<KoTextFormat *>::Iterator lit = m_oldFormats.begin();
while ( p ) {
if ( lit == m_oldFormats.end() )
{
@@ -244,7 +244,7 @@ KoTextCursor * KoParagFormatCommand::unexecute( KoTextCursor *c )
return c;
}
-KoTextFormatCommand::KoTextFormatCommand(KoTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
+KoTextFormatCommand::KoTextFormatCommand(KoTextDocument *d, int sid, int sidx, int eid, int eidx, const TQMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
: KoTextDocFormatCommand(d, sid, sidx, eid, eidx, old, f, fl)
{
}
@@ -275,7 +275,7 @@ void KoTextFormatCommand::resizeCustomItems()
if ( start.parag() == end.parag() )
{
- QString text = start.parag()->string()->toString().mid( start.index(), end.index() - start.index() );
+ TQString text = start.parag()->string()->toString().mid( start.index(), end.index() - start.index() );
for ( int i = start.index(); i < end.index(); ++i )
{
if( start.parag()->at(i)->isCustom())
@@ -287,7 +287,7 @@ void KoTextFormatCommand::resizeCustomItems()
else
{
int i;
- QString text = start.parag()->string()->toString().mid( start.index(), start.parag()->length() - 1 - start.index() );
+ TQString text = start.parag()->string()->toString().mid( start.index(), start.parag()->length() - 1 - start.index() );
for ( i = start.index(); i < start.parag()->length(); ++i )
if( start.parag()->at(i)->isCustom())
{
@@ -360,7 +360,7 @@ void KoChangeVariableSubType::unexecute()
m_var->recalcAndRepaint();
}
-QString KoChangeVariableSubType::name() const
+TQString KoChangeVariableSubType::name() const
{
return i18n( "Change Variable Subtype" );
}
@@ -368,7 +368,7 @@ QString KoChangeVariableSubType::name() const
////
KoChangeVariableFormatProperties::KoChangeVariableFormatProperties(
- const QString &_oldValue, const QString &_newValue,
+ const TQString &_oldValue, const TQString &_newValue,
KoVariable *var)
: KCommand(),
m_newValue(_newValue),
@@ -395,7 +395,7 @@ void KoChangeVariableFormatProperties::unexecute()
m_var->recalcAndRepaint();
}
-QString KoChangeVariableFormatProperties::name() const
+TQString KoChangeVariableFormatProperties::name() const
{
return i18n( "Change Variable Format" );
}
diff --git a/lib/kotext/KoTextCommand.h b/lib/kotext/KoTextCommand.h
index 352fc2fb..c9b4c3b6 100644
--- a/lib/kotext/KoTextCommand.h
+++ b/lib/kotext/KoTextCommand.h
@@ -38,7 +38,7 @@ class KoVariable;
class KOTEXT_EXPORT KoTextCommand : public KNamedCommand
{
public:
- KoTextCommand( KoTextObject * textobj, const QString & name ) :
+ KoTextCommand( KoTextObject * textobj, const TQString & name ) :
KNamedCommand( name ), m_textobj(textobj) {}
~KoTextCommand() {}
@@ -55,13 +55,13 @@ protected:
class KOTEXT_EXPORT KoTextDeleteCommand : public KoTextDocDeleteCommand
{
public:
- KoTextDeleteCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str,
+ KoTextDeleteCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str,
const CustomItemsMap & customItemsMap,
- const QValueList<KoParagLayout> & oldParagLayouts );
+ const TQValueList<KoParagLayout> & oldParagLayouts );
KoTextCursor *execute( KoTextCursor *c );
KoTextCursor *unexecute( KoTextCursor *c );
protected:
- QValueList<KoParagLayout> m_oldParagLayouts;
+ TQValueList<KoParagLayout> m_oldParagLayouts;
CustomItemsMap m_customItemsMap;
};
@@ -71,9 +71,9 @@ protected:
class KoTextInsertCommand : public KoTextDeleteCommand
{
public:
- KoTextInsertCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str,
+ KoTextInsertCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str,
const CustomItemsMap & customItemsMap,
- const QValueList<KoParagLayout> &oldParagLayouts )
+ const TQValueList<KoParagLayout> &oldParagLayouts )
: KoTextDeleteCommand( d, i, idx, str, customItemsMap, oldParagLayouts ) {}
Commands type() const { return Insert; };
KoTextCursor *execute( KoTextCursor *c ) { return KoTextDeleteCommand::unexecute( c ); }
@@ -87,16 +87,16 @@ class KOTEXT_EXPORT KoTextParagCommand : public KoTextDocCommand
{
public:
KoTextParagCommand( KoTextDocument *d, int fParag, int lParag,
- const QValueList<KoParagLayout> &oldParagLayouts,
+ const TQValueList<KoParagLayout> &oldParagLayouts,
KoParagLayout newParagLayout,
int /*KoParagLayout::Flags*/ flags,
- QStyleSheetItem::Margin margin = (QStyleSheetItem::Margin)-1 );
+ TQStyleSheetItem::Margin margin = (TQStyleSheetItem::Margin)-1 );
// margin is only meaningful if flags==Margins only. -1 means all.
KoTextCursor *execute( KoTextCursor *c );
KoTextCursor *unexecute( KoTextCursor *c );
protected:
int firstParag, lastParag;
- QValueList<KoParagLayout> m_oldParagLayouts;
+ TQValueList<KoParagLayout> m_oldParagLayouts;
KoParagLayout m_newParagLayout;
int m_flags;
int m_margin;
@@ -111,14 +111,14 @@ class KoParagFormatCommand : public KoTextDocCommand
{
public:
KoParagFormatCommand( KoTextDocument *d, int fParag, int lParag,
- const QValueList<KoTextFormat *> &oldFormats,
+ const TQValueList<KoTextFormat *> &oldFormats,
KoTextFormat * newFormat );
~KoParagFormatCommand();
KoTextCursor *execute( KoTextCursor *c );
KoTextCursor *unexecute( KoTextCursor *c );
protected:
int firstParag, lastParag;
- QValueList<KoTextFormat *> m_oldFormats;
+ TQValueList<KoTextFormat *> m_oldFormats;
KoTextFormat * m_newFormat;
};
@@ -128,7 +128,7 @@ protected:
class KoTextFormatCommand : public KoTextDocFormatCommand
{
public:
- KoTextFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl );
+ KoTextFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx, const TQMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl );
virtual ~KoTextFormatCommand();
KoTextCursor *execute( KoTextCursor *c );
@@ -146,7 +146,7 @@ public:
KoChangeVariableSubType( short int _oldValue, short int _newValue, KoVariable *var );
void execute();
void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
short int m_newValue;
short int m_oldValue;
@@ -160,13 +160,13 @@ private:
class KoChangeVariableFormatProperties : public KCommand
{
public:
- KoChangeVariableFormatProperties( const QString &_oldValue, const QString &_newValue, KoVariable *var);
- virtual QString name() const;
+ KoChangeVariableFormatProperties( const TQString &_oldValue, const TQString &_newValue, KoVariable *var);
+ virtual TQString name() const;
void execute();
void unexecute();
private:
- QString m_newValue;
- QString m_oldValue;
+ TQString m_newValue;
+ TQString m_oldValue;
KoVariable *m_var;
};
diff --git a/lib/kotext/KoTextCustomItem.cpp b/lib/kotext/KoTextCustomItem.cpp
index 115e8881..e90eae47 100644
--- a/lib/kotext/KoTextCustomItem.cpp
+++ b/lib/kotext/KoTextCustomItem.cpp
@@ -26,15 +26,15 @@
#include <kcommand.h>
-//void KoTextCustomItem::setPainter( QPainter*, bool adjust ){ if ( adjust ) width = 0; }
-//void KoTextCustomItem::setPainter( QPainter*, bool ){ resize(); } // changed for kotext
+//void KoTextCustomItem::setPainter( TQPainter*, bool adjust ){ if ( adjust ) width = 0; }
+//void KoTextCustomItem::setPainter( TQPainter*, bool ){ resize(); } // changed for kotext
bool KoTextCustomItem::enter( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, bool atEnd )
{
doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; Q_UNUSED( atEnd ) return TRUE;
}
-bool KoTextCustomItem::enterAt( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const QPoint & )
+bool KoTextCustomItem::enterAt( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const TQPoint & )
{
doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
}
@@ -70,7 +70,7 @@ KoTextFormat * KoTextCustomItem::format() const
}
-void KoTextCustomItem::draw(QPainter* p, int _x, int _y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected )
+void KoTextCustomItem::draw(TQPainter* p, int _x, int _y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected )
{
KoTextZoomHandler *zh=textDocument()->paintingZoomHandler();
//kdDebug(32500)<<" x :"<<_x<<" y :"<<_y<<" cx :"<<cx<<" cy :"<<cy<<" ch :"<<ch<<" cw :"<<cw<<endl;
@@ -81,20 +81,20 @@ void KoTextCustomItem::draw(QPainter* p, int _x, int _y, int cx, int cy, int cw,
KoTextStringChar* stringChar = paragraph()->at( charIndex );
// Convert x, y, cx, cy, cw and ch from Layout Units to pixels.
- int x = zh->layoutUnitToPixelX(_x) /*+ stringChar->pixelxadj*/;
- int y = zh->layoutUnitToPixelY(_y);
- cx = zh->layoutUnitToPixelX(cx);
- cy = zh->layoutUnitToPixelY(cy);
- cw = zh->layoutUnitToPixelX(_x,cw);
- ch = zh->layoutUnitToPixelY(_y,ch);
- int wpix = zh->layoutUnitToPixelX(_x,width);
- int hpix = zh->layoutUnitToPixelX(_y,height);
+ int x = zh->tqlayoutUnitToPixelX(_x) /*+ stringChar->pixelxadj*/;
+ int y = zh->tqlayoutUnitToPixelY(_y);
+ cx = zh->tqlayoutUnitToPixelX(cx);
+ cy = zh->tqlayoutUnitToPixelY(cy);
+ cw = zh->tqlayoutUnitToPixelX(_x,cw);
+ ch = zh->tqlayoutUnitToPixelY(_y,ch);
+ int wpix = zh->tqlayoutUnitToPixelX(_x,width);
+ int hpix = zh->tqlayoutUnitToPixelX(_y,height);
//kdDebug(32500)<<"After x :"<<x<<" y :"<<y<<" cx :"<<cx<<" cy :"<<cy<<" ch :"<<ch<<" cw :"<<cw<<endl;
- int ascentpix = zh->layoutUnitToPixelY( _y, ascent() );
+ int ascentpix = zh->tqlayoutUnitToPixelY( _y, ascent() );
KoTextFormat * fmt = stringChar->format();
- //bool forPrint = ( p->device()->devType() == QInternal::Printer );
+ //bool forPrint = ( p->device()->devType() == TQInternal::Printer );
p->setFont( fmt->screenFont( zh ) );
int offset=0;
@@ -125,7 +125,7 @@ void CustomItemsMap::insertItems( const KoTextCursor & startCursor, int size )
KoTextCursor cursor( startCursor );
for ( int i = 0; i < size; ++i )
{
- CustomItemsMap::Iterator it = find( i );
+ CustomItemsMap::Iterator it = tqfind( i );
if ( it != end() )
{
kdDebug(32500) << "CustomItemsMap::insertItems setting custom item " << it.data() << endl;
diff --git a/lib/kotext/KoTextCustomItem.h b/lib/kotext/KoTextCustomItem.h
index 4d081f2d..ff7e4ffc 100644
--- a/lib/kotext/KoTextCustomItem.h
+++ b/lib/kotext/KoTextCustomItem.h
@@ -1,7 +1,7 @@
// -*- c++ -*-
/* This file is part of the KDE project
- Original QTextCustomItem is
+ Original TQTextCustomItem is
Copyright (C) 1999-2000 Trolltech AS. All rights reserved.
KoText modifications
Copyright (C) 2001-2005 David Faure <faure@kde.org>
@@ -36,7 +36,7 @@ class KOTEXT_EXPORT KoTextCustomItem
public:
KoTextCustomItem( KoTextDocument *p );
virtual ~KoTextCustomItem();
- virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) /* = 0*/;
+ virtual void draw(TQPainter* p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected ) /* = 0*/;
// Called after the item's paragraph has been formatted
virtual void finalize() {}
@@ -48,7 +48,7 @@ public:
// Called when the format of the character is being changed, see KoTextStringChar::setFormat
virtual void setFormat( KoTextFormat * ) { }
- //virtual void setPainter( QPainter*, bool adjust );
+ //virtual void setPainter( TQPainter*, bool adjust );
enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight };
virtual Placement placement() const { return PlaceInline; }
@@ -57,22 +57,22 @@ public:
virtual bool ownLine() const { return FALSE; }
// Called for "ownline" items
virtual void resize( int nwidth ) { width = nwidth; }
- virtual void invalidate() {};
+ virtual void tqinvalidate() {};
virtual bool isNested() const { return FALSE; }
virtual int minimumWidth() const { return 0; }
virtual int widthHint() const { return 0; }
virtual int ascent() const { return height; }
- virtual QString richText() const { return QString::null; }
+ virtual TQString richText() const { return TQString(); }
int width;
int height;
- QRect geometry() const { return QRect( xpos, ypos, width, height ); }
+ TQRect tqgeometry() const { return TQRect( xpos, ypos, width, height ); }
virtual bool enter( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
- virtual bool enterAt( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const QPoint & );
+ virtual bool enterAt( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy, const TQPoint & );
virtual bool next( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
virtual bool prev( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
virtual bool down( KoTextCursor *, KoTextDocument *&doc, KoTextParag *&parag, int &idx, int &ox, int &oy );
@@ -83,12 +83,12 @@ public:
virtual void pageBreak( int /*y*/, KoTextFlow* /*flow*/ ) {}
- KoTextDocument *parent;
+ KoTextDocument *tqparent;
/** The text document in which this customitem is */
- KoTextDocument * textDocument() const { return parent; }
+ KoTextDocument * textDocument() const { return tqparent; }
/** When the user deletes a custom item, it isn't destroyed but
* moved into the undo/redo history - setDeleted( true )
@@ -106,7 +106,7 @@ public:
virtual KCommand * deleteCommand() { return 0L; }
/** Save to XML */
- virtual void save( QDomElement& formatElem ) = 0;
+ virtual void save( TQDomElement& formatElem ) = 0;
/** Save to Oasis XML */
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const = 0;
/** Return type of custom item. See DTD for VARIABLE.id docu. */
@@ -133,7 +133,7 @@ public:
/**
* All coordinates are in pixels.
*/
- virtual void drawCustomItem(QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected, int offset, bool drawingShadow) = 0;
+ virtual void drawCustomItem(TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow) = 0;
protected:
bool m_deleted;
diff --git a/lib/kotext/KoTextDocument.cpp b/lib/kotext/KoTextDocument.cpp
index 4e0f7dc9..2eb2dd00 100644
--- a/lib/kotext/KoTextDocument.cpp
+++ b/lib/kotext/KoTextDocument.cpp
@@ -31,20 +31,20 @@
#include <KoDom.h>
#include <kdebug.h>
#include <kdeversion.h>
-#include <qapplication.h>
+#include <tqapplication.h>
#include <assert.h>
//#define DEBUG_PAINTING
//// Note that many methods are implemented in korichtext.cpp
-//// Those are the ones that come from Qt, and that mostly work :)
+//// Those are the ones that come from TQt, and that mostly work :)
KoTextDocument::KoTextDocument( KoTextZoomHandler *zoomHandler, KoTextFormatCollection *fc,
KoTextFormatter *formatter, bool createInitialParag )
: m_zoomHandler( zoomHandler ),
m_bDestroying( false ),
-#ifdef QTEXTTABLE_AVAILABLE
- par( 0L /*we don't use parent documents */ ),
+#ifdef TQTEXTTABLE_AVAILABLE
+ par( 0L /*we don't use tqparent documents */ ),
tc( 0 ),
#endif
tArray( 0 ), tStopWidth( 0 )
@@ -74,7 +74,7 @@ void KoTextDocument::init()
fParag = 0;
m_pageBreakEnabled = false;
//minw = 0;
- align = Qt::AlignAuto;
+ align = TQt::AlignAuto;
nSelections = 2;
underlLinks = TRUE;
@@ -98,10 +98,10 @@ void KoTextDocument::init()
flow_ = new KoTextFlow;
//flow_->setWidth( cw );
- leftmargin = 0; // 4 in QRT
- rightmargin = 0; // 4 in QRT
+ leftmargin = 0; // 4 in TQRT
+ rightmargin = 0; // 4 in TQRT
- selectionColors[ Standard ] = QApplication::palette().color( QPalette::Active, QColorGroup::Highlight );
+ selectionColors[ Standard ] = TQApplication::palette().color( TQPalette::Active, TQColorGroup::Highlight );
selectionText[ Standard ] = TRUE;
assert( Standard < nSelections );
selectionText[ InputMethodPreedit ] = FALSE;
@@ -154,13 +154,13 @@ int KoTextDocument::widthUsed() const
KoTextParag *p = fParag;
int w = 0;
while ( p ) {
- int a = p->alignment();
- p->setAlignment( Qt::AlignLeft );
- p->invalidate( 0 );
+ int a = p->tqalignment();
+ p->tqsetAlignment( TQt::AlignLeft );
+ p->tqinvalidate( 0 );
p->format();
- w = QMAX( w, p->rect().width() );
- p->setAlignment( a );
- p->invalidate( 0 );
+ w = TQMAX( w, p->rect().width() );
+ p->tqsetAlignment( a );
+ p->tqinvalidate( 0 );
p = p->next();
}
return w;
@@ -173,7 +173,7 @@ int KoTextDocument::height() const
if ( lParag )
h = lParag->rect().top() + lParag->rect().height() + 1;
//int fh = flow_->boundingRect().height();
- //return QMAX( h, fh );
+ //return TQMAX( h, fh );
return h;
}
@@ -183,7 +183,7 @@ KoTextParag *KoTextDocument::createParag( KoTextDocument *d, KoTextParag *pr, Ko
return new KoTextParag( d, pr, nx, updateIds );
}
-void KoTextDocument::setPlainText( const QString &text )
+void KoTextDocument::setPlainText( const TQString &text )
{
clear();
//preferRichText = FALSE;
@@ -191,12 +191,12 @@ void KoTextDocument::setPlainText( const QString &text )
//oText = text;
int lastNl = 0;
- int nl = text.find( '\n' );
+ int nl = text.tqfind( '\n' );
if ( nl == -1 ) {
lParag = createParag( this, lParag, 0 );
if ( !fParag )
fParag = lParag;
- QString s = text;
+ TQString s = text;
if ( !s.isEmpty() ) {
if ( s[ (int)s.length() - 1 ] == '\r' )
s.remove( s.length() - 1, 1 );
@@ -207,7 +207,7 @@ void KoTextDocument::setPlainText( const QString &text )
lParag = createParag( this, lParag, 0 );
if ( !fParag )
fParag = lParag;
- QString s = text.mid( lastNl, nl - lastNl );
+ TQString s = text.mid( lastNl, nl - lastNl );
if ( !s.isEmpty() ) {
if ( s[ (int)s.length() - 1 ] == '\r' )
s.remove( s.length() - 1, 1 );
@@ -216,7 +216,7 @@ void KoTextDocument::setPlainText( const QString &text )
if ( nl == 0xffffff )
break;
lastNl = nl + 1;
- nl = text.find( '\n', nl + 1 );
+ nl = text.tqfind( '\n', nl + 1 );
if ( nl == -1 )
nl = 0xffffff;
}
@@ -225,16 +225,16 @@ void KoTextDocument::setPlainText( const QString &text )
lParag = fParag = createParag( this, 0, 0 );
}
-void KoTextDocument::setText( const QString &text, const QString & /*context*/ )
+void KoTextDocument::setText( const TQString &text, const TQString & /*context*/ )
{
selections.clear();
setPlainText( text );
}
-QString KoTextDocument::plainText() const
+TQString KoTextDocument::plainText() const
{
- QString buffer;
- QString s;
+ TQString buffer;
+ TQString s;
KoTextParag *p = fParag;
while ( p ) {
s = p->string()->toString();
@@ -247,18 +247,18 @@ QString KoTextDocument::plainText() const
return buffer;
}
-void KoTextDocument::invalidate()
+void KoTextDocument::tqinvalidate()
{
KoTextParag *s = fParag;
while ( s ) {
- s->invalidate( 0 );
+ s->tqinvalidate( 0 );
s = s->next();
}
}
void KoTextDocument::informParagraphDeleted( KoTextParag* parag )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.begin();
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.begin();
for ( ; it != selections.end(); ++it )
{
if ( (*it).startCursor.parag() == parag ) {
@@ -283,7 +283,7 @@ void KoTextDocument::informParagraphDeleted( KoTextParag* parag )
void KoTextDocument::selectionStart( int id, int &paragId, int &index )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return;
KoTextDocumentSelection &sel = *it;
@@ -293,7 +293,7 @@ void KoTextDocument::selectionStart( int id, int &paragId, int &index )
KoTextCursor KoTextDocument::selectionStartCursor( int id)
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return KoTextCursor( this );
KoTextDocumentSelection &sel = *it;
@@ -304,7 +304,7 @@ KoTextCursor KoTextDocument::selectionStartCursor( int id)
KoTextCursor KoTextDocument::selectionEndCursor( int id)
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return KoTextCursor( this );
KoTextDocumentSelection &sel = *it;
@@ -315,7 +315,7 @@ KoTextCursor KoTextDocument::selectionEndCursor( int id)
void KoTextDocument::selectionEnd( int id, int &paragId, int &index )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return;
KoTextDocumentSelection &sel = *it;
@@ -325,7 +325,7 @@ void KoTextDocument::selectionEnd( int id, int &paragId, int &index )
bool KoTextDocument::isSelectionSwapped( int id )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return false;
KoTextDocumentSelection &sel = *it;
@@ -334,7 +334,7 @@ bool KoTextDocument::isSelectionSwapped( int id )
KoTextParag *KoTextDocument::selectionStart( int id )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return 0;
KoTextDocumentSelection &sel = *it;
@@ -345,7 +345,7 @@ KoTextParag *KoTextDocument::selectionStart( int id )
KoTextParag *KoTextDocument::selectionEnd( int id )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return 0;
KoTextDocumentSelection &sel = *it;
@@ -356,7 +356,7 @@ KoTextParag *KoTextDocument::selectionEnd( int id )
void KoTextDocument::addSelection( int id )
{
- nSelections = QMAX( nSelections, id + 1 );
+ nSelections = TQMAX( nSelections, id + 1 );
}
static void setSelectionEndHelper( int id, KoTextDocumentSelection &sel, KoTextCursor &start, KoTextCursor &end )
@@ -374,7 +374,7 @@ static void setSelectionEndHelper( int id, KoTextDocumentSelection &sel, KoTextC
c1.parag()->setSelection( id, c1.index(), c1.parag()->length() - 1 );
c2.parag()->setSelection( id, 0, c2.index() );
} else {
- c1.parag()->setSelection( id, QMIN( c1.index(), c2.index() ), QMAX( c1.index(), c2.index() ) );
+ c1.parag()->setSelection( id, TQMIN( c1.index(), c2.index() ), TQMAX( c1.index(), c2.index() ) );
}
sel.startCursor = start;
@@ -385,7 +385,7 @@ static void setSelectionEndHelper( int id, KoTextDocumentSelection &sel, KoTextC
bool KoTextDocument::setSelectionEnd( int id, KoTextCursor *cursor )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return FALSE;
KoTextDocumentSelection &sel = *it;
@@ -459,7 +459,7 @@ bool KoTextDocument::setSelectionEnd( int id, KoTextCursor *cursor )
c.parag()->removeSelection( id );
if ( inSelection ) {
if ( c.parag() == start.parag() && start.parag() == end.parag() ) {
- c.parag()->setSelection( id, QMIN( start.index(), end.index() ), QMAX( start.index(), end.index() ) );
+ c.parag()->setSelection( id, TQMIN( start.index(), end.index() ), TQMAX( start.index(), end.index() ) );
} else if ( c.parag() == start.parag() && !hadEndParag ) {
c.parag()->setSelection( id, start.index(), c.parag()->length() - 1 );
} else if ( c.parag() == end.parag() && !hadStartParag ) {
@@ -514,11 +514,11 @@ void KoTextDocument::selectAll( int id )
KoTextParag *p = fParag;
while ( p ) {
p->setSelection( id, 0, p->length() - 1 );
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
for ( int i = 0; i < (int)p->length(); ++i ) {
if ( p->at( i )->isCustom() && p->at( i )->customItem()->isNested() ) {
KoTextTable *t = (KoTextTable*)p->at( i )->customItem();
- QPtrList<KoTextTableCell> tableCells = t->tableCells();
+ TQPtrList<KoTextTableCell> tableCells = t->tableCells();
for ( KoTextTableCell *c = tableCells.first(); c; c = tableCells.next() )
c->richText()->selectAll( id );
}
@@ -532,7 +532,7 @@ void KoTextDocument::selectAll( int id )
bool KoTextDocument::removeSelection( int id )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return FALSE;
@@ -581,12 +581,12 @@ bool KoTextDocument::removeSelection( int id )
return TRUE;
}
-QString KoTextDocument::selectedText( int id, bool withCustom ) const
+TQString KoTextDocument::selectedText( int id, bool withCustom ) const
{
// ######## TODO: look at textFormat() and return rich text or plain text (like the text() method!)
- QMap<int, KoTextDocumentSelection>::ConstIterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::ConstIterator it = selections.tqfind( id );
if ( it == selections.end() )
- return QString::null;
+ return TQString();
KoTextDocumentSelection sel = *it;
@@ -599,21 +599,21 @@ QString KoTextDocument::selectedText( int id, bool withCustom ) const
}
if ( c1.parag() == c2.parag() ) {
- QString s;
+ TQString s;
KoTextParag *p = c1.parag();
int end = c2.index();
- if ( p->at( QMAX( 0, end - 1 ) )->isCustom() )
+ if ( p->at( TQMAX( 0, end - 1 ) )->isCustom() )
++end;
if ( !withCustom || !p->customItems() ) {
s += p->string()->toString().mid( c1.index(), end - c1.index() );
} else {
for ( int i = c1.index(); i < end; ++i ) {
if ( p->at( i )->isCustom() ) {
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
if ( p->at( i )->customItem()->isNested() ) {
s += "\n";
KoTextTable *t = (KoTextTable*)p->at( i )->customItem();
- QPtrList<KoTextTableCell> cells = t->tableCells();
+ TQPtrList<KoTextTableCell> cells = t->tableCells();
for ( KoTextTableCell *c = cells.first(); c; c = cells.next() )
s += c->richText()->plainText() + "\n";
s += "\n";
@@ -628,12 +628,12 @@ QString KoTextDocument::selectedText( int id, bool withCustom ) const
return s;
}
- QString s;
+ TQString s;
KoTextParag *p = c1.parag();
int start = c1.index();
while ( p ) {
int end = p == c2.parag() ? c2.index() : p->length() - 1;
- if ( p == c2.parag() && p->at( QMAX( 0, end - 1 ) )->isCustom() )
+ if ( p == c2.parag() && p->at( TQMAX( 0, end - 1 ) )->isCustom() )
++end;
if ( !withCustom || !p->customItems() ) {
s += p->string()->toString().mid( start, end - start );
@@ -642,11 +642,11 @@ QString KoTextDocument::selectedText( int id, bool withCustom ) const
} else {
for ( int i = start; i < end; ++i ) {
if ( p->at( i )->isCustom() ) {
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
if ( p->at( i )->customItem()->isNested() ) {
s += "\n";
KoTextTable *t = (KoTextTable*)p->at( i )->customItem();
- QPtrList<KoTextTableCell> cells = t->tableCells();
+ TQPtrList<KoTextTableCell> cells = t->tableCells();
for ( KoTextTableCell *c = cells.first(); c; c = cells.next() )
s += c->richText()->plainText() + "\n";
s += "\n";
@@ -666,11 +666,11 @@ QString KoTextDocument::selectedText( int id, bool withCustom ) const
return s;
}
-QString KoTextDocument::copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId )
+TQString KoTextDocument::copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId )
{
KoTextCursor c1 = selectionStartCursor( selectionId );
KoTextCursor c2 = selectionEndCursor( selectionId );
- QString text;
+ TQString text;
if ( c1.parag() == c2.parag() )
{
text = c1.parag()->toString( c1.index(), c2.index() - c1.index() );
@@ -696,7 +696,7 @@ QString KoTextDocument::copySelection( KoXmlWriter& writer, KoSavingContext& con
void KoTextDocument::setFormat( int id, const KoTextFormat *f, int flags )
{
- QMap<int, KoTextDocumentSelection>::ConstIterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::ConstIterator it = selections.tqfind( id );
if ( it == selections.end() )
return;
@@ -725,17 +725,17 @@ void KoTextDocument::setFormat( int id, const KoTextFormat *f, int flags )
/*void KoTextDocument::copySelectedText( int id )
{
-#ifndef QT_NO_CLIPBOARD
+#ifndef TQT_NO_CLIPBOARD
if ( !hasSelection( id ) )
return;
- QApplication::clipboard()->setText( selectedText( id ) );
+ TQApplication::tqclipboard()->setText( selectedText( id ) );
#endif
}*/
void KoTextDocument::removeSelectedText( int id, KoTextCursor *cursor )
{
- QMap<int, KoTextDocumentSelection>::Iterator it = selections.find( id );
+ TQMap<int, KoTextDocumentSelection>::Iterator it = selections.tqfind( id );
if ( it == selections.end() )
return;
@@ -756,7 +756,7 @@ void KoTextDocument::removeSelectedText( int id, KoTextCursor *cursor )
return;
}
- // ## Qt has a strange setValid/isValid on QTextCursor, only used in the few lines below !?!?
+ // ## TQt has a strange setValid/isValid on TQTextCursor, only used in the few lines below !?!?
bool valid = true;
if ( c1.parag() == fParag && c1.index() == 0 &&
c2.parag() == lParag && c2.index() == lParag->length() - 1 )
@@ -785,9 +785,9 @@ void KoTextDocument::removeSelectedText( int id, KoTextCursor *cursor )
p->move( dy );
//// kotext
if ( p->paragLayout().counter )
- p->paragLayout().counter->invalidate();
+ p->paragLayout().counter->tqinvalidate();
////
- p->invalidate( 0 );
+ p->tqinvalidate( 0 );
//p->setEndState( -1 );
p = p->next();
}
@@ -813,7 +813,7 @@ KoTextCursor *KoTextDocument::redo( KoTextCursor *c )
return commandHistory->redo( c );
}
-bool KoTextDocument::find( const QString &expr, bool cs, bool wo, bool forward,
+bool KoTextDocument::tqfind( const TQString &expr, bool cs, bool wo, bool forward,
int *parag, int *index, KoTextCursor *cursor )
{
KoTextParag *p = forward ? fParag : lParag;
@@ -824,7 +824,7 @@ bool KoTextDocument::find( const QString &expr, bool cs, bool wo, bool forward,
bool first = TRUE;
while ( p ) {
- QString s = p->string()->toString();
+ TQString s = p->string()->toString();
s.remove( s.length() - 1, 1 ); // get rid of trailing space
int start = forward ? 0 : s.length() - 1;
if ( first && index )
@@ -842,7 +842,7 @@ bool KoTextDocument::find( const QString &expr, bool cs, bool wo, bool forward,
first = FALSE;
for ( ;; ) {
- int res = forward ? s.find( expr, start, cs ) : s.findRev( expr, start, cs );
+ int res = forward ? s.tqfind( expr, start, cs ) : s.tqfindRev( expr, start, cs );
if ( res == -1 )
break;
@@ -881,9 +881,9 @@ bool KoTextDocument::find( const QString &expr, bool cs, bool wo, bool forward,
return FALSE;
}
-bool KoTextDocument::inSelection( int selId, const QPoint &pos ) const
+bool KoTextDocument::inSelection( int selId, const TQPoint &pos ) const
{
- QMap<int, KoTextDocumentSelection>::ConstIterator it = selections.find( selId );
+ TQMap<int, KoTextDocumentSelection>::ConstIterator it = selections.tqfind( selId );
if ( it == selections.end() )
return FALSE;
@@ -900,7 +900,7 @@ bool KoTextDocument::inSelection( int selId, const QPoint &pos ) const
KoTextParag *p = startParag;
while ( p ) {
- if ( p->rect().contains( pos ) ) {
+ if ( p->rect().tqcontains( pos ) ) {
bool inSel = FALSE;
int selStart = p->selectionStart( selId );
int selEnd = p->selectionEnd( selId );
@@ -912,8 +912,8 @@ bool KoTextDocument::inSelection( int selId, const QPoint &pos ) const
if ( i == selEnd )
break;
if ( p->at( i )->lineStart ) {
- y = (*p->lineStarts.find( i ))->y;
- h = (*p->lineStarts.find( i ))->h;
+ y = (*p->lineStarts.tqfind( i ))->y;
+ h = (*p->lineStarts.tqfind( i ))->h;
}
if ( pos.y() - p->rect().y() >= y && pos.y() - p->rect().y() <= y + h ) {
if ( inSel && pos.x() >= p->at( i )->x &&
@@ -932,17 +932,17 @@ bool KoTextDocument::inSelection( int selId, const QPoint &pos ) const
return FALSE;
}
-QPixmap *KoTextDocument::bufferPixmap( const QSize &s )
+TQPixmap *KoTextDocument::bufferPixmap( const TQSize &s )
{
if ( !buf_pixmap ) {
- int w = QABS( s.width() );
- int h = QABS( s.height() );
- buf_pixmap = new QPixmap( w, h );
+ int w = TQABS( s.width() );
+ int h = TQABS( s.height() );
+ buf_pixmap = new TQPixmap( w, h );
} else {
if ( buf_pixmap->width() < s.width() ||
buf_pixmap->height() < s.height() ) {
- buf_pixmap->resize( QMAX( s.width(), buf_pixmap->width() ),
- QMAX( s.height(), buf_pixmap->height() ) );
+ buf_pixmap->resize( TQMAX( s.width(), buf_pixmap->width() ),
+ TQMAX( s.height(), buf_pixmap->height() ) );
}
}
@@ -989,7 +989,7 @@ bool KoTextDocument::visitSelection( int selectionId, KoParagVisitor* visitor, b
bool KoTextDocument::hasSelection( int id, bool visible ) const
{
- return ( selections.find( id ) != selections.end() &&
+ return ( selections.tqfind( id ) != selections.end() &&
( !visible ||
( (KoTextDocument*)this )->selectionStartCursor( id ) !=
( (KoTextDocument*)this )->selectionEndCursor( id ) ) );
@@ -1059,12 +1059,12 @@ bool KoTextDocument::visitFromTo( KoTextParag *firstParag, int firstIndex, KoTex
}
}
-static bool is_printer( QPainter *p )
+static bool is_printer( TQPainter *p )
{
- return p && p->device() && p->device()->devType() == QInternal::Printer;
+ return p && p->device() && p->device()->devType() == TQInternal::Printer;
}
-KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
+KoTextParag *KoTextDocument::drawWYSIWYG( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler, bool onlyChanged,
bool drawCursor, KoTextCursor *cursor,
bool resetChanged, uint drawingFlags )
@@ -1079,7 +1079,7 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
// If someone understand doLayout() please tell me (David)
/*if ( isWithoutDoubleBuffer() || par && par->withoutDoubleBuffer ) { */
//setWithoutDoubleBuffer( TRUE );
- QRect crect( cx, cy, cw, ch );
+ TQRect crect( cx, cy, cw, ch );
drawWithoutDoubleBuffer( p, crect, cg, zoomHandler );
return 0;
}
@@ -1091,27 +1091,27 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
KoTextParag *lastFormatted = 0;
KoTextParag *parag = firstParag();
- QPixmap *doubleBuffer = 0;
- QPainter painter;
+ TQPixmap *doubleBuffer = 0;
+ TQPainter painter;
// All the coordinates in this method are in view pixels
- QRect crect( cx, cy, cw, ch );
+ TQRect crect( cx, cy, cw, ch );
Q_ASSERT( ch > 0 );
#ifdef DEBUG_PAINTING
kdDebug(32500) << "\nKoTextDocument::drawWYSIWYG crect=" << crect << endl;
#endif
// Space above first parag
- QRect pixelRect = parag->pixelRect( zoomHandler );
+ TQRect pixelRect = parag->pixelRect( zoomHandler );
if ( isPageBreakEnabled() && parag && cy <= pixelRect.y() && pixelRect.y() > 0 ) {
- QRect r( 0, 0,
- zoomHandler->layoutUnitToPixelX( parag->document()->x() + parag->document()->width() ),
+ TQRect r( 0, 0,
+ zoomHandler->tqlayoutUnitToPixelX( parag->document()->x() + parag->document()->width() ),
pixelRect.y() );
r &= crect;
if ( !r.isEmpty() ) {
#ifdef DEBUG_PAINTING
kdDebug(32500) << " drawWYSIWYG: space above first parag: " << r << " (pixels)" << endl;
#endif
- p->fillRect( r, cg.brush( QColorGroup::Base ) );
+ p->fillRect( r, cg.brush( TQColorGroup::Base ) );
}
}
@@ -1120,7 +1120,7 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
if ( !parag->isValid() )
parag->format();
- QRect ir = parag->pixelRect( zoomHandler );
+ TQRect ir = parag->pixelRect( zoomHandler );
#ifdef DEBUG_PAINTING
kdDebug(32500) << " drawWYSIWYG: ir=" << ir << endl;
#endif
@@ -1130,8 +1130,8 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
// Test ir.y+ir.height, which is the first pixel _under_ the parag
// (as opposed ir.bottom() which is the last pixel of the parag)
if ( ir.y() + ir.height() < nexty ) {
- QRect r( 0, ir.y() + ir.height(),
- zoomHandler->layoutUnitToPixelX( parag->document()->x() + parag->document()->width() ),
+ TQRect r( 0, ir.y() + ir.height(),
+ zoomHandler->tqlayoutUnitToPixelX( parag->document()->x() + parag->document()->width() ),
nexty - ( ir.y() + ir.height() ) );
r &= crect;
if ( !r.isEmpty() )
@@ -1139,16 +1139,16 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
#ifdef DEBUG_PAINTING
kdDebug(32500) << " drawWYSIWYG: space between parag " << parag->paragId() << " and " << parag->next()->paragId() << " : " << r << " (pixels)" << endl;
#endif
- p->fillRect( r, cg.brush( QColorGroup::Base ) );
+ p->fillRect( r, cg.brush( TQColorGroup::Base ) );
}
}
}
if ( !ir.intersects( crect ) ) {
// Paragraph is not in the crect - but let's check if the area on its right is.
- ir.setWidth( zoomHandler->layoutUnitToPixelX( parag->document()->width() ) );
+ ir.setWidth( zoomHandler->tqlayoutUnitToPixelX( parag->document()->width() ) );
if ( ir.intersects( crect ) && ( drawingFlags & TransparentBackground ) == 0 )
- p->fillRect( ir.intersect( crect ), cg.brush( QColorGroup::Base ) );
+ p->fillRect( ir.intersect( crect ), cg.brush( TQColorGroup::Base ) );
if ( ir.y() > cy + ch ) {
goto floating;
}
@@ -1169,17 +1169,17 @@ KoTextParag *KoTextDocument::drawWYSIWYG( QPainter *p, int cx, int cy, int cw, i
floating:
pixelRect = parag->pixelRect(zoomHandler);
- int docheight = zoomHandler->layoutUnitToPixelY( parag->document()->height() );
+ int docheight = zoomHandler->tqlayoutUnitToPixelY( parag->document()->height() );
if ( pixelRect.y() + pixelRect.height() < docheight ) {
- int docwidth = zoomHandler->layoutUnitToPixelX( parag->document()->width() );
+ int docwidth = zoomHandler->tqlayoutUnitToPixelX( parag->document()->width() );
if ( ( drawingFlags & TransparentBackground ) == 0 ) {
p->fillRect( 0, pixelRect.y() + pixelRect.height(),
docwidth, docheight - ( pixelRect.y() + pixelRect.height() ),
- cg.brush( QColorGroup::Base ) );
+ cg.brush( TQColorGroup::Base ) );
}
if ( !flow()->isEmpty() ) {
- QRect cr( cx, cy, cw, ch );
- cr = cr.intersect( QRect( 0, pixelRect.y() + pixelRect.height(), docwidth,
+ TQRect cr( cx, cy, cw, ch );
+ cr = cr.intersect( TQRect( 0, pixelRect.y() + pixelRect.height(), docwidth,
docheight - ( pixelRect.y() + pixelRect.height() ) ) );
flow()->drawFloatingItems( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, FALSE );
}
@@ -1195,8 +1195,8 @@ floating:
// Used for printing
-void KoTextDocument::drawWithoutDoubleBuffer( QPainter *p, const QRect &cr, const QColorGroup &cg,
- KoTextZoomHandler* zoomHandler, const QBrush *paper )
+void KoTextDocument::drawWithoutDoubleBuffer( TQPainter *p, const TQRect &cr, const TQColorGroup &cg,
+ KoTextZoomHandler* zoomHandler, const TQBrush *paper )
{
if ( !firstParag() )
return;
@@ -1214,11 +1214,11 @@ void KoTextDocument::drawWithoutDoubleBuffer( QPainter *p, const QRect &cr, cons
if ( !parag->isValid() )
parag->format();
- QRect pr( parag->pixelRect( zoomHandler ) );
+ TQRect pr( parag->pixelRect( zoomHandler ) );
pr.setLeft( 0 );
- pr.setWidth( QWIDGETSIZE_MAX );
- // The cliprect is checked in layout units, in KoTextParag::paint
- QRect crect_lu( parag->rect() );
+ pr.setWidth( TQWIDGETSIZE_MAX );
+ // The cliprect is checked in tqlayout units, in KoTextParag::paint
+ TQRect crect_lu( parag->rect() );
if ( !cr.isNull() && !cr.intersects( pr ) ) {
parag = parag->next();
@@ -1229,28 +1229,28 @@ void KoTextDocument::drawWithoutDoubleBuffer( QPainter *p, const QRect &cr, cons
// No need to brush plain white on a printer. Brush all
// other cases (except "full transparent" case).
- QBrush brush = cg.brush( QColorGroup::Base );;
- bool needBrush = brush.style() != Qt::NoBrush &&
- !(brush.style() == Qt::SolidPattern &&
- brush.color() == Qt::white &&
+ TQBrush brush = cg.brush( TQColorGroup::Base );;
+ bool needBrush = brush.style() != TQt::NoBrush &&
+ !(brush.style() == TQt::SolidPattern &&
+ brush.color() == TQt::white &&
is_printer(p));
if ( needBrush && ( m_drawingFlags & TransparentBackground ) == 0 )
- p->fillRect( QRect( 0, 0, pr.width(), pr.height() ), brush );
+ p->fillRect( TQRect( 0, 0, pr.width(), pr.height() ), brush );
- //p->setBrushOrigin( p->brushOrigin() + QPoint( 0, pr.y() ) );
+ //p->setBrushOrigin( p->brushOrigin() + TQPoint( 0, pr.y() ) );
parag->paint( *p, cg, 0, FALSE,
crect_lu.x(), crect_lu.y(),
crect_lu.width(), crect_lu.height() );
p->translate( 0, -pr.y() );
- //p->setBrushOrigin( p->brushOrigin() - QPoint( 0, pr.y() ) );
+ //p->setBrushOrigin( p->brushOrigin() - TQPoint( 0, pr.y() ) );
parag = parag->next();
}
}
// Used for screen display (and also printing?)
// Called by drawWYSIWYG and the app's drawCursor
-void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
- QPixmap *&doubleBuffer, const QColorGroup &cg,
+void KoTextDocument::drawParagWYSIWYG( TQPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
+ TQPixmap *&doubleBuffer, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler, bool drawCursor,
KoTextCursor *cursor, bool resetChanged, uint drawingFlags )
{
@@ -1259,45 +1259,45 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
kdDebug(32500) << "KoTextDocument::drawParagWYSIWYG " << (void*)parag << " id:" << parag->paragId() << endl;
#endif
m_drawingFlags = drawingFlags;
- QPainter *painter = 0;
+ TQPainter *painter = 0;
// Those three rects are in pixels, in the document coordinates (0,0 == topleft of first parag)
- QRect rect = parag->pixelRect( zoomHandler ); // the parag rect
+ TQRect rect = parag->pixelRect( zoomHandler ); // the parag rect
int offsetY = 0;
// Start painting from a given line number.
if ( parag->lineChanged() > -1 )
{
- offsetY = zoomHandler->layoutUnitToPixelY( parag->lineY( parag->lineChanged() ) - parag->topMargin() );
+ offsetY = zoomHandler->tqlayoutUnitToPixelY( parag->lineY( parag->lineChanged() ) - parag->topMargin() );
#ifdef DEBUG_PAINTING
kdDebug(32500) << " Repainting from lineChanged=" << parag->lineChanged() << " -> adding " << offsetY << " to rect" << endl;
#endif
- // Skip the lines that are not repainted by moving Top. The bottom doesn't change.
+ // Skip the lines that are not tqrepainted by moving Top. The bottom doesn't change.
rect.rTop() += offsetY;
}
- QRect crect( cx, cy, cw, ch ); // the overall crect
- QRect ir( rect ); // will be the rect to be repainted
+ TQRect crect( cx, cy, cw, ch ); // the overall crect
+ TQRect ir( rect ); // will be the rect to be tqrepainted
- QBrush brush = cg.brush( QColorGroup::Base );
+ TQBrush brush = cg.brush( TQColorGroup::Base );
// No need to brush plain white on a printer. Brush all
// other cases (except "full transparent" case).
- bool needBrush = brush.style() != Qt::NoBrush &&
+ bool needBrush = brush.style() != TQt::NoBrush &&
( drawingFlags & TransparentBackground ) == 0 &&
- !(brush.style() == Qt::SolidPattern &&
- brush.color() == Qt::white &&
+ !(brush.style() == TQt::SolidPattern &&
+ brush.color() == TQt::white &&
is_printer(p));
- bool useDoubleBuffer = !parag->document()->parent();
+ bool useDoubleBuffer = !parag->document()->tqparent();
if ( is_printer(p) )
useDoubleBuffer = FALSE;
// Can't handle transparency using double-buffering, in case of rotation/scaling (due to bitBlt)
// The test on mat is almost like isIdentity(), but allows for translation.
//// ##### The way to fix this: initialize the pixmap to be fully transparent instead
// of being white.
- QWMatrix mat = p->worldMatrix();
+ TQWMatrix mat = p->tqworldMatrix();
if ( ( mat.m11() != 1.0 || mat.m22() != 1.0 || mat.m12() != 0.0 || mat.m21() != 0.0 )
- && brush.style() != Qt::SolidPattern )
+ && brush.style() != TQt::SolidPattern )
useDoubleBuffer = FALSE;
#ifdef DEBUG_PAINTING
@@ -1308,7 +1308,7 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
#endif
if ( useDoubleBuffer ) {
- painter = new QPainter;
+ painter = new TQPainter;
if ( cx >= 0 && cy >= 0 )
ir = ir.intersect( crect );
if ( !doubleBuffer ||
@@ -1333,7 +1333,7 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
if ( useDoubleBuffer || is_printer( painter ) ) {
// Transparent -> grab background from p's device
- if ( brush.style() != Qt::SolidPattern ) {
+ if ( brush.style() != TQt::SolidPattern ) {
bitBlt( doubleBuffer, 0, 0, p->device(),
ir.x() + (int)p->translationX(), ir.y() + (int)p->translationY(),
ir.width(), ir.height() );
@@ -1341,7 +1341,7 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
}
if ( needBrush )
- painter->fillRect( QRect( 0, 0, ir.width(), ir.height() ), brush );
+ painter->fillRect( TQRect( 0, 0, ir.width(), ir.height() ), brush );
// Now revert the previous painter translation, and instead make (0,0) the topleft of the PARAGRAPH
painter->translate( rect.x() - ir.x(), rect.y() - ir.y() );
@@ -1350,8 +1350,8 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
#endif
//painter->setBrushOrigin( painter->brushOrigin() + rect.topLeft() - ir.topLeft() );
- // The cliprect is checked in layout units, in KoTextParag::paint
- QRect crect_lu( zoomHandler->pixelToLayoutUnit( crect ) );
+ // The cliprect is checked in tqlayout units, in KoTextParag::paint
+ TQRect crect_lu( zoomHandler->pixelToLayoutUnit( crect ) );
#ifdef DEBUG_PAINTING
kdDebug(32500) << "KoTextDocument::drawParagWYSIWYG crect_lu=" << crect_lu << endl;
#endif
@@ -1368,10 +1368,10 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
if ( useDoubleBuffer ) {
delete painter;
painter = 0;
- p->drawPixmap( ir.topLeft(), *doubleBuffer, QRect( QPoint( 0, 0 ), ir.size() ) );
+ p->drawPixmap( ir.topLeft(), *doubleBuffer, TQRect( TQPoint( 0, 0 ), ir.size() ) );
#if 0 // for debug!
p->save();
- p->setPen( Qt::blue );
+ p->setPen( TQt::blue );
p->drawRect( ir.x(), ir.y(), ir.width(), ir.height() );
p->restore();
#endif
@@ -1384,7 +1384,7 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
}
if ( needBrush ) {
- int docright = zoomHandler->layoutUnitToPixelX( parag->document()->x() + parag->document()->width() );
+ int docright = zoomHandler->tqlayoutUnitToPixelX( parag->document()->x() + parag->document()->width() );
#ifdef DEBUG_PAINTING
// kdDebug(32500) << "KoTextDocument::drawParagWYSIWYG my rect is: " << rect << endl;
#endif
@@ -1394,7 +1394,7 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
#endif
p->fillRect( rect.x() + rect.width(), rect.y(),
docright - ( rect.x() + rect.width() ),
- rect.height(), cg.brush( QColorGroup::Base ) );
+ rect.height(), cg.brush( TQColorGroup::Base ) );
}
}
@@ -1403,19 +1403,19 @@ void KoTextDocument::drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx,
}
-KoTextDocCommand *KoTextDocument::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts )
+KoTextDocCommand *KoTextDocument::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts )
{
return new KoTextDeleteCommand( textdoc, id, index, str, customItemsMap, oldParagLayouts );
}
-KoTextParag* KoTextDocument::loadOasisText( const QDomElement& bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection* styleColl, KoTextParag* nextParagraph )
+KoTextParag* KoTextDocument::loadOasisText( const TQDomElement& bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection* styleColl, KoTextParag* nextParagraph )
{
// was OoWriterImport::parseBodyOrSimilar
- QDomElement tag;
+ TQDomElement tag;
forEachElement( tag, bodyElem )
{
context.styleStack().save();
- const QString localName = tag.localName();
+ const TQString localName = tag.localName();
const bool isTextNS = tag.namespaceURI() == KoXmlNS::text;
uint pos = 0;
if ( isTextNS && localName == "p" ) { // text paragraph
@@ -1431,7 +1431,7 @@ KoTextParag* KoTextDocument::loadOasisText( const QDomElement& bodyElem, KoOasis
{
//kdDebug(32500) << " heading " << endl;
context.fillStyleStack( tag, KoXmlNS::text, "style-name", "paragraph" );
- int level = tag.attributeNS( KoXmlNS::text, "outline-level", QString::null ).toInt();
+ int level = tag.attributeNS( KoXmlNS::text, "outline-level", TQString() ).toInt();
bool listOK = false;
// When a heading is inside a list, it seems that the list prevails.
// Example:
@@ -1447,7 +1447,7 @@ KoTextParag* KoTextDocument::loadOasisText( const QDomElement& bodyElem, KoOasis
int restartNumbering = -1;
if ( tag.hasAttributeNS( KoXmlNS::text, "start-value" ) )
// OASIS extension http://lists.oasis-open.org/archives/office/200310/msg00033.html
- restartNumbering = tag.attributeNS( KoXmlNS::text, "start-value", QString::null ).toInt();
+ restartNumbering = tag.attributeNS( KoXmlNS::text, "start-value", TQString() ).toInt();
KoTextParag *parag = createParag( this, lastParagraph, nextParagraph );
parag->loadOasis( tag, context, styleColl, pos );
@@ -1478,13 +1478,13 @@ KoTextParag* KoTextDocument::loadOasisText( const QDomElement& bodyElem, KoOasis
}
else if ( isTextNS && localName == "user-field-decls" )
{
- QDomElement fd;
+ TQDomElement fd;
forEachElement( fd, tag )
{
if ( fd.namespaceURI() == KoXmlNS::text && fd.localName() == "user-field-decl" )
{
- const QString name = fd.attributeNS( KoXmlNS::text, "name", QString::null );
- const QString value = fd.attributeNS( KoXmlNS::office, "value", QString::null );
+ const TQString name = fd.attributeNS( KoXmlNS::text, "name", TQString() );
+ const TQString value = fd.attributeNS( KoXmlNS::office, "value", TQString() );
if ( !name.isEmpty() )
context.variableCollection().setVariableValue( name, value );
}
@@ -1507,13 +1507,13 @@ KoTextParag* KoTextDocument::loadOasisText( const QDomElement& bodyElem, KoOasis
return lastParagraph;
}
-KoTextParag* KoTextDocument::loadList( const QDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph )
+KoTextParag* KoTextDocument::loadList( const TQDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph )
{
- //kdDebug(32500) << "loadList: " << list.attributeNS( KoXmlNS::text, "style-name", QString::null ) << endl;
+ //kdDebug(32500) << "loadList: " << list.attributeNS( KoXmlNS::text, "style-name", TQString() ) << endl;
- const QString oldListStyleName = context.currentListStyleName();
+ const TQString oldListStyleName = context.currentListStyleName();
if ( list.hasAttributeNS( KoXmlNS::text, "style-name" ) )
- context.setCurrentListStyleName( list.attributeNS( KoXmlNS::text, "style-name", QString::null ) );
+ context.setCurrentListStyleName( list.attributeNS( KoXmlNS::text, "style-name", TQString() ) );
bool listOK = !context.currentListStyleName().isEmpty();
int level;
if ( list.localName() == "numbered-paragraph" )
@@ -1523,7 +1523,7 @@ KoTextParag* KoTextDocument::loadList( const QDomElement& list, KoOasisContext&
if ( listOK )
listOK = context.pushListLevelStyle( context.currentListStyleName(), level );
- const QDomElement listStyle = context.listStyleStack().currentListStyle();
+ const TQDomElement listStyle = context.listStyleStack().currentListStyle();
// The tag is either list-level-style-number or list-level-style-bullet
const bool orderedList = listStyle.localName() == "list-level-style-number";
@@ -1532,7 +1532,7 @@ KoTextParag* KoTextDocument::loadList( const QDomElement& list, KoOasisContext&
// A numbered-paragraph contains paragraphs directly (it's both a list and a list-item)
int restartNumbering = -1;
if ( list.hasAttributeNS( KoXmlNS::text, "start-value" ) )
- restartNumbering = list.attributeNS( KoXmlNS::text, "start-value", QString::null ).toInt();
+ restartNumbering = list.attributeNS( KoXmlNS::text, "start-value", TQString() ).toInt();
KoTextParag* oldLast = lastParagraph;
lastParagraph = loadOasisText( list, context, lastParagraph, styleColl, nextParagraph );
KoTextParag* firstListItem = oldLast ? oldLast->next() : firstParag();
@@ -1545,13 +1545,13 @@ KoTextParag* KoTextDocument::loadList( const QDomElement& list, KoOasisContext&
else
{
// Iterate over list items
- for ( QDomNode n = list.firstChild(); !n.isNull(); n = n.nextSibling() )
+ for ( TQDomNode n = list.firstChild(); !n.isNull(); n = n.nextSibling() )
{
- QDomElement listItem = n.toElement();
+ TQDomElement listItem = n.toElement();
int restartNumbering = -1;
if ( listItem.hasAttributeNS( KoXmlNS::text, "start-value" ) )
- restartNumbering = listItem.attributeNS( KoXmlNS::text, "start-value", QString::null ).toInt();
- bool isListHeader = listItem.localName() == "list-header" || listItem.attributeNS( KoXmlNS::text, "is-list-header", QString::null ) == "is-list-header";
+ restartNumbering = listItem.attributeNS( KoXmlNS::text, "start-value", TQString() ).toInt();
+ bool isListHeader = listItem.localName() == "list-header" || listItem.attributeNS( KoXmlNS::text, "is-list-header", TQString() ) == "is-list-header";
KoTextParag* oldLast = lastParagraph;
lastParagraph = loadOasisText( listItem, context, lastParagraph, styleColl, nextParagraph );
KoTextParag* firstListItem = oldLast ? oldLast->next() : firstParag();
diff --git a/lib/kotext/KoTextDocument.h b/lib/kotext/KoTextDocument.h
index 39143d08..2b658a1a 100644
--- a/lib/kotext/KoTextDocument.h
+++ b/lib/kotext/KoTextDocument.h
@@ -23,13 +23,13 @@
#include "KoRichText.h"
#include <koffice_export.h>
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class Q_EXPORT QMap<int, QColor>;
-template class Q_EXPORT QMap<int, bool>;
-template class Q_EXPORT QMap<int, KoTextDocumentSelection>;
-template class Q_EXPORT QPtrList<KoTextDocument>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQ_EXPORT TQMap<int, TQColor>;
+template class TQ_EXPORT TQMap<int, bool>;
+template class TQ_EXPORT TQMap<int, KoTextDocumentSelection>;
+template class TQ_EXPORT TQPtrList<KoTextDocument>;
+// TQMOC_SKIP_END
#endif
class KoStyleCollection;
@@ -42,9 +42,10 @@ class KoTextFormatter;
class KoTextParag;
class CustomItemsMap;
-class KOTEXT_EXPORT KoTextDocument : public QObject
+class KOTEXT_EXPORT KoTextDocument : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
friend class KoTextCursor;
friend class KoTextParag;
@@ -54,7 +55,7 @@ public:
enum SelectionId {
Standard = 0,
InputMethodPreedit = 1,
- HighlightSelection = 2, // used to highlight during search/replace
+ HighlightSelection = 2, // used to highlight during search/tqreplace
Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to
// remove multiple lines with removeSelectedText()
};
@@ -64,13 +65,13 @@ public:
// see below for constructor
virtual ~KoTextDocument();
- //KoTextDocument *parent() const { return par; }
+ //KoTextDocument *tqparent() const { return par; }
- void setText( const QString &text, const QString &context );
+ void setText( const TQString &text, const TQString &context );
- //QString text() const;
- //QString text( int parag ) const;
- //QString originalText() const;
+ //TQString text() const;
+ //TQString text( int parag ) const;
+ //TQString originalText() const;
int x() const;
int y() const;
@@ -93,7 +94,7 @@ public:
void setFirstParag( KoTextParag *p );
void setLastParag( KoTextParag *p );
- void invalidate();
+ void tqinvalidate();
//void setPreProcessor( KoTextPreProcessor *sh );
//KoTextPreProcessor *preProcessor() const;
@@ -101,9 +102,9 @@ public:
void setFormatter( KoTextFormatterBase *f );
KoTextFormatterBase *formatter() const;
- QColor selectionColor( int id ) const;
+ TQColor selectionColor( int id ) const;
bool invertSelectionText( int id ) const;
- void setSelectionColor( int id, const QColor &c );
+ void setSelectionColor( int id, const TQColor &c );
void setInvertSelectionText( int id, bool b );
bool hasSelection( int id, bool visible = false ) const;
bool isSelectionSwapped( int id ); //// kotext
@@ -121,7 +122,7 @@ public:
int numSelections() const { return nSelections; }
void addSelection( int id );
- QString selectedText( int id, bool withCustom = TRUE ) const;
+ TQString selectedText( int id, bool withCustom = TRUE ) const;
//void copySelectedText( int id );
void removeSelectedText( int id, KoTextCursor *cursor );
@@ -134,35 +135,35 @@ public:
KoTextFormatCollection *formatCollection() const;
- bool find( const QString &expr, bool cs, bool wo, bool forward, int *parag, int *index, KoTextCursor *cursor );
+ bool tqfind( const TQString &expr, bool cs, bool wo, bool forward, int *parag, int *index, KoTextCursor *cursor );
- //void setTextFormat( Qt::TextFormat f );
- //Qt::TextFormat textFormat() const;
+ //void setTextFormat( TQt::TextFormat f );
+ //TQt::TextFormat textFormat() const;
- bool inSelection( int selId, const QPoint &pos ) const;
+ bool inSelection( int selId, const TQPoint &pos ) const;
void setUnderlineLinks( bool b ) { underlLinks = b; }
bool underlineLinks() const { return underlLinks; }
- void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
- QBrush *paper() const { return backBrush; }
+ void setPaper( TQBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
+ TQBrush *paper() const { return backBrush; }
- //void doLayout( QPainter *p, int w );
+ //void doLayout( TQPainter *p, int w );
#if 0 // see KoTextDocument
- void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
- void drawParag( QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
- QPixmap *&doubleBuffer, const QColorGroup &cg,
+ void draw( TQPainter *p, const TQRect& rect, const TQColorGroup &cg, const TQBrush *paper = 0 );
+ void drawParag( TQPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
+ TQPixmap *&doubleBuffer, const TQColorGroup &cg,
bool drawCursor, KoTextCursor *cursor, bool resetChanged = TRUE );
- KoTextParag *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
+ KoTextParag *draw( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
bool onlyChanged = FALSE, bool drawCursor = FALSE, KoTextCursor *cursor = 0,
bool resetChanged = TRUE );
#endif
- //void setDefaultFont( const QFont &f );
+ //void setDefaultFont( const TQFont &f );
void registerCustomItem( KoTextCustomItem *i, KoTextParag *p );
void unregisterCustomItem( KoTextCustomItem *i, KoTextParag *p );
- const QPtrList<KoTextCustomItem> & allCustomItems() const { return customItems; }
+ const TQPtrList<KoTextCustomItem> & allCustomItems() const { return customItems; }
void setFlow( KoTextFlow *f );
void takeFlow();
@@ -176,20 +177,20 @@ public:
void setUseFormatCollection( bool b ) { useFC = b; }
bool useFormatCollection() const { return useFC; }
-#ifdef QTEXTTABLE_AVAILABLE
+#ifdef TQTEXTTABLE_AVAILABLE
KoTextTableCell *tableCell() const { return tc; }
void setTableCell( KoTextTableCell *c ) { tc = c; }
#endif
- void setPlainText( const QString &text );
- //void setRichText( const QString &text, const QString &context );
- //QString richText( KoTextParag *p = 0 ) const;
- QString plainText() const;
+ void setPlainText( const TQString &text );
+ //void setRichText( const TQString &text, const TQString &context );
+ //TQString richText( KoTextParag *p = 0 ) const;
+ TQString plainText() const;
//bool focusNextPrevChild( bool next );
- int alignment() const;
- void setAlignment( int a );
+ int tqalignment() const;
+ void tqsetAlignment( int a );
int *tabArray() const;
int tabStopWidth() const;
@@ -202,12 +203,12 @@ public:
int length() const;
void clear( bool createEmptyParag = FALSE );
- KoTextParag* loadList( const QDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
+ KoTextParag* loadList( const TQDomElement& list, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
// For normal loading nextParagraph and pos are 0.
- KoTextParag* loadOasisText( const QDomElement &bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
+ KoTextParag* loadOasisText( const TQDomElement &bodyElem, KoOasisContext& context, KoTextParag* lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph );
- QString copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
+ TQString copySelection( KoXmlWriter& writer, KoSavingContext& context, int selectionId );
void saveOasisContent( KoXmlWriter& writer, KoSavingContext& context ) const;
@@ -226,7 +227,7 @@ signals:
private:
void init();
- QPixmap *bufferPixmap( const QSize &s );
+ TQPixmap *bufferPixmap( const TQSize &s );
//// Beginning of kotext additions
@@ -242,7 +243,7 @@ public:
* If not, ownership of the given one is transferred to the document.
* @param createInitialParag if true, an initial KoTextParag is created. Set to false if you reimplement createParag,
* since the constructor can't call the reimplementation. In that case, make sure to call
- * clear(true) in your constructor; QRT doesn't support documents without paragraphs.
+ * clear(true) in your constructor; TQRT doesn't support documents without paragraphs.
*/
KoTextDocument( KoTextZoomHandler *zoomHandler,
KoTextFormatCollection *fc, KoTextFormatter *formatter = 0L,
@@ -291,15 +292,15 @@ public:
};
/** The main drawing method. Equivalent to KoTextDocument::draw, but reimplemented
* for wysiwyg */
- KoTextParag *drawWYSIWYG( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
+ KoTextParag *drawWYSIWYG( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler, bool onlyChanged = FALSE,
bool drawCursor = FALSE, KoTextCursor *cursor = 0,
bool resetChanged = TRUE, uint drawingFlags = KoTextDocument::DrawSelections );
/** Draw a single paragraph (used by drawWYSIWYG and by KWTextFrameSet::drawCursor).
* Equivalent to KoTextDocument::draw, but modified for wysiwyg */
- void drawParagWYSIWYG( QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
- QPixmap *&doubleBuffer, const QColorGroup &cg,
+ void drawParagWYSIWYG( TQPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch,
+ TQPixmap *&doubleBuffer, const TQColorGroup &cg,
KoTextZoomHandler* zoomHandler,
bool drawCursor, KoTextCursor *cursor,
bool resetChanged = TRUE,
@@ -313,13 +314,13 @@ public:
/** Set by drawParagWYSIWYG, used by KoTextParag::drawParagStringInternal */
bool dontDrawingNoteVariable() const { return (m_drawingFlags & DontDrawNoteVariable); }
- virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts );
+ virtual KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts );
void emitNewCommand(KCommand *cmd) {
emit newCommand( cmd );
}
void emitRepaintChanged() {
- emit repaintChanged();
+ emit tqrepaintChanged();
}
signals:
/**
@@ -329,21 +330,21 @@ signals:
*/
void newCommand( KCommand *cmd );
/**
- * Tell the world that we'd like some repainting to happen.
+ * Tell the world that we'd like some tqrepainting to happen.
* KoTextObject connects (and forwards) that one.
*/
- void repaintChanged();
+ void tqrepaintChanged();
protected:
- void drawWithoutDoubleBuffer( QPainter *p, const QRect &rect, const QColorGroup &cg,
- KoTextZoomHandler* zoomHandler, const QBrush *paper = 0 );
+ void drawWithoutDoubleBuffer( TQPainter *p, const TQRect &rect, const TQColorGroup &cg,
+ KoTextZoomHandler* zoomHandler, const TQBrush *paper = 0 );
/**
* Called by loadOasisText. This allows to extend the loading mechanism
* for special tags no handled by kotext (images, textboxes, tables, etc.)
* @return true if @p tag was handled.
*/
- virtual bool loadOasisBodyTag( const QDomElement& /*tag*/, KoOasisContext& /*context*/,
+ virtual bool loadOasisBodyTag( const TQDomElement& /*tag*/, KoOasisContext& /*context*/,
KoTextParag* & /*lastParagraph*/, KoStyleCollection* /*styleColl*/,
KoTextParag* /*nextParagraph*/ ) {
return false;
@@ -356,9 +357,9 @@ protected:
* KoTextDocument.
* @return true (and optionally @p textData and @p customItem) if @p tag was handled.
*/
- virtual bool loadSpanTag( const QDomElement& /*tag*/, KoOasisContext& /*context*/,
+ virtual bool loadSpanTag( const TQDomElement& /*tag*/, KoOasisContext& /*context*/,
KoTextParag* /*parag*/, uint /*pos*/,
- QString& /*textData*/, KoTextCustomItem* & /*customItem*/ ) {
+ TQString& /*textData*/, KoTextCustomItem* & /*customItem*/ ) {
return false;
}
@@ -372,22 +373,22 @@ private:
//// End of kotext additions
private:
- /*struct Q_EXPORT Focus {
+ /*struct TQ_EXPORT Focus {
KoTextParag *parag;
int start, len;
- QString href;
+ TQString href;
};*/
int cx, cy; //, cw, vw;
KoTextParag *fParag, *lParag;
//KoTextPreProcessor *pProcessor;
- QMap<int, QColor> selectionColors;
- QMap<int, KoTextDocumentSelection> selections;
- QMap<int, bool> selectionText;
+ TQMap<int, TQColor> selectionColors;
+ TQMap<int, KoTextDocumentSelection> selections;
+ TQMap<int, bool> selectionText;
KoTextDocCommandHistory *commandHistory;
KoTextFormatterBase *pFormatter;
KoTextFormatCollection *fCollection;
- //Qt::TextFormat txtFormat;
+ //TQt::TextFormat txtFormat;
//bool preferRichText : 1;
bool m_pageBreakEnabled : 1;
bool useFC : 1;
@@ -397,9 +398,9 @@ private:
bool addMargs : 1;
int nSelections;
KoTextFlow *flow_;
- QPtrList<KoTextCustomItem> customItems;
- QBrush *backBrush;
- QPixmap *buf_pixmap;
+ TQPtrList<KoTextCustomItem> customItems;
+ TQBrush *backBrush;
+ TQPixmap *buf_pixmap;
//Focus focusIndicator;
//int minw;
int leftmargin;
@@ -423,7 +424,7 @@ inline int KoTextDocument::y() const
inline int KoTextDocument::width() const
{
return flow_->width();
- //return QMAX( cw, flow_->width() );
+ //return TQMAX( cw, flow_->width() );
}
//inline int KoTextDocument::visibleWidth() const
@@ -453,7 +454,7 @@ inline void KoTextDocument::setLastParag( KoTextParag *p )
inline void KoTextDocument::setWidth( int w )
{
- //cw = QMAX( w, minw );
+ //cw = TQMAX( w, minw );
flow_->setWidth( w );
//vw = w;
}
@@ -509,7 +510,7 @@ inline KoTextFormatterBase *KoTextDocument::formatter() const
return pFormatter;
}
-inline QColor KoTextDocument::selectionColor( int id ) const
+inline TQColor KoTextDocument::selectionColor( int id ) const
{
return selectionColors[ id ];
}
@@ -519,7 +520,7 @@ inline bool KoTextDocument::invertSelectionText( int id ) const
return selectionText[ id ];
}
-inline void KoTextDocument::setSelectionColor( int id, const QColor &c )
+inline void KoTextDocument::setSelectionColor( int id, const TQColor &c )
{
selectionColors[ id ] = c;
}
@@ -534,12 +535,12 @@ inline KoTextFormatCollection *KoTextDocument::formatCollection() const
return fCollection;
}
-inline int KoTextDocument::alignment() const
+inline int KoTextDocument::tqalignment() const
{
return align;
}
-inline void KoTextDocument::setAlignment( int a )
+inline void KoTextDocument::tqsetAlignment( int a )
{
align = a;
}
@@ -564,7 +565,7 @@ inline void KoTextDocument::setTabStops( int tw )
tStopWidth = tw;
}
-/*inline QString KoTextDocument::originalText() const
+/*inline TQString KoTextDocument::originalText() const
{
if ( oTextValid )
return oText;
@@ -600,12 +601,12 @@ public:
};
class KCommand;
-class QDomElement;
+class TQDomElement;
class KMacroCommand;
/** A CustomItemsMap associates a custom item to an index
* Used in the undo/redo info for insert/delete text. */
-class CustomItemsMap : public QMap<int, KoTextCustomItem *>
+class CustomItemsMap : public TQMap<int, KoTextCustomItem *>
{
public:
diff --git a/lib/kotext/KoTextFormat.cpp b/lib/kotext/KoTextFormat.cpp
index ff4de62c..7395a050 100644
--- a/lib/kotext/KoTextFormat.cpp
+++ b/lib/kotext/KoTextFormat.cpp
@@ -29,8 +29,8 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qapplication.h>
-#include <qregexp.h>
+#include <tqapplication.h>
+#include <tqregexp.h>
#include <assert.h>
void KoTextFormat::KoTextFormatPrivate::clearCache()
@@ -60,9 +60,9 @@ KoTextFormat::KoTextFormat()
va = AlignNormal;
collection = 0;
//// kotext: WYSIWYG works much much better with scalable fonts -> force it to be scalable
- fn.setStyleStrategy( QFont::ForceOutline );
+ fn.setStyleStrategy( TQFont::ForceOutline );
d = new KoTextFormatPrivate;
- m_textUnderlineColor=QColor();
+ m_textUnderlineColor=TQColor();
m_underlineType = U_NONE;
m_strikeOutType = S_NONE;
m_underlineStyle = U_SOLID;
@@ -82,11 +82,11 @@ KoTextFormat::KoTextFormat()
//#endif
}
-KoTextFormat::KoTextFormat( const QFont &f, const QColor &c, const QString &_language, bool hyphenation, KoTextFormatCollection *parent )
- : fn( f ), col( c ) /*fm( QFontMetrics( f ) ),*/ //linkColor( TRUE )
+KoTextFormat::KoTextFormat( const TQFont &f, const TQColor &c, const TQString &_language, bool hyphenation, KoTextFormatCollection *tqparent )
+ : fn( f ), col( c ) /*fm( TQFontMetrics( f ) ),*/ //linkColor( TRUE )
{
#ifdef DEBUG_COLLECTION
- kdDebug(32500) << "KoTextFormat with font & color & parent (" << parent << "), addRef. " << this << endl;
+ kdDebug(32500) << "KoTextFormat with font & color & tqparent (" << tqparent << "), addRef. " << this << endl;
#endif
int pointSize;
if ( f.pointSize() == -1 ) // font was set with a pixelsize, we need a pointsize!
@@ -95,9 +95,9 @@ KoTextFormat::KoTextFormat( const QFont &f, const QColor &c, const QString &_lan
pointSize = f.pointSize();
fn.setPointSize( pointSize );
// WYSIWYG works much much better with scalable fonts -> force it to be scalable
- fn.setStyleStrategy( QFont::ForceOutline );
+ fn.setStyleStrategy( TQFont::ForceOutline );
ref = 0;
- collection = parent;
+ collection = tqparent;
//leftBearing = fm.minLeftBearing();
//rightBearing = fm.minRightBearing();
//hei = fm.height();
@@ -107,7 +107,7 @@ KoTextFormat::KoTextFormat( const QFont &f, const QColor &c, const QString &_lan
va = AlignNormal;
//// kotext
d = new KoTextFormatPrivate;
- m_textUnderlineColor = QColor();
+ m_textUnderlineColor = TQColor();
m_underlineType = U_NONE;
m_strikeOutType = S_NONE;
m_underlineStyle = U_SOLID;
@@ -127,29 +127,29 @@ KoTextFormat::KoTextFormat( const QFont &f, const QColor &c, const QString &_lan
addRef();
}
-KoTextFormat::KoTextFormat( const QFont &_font,
+KoTextFormat::KoTextFormat( const TQFont &_font,
VerticalAlignment _valign,
- const QColor & _color,
- const QColor & _backGroundColor,
- const QColor & _underlineColor,
+ const TQColor & _color,
+ const TQColor & _backGroundColor,
+ const TQColor & _underlineColor,
KoTextFormat::UnderlineType _underlineType,
KoTextFormat::UnderlineStyle _underlineStyle,
KoTextFormat::StrikeOutType _strikeOutType,
KoTextFormat::StrikeOutStyle _strikeOutStyle,
KoTextFormat::AttributeStyle _fontAttribute,
- const QString &_language,
+ const TQString &_language,
double _relativeTextSize,
int _offsetFromBaseLine,
bool _wordByWord,
bool _hyphenation,
double _shadowDistanceX,
double _shadowDistanceY,
- const QColor& _shadowColor )
+ const TQColor& _shadowColor )
{
ref = 0;
collection = 0;
fn = _font;
- fn.setStyleStrategy( QFont::ForceOutline );
+ fn.setStyleStrategy( TQFont::ForceOutline );
col = _color;
missp = false;
va = _valign;
@@ -188,8 +188,8 @@ KoTextFormat::~KoTextFormat()
// Removing a format that is in the collection is forbidden, in fact.
// It should have been removed from the collection before being deleted.
#ifndef NDEBUG
- if ( parent() && parent()->defaultFormat() ) // not when destroying the collection
- assert( ! ( parent()->dict().find( key() ) == this ) );
+ if ( tqparent() && tqparent()->defaultFormat() ) // not when destroying the collection
+ assert( ! ( tqparent()->dict().tqfind( key() ) == this ) );
// (has to be the same pointer, not only the same key)
#endif
delete d;
@@ -241,15 +241,15 @@ KoTextFormat& KoTextFormat::operator=( const KoTextFormat &f )
}
// Helper for load
-static void importTextPosition( const QString& text_position, double fontSize, KoTextFormat::VerticalAlignment& value, double& relativetextsize, int& offset, KoOasisContext& context )
+static void importTextPosition( const TQString& text_position, double fontSize, KoTextFormat::VerticalAlignment& value, double& relativetextsize, int& offset, KoOasisContext& context )
{
//OO: <vertical position (% or sub or super)> [<size as %>]
//Examples: "super" or "super 58%" or "82% 58%" (where 82% is the vertical position)
- QStringList lst = QStringList::split( ' ', text_position );
+ TQStringList lst = TQStringList::split( ' ', text_position );
if ( !lst.isEmpty() )
{
- QString textPos = lst.front().stripWhiteSpace();
- QString textSize;
+ TQString textPos = lst.front().stripWhiteSpace();
+ TQString textSize;
lst.pop_front();
if ( !lst.isEmpty() )
textSize = lst.front().stripWhiteSpace();
@@ -265,7 +265,7 @@ static void importTextPosition( const QString& text_position, double fontSize, K
{
textPos.truncate( textPos.length() - 1 );
double val = textPos.toDouble();
- offset = qRound( fontSize * val / 100.0 );
+ offset = tqRound( fontSize * val / 100.0 );
value = KoTextFormat::AlignCustom;
}
else if ( textPos == "super" )
@@ -285,7 +285,7 @@ static void importTextPosition( const QString& text_position, double fontSize, K
}
// OASIS 14.2.29
-static void importOasisUnderline( const QString& type, const QString& style,
+static void importOasisUnderline( const TQString& type, const TQString& style,
KoTextFormat::UnderlineType& underline,
KoTextFormat::UnderlineStyle& styleline )
{
@@ -317,7 +317,7 @@ static void importOasisUnderline( const QString& type, const QString& style,
// We should separate them in kotext...
}
-QString exportOasisUnderline( KoTextFormat::UnderlineStyle styleline )
+TQString exportOasisUnderline( KoTextFormat::UnderlineStyle styleline )
{
switch( styleline ) {
case KoTextFormat::U_DOT:
@@ -334,7 +334,7 @@ QString exportOasisUnderline( KoTextFormat::UnderlineStyle styleline )
}
// Helper for load. Legacy OO format.
-static void importUnderline( const QString& in,
+static void importUnderline( const TQString& in,
KoTextFormat::UnderlineType& underline,
KoTextFormat::UnderlineStyle& styleline )
{
@@ -383,7 +383,7 @@ void KoTextFormat::load( KoOasisContext& context )
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "font-family" ) // 3.10.9
|| styleStack.hasAttributeNS( KoXmlNS::style, "font-name") ) { // 3.10.8
// Hmm, the remove "'" could break it's in the middle of the fontname...
- QString fontName = styleStack.attributeNS( KoXmlNS::fo, "font-family" ).remove( "'" );
+ TQString fontName = styleStack.attributeNS( KoXmlNS::fo, "font-family" ).remove( "'" );
if (fontName.isEmpty()) {
// ##### TODO. This is wrong. style:font-name refers to a font-decl entry.
// We have to look it up there, and retrieve _all_ font attributes from it, not just the name.
@@ -394,7 +394,7 @@ void KoTextFormat::load( KoOasisContext& context )
if ( fontName == "Thorndale" )
fontName = "Times New Roman";
- fontName.remove(QRegExp("\\sCE$")); // Arial CE -> Arial
+ fontName.remove(TQRegExp("\\sCE$")); // Arial CE -> Arial
fn.setFamily( fontName );
}
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "font-size" ) ) { // 3.10.14
@@ -402,14 +402,14 @@ void KoTextFormat::load( KoOasisContext& context )
fn.setPointSizeFloat( pointSize );
}
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "font-weight" ) ) { // 3.10.24
- QString fontWeight = styleStack.attributeNS( KoXmlNS::fo, "font-weight" );
+ TQString fontWeight = styleStack.attributeNS( KoXmlNS::fo, "font-weight" );
int boldness;
if ( fontWeight == "normal" )
boldness = 50;
else if ( fontWeight == "bold" )
boldness = 75;
else
- // XSL/CSS has 100,200,300...900. Not the same scale as Qt!
+ // XSL/CSS has 100,200,300...900. Not the same scale as TQt!
// See http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#font-weight
boldness = fontWeight.toInt() / 10;
fn.setWeight( boldness );
@@ -427,7 +427,7 @@ void KoTextFormat::load( KoOasisContext& context )
d->m_bWordByWord = (styleStack.hasAttributeNS( KoXmlNS::fo, "score-spaces")) // 3.10.25
&& (styleStack.attributeNS( KoXmlNS::fo, "score-spaces") == "false");
if( styleStack.hasAttributeNS( KoXmlNS::style, "text-crossing-out" )) { // 3.10.6
- QString strikeOutType = styleStack.attributeNS( KoXmlNS::style, "text-crossing-out" );
+ TQString strikeOutType = styleStack.attributeNS( KoXmlNS::style, "text-crossing-out" );
if( strikeOutType =="double-line")
m_strikeOutType = S_DOUBLE;
else if( strikeOutType =="single-line")
@@ -448,7 +448,7 @@ void KoTextFormat::load( KoOasisContext& context )
importUnderline( styleStack.attributeNS( KoXmlNS::style, "text-underline" ),
m_underlineType, m_underlineStyle );
}
- QString underLineColor = styleStack.attributeNS( KoXmlNS::style, "text-underline-color" ); // OO 3.10.23, OASIS 14.4.31
+ TQString underLineColor = styleStack.attributeNS( KoXmlNS::style, "text-underline-color" ); // OO 3.10.23, OASIS 14.4.31
if ( !underLineColor.isEmpty() && underLineColor != "font-color" )
m_textUnderlineColor.setNamedColor( underLineColor );
@@ -480,7 +480,7 @@ void KoTextFormat::load( KoOasisContext& context )
if ( smallCaps ) {
m_attributeFont = ATT_SMALL_CAPS;
} else {
- QString textTransform = styleStack.attributeNS( KoXmlNS::fo, "text-transform" );
+ TQString textTransform = styleStack.attributeNS( KoXmlNS::fo, "text-transform" );
if ( textTransform == "uppercase" )
m_attributeFont = ATT_UPPER;
else if ( textTransform == "lowercase" )
@@ -490,14 +490,14 @@ void KoTextFormat::load( KoOasisContext& context )
}
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "language") ) { // 3.10.17
m_language = styleStack.attributeNS( KoXmlNS::fo, "language");
- const QString country = styleStack.attributeNS( KoXmlNS::fo, "country" );
+ const TQString country = styleStack.attributeNS( KoXmlNS::fo, "country" );
if ( !country.isEmpty() ) {
m_language += '_';
m_language += country;
}
}
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "background-color") ) {
- QString tmp = styleStack.attributeNS( KoXmlNS::fo, "background-color");
+ TQString tmp = styleStack.attributeNS( KoXmlNS::fo, "background-color");
if (tmp != "transparent")
m_textBackColor.setNamedColor( tmp );
}
@@ -518,7 +518,7 @@ void KoTextFormat::load( KoOasisContext& context )
style:font-family-generic, 3.10.10 - roman, swiss, modern -> map to a font?
style:font-style-name, 3.10.11 - can be ignored, says DV, the other ways to specify a font are more precise
style:font-pitch, 3.10.12 - fixed or variable -> map to a font?
- style:font-charset, 3.10.14 - not necessary with Qt
+ style:font-charset, 3.10.14 - not necessary with TQt
style:font-size-rel, 3.10.15 - TODO in StyleStack::fontSize()
fo:letter-spacing, 3.10.16 - not implemented in kotext
style:text-relief, 3.10.20 - not implemented in kotext
@@ -557,7 +557,7 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
int w = fn.weight();
if ( !refFormat || w != refFormat->font().weight() )
{
- gs.addProperty( "fo:font-weight", w == 50 ? "normal" : w == 75 ? "bold" : QString::number( qRound( w / 10 ) * 100 ), tt );
+ gs.addProperty( "fo:font-weight", w == 50 ? "normal" : w == 75 ? "bold" : TQString::number( tqRound( w / 10 ) * 100 ), tt );
}
if ( !refFormat || this->font().italic() != refFormat->font().italic() )
{
@@ -572,7 +572,7 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
{
gs.addProperty( "style:text-underline-type", m_underlineType == U_NONE ? "none" :
m_underlineType == U_DOUBLE ? "double" : "single", tt );
- QString styleline;
+ TQString styleline;
if ( m_underlineType == U_WAVE )
styleline = "wave";
else
@@ -593,7 +593,7 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
// TODO U_SIMPLE_BOLD
// TODO style:text-line-through-mode
gs.addProperty( "style:text-line-through-type", m_strikeOutType == S_DOUBLE ? "double" : "single", tt );
- const QString styleline = exportOasisUnderline( (UnderlineStyle) m_strikeOutStyle );
+ const TQString styleline = exportOasisUnderline( (UnderlineStyle) m_strikeOutStyle );
gs.addProperty( "style:text-line-through-style", styleline, tt );
//gs.addProperty( "style:text-line-through-color", ...) TODO in kotext
}
@@ -606,16 +606,16 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
if ( !refFormat || (this->vAlign() != refFormat->vAlign())
|| (this->relativeTextSize() != refFormat->relativeTextSize()) )
{
- QString textPos;
+ TQString textPos;
if ( d->m_offsetFromBaseLine != 0 )
- textPos = QString::number( 100 * d->m_offsetFromBaseLine / fn.pointSizeFloat() ) + '%';
+ textPos = TQString::number( 100 * d->m_offsetFromBaseLine / fn.pointSizeFloat() ) + '%';
else if ( va == AlignSuperScript ) textPos = "super";
else if ( va == AlignSubScript ) textPos = "sub";
else textPos = "0%"; // AlignNormal
if ( va != AlignNormal )
{
textPos += ' ';
- textPos += QString::number( d->m_relativeTextSize * 100 );
+ textPos += TQString::number( d->m_relativeTextSize * 100 );
textPos += '%';
}
gs.addProperty( "style:text-position", textPos, tt );
@@ -643,9 +643,9 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
if( !refFormat || this->language() != refFormat->language())
{
- QString lang = m_language;
- QString country;
- const int pos = lang.find( '_' );
+ TQString lang = m_language;
+ TQString country;
+ const int pos = lang.tqfind( '_' );
if ( pos != -1 ) {
country = lang.mid( pos + 1 );
lang = lang.left( pos );
@@ -675,7 +675,7 @@ void KoTextFormat::save( KoGenStyle& gs, KoSavingContext& context, KoTextFormat
void KoTextFormat::update()
{
//kdDebug(32500) << this << " KoTextFormat::update " << fn.family() << " " << pointSize() << endl;
- m_key = QString::null; // invalidate key, recalc at the next key() call
+ m_key = TQString(); // tqinvalidate key, recalc at the next key() call
assert( d );
d->clearCache(); // i.e. recalc at the next screenFont[Metrics]() call
}
@@ -775,7 +775,7 @@ void KoTextFormat::setUnderline( bool b )
update();
}
-void KoTextFormat::setFamily( const QString &f )
+void KoTextFormat::setFamily( const TQString &f )
{
if ( f == fn.family() )
return;
@@ -791,16 +791,16 @@ void KoTextFormat::setPointSize( int s )
update();
}
-void KoTextFormat::setFont( const QFont &f )
+void KoTextFormat::setFont( const TQFont &f )
{
if ( f == fn )
return;
fn = f;
- fn.setStyleStrategy( QFont::ForceOutline );
+ fn.setStyleStrategy( TQFont::ForceOutline );
update();
}
-void KoTextFormat::setColor( const QColor &c )
+void KoTextFormat::setColor( const TQColor &c )
{
if ( c == col )
return;
@@ -827,49 +827,49 @@ int KoTextFormat::minRightBearing() const
#endif
// ## Maybe we need a binary form for speed when NDEBUG, and to keep the
-// ## readable form when !NDEBUG, like QFont does?
+// ## readable form when !NDEBUG, like TQFont does?
void KoTextFormat::generateKey()
{
- QString k = fn.key();
+ TQString k = fn.key();
k += '/';
if ( col.isValid() ) // just to shorten the key in the common case
- k += QString::number( (uint)col.rgb() );
+ k += TQString::number( (uint)col.rgb() );
k += '/';
- k += QString::number( (int)isMisspelled() ); // 1 digit, no need for '/'
- k += QString::number( (int)vAlign() );
+ k += TQString::number( (int)isMisspelled() ); // 1 digit, no need for '/'
+ k += TQString::number( (int)vAlign() );
//// kotext addition
k += '/';
if (m_textBackColor.isValid())
- k += QString::number( (uint)m_textBackColor.rgb() );
+ k += TQString::number( (uint)m_textBackColor.rgb() );
k += '/';
if ( m_textUnderlineColor.isValid())
- k += QString::number( (uint)m_textUnderlineColor.rgb() );
+ k += TQString::number( (uint)m_textUnderlineColor.rgb() );
k += '/';
- k += QString::number( (int)m_underlineType ); // a digit each, no need for '/'
- k += QString::number( (int)m_strikeOutType );
- k += QString::number( (int)m_underlineStyle );
- k += QString::number( (int)m_strikeOutStyle );
+ k += TQString::number( (int)m_underlineType ); // a digit each, no need for '/'
+ k += TQString::number( (int)m_strikeOutType );
+ k += TQString::number( (int)m_underlineStyle );
+ k += TQString::number( (int)m_strikeOutStyle );
k += '/';
k += m_language;
k += '/';
if ( d->m_shadowDistanceX != 0 || d->m_shadowDistanceY != 0 )
{
- k += QString::number( d->m_shadowDistanceX );
+ k += TQString::number( d->m_shadowDistanceX );
k += '/';
- k += QString::number( d->m_shadowDistanceY );
+ k += TQString::number( d->m_shadowDistanceY );
k += '/';
- k += QString::number( (uint)d->m_shadowColor.rgb() );
+ k += TQString::number( (uint)d->m_shadowColor.rgb() );
}
k += '/';
- k += QString::number( d->m_relativeTextSize);
+ k += TQString::number( d->m_relativeTextSize);
k += '/';
- k += QString::number( d->m_offsetFromBaseLine);
+ k += TQString::number( d->m_offsetFromBaseLine);
k += '/';
- k += QString::number( (int)d->m_bWordByWord); // boolean -> 1 digit -> no '/'
- k += QString::number( (int)m_attributeFont);
+ k += TQString::number( (int)d->m_bWordByWord); // boolean -> 1 digit -> no '/'
+ k += TQString::number( (int)m_attributeFont);
k += '/';
- k += QString::number( (int)d->m_bHyphenation); // boolean -> 1 digit -> no '/'
- k += QString::number( (double)d->m_underLineWidth);
+ k += TQString::number( (int)d->m_bHyphenation); // boolean -> 1 digit -> no '/'
+ k += TQString::number( (double)d->m_underLineWidth);
////
// Keep in sync with method below
m_key = k;
@@ -877,27 +877,27 @@ void KoTextFormat::generateKey()
// This is used to create "simple formats", with font and color etc., but without
// advanced features. Doesn't matter, don't extend the args.
-QString KoTextFormat::getKey( const QFont &fn, const QColor &col, bool misspelled, VerticalAlignment a )
+TQString KoTextFormat::getKey( const TQFont &fn, const TQColor &col, bool misspelled, VerticalAlignment a )
{
- QString k = fn.key();
+ TQString k = fn.key();
k += '/';
if ( col.isValid() ) // just to shorten the key in the common case
- k += QString::number( (uint)col.rgb() );
+ k += TQString::number( (uint)col.rgb() );
k += '/';
- k += QString::number( (int)misspelled );
- k += QString::number( (int)a );
+ k += TQString::number( (int)misspelled );
+ k += TQString::number( (int)a );
//// kotext addition
k += '/';
// no background color
k += '/';
// no underline color
k += '/';
- k += QString::number( (int)U_NONE );
- k += QString::number( (int)S_NONE ); // no double-underline in a "simple format"
- k += QString::number( (int)U_SOLID );
- k += QString::number( (int)S_SOLID ); // no double-underline in a "simple format"
+ k += TQString::number( (int)U_NONE );
+ k += TQString::number( (int)S_NONE ); // no double-underline in a "simple format"
+ k += TQString::number( (int)U_SOLID );
+ k += TQString::number( (int)S_SOLID ); // no double-underline in a "simple format"
k += '/';
- //k += QString::null; // spellcheck language
+ //k += TQString(); // spellcheck language
k += '/';
//no shadow
k += '/';
@@ -916,7 +916,7 @@ QString KoTextFormat::getKey( const QFont &fn, const QColor &col, bool misspelle
}
-QString KoTextFormat::key() const
+TQString KoTextFormat::key() const
{
if ( m_key.isEmpty() )
const_cast<KoTextFormat*>( this )->generateKey();
@@ -976,14 +976,14 @@ void KoTextFormat::setStrikeOutStyle( StrikeOutStyle _type )
update();
}
-void KoTextFormat::setTextBackgroundColor(const QColor &_col)
+void KoTextFormat::setTextBackgroundColor(const TQColor &_col)
{
if(m_textBackColor==_col)
return;
m_textBackColor=_col;
update();
}
-void KoTextFormat::setTextUnderlineColor(const QColor &_col)
+void KoTextFormat::setTextUnderlineColor(const TQColor &_col)
{
if ( m_textUnderlineColor == _col )
return;
@@ -991,7 +991,7 @@ void KoTextFormat::setTextUnderlineColor(const QColor &_col)
update();
}
-void KoTextFormat::setShadow( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor )
+void KoTextFormat::setShadow( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor )
{
if ( d->m_shadowDistanceX == shadowDistanceX &&
d->m_shadowDistanceY == shadowDistanceY &&
@@ -1081,11 +1081,11 @@ int KoTextFormat::compare( const KoTextFormat & format ) const
return flags;
}
-QColor KoTextFormat::defaultTextColor( QPainter * painter )
+TQColor KoTextFormat::defaultTextColor( TQPainter * painter )
{
- if ( painter->device()->devType() == QInternal::Printer )
- return Qt::black;
- return QApplication::palette().color( QPalette::Active, QColorGroup::Text );
+ if ( painter->device()->devType() == TQInternal::Printer )
+ return TQt::black;
+ return TQApplication::palette().color( TQPalette::Active, TQColorGroup::Text );
}
float KoTextFormat::screenPointSize( const KoTextZoomHandler* zh ) const
@@ -1094,7 +1094,7 @@ float KoTextFormat::screenPointSize( const KoTextZoomHandler* zh ) const
int pointSizeLU = KoTextZoomHandler::ptToLayoutUnitPt( pointSize() );
if ( vAlign() != KoTextFormat::AlignNormal )
pointSizeLU = (int)( pointSizeLU *relativeTextSize() );
- return zh->layoutUnitToFontSize( pointSizeLU, false /* forPrint */ );
+ return zh->tqlayoutUnitToFontSize( pointSizeLU, false /* forPrint */ );
}
float KoTextFormat::refPointSize() const
@@ -1105,13 +1105,13 @@ float KoTextFormat::refPointSize() const
return pointSize();
}
-QFont KoTextFormat::refFont() const
+TQFont KoTextFormat::refFont() const
{
float pointSize = refPointSize();
if ( !d->m_refFont || pointSize != d->m_refFont->pointSizeFloat() )
{
delete d->m_refFont;
- d->m_refFont = new QFont( font() );
+ d->m_refFont = new TQFont( font() );
d->m_refFont->setPointSizeFloat( pointSize );
delete d->m_refFontMetrics;
d->m_refFontMetrics = 0;
@@ -1120,7 +1120,7 @@ QFont KoTextFormat::refFont() const
return *d->m_refFont;
}
-QFont KoTextFormat::screenFont( const KoTextZoomHandler* zh ) const
+TQFont KoTextFormat::screenFont( const KoTextZoomHandler* zh ) const
{
float pointSize = screenPointSize( zh );
//kdDebug(32500) << "KoTextFormat::screenFont pointSize=" << pointSize << endl;
@@ -1132,7 +1132,7 @@ QFont KoTextFormat::screenFont( const KoTextZoomHandler* zh ) const
if ( !d->m_screenFont || kAbs( pointSize - d->m_screenFont->pointSizeFloat() ) > 1E-4 )
{
delete d->m_screenFont;
- d->m_screenFont = new QFont( font() );
+ d->m_screenFont = new TQFont( font() );
d->m_screenFont->setPointSizeFloat( pointSize );
delete d->m_screenFontMetrics;
d->m_screenFontMetrics = 0;
@@ -1141,36 +1141,36 @@ QFont KoTextFormat::screenFont( const KoTextZoomHandler* zh ) const
return *d->m_screenFont;
}
-const QFontMetrics& KoTextFormat::screenFontMetrics( const KoTextZoomHandler* zh ) const
+const TQFontMetrics& KoTextFormat::screenFontMetrics( const KoTextZoomHandler* zh ) const
{
- QFont f = screenFont(zh); // don't move inside the if!
+ TQFont f = screenFont(zh); // don't move inside the if!
- if ( !d->m_screenFontMetrics ) // not calculated, or invalidated by screenFont above
+ if ( !d->m_screenFontMetrics ) // not calculated, or tqinvalidated by screenFont above
{
//kdDebug(32500) << this << " KoTextFormat::screenFontMetrics pointSize=" << pointSize << " d->m_screenFont->pointSizeFloat()=" << d->m_screenFont->pointSizeFloat() << endl;
- d->m_screenFontMetrics = new QFontMetrics( f );
+ d->m_screenFontMetrics = new TQFontMetrics( f );
//kdDebug(32500) << "KoTextFormat::screenFontMetrics created new metrics with size " << pointSize << " height:" << d->m_screenFontMetrics->height() << endl;
}
return *d->m_screenFontMetrics;
}
-const QFontMetrics& KoTextFormat::refFontMetrics() const
+const TQFontMetrics& KoTextFormat::refFontMetrics() const
{
- QFont f = refFont();
+ TQFont f = refFont();
if ( !d->m_refFontMetrics )
{
//kdDebug(32500) << this << " KoTextFormat::refFontMetrics pointSize=" << pointSize << " d->m_refFont->pointSizeFloat()=" << d->m_refFont->pointSizeFloat() << endl;
- d->m_refFontMetrics = new QFontMetrics( f );
+ d->m_refFontMetrics = new TQFontMetrics( f );
//kdDebug(32500) << "KoTextFormat::refFontMetrics created new metrics with size " << pointSize << " height:" << d->m_refFontMetrics->height() << endl;
}
return *d->m_refFontMetrics;
}
-QFont KoTextFormat::smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const
+TQFont KoTextFormat::smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const
{
- QFont font = applyZoom ? screenFont( zh ) : refFont();
- QFontMetrics fm = refFontMetrics(); // only used for proportions, so applyZoom doesn't matter
+ TQFont font = applyZoom ? screenFont( zh ) : refFont();
+ TQFontMetrics fm = refFontMetrics(); // only used for proportions, so applyZoom doesn't matter
double pointSize = font.pointSize() * ((double)fm.boundingRect("x").height()/(double)fm.boundingRect("X").height());
font.setPointSizeFloat( pointSize );
return font;
@@ -1179,15 +1179,15 @@ QFont KoTextFormat::smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom )
int KoTextFormat::charWidth( const KoTextZoomHandler* zh, bool applyZoom, const KoTextStringChar* c,
const KoTextParag* parag, int i ) const
{
- ushort unicode = c->c.unicode();
- if ( !c->charStop || unicode == 0xad || unicode == 0x2028 )
+ ushort tqunicode = c->c.tqunicode();
+ if ( !c->charStop || tqunicode == 0xad || tqunicode == 0x2028 )
return 0;
Q_ASSERT( !c->isCustom() ); // actually it's a bit stupid to call this for custom items
if( c->isCustom() ) {
if( c->customItem()->placement() == KoTextCustomItem::PlaceInline ) {
// customitem width is in LU pixels. Convert to 100%-zoom-pixels (pt2pt==pix2pix)
- double w = KoTextZoomHandler::layoutUnitPtToPt( c->customItem()->width );
- return qRound( applyZoom ? ( w * zh->zoomFactorX() ) : w );
+ double w = KoTextZoomHandler::tqlayoutUnitPtToPt( c->customItem()->width );
+ return tqRound( applyZoom ? ( w * zh->zoomFactorX() ) : w );
}
else
return 0;
@@ -1199,7 +1199,7 @@ int KoTextFormat::charWidth( const KoTextZoomHandler* zh, bool applyZoom, const
// Small caps -> we can't use the cached font metrics from KoTextFormat
if ( attributeFont() == KoTextFormat::ATT_SMALL_CAPS && c->c.upper() != c->c )
{
- pixelww = QFontMetrics( smallCapsFont( zh, applyZoom ) ).width( displayedChar( c->c ) );
+ pixelww = TQFontMetrics( smallCapsFont( zh, applyZoom ) ).width( displayedChar( c->c ) );
}
else
// Use the cached font metrics from KoTextFormat
@@ -1209,13 +1209,13 @@ int KoTextFormat::charWidth( const KoTextZoomHandler* zh, bool applyZoom, const
pixelww = this->screenFontMetrics( zh ).width( displayedChar( c->c ) );
} else {
// Use the m_screenWidths[] array when possible, even faster
- Q_ASSERT( unicode < 256 );
- pixelww = d->m_screenWidths[ unicode ];
+ Q_ASSERT( tqunicode < 256 );
+ pixelww = d->m_screenWidths[ tqunicode ];
// Not in cache yet -> calculate
if ( pixelww == 0 ) {
pixelww = this->screenFontMetrics( zh ).width( displayedChar( c->c ) );
Q_ASSERT( pixelww < 65535 );
- d->m_screenWidths[ unicode ] = pixelww;
+ d->m_screenWidths[ tqunicode ] = pixelww;
}
}
}
@@ -1226,13 +1226,13 @@ int KoTextFormat::charWidth( const KoTextZoomHandler* zh, bool applyZoom, const
else {
// Complex text. We need some hacks to get the right metric here
bool smallCaps = ( attributeFont() == KoTextFormat::ATT_SMALL_CAPS && c->c.upper() != c->c );
- const QFontMetrics& fontMetrics = smallCaps ? smallCapsFont( zh, applyZoom ) : applyZoom ? screenFontMetrics( zh ) : refFontMetrics();
- QString str;
+ const TQFontMetrics& fontMetrics = smallCaps ? smallCapsFont( zh, applyZoom ) : applyZoom ? screenFontMetrics( zh ) : refFontMetrics();
+ TQString str;
int pos = 0;
if( i > 8 )
pos = i - 8;
int off = i - pos;
- int end = QMIN( parag->length(), i + 8 );
+ int end = TQMIN( parag->length(), i + 8 );
while ( pos < end ) {
str += displayedChar( parag->at(pos)->c );
pos++;
@@ -1241,7 +1241,7 @@ int KoTextFormat::charWidth( const KoTextZoomHandler* zh, bool applyZoom, const
}
#if 0
- kdDebug(32500) << "KoTextFormat::charWidth: char=" << QString(c->c) << " format=" << key()
+ kdDebug(32500) << "KoTextFormat::charWidth: char=" << TQString(c->c) << " format=" << key()
<< ", applyZoom=" << applyZoom << " pixel-width=" << pixelww << endl;
#endif
return pixelww;
@@ -1252,7 +1252,7 @@ int KoTextFormat::height() const
if ( d->m_refHeight < 0 )
{
// Calculate height using 100%-zoom font
- int h = refFontMetrics().height()+QABS(offsetFromBaseLine());
+ int h = refFontMetrics().height()+TQABS(offsetFromBaseLine());
if ( vAlign() == KoTextFormat::AlignSuperScript )
h += refFontMetrics().height()/2;
else if ( vAlign() == KoTextFormat::AlignSubScript )
@@ -1261,12 +1261,12 @@ int KoTextFormat::height() const
// Add room for the shadow
if ( d->m_shadowDistanceY != 0 ) {
// pt -> pixel (at 100% zoom)
- h += (int)(POINT_TO_INCH( static_cast<double>( KoGlobal::dpiY() ) ) * QABS( d->m_shadowDistanceY ) );
+ h += (int)(POINT_TO_INCH( static_cast<double>( KoGlobal::dpiY() ) ) * TQABS( d->m_shadowDistanceY ) );
}
//kdDebug(32500) << "KoTextFormat::height 100%-zoom font says h=" << h << " in LU:" << KoTextZoomHandler::ptToLayoutUnitPt(h) << endl;
// Then scale to LU
- d->m_refHeight = qRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
+ d->m_refHeight = tqRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
}
return d->m_refHeight;
}
@@ -1280,7 +1280,7 @@ int KoTextFormat::offsetX() const // in LU pixels
// Somehow we should only do this if x == 0 (in the formatter)
if ( d->m_shadowDistanceX < 0 )
{
- double lupt = KoTextZoomHandler::ptToLayoutUnitPt( QABS( d->m_shadowDistanceX ) );
+ double lupt = KoTextZoomHandler::ptToLayoutUnitPt( TQABS( d->m_shadowDistanceX ) );
off += (int)(POINT_TO_INCH( static_cast<double>( KoGlobal::dpiX() ) ) * lupt );
}
#endif
@@ -1294,14 +1294,14 @@ int KoTextFormat::offsetY() const // in LU pixels
// Shadow on top -> character is moved down
if ( d->m_shadowDistanceY < 0 )
{
- double lupt = KoTextZoomHandler::ptToLayoutUnitPt( QABS( d->m_shadowDistanceY ) );
+ double lupt = KoTextZoomHandler::ptToLayoutUnitPt( TQABS( d->m_shadowDistanceY ) );
off += (int)(POINT_TO_INCH( static_cast<double>( KoGlobal::dpiY() ) ) * lupt );
}
#endif
return off;
}
-QString KoTextFormat::displayedString( const QString& str )const
+TQString KoTextFormat::displayedString( const TQString& str )const
{
switch ( m_attributeFont ) {
case ATT_NONE:
@@ -1317,9 +1317,9 @@ QString KoTextFormat::displayedString( const QString& str )const
}
}
-QChar KoTextFormat::displayedChar( QChar c )const
+TQChar KoTextFormat::displayedChar( TQChar c )const
{
- if ( c.unicode() == 0xa0 ) // nbsp
+ if ( c.tqunicode() == 0xa0 ) // nbsp
return ' ';
switch ( m_attributeFont ) {
case ATT_NONE:
@@ -1346,7 +1346,7 @@ int KoTextFormat::ascent() const
if ( vAlign() == KoTextFormat::AlignSuperScript )
h += refFontMetrics().height()/2;
// Then scale to LU
- d->m_refAscent = qRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
+ d->m_refAscent = tqRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
//d->m_refAscent += offsetY();
}
return d->m_refAscent;
@@ -1361,7 +1361,7 @@ int KoTextFormat::descent() const
if ( offsetFromBaseLine()<0 )
h -= offsetFromBaseLine();
// Then scale to LU
- d->m_refDescent = qRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
+ d->m_refDescent = tqRound( KoTextZoomHandler::ptToLayoutUnitPt( h ) );
//d->m_refDescent += offsetY();
}
return d->m_refDescent;
@@ -1374,7 +1374,7 @@ int KoTextFormat::charWidthLU( const KoTextStringChar* c, const KoTextParag* par
return KoTextZoomHandler::ptToLayoutUnitPt( charWidth( 0L, false, c, parag, i ) );
}
-int KoTextFormat::width( const QChar& ch ) const
+int KoTextFormat::width( const TQChar& ch ) const
{
// Warning this doesn't take into account the shadow
return KoTextZoomHandler::ptToLayoutUnitPt( refFontMetrics().width( ch ) );
@@ -1390,43 +1390,43 @@ KoCharStyle *KoTextFormat::style() const
return d->m_charStyle;
}
-QString KoTextFormat::shadowAsCss( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor )
+TQString KoTextFormat::shadowAsCss( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor )
{
// http://www.w3.org/TR/REC-CSS2/text.html#text-shadow-props
// none | [<color> || <length (h)> <length (v)> <length (blur radius, not used here)>] ...
// => none or color length length
if ( shadowDistanceX != 0 || shadowDistanceY != 0 )
{
- QString css = shadowColor.name() + " ";
- css += QString::number(shadowDistanceX) + "pt ";
- css += QString::number(shadowDistanceY) + "pt";
+ TQString css = shadowColor.name() + " ";
+ css += TQString::number(shadowDistanceX) + "pt ";
+ css += TQString::number(shadowDistanceY) + "pt";
return css;
}
return "none";
}
-QString KoTextFormat::shadowAsCss() const
+TQString KoTextFormat::shadowAsCss() const
{
return shadowAsCss( d->m_shadowDistanceX, d->m_shadowDistanceY, d->m_shadowColor );
}
-void KoTextFormat::parseShadowFromCss( const QString& _css )
+void KoTextFormat::parseShadowFromCss( const TQString& _css )
{
- QString css = _css.simplifyWhiteSpace();
+ TQString css = _css.simplifyWhiteSpace();
if ( css.isEmpty() || css == "none" )
{
d->m_shadowDistanceX = 0;
d->m_shadowDistanceY = 0;
- d->m_shadowColor = QColor();
+ d->m_shadowColor = TQColor();
} else
{
- QStringList tokens = QStringList::split(' ', css);
+ TQStringList tokens = TQStringList::split(' ', css);
if ( tokens.isEmpty() ) {
kdWarning(32500) << "Parse error in text-shadow: " << css << endl;
return;
}
// Check which token looks like a color
- QColor col( tokens.first() );
+ TQColor col( tokens.first() );
if ( col.isValid() )
tokens.pop_front();
else if ( tokens.count() > 1 )
@@ -1452,7 +1452,7 @@ void KoTextFormat::parseShadowFromCss( const QString& _css )
update();
}
-QColor KoTextFormat::shadowColor() const
+TQColor KoTextFormat::shadowColor() const
{
if ( d->m_shadowColor.isValid() )
return d->m_shadowColor;
@@ -1471,9 +1471,9 @@ int KoTextFormat::shadowY( KoTextZoomHandler *zh ) const
}
//static
-QString KoTextFormat::underlineStyleToString( KoTextFormat::UnderlineStyle _lineType )
+TQString KoTextFormat::underlineStyleToString( KoTextFormat::UnderlineStyle _lineType )
{
- QString strLineType;
+ TQString strLineType;
switch ( _lineType )
{
case KoTextFormat::U_SOLID:
@@ -1495,9 +1495,9 @@ QString KoTextFormat::underlineStyleToString( KoTextFormat::UnderlineStyle _line
return strLineType;
}
-QString KoTextFormat::strikeOutStyleToString( KoTextFormat::StrikeOutStyle _lineType )
+TQString KoTextFormat::strikeOutStyleToString( KoTextFormat::StrikeOutStyle _lineType )
{
- QString strLineType;
+ TQString strLineType;
switch ( _lineType )
{
case KoTextFormat::S_SOLID:
@@ -1519,7 +1519,7 @@ QString KoTextFormat::strikeOutStyleToString( KoTextFormat::StrikeOutStyle _line
return strLineType;
}
-KoTextFormat::UnderlineStyle KoTextFormat::stringToUnderlineStyle( const QString & _str )
+KoTextFormat::UnderlineStyle KoTextFormat::stringToUnderlineStyle( const TQString & _str )
{
if ( _str =="solid")
return KoTextFormat::U_SOLID;
@@ -1535,7 +1535,7 @@ KoTextFormat::UnderlineStyle KoTextFormat::stringToUnderlineStyle( const QString
return KoTextFormat::U_SOLID;
}
-KoTextFormat::StrikeOutStyle KoTextFormat::stringToStrikeOutStyle( const QString & _str )
+KoTextFormat::StrikeOutStyle KoTextFormat::stringToStrikeOutStyle( const TQString & _str )
{
if ( _str =="solid")
return KoTextFormat::S_SOLID;
@@ -1551,21 +1551,21 @@ KoTextFormat::StrikeOutStyle KoTextFormat::stringToStrikeOutStyle( const QString
return KoTextFormat::S_SOLID;
}
-QString KoTextFormat::attributeFontToString( KoTextFormat::AttributeStyle _attr )
+TQString KoTextFormat::attributeFontToString( KoTextFormat::AttributeStyle _attr )
{
if (_attr == KoTextFormat::ATT_NONE )
- return QString("none");
+ return TQString("none");
else if ( _attr == KoTextFormat::ATT_UPPER )
- return QString("uppercase");
+ return TQString("uppercase");
else if ( _attr == KoTextFormat::ATT_LOWER )
- return QString("lowercase");
+ return TQString("lowercase");
else if ( _attr == KoTextFormat::ATT_SMALL_CAPS )
- return QString("smallcaps");
+ return TQString("smallcaps");
else
- return QString("none");
+ return TQString("none");
}
-KoTextFormat::AttributeStyle KoTextFormat::stringToAttributeFont( const QString & _str )
+KoTextFormat::AttributeStyle KoTextFormat::stringToAttributeFont( const TQString & _str )
{
if ( _str == "none" )
return KoTextFormat::ATT_NONE;
@@ -1598,7 +1598,7 @@ void KoTextFormat::setUnderLineWidth( double ulw )
}
-void KoTextFormat::setLanguage( const QString & _lang)
+void KoTextFormat::setLanguage( const TQString & _lang)
{
if ( m_language == _lang )
return;
@@ -1606,9 +1606,9 @@ void KoTextFormat::setLanguage( const QString & _lang)
update();
}
-QStringList KoTextFormat::underlineTypeList()
+TQStringList KoTextFormat::underlineTypeList()
{
- QStringList lst;
+ TQStringList lst;
lst <<i18n("Underline Style", "None");
lst <<i18n("Single");
lst <<i18n("Double");
@@ -1617,9 +1617,9 @@ QStringList KoTextFormat::underlineTypeList()
return lst;
}
-QStringList KoTextFormat::strikeOutTypeList()
+TQStringList KoTextFormat::strikeOutTypeList()
{
- QStringList lst;
+ TQStringList lst;
lst <<i18n("Strikeout Style", "None");
lst <<i18n("Single");
lst <<i18n("Double");
@@ -1627,9 +1627,9 @@ QStringList KoTextFormat::strikeOutTypeList()
return lst;
}
-QStringList KoTextFormat::fontAttributeList()
+TQStringList KoTextFormat::fontAttributeList()
{
- QStringList lst;
+ TQStringList lst;
lst <<i18n("Normal");
lst <<i18n("Uppercase");
lst <<i18n("Lowercase");
@@ -1637,9 +1637,9 @@ QStringList KoTextFormat::fontAttributeList()
return lst;
}
-QStringList KoTextFormat::underlineStyleList()
+TQStringList KoTextFormat::underlineStyleList()
{
- QStringList lst;
+ TQStringList lst;
lst <<"_________"; // SOLID
lst <<"___ ___ __"; // DASH
lst <<"_ _ _ _ _ _"; // DOT
@@ -1648,9 +1648,9 @@ QStringList KoTextFormat::underlineStyleList()
return lst;
}
-QStringList KoTextFormat::strikeOutStyleList()
+TQStringList KoTextFormat::strikeOutStyleList()
{
- QStringList lst;
+ TQStringList lst;
lst <<"_________"; // SOLID
lst <<"___ ___ __"; // DASH
lst <<"_ _ _ _ _ _"; // DOT
@@ -1662,10 +1662,10 @@ QStringList KoTextFormat::strikeOutStyleList()
#ifndef NDEBUG
void KoTextFormat::printDebug()
{
- QString col = color().isValid() ? color().name() : QString("(default)");
+ TQString col = color().isValid() ? color().name() : TQString("(default)");
kdDebug(32500) << "format '" << key() << "' (" << (void*)this << "):"
<< " refcount: " << ref
- << " realfont: " << QFontInfo( font() ).family()
+ << " realfont: " << TQFontInfo( font() ).family()
<< " color: " << col << " shadow=" << shadowAsCss() << endl;
}
#endif
@@ -1678,14 +1678,14 @@ KoTextFormatCollection::KoTextFormatCollection()
#ifdef DEBUG_COLLECTION
kdDebug(32500) << "KoTextFormatCollection::KoTextFormatCollection " << this << endl;
#endif
- defFormat = new KoTextFormat( QApplication::font(), QColor(), KGlobal::locale()->language(), false );
+ defFormat = new KoTextFormat( TQApplication::font(), TQColor(), KGlobal::locale()->language(), false );
lastFormat = cres = 0;
cflags = -1;
cKey.setAutoDelete( TRUE );
cachedFormat = 0;
}
-KoTextFormatCollection::KoTextFormatCollection( const QFont& defaultFont, const QColor& defaultColor, const QString & defaultLanguage, bool defaultHyphenation )
+KoTextFormatCollection::KoTextFormatCollection( const TQFont& defaultFont, const TQColor& defaultColor, const TQString & defaultLanguage, bool defaultHyphenation )
: cKey( 307 )
{
#ifdef DEBUG_COLLECTION
@@ -1709,7 +1709,7 @@ KoTextFormatCollection::~KoTextFormatCollection()
KoTextFormat *KoTextFormatCollection::format( const KoTextFormat *f )
{
- if ( f->parent() == this || f == defFormat ) {
+ if ( f->tqparent() == this || f == defFormat ) {
#ifdef DEBUG_COLLECTION
kdDebug(32500) << " format(f) need '" << f->key() << "', best case!" << endl;
#endif
@@ -1737,7 +1737,7 @@ KoTextFormat *KoTextFormatCollection::format( const KoTextFormat *f )
}
#endif
- KoTextFormat *fm = cKey.find( f->key() );
+ KoTextFormat *fm = cKey.tqfind( f->key() );
if ( fm ) {
#ifdef DEBUG_COLLECTION
kdDebug(32500) << " format(f) need '" << f->key() << "', normal case!" << endl;
@@ -1783,7 +1783,7 @@ KoTextFormat *KoTextFormatCollection::format( const KoTextFormat *of, const KoTe
#endif
cres->copyFormat( *nf, flags );
- KoTextFormat *fm = cKey.find( cres->key() );
+ KoTextFormat *fm = cKey.tqfind( cres->key() );
if ( !fm ) {
#ifdef DEBUG_COLLECTION
kdDebug(32500) << " format(of,nf,flags) mix of '" << of->key() << "' and '" << nf->key() << ", worst case!" << endl;
@@ -1803,7 +1803,7 @@ KoTextFormat *KoTextFormatCollection::format( const KoTextFormat *of, const KoTe
}
#if 0
-KoTextFormat *KoTextFormatCollection::format( const QFont &f, const QColor &c, const QString & language, bool hyphen )
+KoTextFormat *KoTextFormatCollection::format( const TQFont &f, const TQColor &c, const TQString & language, bool hyphen )
{
if ( cachedFormat && cfont == f && ccol == c ) {
#ifdef DEBUG_COLLECTION
@@ -1813,8 +1813,8 @@ KoTextFormat *KoTextFormatCollection::format( const QFont &f, const QColor &c, c
return cachedFormat;
}
- QString key = KoTextFormat::getKey( f, c, FALSE, KoTextFormat::AlignNormal );
- cachedFormat = cKey.find( key );
+ TQString key = KoTextFormat::getKey( f, c, FALSE, KoTextFormat::AlignNormal );
+ cachedFormat = cKey.tqfind( key );
cfont = f;
ccol = c;
@@ -1854,16 +1854,16 @@ void KoTextFormatCollection::remove( KoTextFormat *f )
void KoTextFormatCollection::zoomChanged()
{
- QDictIterator<KoTextFormat> it( cKey );
+ TQDictIterator<KoTextFormat> it( cKey );
for ( ; it.current(); ++it ) {
it.current()->zoomChanged();
}
}
#if 0
-void KoTextFormatCollection::setPainter( QPainter *p )
+void KoTextFormatCollection::setPainter( TQPainter *p )
{
- QDictIterator<KoTextFormat> it( cKey );
+ TQDictIterator<KoTextFormat> it( cKey );
KoTextFormat *f;
while ( ( f = it.current() ) ) {
++it;
@@ -1876,8 +1876,8 @@ void KoTextFormatCollection::setPainter( QPainter *p )
void KoTextFormatCollection::debug()
{
kdDebug(32500) << "------------ KoTextFormatCollection: debug --------------- BEGIN" << endl;
- kdDebug(32500) << "Default Format: '" << defFormat->key() << "' (" << (void*)defFormat << "): realfont: " << QFontInfo( defFormat->font() ).family() << endl;
- QDictIterator<KoTextFormat> it( cKey );
+ kdDebug(32500) << "Default Format: '" << defFormat->key() << "' (" << (void*)defFormat << "): realfont: " << TQFontInfo( defFormat->font() ).family() << endl;
+ TQDictIterator<KoTextFormat> it( cKey );
for ( ; it.current(); ++it ) {
Q_ASSERT(it.currentKey() == it.current()->key());
if(it.currentKey() != it.current()->key())
diff --git a/lib/kotext/KoTextFormat.h b/lib/kotext/KoTextFormat.h
index 850dcd2f..25211f54 100644
--- a/lib/kotext/KoTextFormat.h
+++ b/lib/kotext/KoTextFormat.h
@@ -24,14 +24,14 @@
#undef S_NONE // Solaris defines it in sys/signal.h
-#include <qcolor.h>
-#include <qfont.h>
-#include <qstring.h>
-#include <qdict.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqstring.h>
+#include <tqdict.h>
#include <koffice_export.h>
class KoGenStyle;
-class QFontMetrics;
+class TQFontMetrics;
class KoCharStyle;
class KoTextFormatCollection;
class KoTextZoomHandler;
@@ -73,10 +73,10 @@ public:
}
void clearCache();
// caching for speedup when formatting
- QFont* m_screenFont; // font to be used when painting (zoom-dependent)
- QFontMetrics* m_screenFontMetrics; // font metrics on screen (zoom-dependent)
- QFont* m_refFont; // font to be used when formatting text for layout units
- QFontMetrics* m_refFontMetrics; // font metrics for m_refFontMetrics
+ TQFont* m_screenFont; // font to be used when painting (zoom-dependent)
+ TQFontMetrics* m_screenFontMetrics; // font metrics on screen (zoom-dependent)
+ TQFont* m_refFont; // font to be used when formatting text for tqlayout units
+ TQFontMetrics* m_refFontMetrics; // font metrics for m_refFontMetrics
int m_refAscent;
int m_refDescent;
int m_refHeight;
@@ -89,7 +89,7 @@ public:
double m_shadowDistanceX; // 0 in both x and y means no shadow
double m_shadowDistanceY;
- QColor m_shadowColor;
+ TQColor m_shadowColor;
bool m_bWordByWord;
bool m_bHyphenation;
};
@@ -124,7 +124,7 @@ public:
WordByWord | Attribute | Hyphenation | UnderLineWidth
};
- enum VerticalAlignment { AlignNormal, AlignSubScript, AlignSuperScript, AlignCustom }; // QRT now has it in another order, but it's too late, we use this order in KWord's file format now !
+ enum VerticalAlignment { AlignNormal, AlignSubScript, AlignSuperScript, AlignCustom }; // TQRT now has it in another order, but it's too late, we use this order in KWord's file format now !
enum UnderlineType { U_NONE = 0, U_SIMPLE = 1, U_DOUBLE = 2, U_SIMPLE_BOLD = 3, U_WAVE = 4};
enum StrikeOutType { S_NONE = 0, S_SIMPLE = 1, S_DOUBLE = 2, S_SIMPLE_BOLD = 3};
enum UnderlineStyle { U_SOLID = 0 , U_DASH = 1, U_DOT = 2, U_DASH_DOT = 3, U_DASH_DOT_DOT = 4};
@@ -138,35 +138,35 @@ public:
/// A simple text format with some default settings
/// Only used for the default format
- KoTextFormat( const QFont &f, const QColor &c, const QString &_language,
- bool hyphenation, KoTextFormatCollection *parent = 0 );
+ KoTextFormat( const TQFont &f, const TQColor &c, const TQString &_language,
+ bool hyphenation, KoTextFormatCollection *tqparent = 0 );
/// A complete text format (used by KoFontDia)
- KoTextFormat( const QFont &_font,
+ KoTextFormat( const TQFont &_font,
VerticalAlignment _valign,
- const QColor & _color,
- const QColor & _backGroundColor,
- const QColor & _underlineColor,
+ const TQColor & _color,
+ const TQColor & _backGroundColor,
+ const TQColor & _underlineColor,
KoTextFormat::UnderlineType _underlineType,
KoTextFormat::UnderlineStyle _underlineStyle,
KoTextFormat::StrikeOutType _strikeOutType,
KoTextFormat::StrikeOutStyle _strikeOutStyle,
KoTextFormat::AttributeStyle _fontAttribute,
- const QString &_language,
+ const TQString &_language,
double _relativeTextSize,
int _offsetFromBaseLine,
bool _wordByWord,
bool _hyphenation,
double _shadowDistanceX,
double _shadowDistanceY,
- const QColor& shadowColor );
+ const TQColor& shadowColor );
KoTextFormat( const KoTextFormat &fm );
- //KoTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr ) const;
+ //KoTextFormat makeTextFormat( const TQStyleSheetItem *style, const TQMap<TQString,TQString>& attr ) const;
KoTextFormat& operator=( const KoTextFormat &fm );
void copyFormat( const KoTextFormat &fm, int flags );
- QColor color() const;
- QFont font() const;
+ TQColor color() const;
+ TQFont font() const;
int pointSize() const { return font().pointSize(); }
bool isMisspelled() const;
VerticalAlignment vAlign() const;
@@ -177,8 +177,8 @@ public:
* Do not call this for custom items, or for complex glyphs.
* But this can still be used for ' ' (for parag counters), 'x' (for tabs) etc.
*/
- int width( const QChar &c ) const;
- int width( const QString &str, int pos ) const;
+ int width( const TQChar &c ) const;
+ int width( const TQString &str, int pos ) const;
int height() const; // in LU pixels
int ascent() const; // in LU pixels
int descent() const; // in LU pixels
@@ -189,19 +189,19 @@ public:
void setBold( bool b );
void setItalic( bool b );
void setUnderline( bool b );
- void setFamily( const QString &f );
+ void setFamily( const TQString &f );
void setPointSize( int s );
- void setFont( const QFont &f );
- void setColor( const QColor &c );
+ void setFont( const TQFont &f );
+ void setColor( const TQColor &c );
void setMisspelled( bool b );
void setVAlign( VerticalAlignment a );
bool operator==( const KoTextFormat &f ) const;
- KoTextFormatCollection *parent() const;
- void setCollection( KoTextFormatCollection *parent ) { collection = parent; }
- QString key() const;
+ KoTextFormatCollection *tqparent() const;
+ void setCollection( KoTextFormatCollection *tqparent ) { collection = tqparent; }
+ TQString key() const;
- static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign );
+ static TQString getKey( const TQFont &f, const TQColor &c, bool misspelled, VerticalAlignment vAlign );
void addRef();
void removeRef();
@@ -211,7 +211,7 @@ public:
/** Call this when a text color is set to 'invalid', meaning 'whatever the
* default for the color scheme is' */
- static QColor defaultTextColor( QPainter * painter );
+ static TQColor defaultTextColor( TQPainter * painter );
void setStrikeOutType (StrikeOutType _type);
StrikeOutType strikeOutType()const {return m_strikeOutType;}
@@ -220,11 +220,11 @@ public:
StrikeOutStyle strikeOutStyle()const {return m_strikeOutStyle;}
- void setTextBackgroundColor(const QColor &);
- QColor textBackgroundColor()const {return m_textBackColor;}
+ void setTextBackgroundColor(const TQColor &);
+ TQColor textBackgroundColor()const {return m_textBackColor;}
- void setTextUnderlineColor(const QColor &);
- QColor textUnderlineColor()const {return m_textUnderlineColor;}
+ void setTextUnderlineColor(const TQColor &);
+ TQColor textUnderlineColor()const {return m_textUnderlineColor;}
void setUnderlineType (UnderlineType _type);
UnderlineType underlineType()const {return m_underlineType;}
@@ -232,8 +232,8 @@ public:
void setUnderlineStyle (UnderlineStyle _type);
UnderlineStyle underlineStyle()const {return m_underlineStyle;}
- void setLanguage( const QString & _lang);
- QString language() const { return m_language;}
+ void setLanguage( const TQString & _lang);
+ TQString language() const { return m_language;}
void setHyphenation( bool b );
bool hyphenation() const { return d->m_bHyphenation; }
@@ -250,17 +250,17 @@ public:
double shadowDistanceX() const { return d->m_shadowDistanceX; }
double shadowDistanceY() const { return d->m_shadowDistanceY; }
- QColor shadowColor() const;
+ TQColor shadowColor() const;
/// Return the amount of pixels for the horizontal shadow distance at a given zoom level
int shadowX( KoTextZoomHandler *zh ) const;
/// Return the amount of pixels for the vertical shadow distance at a given zoom level
int shadowY( KoTextZoomHandler *zh ) const;
- void setShadow( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ void setShadow( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
/// Return css string for the shadow, used when saving
- QString shadowAsCss() const;
- static QString shadowAsCss( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ TQString shadowAsCss() const;
+ static TQString shadowAsCss( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
/// Load shadow attributes from a css string, used when loading
- void parseShadowFromCss( const QString& css );
+ void parseShadowFromCss( const TQString& css );
double relativeTextSize() const { return d->m_relativeTextSize;}
void setRelativeTextSize( double _size );
@@ -297,29 +297,29 @@ public:
* This is the one used during formatting, independently from the zoom level.
* This method takes care of superscript and subscript (smaller font).
*/
- const QFontMetrics& refFontMetrics() const;
+ const TQFontMetrics& refFontMetrics() const;
/**
* Returns the font metrics for the font used at the zoom & resolution
* given by 'zh'. Despite the name, this is probably valid for printing too.
* This method takes care of superscript and subscript (smaller font).
*/
- const QFontMetrics& screenFontMetrics( const KoTextZoomHandler* zh ) const;
+ const TQFontMetrics& screenFontMetrics( const KoTextZoomHandler* zh ) const;
/**
* @return the reference font, i.e. with the size specified by the user.
- * This is used at text layout time (e.g. kotextformatter)
+ * This is used at text tqlayout time (e.g. kotextformatter)
*/
- QFont refFont() const;
+ TQFont refFont() const;
/**
* Returns the font to be used at the zoom & resolution given by 'zh'.
* Despite the name, this is probably valid for printing too.
* This method takes care of superscript and subscript (smaller font).
*/
- QFont screenFont( const KoTextZoomHandler* zh ) const;
+ TQFont screenFont( const KoTextZoomHandler* zh ) const;
- QFont smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const;
+ TQFont smallCapsFont( const KoTextZoomHandler* zh, bool applyZoom ) const;
/**
* Return the width of one char in one paragraph.
@@ -338,20 +338,20 @@ public:
void applyCharStyle( KoCharStyle *_style );
KoCharStyle *style() const;
- static QString underlineStyleToString( UnderlineStyle _lineType );
- static QString strikeOutStyleToString( StrikeOutStyle _lineType );
- static UnderlineStyle stringToUnderlineStyle( const QString & _str );
- static StrikeOutStyle stringToStrikeOutStyle( const QString & _str );
+ static TQString underlineStyleToString( UnderlineStyle _lineType );
+ static TQString strikeOutStyleToString( StrikeOutStyle _lineType );
+ static UnderlineStyle stringToUnderlineStyle( const TQString & _str );
+ static StrikeOutStyle stringToStrikeOutStyle( const TQString & _str );
- static QString attributeFontToString( KoTextFormat::AttributeStyle _attr );
- static AttributeStyle stringToAttributeFont( const QString & _str );
+ static TQString attributeFontToString( KoTextFormat::AttributeStyle _attr );
+ static AttributeStyle stringToAttributeFont( const TQString & _str );
- QString displayedString( const QString& c )const;
- static QStringList underlineTypeList();
- static QStringList strikeOutTypeList();
- static QStringList fontAttributeList();
- static QStringList underlineStyleList();
- static QStringList strikeOutStyleList();
+ TQString displayedString( const TQString& c )const;
+ static TQStringList underlineTypeList();
+ static TQStringList strikeOutTypeList();
+ static TQStringList fontAttributeList();
+ static TQStringList underlineStyleList();
+ static TQStringList strikeOutStyleList();
/// Load a text format from OASIS XML
void load( KoOasisContext& context );
@@ -367,37 +367,37 @@ public:
void zoomChanged();
protected:
- QChar displayedChar( QChar c )const;
+ TQChar displayedChar( TQChar c )const;
void generateKey();
private:
void update();
- QColor m_textBackColor;
- QColor m_textUnderlineColor;
+ TQColor m_textBackColor;
+ TQColor m_textUnderlineColor;
UnderlineType m_underlineType;
StrikeOutType m_strikeOutType;
UnderlineStyle m_underlineStyle;
StrikeOutStyle m_strikeOutStyle;
- QString m_language;
+ TQString m_language;
AttributeStyle m_attributeFont;
class KoTextFormatPrivate;
KoTextFormatPrivate *d;
- QFont fn;
- QColor col;
+ TQFont fn;
+ TQColor col;
uint missp : 1;
//uint linkColor : 1;
VerticalAlignment va;
KoTextFormatCollection *collection;
int ref;
- QString m_key;
+ TQString m_key;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class Q_EXPORT QDict<KoTextFormat>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQ_EXPORT TQDict<KoTextFormat>;
+// TQMOC_SKIP_END
#endif
class KOTEXT_EXPORT KoTextFormatCollection
@@ -412,8 +412,8 @@ public:
* @param defaultLanguage the language to use for the default format
* @param defaultHyphenation the hyphenation setting for the default format
*/
- KoTextFormatCollection( const QFont& defaultFont, const QColor& defaultColor,
- const QString & defaultLanguage, bool defaultHyphenation );
+ KoTextFormatCollection( const TQFont& defaultFont, const TQColor& defaultColor,
+ const TQString & defaultLanguage, bool defaultHyphenation );
/*virtual*/ ~KoTextFormatCollection();
void setDefaultFormat( KoTextFormat *f );
@@ -421,42 +421,42 @@ public:
/*virtual*/ KoTextFormat *format( const KoTextFormat *f );
/*virtual*/ KoTextFormat *format( const KoTextFormat *of, const KoTextFormat *nf, int flags );
// Only used for the default format
-// /*virtual*/ KoTextFormat *format( const QFont &f, const QColor &c , const QString &_language, bool hyphen );
+// /*virtual*/ KoTextFormat *format( const TQFont &f, const TQColor &c , const TQString &_language, bool hyphen );
/*virtual*/ void remove( KoTextFormat *f );
/*virtual*/ KoTextFormat *createFormat( const KoTextFormat &f ) { return new KoTextFormat( f ); }
// Only used for the default format
-// /*virtual*/ KoTextFormat *createFormat( const QFont &f, const QColor &c, const QString & _language, bool hyphen ) { return new KoTextFormat( f, c, _language, hyphen, this ); }
+// /*virtual*/ KoTextFormat *createFormat( const TQFont &f, const TQColor &c, const TQString & _language, bool hyphen ) { return new KoTextFormat( f, c, _language, hyphen, this ); }
void debug();
// Called when the zoom or resolution changes
void zoomChanged();
- //void setPainter( QPainter *p );
- //QStyleSheet *styleSheet() const { return sheet; }
- //void setStyleSheet( QStyleSheet *s ) { sheet = s; }
+ //void setPainter( TQPainter *p );
+ //TQStyleSheet *styleSheet() const { return sheet; }
+ //void setStyleSheet( TQStyleSheet *s ) { sheet = s; }
//void updateStyles();
//void updateFontSizes( int base );
- //void updateFontAttributes( const QFont &f, const QFont &old );
+ //void updateFontAttributes( const TQFont &f, const TQFont &old );
- QDict<KoTextFormat> & dict() { return cKey; }
+ TQDict<KoTextFormat> & dict() { return cKey; }
private:
KoTextFormat *defFormat, *lastFormat, *cachedFormat;
- QDict<KoTextFormat> cKey;
+ TQDict<KoTextFormat> cKey;
KoTextFormat *cres;
- QFont cfont;
- QColor ccol;
- QString kof, knf;
+ TQFont cfont;
+ TQColor ccol;
+ TQString kof, knf;
int cflags;
- //QStyleSheet *sheet;
+ //TQStyleSheet *sheet;
};
-inline QColor KoTextFormat::color() const
+inline TQColor KoTextFormat::color() const
{
return col;
}
-inline QFont KoTextFormat::font() const
+inline TQFont KoTextFormat::font() const
{
return fn;
}
@@ -476,7 +476,7 @@ inline bool KoTextFormat::operator==( const KoTextFormat &f ) const
return key() == f.key();
}
-inline KoTextFormatCollection *KoTextFormat::parent() const
+inline KoTextFormatCollection *KoTextFormat::tqparent() const
{
return collection;
}
diff --git a/lib/kotext/KoTextFormatter.cpp b/lib/kotext/KoTextFormatter.cpp
index 7670dff6..6696f041 100644
--- a/lib/kotext/KoTextFormatter.cpp
+++ b/lib/kotext/KoTextFormatter.cpp
@@ -30,7 +30,7 @@
//#define DEBUG_FORMATTER
-// Vertical info (height, baseline etc.)
+//Qt::Vertical info (height, baseline etc.)
//#define DEBUG_FORMATTER_VERT
// Line and paragraph width
@@ -66,7 +66,7 @@ struct TemporaryWordData
};
bool KoTextFormatter::format( KoTextDocument *doc, KoTextParag *parag,
- int start, const QMap<int, KoTextParagLineStart*> &,
+ int start, const TQMap<int, KoTextParagLineStart*> &,
int& y, int& widthUsed )
{
KoTextFormatterCore formatter( this, doc, parag, start );
@@ -83,7 +83,7 @@ KoTextFormatterCore::KoTextFormatterCore( KoTextFormatter* _settings,
{
}
-QPair<int, int> KoTextFormatterCore::determineCharWidth()
+TQPair<int, int> KoTextFormatterCore::determineCharWidth()
{
int ww, pixelww;
KoTextZoomHandler *zh = doc->formattingZoomHandler();
@@ -92,9 +92,9 @@ QPair<int, int> KoTextFormatterCore::determineCharWidth()
if ( c->isCustom() ) {
ww = c->customItem()->width;
Q_ASSERT( ww >= 0 );
- ww = QMAX(0, ww);
+ ww = TQMAX(0, ww);
#ifndef REF_IS_LU
- pixelww = zh->layoutUnitToPixelX( ww );
+ pixelww = zh->tqlayoutUnitToPixelX( ww );
#endif
} else {
ww = charFormat->charWidthLU( c, parag, i );
@@ -113,12 +113,12 @@ QPair<int, int> KoTextFormatterCore::determineCharWidth()
kdDebug(32500) << "nextTab for x=" << x << " returned nx=" << nx << " (=> ww=" << ww << ")" << endl;
#endif
#ifndef REF_IS_LU
- pixelww = zh->layoutUnitToPixelX( ww );
+ pixelww = zh->tqlayoutUnitToPixelX( ww );
#endif
}
Q_ASSERT( ww >= 0 );
c->width = ww;
- return qMakePair(ww, pixelww);
+ return tqMakePair(ww, pixelww);
}
@@ -131,8 +131,8 @@ int KoTextFormatterCore::leftMargin( bool firstLine, bool includeFirstLineMargin
left += parag->firstLineMargin();
// Add the width of the paragraph counter - first line of parag only.
if( parag->counter() &&
- ( parag->counter()->alignment() == Qt::AlignLeft ||
- parag->counter()->alignment() == Qt::AlignAuto ) )
+ ( parag->counter()->tqalignment() == TQt::AlignLeft ||
+ parag->counter()->tqalignment() == TQt::AlignAuto ) )
left += parag->counterWidth(); // in LU pixels
}
return left;
@@ -140,7 +140,7 @@ int KoTextFormatterCore::leftMargin( bool firstLine, bool includeFirstLineMargin
int KoTextFormatterCore::rightMargin( bool firstLine ) const
{
- int right = parag->rightMargin(); // 'rm' in QRT
+ int right = parag->rightMargin(); // 'rm' in TQRT
if ( /*doc &&*/ firstLine && parag->string()->isRightToLeft() )
right += parag->firstLineMargin();
return right;
@@ -195,8 +195,8 @@ bool KoTextFormatterCore::format()
// The result might not be 100% accurate when using a tab (it'll use x=0
// but with counters/margins this might be different). This is why
// we call determineCharWidth() again from within the loop.
- QPair<int, int> widths = determineCharWidth();
- int ww = widths.first; // width in layout units
+ TQPair<int, int> widths = determineCharWidth();
+ int ww = widths.first; // width in tqlayout units
#ifndef REF_IS_LU
int pixelww = widths.second; // width in pixels
#endif
@@ -214,7 +214,7 @@ bool KoTextFormatterCore::format()
int maxY = doc ? doc->flow()->availableHeight() : -1;
- availableWidth = dw - initialRMargin; // 'w' in QRT
+ availableWidth = dw - initialRMargin; // 'w' in TQRT
#if defined(DEBUG_FORMATTER) || defined(DEBUG_FORMATTER_WIDTH)
kdDebug(32500) << "KoTextFormatter::format formatting parag " << parag->paragId()
<< " text:" << parag->string()->toString() << "\n"
@@ -235,7 +235,7 @@ bool KoTextFormatterCore::format()
wused = 0;
- QValueList<TemporaryWordData> tempWordData;
+ TQValueList<TemporaryWordData> tempWordData;
#ifdef DEBUG_FORMATTER
kdDebug(32500) << "Initial KoTextParagLineStart at y=" << y << endl;
@@ -251,16 +251,16 @@ bool KoTextFormatterCore::format()
bool lastWasNonInlineCustom = FALSE;
bool abort = false;
- int align = parag->alignment();
- if ( align == Qt::AlignAuto && doc && doc->alignment() != Qt::AlignAuto )
- align = doc->alignment();
+ int align = parag->tqalignment();
+ if ( align == TQt::AlignAuto && doc && doc->tqalignment() != TQt::AlignAuto )
+ align = doc->tqalignment();
int col = 0;
- maxAvailableWidth = qMakePair( 0, 0 );
+ maxAvailableWidth = tqMakePair( 0, 0 );
KoTextZoomHandler *zh = doc->formattingZoomHandler();
- int pixelx = zh->layoutUnitToPixelX( x );
+ int pixelx = zh->tqlayoutUnitToPixelX( x );
int lastPixelx = 0;
KoTextStringChar* lastChr = 0;
@@ -285,7 +285,7 @@ bool KoTextFormatterCore::format()
else
lastWasNonInlineCustom = FALSE;
- QPair<int, int> widths = determineCharWidth();
+ TQPair<int, int> widths = determineCharWidth();
ww = widths.first;
pixelww = widths.second;
@@ -326,7 +326,7 @@ bool KoTextFormatterCore::format()
}
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "c='" << QString(c->c) << "' i=" << i << "/" << len << " x=" << x << " ww=" << ww << " availableWidth=" << availableWidth << " (test is x+ww>aW) lastBreak=" << lastBreak << " isBreakable=" << settings->isBreakable(string, i) << endl;
+ kdDebug(32500) << "c='" << TQString(c->c) << "' i=" << i << "/" << len << " x=" << x << " ww=" << ww << " availableWidth=" << availableWidth << " (test is x+ww>aW) lastBreak=" << lastBreak << " isBreakable=" << settings->isBreakable(string, i) << endl;
#endif
// Wrapping at end of line - one big if :)
if (
@@ -357,16 +357,16 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "BREAKING" << endl;
#endif
//if ( wrapAtColumn() != -1 )
- // minw = QMAX( minw, x + ww );
+ // minw = TQMAX( minw, x + ww );
bool hyphenated = false;
// Hyphenation: check if we can break somewhere between lastBreak and i
if ( settings->hyphenator() && !c->isCustom() )
{
- int wordStart = QMAX(0, lastBreak+1);
+ int wordStart = TQMAX(0, lastBreak+1);
// Breaking after i isn't possible, i is too far already
int maxlen = i - wordStart; // we can't accept to break after maxlen
- QString word = string->mid( wordStart, maxlen );
+ TQString word = string->mid( wordStart, maxlen );
int wordEnd = i;
// but we need to compose the entire word, to hyphenate it
while ( wordEnd < len && !settings->isBreakable( string, wordEnd ) ) {
@@ -375,7 +375,7 @@ bool KoTextFormatterCore::format()
}
if ( word.length() > 1 ) // don't call the hyphenator for empty or one-letter words
{
- QString lang = string->at(wordStart).format()->language();
+ TQString lang = string->at(wordStart).format()->language();
char * hyphens = settings->hyphenator()->hyphens( word, lang );
#if defined(DEBUG_HYPHENATION)
kdDebug(32500) << "Hyphenation: word=" << word << " lang=" << lang << " hyphens=" << hyphens << " maxlen=" << maxlen << endl;
@@ -385,7 +385,7 @@ bool KoTextFormatterCore::format()
Q_ASSERT( maxlen <= hylen );
// If this word was already hyphenated (at the previous line),
// don't break it there again. We can only break after firstChar.
- int minPos = QMAX( 0, (firstChar - &string->at(0)) - wordStart );
+ int minPos = TQMAX( 0, (firstChar - &string->at(0)) - wordStart );
// Check hyphenation positions from the end
for ( int hypos = maxlen-1 ; hypos >= minPos ; --hypos )
@@ -424,8 +424,8 @@ bool KoTextFormatterCore::format()
if ( !emptyLine && i > 0 )
{
// (combine lineStart->baseLine/lineStart->h and tmpBaseLine/tmph)
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
@@ -445,7 +445,7 @@ bool KoTextFormatterCore::format()
ww, // ## correct?
x, initialRMargin, dw, parag );
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
initialHeight = tmph;
initialLMargin = x;
availableWidth = dw - initialRMargin;
@@ -468,7 +468,7 @@ bool KoTextFormatterCore::format()
tmpBaseLine = lineStart->baseLine;
lastBreak = -1;
col = 0;
- //tminw = marg; // not in QRT?
+ //tminw = marg; // not in TQRT?
tmpWused = 0;
}
// recalc everything for 'i', it might still not be ok where it is...
@@ -495,7 +495,7 @@ bool KoTextFormatterCore::format()
}
}
// maxY not known (or "final choice for empty line") -> keep going ('i' remains where it is)
- // (in case of maxY not known, this is the initial QRT behaviour)
+ // (in case of maxY not known, this is the initial TQRT behaviour)
} else {
// If breaking means we're after maxY, then we won't do it.
// Hopefully KWord will create more pages.
@@ -516,11 +516,11 @@ bool KoTextFormatterCore::format()
spaceAfterLine -= c->width;
//else
- if ( c->c.unicode() == 0xad || hyphenated ) // soft hyphen or hyphenation
+ if ( c->c.tqunicode() == 0xad || hyphenated ) // soft hyphen or hyphenation
{
// Recalculate its width, the hyphen will appear finally (important for the parag rect)
- int width = KoTextZoomHandler::ptToLayoutUnitPt( c->format()->refFontMetrics().width( QChar(0xad) ) );
- if ( c->c.unicode() == 0xad )
+ int width = KoTextZoomHandler::ptToLayoutUnitPt( c->format()->refFontMetrics().width( TQChar(0xad) ) );
+ if ( c->c.tqunicode() == 0xad )
c->width = width;
spaceAfterLine -= width;
}
@@ -534,7 +534,7 @@ bool KoTextFormatterCore::format()
c = &string->at( i + 1 ); // The first char in the new line
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "Next line will start at i+1=" << i+1 << ", char=" << QString(c->c) << endl;
+ kdDebug(32500) << "Next line will start at i+1=" << i+1 << ", char=" << TQString(c->c) << endl;
#endif
tmph = c->height();
@@ -545,7 +545,7 @@ bool KoTextFormatterCore::format()
c->width,
x, initialRMargin, dw, parag );
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
initialHeight = tmph;
initialLMargin = x;
availableWidth = dw - initialRMargin;
@@ -575,17 +575,17 @@ bool KoTextFormatterCore::format()
<< " with " << c->ascent() << "/" << c->height() << endl;
#endif
// (combine tmpBaseLine/tmph and this character)
- int belowBaseLine = QMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
- tmpBaseLine = QMAX( tmpBaseLine, c->ascent() );
+ int belowBaseLine = TQMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
+ tmpBaseLine = TQMAX( tmpBaseLine, c->ascent() );
tmph = tmpBaseLine + belowBaseLine;
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << " -> tmpBaseLine/tmph : " << tmpBaseLine << "/" << tmph << endl;
#endif
}
tempWordData.clear();
- //minw = QMAX( minw, tminw );
+ //minw = TQMAX( minw, tminw );
//tminw = marg + ww;
- wused = QMAX( wused, tmpWused );
+ wused = TQMAX( wused, tmpWused );
#ifdef DEBUG_FORMATTER_WIDTH
kdDebug(32500) << " Breakable character (i=" << i << " len=" << len << "): wused=" << wused << endl;
#endif
@@ -594,8 +594,8 @@ bool KoTextFormatterCore::format()
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << "Breakable character: combining " << lineStart->baseLine << "/" << lineStart->h << " with " << tmpBaseLine << "/" << tmph << endl;
#endif
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
#ifdef DEBUG_FORMATTER_VERT
@@ -624,7 +624,7 @@ bool KoTextFormatterCore::format()
#endif
i = (firstChar - &string->at(0));
x = newLMargin;
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
availableWidth = dw - newRMargin;
initialLMargin = newLMargin;
initialRMargin = newRMargin;
@@ -641,7 +641,7 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "Restarting with i=" << i << " x=" << x << " y=" << y << " tmph=" << tmph << " initialHeight=" << initialHeight << " initialLMargin=" << initialLMargin << " initialRMargin=" << initialRMargin << " y=" << y << endl;
#endif
// ww and pixelww already calculated and stored, no need to duplicate
- // code like QRT does.
+ // code like TQRT does.
ww = c->width;
#ifndef REF_IS_LU
pixelww = c->pixelwidth;
@@ -662,8 +662,8 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << " Non-breakable character: combining " << tmpBaseLine << "/" << tmph << " with " << c->ascent() << "/" << c->height() << endl;
#endif
// (combine tmpBaseLine/tmph and this character)
- int belowBaseLine = QMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
- tmpBaseLine = QMAX( tmpBaseLine, c->ascent() );
+ int belowBaseLine = TQMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
+ tmpBaseLine = TQMAX( tmpBaseLine, c->ascent() );
tmph = tmpBaseLine + belowBaseLine;
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << " -> tmpBaseLine/tmph : " << tmpBaseLine << "/" << tmph << endl;
@@ -679,10 +679,10 @@ bool KoTextFormatterCore::format()
c->x = x;
// pixelxadj is the adjustement to add to lu2pixel(x), to find pixelx
// (pixelx would be too expensive to store directly since it would require an int)
- c->pixelxadj = pixelx - zh->layoutUnitToPixelX( x );
+ c->pixelxadj = pixelx - zh->tqlayoutUnitToPixelX( x );
//c->pixelwidth = pixelww; // done as pixelx - lastPixelx below
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "LU: x=" << x << " [equiv. to pix=" << zh->layoutUnitToPixelX( x ) << "] ; PIX: x=" << pixelx << " --> adj=" << c->pixelxadj << endl;
+ kdDebug(32500) << "LU: x=" << x << " [equiv. to pix=" << zh->tqlayoutUnitToPixelX( x ) << "] ; PIX: x=" << pixelx << " --> adj=" << c->pixelxadj << endl;
#endif
x += ww;
@@ -690,13 +690,13 @@ bool KoTextFormatterCore::format()
if ( i > 0 )
lastChr->pixelwidth = pixelx - lastPixelx;
if ( i < len - 1 )
- tmpWused = QMAX( tmpWused, x );
+ tmpWused = TQMAX( tmpWused, x );
else // trailing space
- c->pixelwidth = zh->layoutUnitToPixelX( ww ); // was: pixelww;
+ c->pixelwidth = zh->tqlayoutUnitToPixelX( ww ); // was: pixelww;
lastPixelx = pixelx;
#ifdef REF_IS_LU
- pixelx = zh->layoutUnitToPixelX( x ); // no accumulating rounding errors anymore
+ pixelx = zh->tqlayoutUnitToPixelX( x ); // no accumulating rounding errors anymore
#else
pixelx += pixelww;
#endif
@@ -706,7 +706,7 @@ bool KoTextFormatterCore::format()
}
// ### hack. The last char in the paragraph is always invisible, and somehow sometimes has a wrong format. It changes between
- // layouting and printing. This corrects some layouting errors in BiDi mode due to this.
+ // tqlayouting and printing. This corrects some tqlayouting errors in BiDi mode due to this.
if ( len > 1 /*&& !c->isAnchor()*/ ) {
c->format()->removeRef();
c->setFormat( string->at( len - 2 ).format() );
@@ -722,8 +722,8 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "Last Line... Combining " << lineStart->baseLine << "/" << lineStart->h << " with " << tmpBaseLine << "/" << tmph << endl;
#endif
// (combine lineStart and tmpBaseLine/tmph)
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
#ifdef DEBUG_FORMATTER_WIDTH
@@ -733,15 +733,15 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << " -> lineStart->baseLine/lineStart->h : " << lineStart->baseLine << "/" << lineStart->h << endl;
#endif
// last line in a paragraph is not justified
- if ( align == Qt::AlignJustify )
- align = Qt::AlignAuto;
+ if ( align == TQt::AlignJustify )
+ align = TQt::AlignAuto;
int space = availableWidth - x + c->width; // don't count the trailing space (it breaks e.g. centering)
KoTextParagLineStart *lineStart2 = koFormatLine( zh, parag, string, lineStart, firstChar, c, align, space );
delete lineStart2;
}
- //minw = QMAX( minw, tminw );
- wused = QMAX( wused, tmpWused );
+ //minw = TQMAX( minw, tminw );
+ wused = TQMAX( wused, tmpWused );
#ifdef DEBUG_FORMATTER_WIDTH
kdDebug(32500) << "Done, wused=" << wused << endl;
#endif
@@ -749,7 +749,7 @@ bool KoTextFormatterCore::format()
int m = parag->bottomMargin();
// ##### Does OOo add margins or does it max them?
//if ( parag->next() && doc && !doc->addMargins() )
- // m = QMAX( m, parag->next()->topMargin() );
+ // m = TQMAX( m, parag->next()->topMargin() );
parag->setFullWidth( fullWidth );
//if ( parag->next() && parag->next()->isLineBreak() )
// m = 0;
@@ -760,20 +760,20 @@ bool KoTextFormatterCore::format()
tmpWused += currentRightMargin; // ### this can break with a variable right-margin
//if ( wrapAtColumn() != -1 )
- // minw = QMAX(minw, wused);
+ // minw = TQMAX(minw, wused);
//thisminw = minw;
#ifdef DEBUG_FORMATTER
// Sanity checking
int numberOfLines = 0;
- QString charPosList;
+ TQString charPosList;
for ( int i = 0 ; i < len; ++i ) {
KoTextStringChar *chr = &string->at( i );
if ( i == 0 )
assert( chr->lineStart );
if ( chr->lineStart ) {
++numberOfLines;
- charPosList += QString::number(i) + " ";
+ charPosList += TQString::number(i) + " ";
}
}
kdDebug(32500) << parag->lineStartList().count() << " lines. " << numberOfLines << " chars with lineStart set: " << charPosList << endl;
@@ -787,11 +787,11 @@ void KoTextFormatterCore::moveChar( KoTextStringChar& chr, KoTextZoomHandler *zh
int deltaX, int deltaPixelX )
{
#ifndef REF_IS_LU
- int pixelx = chr.pixelxadj + zh->layoutUnitToPixelX( chr.x );
+ int pixelx = chr.pixelxadj + zh->tqlayoutUnitToPixelX( chr.x );
#endif
chr.x += deltaX;
#ifndef REF_IS_LU
- chr.pixelxadj = pixelx + deltaPixelX - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + deltaPixelX - zh->tqlayoutUnitToPixelX( chr.x );
#endif
}
@@ -810,16 +810,16 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
if (space < 0)
space = 0;
- // do alignment Auto == Left in this case
- if ( align & Qt::AlignHCenter || align & Qt::AlignRight ) {
- if ( align & Qt::AlignHCenter )
+ // do tqalignment Auto == Left in this case
+ if ( align & TQt::AlignHCenter || align & TQt::AlignRight ) {
+ if ( align & TQt::AlignHCenter )
space /= 2;
- int toAddPix = zh->layoutUnitToPixelX( space );
+ int toAddPix = zh->tqlayoutUnitToPixelX( space );
for ( int j = last; j >= start; --j ) {
KoTextStringChar &chr = string->at( j );
moveChar( chr, zh, space, toAddPix );
}
- } else if ( align & Qt::AlignJustify ) {
+ } else if ( align & TQt::AlignJustify ) {
int numSpaces = 0;
// End at "last-1", the last space ends up with a width of 0
for ( int j = last-1; j >= start; --j ) {
@@ -841,12 +841,12 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
if( settings->isStretchable( string, k ) && numSpaces ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
chr.width += s;
#ifndef REF_IS_LU
- chr.pixelwidth += zh->layoutUnitToPixelX( s ); // ### rounding problem, recalculate
+ chr.pixelwidth += zh->tqlayoutUnitToPixelX( s ); // ### rounding problem, recalculate
#endif
}
}
@@ -889,7 +889,7 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
line->w = chr.x + chr.width; //string->width( last );
// Add width of hyphen (so that it appears)
if ( line->hyphenated )
- line->w += KoTextZoomHandler::ptToLayoutUnitPt( chr.format()->refFontMetrics().width( QChar(0xad) ) );
+ line->w += KoTextZoomHandler::ptToLayoutUnitPt( chr.format()->refFontMetrics().width( TQChar(0xad) ) );
} else
line->w = 0;
#endif
@@ -912,7 +912,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
KoTextParag * /*parag*/, KoTextString *text, KoTextParagLineStart *line,
KoTextStringChar *startChar, KoTextStringChar *lastChar, int align, int space )
{
- // This comes from Qt (3.3.x) but seems wrong: the last space is where we draw
+ // This comes from TQt (3.3.x) but seems wrong: the last space is where we draw
// the "end of paragraph" sign, so it needs to be correctly positioned too.
#if 0
// ignore white space at the end of the line.
@@ -930,11 +930,11 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
kdDebug(32500) << "*KoTextFormatter::koBidiReorderLine from " << start << " to " << last << " space=" << space << " startChar->x=" << startChar->x << endl;
#endif
KoBidiControl *control = new KoBidiControl( line->context(), line->status );
- QString str;
+ TQString str;
str.setUnicode( 0, last - start + 1 );
// fill string with logically ordered chars.
KoTextStringChar *ch = startChar;
- QChar *qch = (QChar *)str.unicode();
+ TQChar *qch = (TQChar *)str.tqunicode();
while ( ch <= lastChar ) {
*qch = ch->c;
qch++;
@@ -942,25 +942,25 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
int x = startChar->x;
- QPtrList<KoTextRun> *runs;
+ TQPtrList<KoTextRun> *runs;
runs = KoComplexText::bidiReorderLine(control, str, 0, last - start + 1,
- (text->isRightToLeft() ? QChar::DirR : QChar::DirL) );
+ (text->isRightToLeft() ? TQChar::DirR : TQChar::DirL) );
// now construct the reordered string out of the runs...
int numSpaces = 0;
- // set the correct alignment. This is a bit messy....
- if( align == Qt::AlignAuto ) {
+ // set the correct tqalignment. This is a bit messy....
+ if( align == TQt::AlignAuto ) {
// align according to directionality of the paragraph...
if ( text->isRightToLeft() )
- align = Qt::AlignRight;
+ align = TQt::AlignRight;
}
- if ( align & Qt::AlignHCenter ) {
+ if ( align & TQt::AlignHCenter ) {
x += space/2;
- } else if ( align & Qt::AlignRight ) {
+ } else if ( align & TQt::AlignRight ) {
x += space;
- } else if ( align & Qt::AlignJustify ) {
+ } else if ( align & TQt::AlignJustify ) {
for ( int j = last - 1; j >= start; --j ) {
//// Start at last tab, if any. BR #40472 specifies that justifying should start after the last tab.
if ( text->at( j ).c == '\t' ) {
@@ -973,7 +973,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
// TODO #ifndef REF_IS_LU or remove
- int pixelx = zh->layoutUnitToPixelX( x );
+ int pixelx = zh->tqlayoutUnitToPixelX( x );
int toAdd = 0;
int toAddPix = 0;
bool first = TRUE;
@@ -991,11 +991,11 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
if( numSpaces && !first && settings->isBreakable( text, pos ) ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
chr.width += s;
- chr.pixelwidth += zh->layoutUnitToPixelX( s ); // ### rounding problem, recalculate
+ chr.pixelwidth += zh->tqlayoutUnitToPixelX( s ); // ### rounding problem, recalculate
} else if ( first ) {
first = FALSE;
if ( chr.c == ' ' ) // trailing space
@@ -1006,9 +1006,9 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
chr.x = x + toAdd;
- chr.pixelxadj = pixelx + toAddPix - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + toAddPix - zh->tqlayoutUnitToPixelX( chr.x );
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "koBidiReorderLine: pos=" << pos << " x(LU)=" << x << " toAdd(LU)=" << toAdd << " -> chr.x=" << chr.x << " pixelx=" << pixelx << "+" << zh->layoutUnitToPixelX( toAdd ) << ", pixelxadj=" << pixelx+zh->layoutUnitToPixelX( toAdd )-zh->layoutUnitToPixelX( chr.x ) << endl;
+ kdDebug(32500) << "koBidiReorderLine: pos=" << pos << " x(LU)=" << x << " toAdd(LU)=" << toAdd << " -> chr.x=" << chr.x << " pixelx=" << pixelx << "+" << zh->tqlayoutUnitToPixelX( toAdd ) << ", pixelxadj=" << pixelx+zh->tqlayoutUnitToPixelX( toAdd )-zh->tqlayoutUnitToPixelX( chr.x ) << endl;
#endif
chr.rightToLeft = TRUE;
chr.startOfRun = FALSE;
@@ -1028,7 +1028,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
if( numSpaces && !first && settings->isBreakable( text, pos ) ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
} else if ( first ) {
@@ -1041,7 +1041,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
chr.x = x + toAdd;
- chr.pixelxadj = pixelx + toAddPix - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + toAddPix - zh->tqlayoutUnitToPixelX( chr.x );
chr.rightToLeft = FALSE;
chr.startOfRun = FALSE;
int ww = chr.width;
diff --git a/lib/kotext/KoTextFormatter.h b/lib/kotext/KoTextFormatter.h
index ad120437..0e2bcf6f 100644
--- a/lib/kotext/KoTextFormatter.h
+++ b/lib/kotext/KoTextFormatter.h
@@ -37,7 +37,7 @@ public:
KoTextFormatter();
virtual ~KoTextFormatter();
- virtual bool format( KoTextDocument *doc, KoTextParag *parag, int start, const QMap<int, KoTextParagLineStart*> &oldLineStarts, int& y, int& widthUsed );
+ virtual bool format( KoTextDocument *doc, KoTextParag *parag, int start, const TQMap<int, KoTextParagLineStart*> &oldLineStarts, int& y, int& widthUsed );
// Called after formatting a paragraph
virtual void postFormat( KoTextParag* parag );
@@ -69,7 +69,7 @@ public:
protected:
// Return ww (in LU) and pixelww (in pixels)
// Should be called only once per char
- QPair<int, int> determineCharWidth();
+ TQPair<int, int> determineCharWidth();
KoTextParagLineStart *koFormatLine(
KoTextZoomHandler *zh,
@@ -103,7 +103,7 @@ private:
// When moving a big item down, we might want to rollback
// to the 'best position for it' if we can't make it fit anywhere else.
- QPair<int,int> maxAvailableWidth; // first=y second=available width
+ TQPair<int,int> maxAvailableWidth; // first=y second=available width
// Information on current char
KoTextStringChar *c;
diff --git a/lib/kotext/KoTextIterator.cpp b/lib/kotext/KoTextIterator.cpp
index 87a90fb3..ed320ed1 100644
--- a/lib/kotext/KoTextIterator.cpp
+++ b/lib/kotext/KoTextIterator.cpp
@@ -33,7 +33,7 @@
* So we go from the first to the last textobject, or from the last to the first textobject.
*/
-void KoTextIterator::init( const QValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options )
+void KoTextIterator::init( const TQValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options )
{
Q_ASSERT( !lstObjects.isEmpty() );
@@ -89,7 +89,7 @@ void KoTextIterator::init( const QValueList<KoTextObject *> & lstObjects, KoText
m_lstObjects.pop_front();
m_lstObjects.push_back( textobj );
if ( m_lstObjects.first() == initialFirst ) { // safety
- kdWarning(32500) << "Didn't manage to find " << textView->textObject() << " in the list of textobjects!!!" << endl;
+ kdWarning(32500) << "Didn't manage to tqfind " << textView->textObject() << " in the list of textobjects!!!" << endl;
break;
}
}
@@ -99,7 +99,7 @@ void KoTextIterator::init( const QValueList<KoTextObject *> & lstObjects, KoText
m_lstObjects.pop_back();
m_lstObjects.push_front( textobj );
if ( m_lstObjects.first() == initialFirst ) { // safety
- kdWarning(32500) << "Didn't manage to find " << textView->textObject() << " in the list of textobjects!!!" << endl;
+ kdWarning(32500) << "Didn't manage to tqfind " << textView->textObject() << " in the list of textobjects!!!" << endl;
break;
}
}
@@ -128,7 +128,7 @@ void KoTextIterator::init( const QValueList<KoTextObject *> & lstObjects, KoText
m_currentParag = m_firstParag;
#ifdef DEBUG_ITERATOR
kdDebug(32500) << "KoTextIterator::init from(" << *m_currentTextObj << "," << m_firstParag->paragId() << ") - to(" << (forw?m_lstObjects.last():m_lstObjects.first()) << "," << m_lastParag->paragId() << "), " << m_lstObjects.count() << " textObjects." << endl;
- QValueList<KoTextObject *>::Iterator it = m_lstObjects.begin();
+ TQValueList<KoTextObject *>::Iterator it = m_lstObjects.begin();
for( ; it != m_lstObjects.end(); ++it )
kdDebug(32500) << (*it) << " " << (*it)->name() << endl;
#endif
@@ -161,12 +161,12 @@ void KoTextIterator::restart()
void KoTextIterator::connectTextObjects()
{
- QValueList<KoTextObject *>::Iterator it = m_lstObjects.begin();
+ TQValueList<KoTextObject *>::Iterator it = m_lstObjects.begin();
for( ; it != m_lstObjects.end(); ++it ) {
- connect( (*it), SIGNAL( paragraphDeleted( KoTextParag* ) ),
- this, SLOT( slotParagraphDeleted( KoTextParag* ) ) );
- connect( (*it), SIGNAL( paragraphModified( KoTextParag*, int, int, int ) ),
- this, SLOT( slotParagraphModified( KoTextParag*, int, int, int ) ) );
+ connect( (*it), TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ),
+ this, TQT_SLOT( slotParagraphDeleted( KoTextParag* ) ) );
+ connect( (*it), TQT_SIGNAL( paragraphModified( KoTextParag*, int, int, int ) ),
+ this, TQT_SLOT( slotParagraphModified( KoTextParag*, int, int, int ) ) );
// We don't connect to destroyed(), because for undo/redo purposes,
// we never really delete textdocuments nor textobjects.
// So this is never called.
@@ -291,34 +291,34 @@ int KoTextIterator::currentStartIndex() const
return currentTextAndIndex().first;
}
-QString KoTextIterator::currentText() const
+TQString KoTextIterator::currentText() const
{
return currentTextAndIndex().second;
}
-QPair<int, QString> KoTextIterator::currentTextAndIndex() const
+TQPair<int, TQString> KoTextIterator::currentTextAndIndex() const
{
Q_ASSERT( m_currentParag );
Q_ASSERT( m_currentParag->string() );
- QString str = m_currentParag->string()->toString();
+ TQString str = m_currentParag->string()->toString();
str.truncate( str.length() - 1 ); // remove trailing space
bool forw = ! ( m_options & KFindDialog::FindBackwards );
if ( m_currentParag == m_firstParag )
{
if ( m_firstParag == m_lastParag ) // special case, needs truncating at both ends
- return forw ? qMakePair( m_firstIndex, str.mid( m_firstIndex, m_lastIndex - m_firstIndex ) )
- : qMakePair( m_lastIndex, str.mid( m_lastIndex, m_firstIndex - m_lastIndex ) );
+ return forw ? tqMakePair( m_firstIndex, str.mid( m_firstIndex, m_lastIndex - m_firstIndex ) )
+ : tqMakePair( m_lastIndex, str.mid( m_lastIndex, m_firstIndex - m_lastIndex ) );
else
- return forw ? qMakePair( m_firstIndex, str.mid( m_firstIndex ) )
- : qMakePair( 0, str.left( m_firstIndex ) );
+ return forw ? tqMakePair( m_firstIndex, str.mid( m_firstIndex ) )
+ : tqMakePair( 0, str.left( m_firstIndex ) );
}
if ( m_currentParag == m_lastParag )
{
- return forw ? qMakePair( 0, str.left( m_lastIndex ) )
- : qMakePair( m_lastIndex, str.mid( m_lastIndex ) );
+ return forw ? tqMakePair( 0, str.left( m_lastIndex ) )
+ : tqMakePair( m_lastIndex, str.mid( m_lastIndex ) );
}
// Not the first parag, nor the last, so we return it all
- return qMakePair( 0, str );
+ return tqMakePair( 0, str );
}
bool KoTextIterator::hasText() const
@@ -348,8 +348,8 @@ void KoTextIterator::setOptions( int options )
bool isBack = (options & KFindDialog::FindBackwards);
if ( wasBack != isBack )
{
- qSwap( m_firstParag, m_lastParag );
- qSwap( m_firstIndex, m_lastIndex );
+ tqSwap( m_firstParag, m_lastParag );
+ tqSwap( m_firstIndex, m_lastIndex );
if ( m_currentParag == 0 ) // done? -> reinit
{
#ifdef DEBUG_ITERATOR
diff --git a/lib/kotext/KoTextIterator.h b/lib/kotext/KoTextIterator.h
index 40934a18..c2c5fff8 100644
--- a/lib/kotext/KoTextIterator.h
+++ b/lib/kotext/KoTextIterator.h
@@ -19,10 +19,10 @@
#ifndef KOTEXTITERATOR_H
#define KOTEXTITERATOR_H
-#include <qvaluelist.h>
-#include <qstring.h>
-#include <qpair.h>
-#include <qobject.h>
+#include <tqvaluelist.h>
+#include <tqstring.h>
+#include <tqpair.h>
+#include <tqobject.h>
#include <koffice_export.h>
class KoTextParag;
class KoTextObject;
@@ -33,19 +33,20 @@ class KoTextView;
* with many options (from cursor, backwards, in selection).
* @short General purpose paragraph iterator
*/
-class KOTEXT_EXPORT KoTextIterator : public QObject
+class KOTEXT_EXPORT KoTextIterator : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* @param lstObjects list of text objects to iterate over
* @param textView view in which the objects live
* @param options see KFindDialog
*/
- KoTextIterator( const QValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options ) {
+ KoTextIterator( const TQValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options ) {
init( lstObjects, textView, options );
}
- void init( const QValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options );
+ void init( const TQValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options );
/**
* Restart from the beginning - assumes same parameters given to init
@@ -83,7 +84,7 @@ public:
/**
* @return the string at the current position of the iterator
*/
- QString currentText() const;
+ TQString currentText() const;
/**
* @return the string at the current position of the iterator
@@ -106,7 +107,7 @@ public:
* Use this instead of separate calls to currentText and currentStartIndex,
* for performance reasons.
*/
- QPair<int, QString> currentTextAndIndex() const;
+ TQPair<int, TQString> currentTextAndIndex() const;
signals:
/**
@@ -130,10 +131,10 @@ protected slots:
void slotParagraphModified( KoTextParag* parag, int /*ParagModifyType*/, int pos, int length );
private:
- // The reason we use a QValueList of pointers instead of QPtrList
- // is that having a QPtrListIterator member var can't work, one can't
+ // The reason we use a TQValueList of pointers instead of TQPtrList
+ // is that having a TQPtrListIterator member var can't work, one can't
// initialize it afterwards.
- QValueList<KoTextObject *> m_lstObjects;
+ TQValueList<KoTextObject *> m_lstObjects;
int m_options;
// This is relative to the first textobject in m_lstObjects
@@ -147,7 +148,7 @@ private:
int m_lastIndex;
// Our current position
- QValueList<KoTextObject *>::Iterator m_currentTextObj;
+ TQValueList<KoTextObject *>::Iterator m_currentTextObj;
KoTextParag* m_currentParag;
};
diff --git a/lib/kotext/KoTextObject.cpp b/lib/kotext/KoTextObject.cpp
index 3ff03216..c65e3bb6 100644
--- a/lib/kotext/KoTextObject.cpp
+++ b/lib/kotext/KoTextObject.cpp
@@ -35,9 +35,9 @@
#include <kdebug.h>
#include <kapplication.h>
-#include <qtimer.h>
-#include <qregexp.h>
-#include <qprogressdialog.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
+#include <tqprogressdialog.h>
#include <assert.h>
@@ -57,21 +57,21 @@ public:
bool abortFormatting;
};
-KoTextObject::KoTextObject( KoTextZoomHandler *zh, const QFont& defaultFont,
- const QString &defaultLanguage, bool hyphenation,
+KoTextObject::KoTextObject( KoTextZoomHandler *zh, const TQFont& defaultFont,
+ const TQString &defaultLanguage, bool hyphenation,
KoParagStyle* defaultStyle, int tabStopWidth,
- QObject* parent, const char *name )
- : QObject( parent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
+ TQObject* tqparent, const char *name )
+ : TQObject( tqparent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
{
- textdoc = new KoTextDocument( zh, new KoTextFormatCollection( defaultFont, QColor(),defaultLanguage, hyphenation ) );
+ textdoc = new KoTextDocument( zh, new KoTextFormatCollection( defaultFont, TQColor(),defaultLanguage, hyphenation ) );
if ( tabStopWidth != -1 )
textdoc->setTabStops( tabStopWidth );
init();
}
KoTextObject::KoTextObject( KoTextDocument* _textdoc, KoParagStyle* defaultStyle,
- QObject* parent, const char *name )
- : QObject( parent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
+ TQObject* tqparent, const char *name )
+ : TQObject( tqparent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
{
textdoc = _textdoc;
init();
@@ -87,31 +87,31 @@ void KoTextObject::init()
m_lastFormatted = textdoc->firstParag();
m_highlightSelectionAdded = false;
interval = 0;
- changeIntervalTimer = new QTimer( this );
- connect( changeIntervalTimer, SIGNAL( timeout() ),
- this, SLOT( doChangeInterval() ) );
+ changeIntervalTimer = new TQTimer( this );
+ connect( changeIntervalTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( doChangeInterval() ) );
- formatTimer = new QTimer( this );
- connect( formatTimer, SIGNAL( timeout() ),
- this, SLOT( formatMore() ) );
+ formatTimer = new TQTimer( this );
+ connect( formatTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( formatMore() ) );
// Apply default style to initial paragraph
if ( m_lastFormatted && m_defaultStyle )
m_lastFormatted->applyStyle( m_defaultStyle );
- connect( textdoc, SIGNAL( paragraphDeleted( KoTextParag* ) ),
- this, SIGNAL( paragraphDeleted( KoTextParag* ) ) );
- connect( textdoc, SIGNAL( paragraphDeleted( KoTextParag* ) ),
- this, SLOT( slotParagraphDeleted( KoTextParag* ) ) );
- connect( textdoc, SIGNAL( newCommand( KCommand* ) ),
- this, SIGNAL( newCommand( KCommand* ) ) );
- connect( textdoc, SIGNAL( repaintChanged() ),
- this, SLOT( emitRepaintChanged() ) );
+ connect( textdoc, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ),
+ this, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ) );
+ connect( textdoc, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ),
+ this, TQT_SLOT( slotParagraphDeleted( KoTextParag* ) ) );
+ connect( textdoc, TQT_SIGNAL( newCommand( KCommand* ) ),
+ this, TQT_SIGNAL( newCommand( KCommand* ) ) );
+ connect( textdoc, TQT_SIGNAL( tqrepaintChanged() ),
+ this, TQT_SLOT( emitRepaintChanged() ) );
- connect( this, SIGNAL(paragraphModified( KoTextParag*, int, int , int ) ),
- this, SLOT(slotParagraphModified(KoTextParag *, int, int , int)));
- connect( this, SIGNAL(paragraphCreated( KoTextParag* )),
- this, SLOT(slotParagraphCreated(KoTextParag *)));
+ connect( this, TQT_SIGNAL(paragraphModified( KoTextParag*, int, int , int ) ),
+ this, TQT_SLOT(slotParagraphModified(KoTextParag *, int, int , int)));
+ connect( this, TQT_SIGNAL(paragraphCreated( KoTextParag* )),
+ this, TQT_SLOT(slotParagraphCreated(KoTextParag *)));
}
KoTextObject::~KoTextObject()
@@ -193,7 +193,7 @@ bool KoTextObject::selectionHasCustomItems( KoTextDocument::SelectionId selectio
void KoTextObject::slotAfterUndoRedo()
{
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
emit showCursor();
emit ensureCursorVisible();
@@ -231,7 +231,7 @@ void KoTextObject::undo()
emit setCursor( c );
setLastFormattedParag( textdoc->firstParag() );
delete cursor;
- QTimer::singleShot( 0, this, SLOT( slotAfterUndoRedo() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotAfterUndoRedo() ) );
}
void KoTextObject::redo()
@@ -248,13 +248,13 @@ void KoTextObject::redo()
emit setCursor( c ); // see undo
setLastFormattedParag( textdoc->firstParag() );
delete cursor;
- QTimer::singleShot( 0, this, SLOT( slotAfterUndoRedo() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotAfterUndoRedo() ) );
}
KoTextObject::UndoRedoInfo::UndoRedoInfo( KoTextObject *to )
: type( Invalid ), textobj(to), cursor( 0 )
{
- text = QString::null;
+ text = TQString();
id = -1;
index = -1;
placeHolderCmd = 0L;
@@ -289,11 +289,11 @@ void KoTextObject::UndoRedoInfo::clear()
if ( itemCmd )
placeHolderCmd->addCommand( itemCmd );
}
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
}
else
{
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
}
}
} break;
@@ -303,7 +303,7 @@ void KoTextObject::UndoRedoInfo::clear()
KoTextDocCommand * cmd = textobj->deleteTextCommand( textdoc, id, index, text.rawData(), customItemsMap, oldParagLayouts );
textdoc->addCommand( cmd );
Q_ASSERT( placeHolderCmd );
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
// Deleting any custom items -> let them add their command
if ( !customItemsMap.isEmpty() )
{
@@ -315,9 +315,9 @@ void KoTextObject::UndoRedoInfo::clear()
}
}
type = Invalid;
- // Before Qt-3.2.0, this called KoTextString::clear(), which called resize(0) on the array, which _detached_. Tricky.
- // Since Qt-3.2.0, resize(0) doesn't detach anymore -> KoTextDocDeleteCommand calls copy() itself.
- text = QString::null;
+ // Before TQt-3.2.0, this called KoTextString::clear(), which called resize(0) on the array, which _detached_. Tricky.
+ // Since TQt-3.2.0, resize(0) doesn't detach anymore -> KoTextDocDeleteCommand calls copy() itself.
+ text = TQString();
id = -1;
index = -1;
oldParagLayouts.clear();
@@ -344,7 +344,7 @@ void KoTextObject::copyCharFormatting( KoTextParag *parag, int position, int ind
}
}
-// Based on QTextView::readFormats - with all code duplication moved to copyCharFormatting
+// Based on TQTextView::readFormats - with all code duplication moved to copyCharFormatting
void KoTextObject::readFormats( KoTextCursor &c1, KoTextCursor &c2, bool copyParagLayouts, bool moveCustomItems )
{
//kdDebug(32500) << "KoTextObject::readFormats moveCustomItems=" << moveCustomItems << endl;
@@ -389,7 +389,7 @@ void KoTextObject::readFormats( KoTextCursor &c1, KoTextCursor &c2, bool copyPar
}
}
-void KoTextObject::newPlaceHolderCommand( const QString & name )
+void KoTextObject::newPlaceHolderCommand( const TQString & name )
{
Q_ASSERT( !undoRedoInfo.placeHolderCmd );
if ( undoRedoInfo.placeHolderCmd ) kdDebug(32500) << kdBacktrace();
@@ -436,7 +436,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = parag->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
if ( !cursor->atParagEnd() )
@@ -476,7 +476,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = parag->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
undoRedoInfo.text.insert( 0, cursor->parag()->at( cursor->index()-1 ) );
@@ -502,13 +502,13 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Insert Text") );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
}
undoRedoInfo.text += "\n";
if ( cursor->parag() )
{
- QString last_line = cursor->parag()->toString();
- last_line.remove(0,last_line.find(' ')+1);
+ TQString last_line = cursor->parag()->toString();
+ last_line.remove(0,last_line.tqfind(' ')+1);
if( last_line.isEmpty() && cursor->parag()->counter() && cursor->parag()->counter()->numbering() == KoParagCounter::NUM_LIST ) //if the previous line the in paragraph is empty
{
@@ -520,7 +520,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
cursor->parag()->setNoCounter();
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
emit updateUI( doUpdateCurrentFormat );
@@ -560,11 +560,11 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
if ( cursor->atParagEnd() ) {
- // Get paraglayout from next parag (next can't be 0 here)
+ // Get paragtqlayout from next parag (next can't be 0 here)
KoParagLayout paragLayout = parag->next()->paragLayout();
if ( cursor->remove() )
{
@@ -588,24 +588,24 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
clearUndoRedoInfo();
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
emit updateUI( doUpdateCurrentFormat );
}
void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
- const QString &txt, const QString & commandName, KoTextDocument::SelectionId selectionId,
+ const TQString &txt, const TQString & commandName, KoTextDocument::SelectionId selectionId,
int insertFlags, CustomItemsMap customItemsMap )
{
if ( protectContent() )
return;
const bool checkNewLine = insertFlags & CheckNewLine;
const bool removeSelected = ( insertFlags & DoNotRemoveSelected ) == 0;
- const bool repaint = ( insertFlags & DoNotRepaint ) == 0;
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0;
//kdDebug(32500) << "KoTextObject::insert txt=" << txt << endl;
bool tinyRepaint = !checkNewLine;
- if ( repaint )
+ if ( tqrepaint )
emit hideCursor();
if ( textdoc->hasSelection( selectionId, true ) && removeSelected ) {
kdDebug() << k_funcinfo << "removing selection " << selectionId << endl;
@@ -618,7 +618,7 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
textdoc->setSelectionStart( KoTextDocument::Temp, cursor );
KoTextCursor oc = *cursor;
kdDebug(32500) << "overwrite: going to insert " << txt.length() << " chars; idx=" << oc.index() << endl;
- oc.setIndex( QMIN( oc.index() + (int)txt.length(), oc.parag()->lastCharPos() + 1 ) );
+ oc.setIndex( TQMIN( oc.index() + (int)txt.length(), oc.parag()->lastCharPos() + 1 ) );
kdDebug(32500) << "overwrite: removing from " << cursor->index() << " to " << oc.index() << endl;
if ( oc.index() > cursor->index() )
{
@@ -635,11 +635,11 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
clearUndoRedoInfo();
checkUndoRedoInfo( cursor, UndoRedoInfo::Insert );
if ( !undoRedoInfo.valid() ) {
- if ( !commandName.isNull() ) // see replace-selection
+ if ( !commandName.isNull() ) // see tqreplace-selection
newPlaceHolderCommand( commandName );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
}
int oldLen = undoRedoInfo.text.length();
KoTextCursor oldCursor = *cursor;
@@ -673,7 +673,7 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
}
// Speed optimization: if we only type a char, and it doesn't
- // invalidate the next parag, only format the current one
+ // tqinvalidate the next parag, only format the current one
// ### This idea is wrong. E.g. when the last parag grows and must create a new page.
#if 0
KoTextParag *parag = cursor->parag();
@@ -687,9 +687,9 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
// Doing this here means callers don't have to do it, and cursor can be positionned correctly.
ensureFormatted( cursor->parag() );
- // Speed optimization: if we only type a char, only repaint from current line
+ // Speed optimization: if we only type a char, only tqrepaint from current line
// (In fact the one before. When typing a space, a word could move up to the
- // line before, we need to repaint it too...)
+ // line before, we need to tqrepaint it too...)
if ( !checkNewLine && tinyRepaint && !wasChanged )
{
// insert() called format() which called setChanged().
@@ -703,12 +703,12 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
parag->setLineChanged( origLine - 1 ); // if origLine=0, it'll pass -1, which is 'all'
}
- if ( repaint ) {
- emit repaintChanged( this );
+ if ( tqrepaint ) {
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
- // we typed the first char of a paragraph in AlignAuto mode -> show correct alignment in UI
- if ( oldCursor.index() == 0 && oldCursor.parag()->alignment() == Qt::AlignAuto )
+ // we typed the first char of a paragraph in AlignAuto mode -> show correct tqalignment in UI
+ if ( oldCursor.index() == 0 && oldCursor.parag()->tqalignment() == TQt::AlignAuto )
emit updateUI( true );
}
@@ -722,11 +722,11 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
if ( !removeSelected ) {
// ## not sure why we do this. I'd prefer leaving the selection unchanged...
// but then it'd need adjustements in the offsets etc.
- if ( textdoc->removeSelection( selectionId ) && repaint )
- selectionChangedNotify(); // does the repaint
+ if ( textdoc->removeSelection( selectionId ) && tqrepaint )
+ selectionChangedNotify(); // does the tqrepaint
}
if ( !customItemsMap.isEmpty()
- && !commandName.isNull() /* see replace-selection; #139890 */ ) {
+ && !commandName.isNull() /* see tqreplace-selection; #139890 */ ) {
clearUndoRedoInfo();
}
@@ -741,15 +741,15 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
}
}
-void KoTextObject::pasteText( KoTextCursor * cursor, const QString & text, KoTextFormat * currentFormat, bool removeSelected )
+void KoTextObject::pasteText( KoTextCursor * cursor, const TQString & text, KoTextFormat * currentFormat, bool removeSelected )
{
if ( protectContent() )
return;
kdDebug(32500) << "KoTextObject::pasteText cursor parag=" << cursor->parag()->paragId() << endl;
- QString t = text;
+ TQString t = text;
// Need to convert CRLF to NL
- QRegExp crlf( QString::fromLatin1("\r\n") );
- t.replace( crlf, QChar('\n') );
+ TQRegExp crlf( TQString::tqfromLatin1("\r\n") );
+ t.tqreplace( crlf, TQChar('\n') );
// Convert non-printable chars
for ( int i=0; (uint) i<t.length(); i++ ) {
if ( t[ i ] < ' ' && t[ i ] != '\n' && t[ i ] != '\t' )
@@ -763,7 +763,7 @@ void KoTextObject::pasteText( KoTextCursor * cursor, const QString & text, KoTex
insert( cursor, currentFormat, t, i18n("Paste Text"),
KoTextDocument::Standard, insertFlags );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
@@ -793,7 +793,7 @@ KCommand* KoTextObject::setParagLayoutCommand( KoTextCursor * cursor, const KoPa
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit showCursor();
emit updateUI( true );
@@ -803,7 +803,7 @@ KCommand* KoTextObject::setParagLayoutCommand( KoTextCursor * cursor, const KoPa
KoTextDocCommand * cmd = new KoTextParagCommand( textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts,
paragLayout, paragLayoutFlags,
- (QStyleSheetItem::Margin)marginIndex );
+ (TQStyleSheetItem::Margin)marginIndex );
textdoc->addCommand( cmd );
return new KoTextCommand( this, /*cmd, */"related to KoTextParagCommand" );
}
@@ -872,8 +872,8 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
if ( createUndoRedo )
{
- QValueList<KoTextFormat *> lstFormats;
- //QString str;
+ TQValueList<KoTextFormat *> lstFormats;
+ //TQString str;
for ( KoTextParag * parag = firstParag ; parag && parag != lastParag->next() ; parag = parag->next() )
{
//str += parag->string()->toString() + '\n';
@@ -887,7 +887,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
c2.setIndex( lastParag->string()->length() );
undoRedoInfo.clear();
undoRedoInfo.type = UndoRedoInfo::Invalid; // same trick
- readFormats( c1, c2 ); // gather char-format info but not paraglayouts nor customitems
+ readFormats( c1, c2 ); // gather char-format info but not paragtqlayouts nor customitems
KoTextDocCommand * cmd = new KoTextFormatCommand( textdoc, firstParag->paragId(), 0,
lastParag->paragId(), c2.index(),
@@ -916,7 +916,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
}
//resize all variables after applying the style
- QPtrListIterator<KoTextCustomItem> cit( textdoc->allCustomItems() );
+ TQPtrListIterator<KoTextCustomItem> cit( textdoc->allCustomItems() );
for ( ; cit.current() ; ++cit )
cit.current()->resize();
@@ -925,7 +925,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
{
setLastFormattedParag( firstParag );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
emit showCursor();
}
@@ -949,7 +949,7 @@ void KoTextObject::applyStyleChange( KoStyleChangeDefMap changed )
KoTextParag *p = textdoc->firstParag();
while ( p ) {
- KoStyleChangeDefMap::Iterator it = changed.find( p->style() );
+ KoStyleChangeDefMap::Iterator it = changed.tqfind( p->style() );
if ( it != changed.end() )
{
if ( (*it).paragLayoutChanged == -1 || (*it).formatChanged == -1 ) // Style has been deleted
@@ -977,7 +977,7 @@ void KoTextObject::applyStyleChange( KoStyleChangeDefMap changed )
}
setLastFormattedParag( textdoc->firstParag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
}
@@ -1054,7 +1054,7 @@ KCommand * KoTextObject::setFormatCommand( KoTextCursor * cursor, KoTextFormat *
undoRedoInfo.clear();
setLastFormattedParag( c1.parag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit showCursor();
}
if ( isNewFormat ) {
@@ -1066,9 +1066,9 @@ KCommand * KoTextObject::setFormatCommand( KoTextCursor * cursor, KoTextFormat *
if ( cursor->parag()->length() == 1 ) {
newFormat->addRef();
cursor->parag()->setFormat( newFormat );
- cursor->parag()->invalidate(0);
+ cursor->parag()->tqinvalidate(0);
cursor->parag()->format();
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
}
@@ -1125,7 +1125,7 @@ KCommand *KoTextObject::setCounterCommand( KoTextCursor * cursor, const KoParagC
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
if ( !undoRedoInfo.newParagLayout.counter )
undoRedoInfo.newParagLayout.counter = new KoParagCounter;
*undoRedoInfo.newParagLayout.counter = counter;
@@ -1146,7 +1146,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
if ( protectContent() )
return 0L;
if ( !textdoc->hasSelection( selectionId, true ) && cursor &&
- (int)cursor->parag()->alignment() == align )
+ (int)cursor->parag()->tqalignment() == align )
return 0L; // No change needed.
emit hideCursor();
@@ -1164,8 +1164,8 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
start->setAlign(align);
}
formatMore( 2 );
- emit repaintChanged( this );
- undoRedoInfo.newParagLayout.alignment = align;
+ emit tqrepaintChanged( this );
+ undoRedoInfo.newParagLayout.tqalignment = align;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
@@ -1177,7 +1177,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
return new KoTextCommand( this, /*cmd, */i18n("Change Alignment") );
}
-KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetItem::Margin m, double margin , KoTextDocument::SelectionId selectionId ) {
+KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, TQStyleSheetItem::Margin m, double margin , KoTextDocument::SelectionId selectionId ) {
if ( protectContent() )
return 0L;
@@ -1202,17 +1202,17 @@ KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetIte
start->setMargin(m, margin);
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.margins[m] = margin;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
KoParagLayout::Margins, m );
textdoc->addCommand( cmd );
- QString name;
- if ( m == QStyleSheetItem::MarginFirstLine )
+ TQString name;
+ if ( m == TQStyleSheetItem::MarginFirstLine )
name = i18n("Change First Line Indent");
- else if ( m == QStyleSheetItem::MarginLeft || m == QStyleSheetItem::MarginRight )
+ else if ( m == TQStyleSheetItem::MarginLeft || m == TQStyleSheetItem::MarginRight )
name = i18n("Change Indent");
else
name = i18n("Change Paragraph Spacing");
@@ -1223,7 +1223,7 @@ KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetIte
}
KCommand * KoTextObject::setBackgroundColorCommand( KoTextCursor * cursor,
- const QColor & color,
+ const TQColor & color,
KoTextDocument::SelectionId selectionId ) {
if ( protectContent() )
return 0L;
@@ -1250,7 +1250,7 @@ KCommand * KoTextObject::setBackgroundColorCommand( KoTextCursor * cursor,
start->setBackgroundColor(color);
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
// Update undo/redo info
undoRedoInfo.newParagLayout.backgroundColor = color;
@@ -1298,7 +1298,7 @@ KCommand * KoTextObject::setLineSpacingCommand( KoTextCursor * cursor, double sp
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.setLineSpacingValue( spacing );
undoRedoInfo.newParagLayout.lineSpacingType = _type;
KoTextParagCommand *cmd = new KoTextParagCommand(
@@ -1358,7 +1358,7 @@ KCommand * KoTextObject::setBordersCommand( KoTextCursor * cursor, const KoBorde
end->next()->setChanged( true );
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.leftBorder=leftBorder;
undoRedoInfo.newParagLayout.rightBorder=rightBorder;
undoRedoInfo.newParagLayout.topBorder=topBorder;
@@ -1367,7 +1367,7 @@ KCommand * KoTextObject::setBordersCommand( KoTextCursor * cursor, const KoBorde
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
- KoParagLayout::Borders, (QStyleSheetItem::Margin)-1 );
+ KoParagLayout::Borders, (TQStyleSheetItem::Margin)-1 );
textdoc->addCommand( cmd );
undoRedoInfo.clear();
@@ -1414,13 +1414,13 @@ KCommand * KoTextObject::setJoinBordersCommand( KoTextCursor * cursor, bool join
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.joinBorder=join;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
- KoParagLayout::Borders, (QStyleSheetItem::Margin)-1 );
+ KoParagLayout::Borders, (TQStyleSheetItem::Margin)-1 );
textdoc->addCommand( cmd );
undoRedoInfo.clear();
@@ -1456,7 +1456,7 @@ KCommand * KoTextObject::setTabListCommand( KoTextCursor * cursor, const KoTabul
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.setTabList( tabList );
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
@@ -1469,7 +1469,7 @@ KCommand * KoTextObject::setTabListCommand( KoTextCursor * cursor, const KoTabul
return new KoTextCommand( this, /*cmd, */i18n("Change Tabulator") );
}
-KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar::Direction d, KoTextDocument::SelectionId selectionId )
+KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, TQChar::Direction d, KoTextDocument::SelectionId selectionId )
{
if ( protectContent() )
return 0L;
@@ -1494,7 +1494,7 @@ KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar:
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
////// ### TODO
#if 0
undoRedoInfo.newParagLayout.direction = d;
@@ -1514,7 +1514,7 @@ KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar:
#endif
}
-void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, const QString & cmdName, bool createUndoRedo )
+void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, const TQString & cmdName, bool createUndoRedo )
{
if ( protectContent() )
return ;
@@ -1524,7 +1524,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
checkUndoRedoInfo( cursor, UndoRedoInfo::RemoveSelected );
if ( !undoRedoInfo.valid() ) {
textdoc->selectionStart( selectionId, undoRedoInfo.id, undoRedoInfo.index );
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
newPlaceHolderCommand( cmdName.isNull() ? i18n("Remove Selected Text") : cmdName );
}
}
@@ -1537,7 +1537,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
setLastFormattedParag( cursor->parag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
@@ -1547,7 +1547,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
undoRedoInfo.clear();
}
-KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool repaint )
+KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint )
{
if ( protectContent() )
return 0L;
@@ -1571,20 +1571,20 @@ KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTex
undoRedoInfo.customItemsMap,
undoRedoInfo.oldParagLayouts );
textdoc->addCommand(cmd);
- macroCmd->addCommand(new KoTextCommand( this, /*cmd, */QString::null ));
+ macroCmd->addCommand(new KoTextCommand( this, /*cmd, */TQString() ));
if(!undoRedoInfo.customItemsMap.isEmpty())
undoRedoInfo.customItemsMap.deleteAll( macroCmd );
undoRedoInfo.type = UndoRedoInfo::Invalid; // we don't want clear() to create a command
undoRedoInfo.clear();
- if ( repaint )
+ if ( tqrepaint )
selectionChangedNotify();
return macroCmd;
}
-KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QString & replacement,
- const QString & cmdName,
+KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQString & replacement,
+ const TQString & cmdName,
KoTextDocument::SelectionId selectionId,
int insertFlags,
CustomItemsMap customItemsMap )
@@ -1592,8 +1592,8 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
if ( protectContent() )
return 0L;
Q_ASSERT( ( insertFlags & DoNotRemoveSelected ) == 0 ); // nonsensical
- const bool repaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
- if ( repaint )
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/tqreplace
+ if ( tqrepaint )
emit hideCursor();
// This could be improved to use a macro command only when there's a selection to remove.
KMacroCommand * macroCmd = new KMacroCommand( cmdName );
@@ -1604,20 +1604,20 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
format->addRef();
// Remove selected text, if any
- KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, repaint );
+ KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, tqrepaint );
if ( removeSelCmd )
macroCmd->addCommand( removeSelCmd );
// Insert replacement
insert( cursor, format,
- replacement, QString::null /* no place holder command */,
+ replacement, TQString() /* no place holder command */,
selectionId, insertFlags | DoNotRemoveSelected, customItemsMap );
KoTextDocCommand * cmd = new KoTextInsertCommand( textdoc, undoRedoInfo.id, undoRedoInfo.index,
undoRedoInfo.text.rawData(),
CustomItemsMap(), undoRedoInfo.oldParagLayouts );
textdoc->addCommand( cmd );
- macroCmd->addCommand( new KoTextCommand( this, /*cmd, */QString::null ) );
+ macroCmd->addCommand( new KoTextCommand( this, /*cmd, */TQString() ) );
undoRedoInfo.type = UndoRedoInfo::Invalid; // we don't want clear() to create a command
undoRedoInfo.clear();
@@ -1625,10 +1625,10 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
format->removeRef();
setLastFormattedParag( c1.parag() );
- if ( repaint )
+ if ( tqrepaint )
{
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
@@ -1642,34 +1642,34 @@ KCommand * KoTextObject::insertParagraphCommand( KoTextCursor *cursor )
{
if ( protectContent() )
return 0L;
- return replaceSelectionCommand( cursor, "\n", QString::null, KoTextDocument::Standard, CheckNewLine );
+ return replaceSelectionCommand( cursor, "\n", TQString(), KoTextDocument::Standard, CheckNewLine );
}
-void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool repaint )
+void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint )
{
if ( !m_highlightSelectionAdded )
{
textdoc->addSelection( KoTextDocument::HighlightSelection );
textdoc->setSelectionColor( KoTextDocument::HighlightSelection,
- QApplication::palette().color( QPalette::Active, QColorGroup::Dark ) );
+ TQApplication::palette().color( TQPalette::Active, TQColorGroup::Dark ) );
textdoc->setInvertSelectionText( KoTextDocument::HighlightSelection, true );
m_highlightSelectionAdded = true;
}
- removeHighlight(repaint); // remove previous highlighted selection
+ removeHighlight(tqrepaint); // remove previous highlighted selection
KoTextCursor cursor( textdoc );
cursor.setParag( parag );
cursor.setIndex( index );
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( index + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- if ( repaint ) {
+ if ( tqrepaint ) {
parag->setChanged( true );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
-void KoTextObject::removeHighlight(bool repaint)
+void KoTextObject::removeHighlight(bool tqrepaint)
{
if ( textdoc->hasSelection( KoTextDocument::HighlightSelection, true ) )
{
@@ -1677,8 +1677,8 @@ void KoTextObject::removeHighlight(bool repaint)
oldParag->setChanged( true );
textdoc->removeSelection( KoTextDocument::HighlightSelection );
}
- if ( repaint )
- emit repaintChanged( this );
+ if ( tqrepaint )
+ emit tqrepaintChanged( this );
}
void KoTextObject::selectAll( bool select )
@@ -1692,19 +1692,19 @@ void KoTextObject::selectAll( bool select )
void KoTextObject::selectionChangedNotify( bool enableActions /* = true */)
{
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
if ( enableActions )
emit selectionChanged( hasSelection() );
}
-void KoTextObject::setViewArea( QWidget* w, int maxY )
+void KoTextObject::setViewArea( TQWidget* w, int maxY )
{
- m_mapViewAreas.replace( w, maxY );
+ m_mapViewAreas.tqreplace( w, maxY );
}
void KoTextObject::setLastFormattedParag( KoTextParag *parag )
{
- //kdDebug() << k_funcinfo << parag << " (" << ( parag ? QString::number(parag->paragId()) : QString("(null)") ) << ")" << endl;
+ //kdDebug() << k_funcinfo << parag << " (" << ( parag ? TQString::number(parag->paragId()) : TQString("(null)") ) << ")" << endl;
if ( !m_lastFormatted || !parag || m_lastFormatted->paragId() >= parag->paragId() ) {
m_lastFormatted = parag;
}
@@ -1725,7 +1725,7 @@ void KoTextObject::ensureFormatted( KoTextParag * parag, bool emitAfterFormattin
return;
}
// The paragid diff is "a good guess". The >=1 is a safety measure ;)
- bool ret = formatMore( QMAX( 1, parag->paragId() - m_lastFormatted->paragId() ), emitAfterFormatting );
+ bool ret = formatMore( TQMAX( 1, parag->paragId() - m_lastFormatted->paragId() ), emitAfterFormatting );
if ( !ret ) { // aborted
//kdDebug(32500) << "ensureFormatted aborted!" << endl;
break;
@@ -1760,9 +1760,9 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
d->afterFormattingEmitted = false;
int viewsBottom = 0;
- QMapIterator<QWidget *, int> mapIt = m_mapViewAreas.begin();
+ TQMapIterator<TQWidget *, int> mapIt = m_mapViewAreas.begin();
for ( ; mapIt != m_mapViewAreas.end() ; ++mapIt )
- viewsBottom = QMAX( viewsBottom, mapIt.data() );
+ viewsBottom = TQMAX( viewsBottom, mapIt.data() );
#ifdef DEBUG_FORMAT_MORE
kdDebug(32500) << "formatMore " << name()
@@ -1826,12 +1826,12 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
}
else // formatting was done previously, but not emit afterFormatting
{
- QRect rect = textdoc->lastParag()->rect();
+ TQRect rect = textdoc->lastParag()->rect();
bottom = rect.top() + rect.height();
}
#ifdef DEBUG_FORMAT_MORE
- QString id;
- if ( m_lastFormatted ) id = QString(" (%1)").arg(m_lastFormatted->paragId());
+ TQString id;
+ if ( m_lastFormatted ) id = TQString(" (%1)").tqarg(m_lastFormatted->paragId());
kdDebug(32500) << "formatMore finished formatting. "
<< " bottom=" << bottom
<< " m_lastFormatted=" << m_lastFormatted << id
@@ -1865,7 +1865,7 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
}
else
{
- interval = QMAX( 0, interval );
+ interval = TQMAX( 0, interval );
#ifdef DEBUG_FORMAT_MORE
kdDebug(32500) << name() << " formatMore: all formatted interval=" << interval << endl;
#endif
@@ -1912,7 +1912,7 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
KMacroCommand * macroCmd = new KMacroCommand( i18n("Change Case") );
KoTextFormat *curFormat = parag->paragraphFormat();
- const QString text = parag->string()->toString().mid( cursorPosStart, cursorPosEnd - cursorPosStart );
+ const TQString text = parag->string()->toString().mid( cursorPosStart, cursorPosEnd - cursorPosStart );
int posStart = cursorPosStart;
int posEnd = cursorPosStart;
KoTextCursor c1( textdoc );
@@ -1931,12 +1931,12 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
c2.setIndex( posEnd );
//kdDebug() << k_funcinfo << "found custom at " << i << " : doing from " << posStart << " to " << posEnd << endl;
- const QString repl = text.mid( posStart, posEnd - posStart );
+ const TQString repl = text.mid( posStart, posEnd - posStart );
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
do
{
++i;
@@ -1956,12 +1956,12 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
c2.setIndex( posEnd );
//kdDebug() << k_funcinfo << "found new format at " << i << " : doing from " << posStart << " to " << posEnd << endl;
- const QString repl = text.mid( posStart, posEnd - posStart );
+ const TQString repl = text.mid( posStart, posEnd - posStart );
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
posStart=i;
posEnd=i;
curFormat = newFormat;
@@ -1978,10 +1978,10 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
- const QString repl = text.mid( posStart, cursorPosEnd - posStart );
+ const TQString repl = text.mid( posStart, cursorPosEnd - posStart );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
}
return macroCmd;
@@ -1999,7 +1999,7 @@ KCommand *KoTextObject::changeCaseOfText(KoTextCursor *cursor,KoChangeCaseDia::T
if ( start.parag() == end.parag() )
{
- int endIndex = QMIN( start.parag()->length() - 1, end.index() );
+ int endIndex = TQMIN( start.parag()->length() - 1, end.index() );
macroCmd->addCommand( changeCaseOfTextParag( start.index(), endIndex, _type,
cursor, start.parag() ) );
}
@@ -2015,21 +2015,21 @@ KCommand *KoTextObject::changeCaseOfText(KoTextCursor *cursor,KoChangeCaseDia::T
}
if ( p )
{
- int endIndex = QMIN( p->length() - 1, end.index() );
+ int endIndex = TQMIN( p->length() - 1, end.index() );
macroCmd->addCommand( changeCaseOfTextParag(0, endIndex, _type, cursor, end.parag() ));
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
return macroCmd;
}
-QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::TypeOfCase _type)
+TQString KoTextObject::textChangedCase(const TQString& _text,KoChangeCaseDia::TypeOfCase _type)
{
- QString text(_text);
+ TQString text(_text);
switch(_type)
{
case KoChangeCaseDia::UpperCase:
@@ -2041,25 +2041,25 @@ QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::Type
case KoChangeCaseDia::TitleCase:
for(uint i=0;i<text.length();i++)
{
- if(text.at(i)!=' ')
+ if(text.tqat(i)!=' ')
{
- QChar prev = text.at(QMAX(i-1,0));
+ TQChar prev = text.tqat(TQMAX(i-1,0));
if(i==0 || prev == ' ' || prev == '\n' || prev == '\t')
- text=text.replace(i, 1, text.at(i).upper() );
+ text=text.tqreplace(i, 1, text.tqat(i).upper() );
else
- text=text.replace(i, 1, text.at(i).lower() );
+ text=text.tqreplace(i, 1, text.tqat(i).lower() );
}
}
break;
case KoChangeCaseDia::ToggleCase:
for(uint i=0;i<text.length();i++)
{
- QString repl=QString(text.at(i));
- if(text.at(i)!=text.at(i).upper())
+ TQString repl=TQString(text.at(i));
+ if(text.tqat(i)!=text.tqat(i).upper())
repl=repl.upper();
- else if(text.at(i).lower()!=text.at(i))
+ else if(text.tqat(i).lower()!=text.tqat(i))
repl=repl.lower();
- text=text.replace(i, 1, repl );
+ text=text.tqreplace(i, 1, repl );
}
break;
case KoChangeCaseDia::SentenceCase:
@@ -2067,9 +2067,9 @@ QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::Type
{
if(text.at(i)!=' ')
{
- QChar prev = text.at(QMAX(i-1,0));
+ TQChar prev = text.at(TQMAX(i-1,0));
if(i==0 || prev == '\n' ||prev.isPunct())
- text=text.replace(i, 1, text.at(i).upper() );
+ text=text.tqreplace(i, 1, text.tqat(i).upper() );
}
}
break;
@@ -2101,7 +2101,7 @@ bool KoTextObject::rtl() const
return textdoc->firstParag()->string()->isRightToLeft();
}
-void KoTextObject::loadOasisContent( const QDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl )
+void KoTextObject::loadOasisContent( const TQDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl )
{
textDocument()->clear(false); // Get rid of dummy paragraph (and more if any)
setLastFormattedParag( 0L ); // no more parags, avoid UMR in next setLastFormattedParag call
@@ -2120,7 +2120,7 @@ void KoTextObject::loadOasisContent( const QDomElement &bodyElem, KoOasisContext
setLastFormattedParag( textDocument()->firstParag() );
}
-KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisContext& context,
+KoTextCursor KoTextObject::pasteOasisText( const TQDomElement &bodyElem, KoOasisContext& context,
KoTextCursor& cursor, KoStyleCollection * styleColl )
{
KoTextCursor resultCursor( cursor );
@@ -2139,16 +2139,16 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
} else {
// Pasting inside a non-empty paragraph -> insert/append text to it.
// This loop looks for the *FIRST* paragraph only.
- for ( QDomNode text (bodyElem.firstChild()); !text.isNull(); text = text.nextSibling() )
+ for ( TQDomNode text (bodyElem.firstChild()); !text.isNull(); text = text.nextSibling() )
{
- QDomElement tag = text.toElement();
+ TQDomElement tag = text.toElement();
if ( tag.isNull() ) continue;
// The first tag could be a text:p, text:h, text:numbered-paragraph, but also
// a frame (anchored to page), a TOC, etc. For those, don't try to concat-with-existing-paragraph.
// For text:numbered-paragraph, find the text:p or text:h inside it.
- QDomElement tagToLoad = tag;
+ TQDomElement tagToLoad = tag;
if ( tag.localName() == "numbered-paragraph" ) {
- QDomElement npchild;
+ TQDomElement npchild;
forEachElement( npchild, tag )
{
if ( npchild.localName() == "p" || npchild.localName() == "h" ) {
@@ -2167,7 +2167,7 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
context.styleStack().restore();
lastParagraph->setChanged( true );
- lastParagraph->invalidate( 0 );
+ lastParagraph->tqinvalidate( 0 );
// Now split this parag, to make room for the next paragraphs
resultCursor.setParag( lastParagraph );
@@ -2176,7 +2176,7 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
removeNewline = true;
// Done with first parag, remove it and exit loop
- const_cast<QDomElement &>( bodyElem ).removeChild( tag ); // somewhat hackish
+ const_cast<TQDomElement &>( bodyElem ).removeChild( tag ); // somewhat hackish
}
break;
}
@@ -2256,23 +2256,23 @@ void KoTextObject::setNeedSpellCheck(bool b)
parag->string()->setNeedsSpellCheck( b );
}
-bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected )
+bool KoTextObject::statistics( TQProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected )
{
// parts of words for better counting of syllables:
// (only use reg exp if necessary -> speed up)
- QStringList subs_syl;
+ TQStringList subs_syl;
subs_syl << "cial" << "tia" << "cius" << "cious" << "giu" << "ion" << "iou";
- QStringList subs_syl_regexp;
+ TQStringList subs_syl_regexp;
subs_syl_regexp << "sia$" << "ely$";
- QStringList add_syl;
+ TQStringList add_syl;
add_syl << "ia" << "riet" << "dien" << "iu" << "io" << "ii";
- QStringList add_syl_regexp;
+ TQStringList add_syl_regexp;
add_syl_regexp << "[aeiouym]bl$" << "[aeiou]{3}" << "^mc" << "ism$"
<< "[^l]lien" << "^coa[dglx]." << "[^gq]ua[^auieo]" << "dnt$";
- QString s;
+ TQString s;
KoTextParag * parag = textdoc->firstParag();
for ( ; parag ; parag = parag->next() )
{
@@ -2313,7 +2313,7 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// Character count
for ( uint i = 0 ; i < s.length() - ( hasTrailingSpace ? 1 : 0 ) ; ++i )
{
- QChar ch = s[i];
+ TQChar ch = s[i];
++charsWithSpace;
if ( !ch.isSpace() )
++charsWithoutSpace;
@@ -2325,12 +2325,12 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// is quite good, as some words get a number that's too high and others get
// one that's too low.
// IMPORTANT: please test any changes against demos/statistics.kwd
- QRegExp re("\\s+");
- QStringList wordlist = QStringList::split(re, s);
+ TQRegExp re("\\s+");
+ TQStringList wordlist = TQStringList::split(re, s);
words += wordlist.count();
re.setCaseSensitive(false);
- for ( QStringList::Iterator it = wordlist.begin(); it != wordlist.end(); ++it ) {
- QString word = *it;
+ for ( TQStringList::Iterator it = wordlist.begin(); it != wordlist.end(); ++it ) {
+ TQString word = *it;
re.setPattern("[!?.,:_\"-]"); // clean word from punctuation
word.remove(re);
if ( word.length() <= 3 ) { // extension to the original algorithm
@@ -2340,24 +2340,24 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
re.setPattern("e$");
word.remove(re);
re.setPattern("[^aeiouy]+");
- QStringList syls = QStringList::split(re, word);
+ TQStringList syls = TQStringList::split(re, word);
int word_syllables = 0;
- for ( QStringList::Iterator it = subs_syl.begin(); it != subs_syl.end(); ++it ) {
- if( word.find(*it, 0, false) != -1 )
+ for ( TQStringList::Iterator it = subs_syl.begin(); it != subs_syl.end(); ++it ) {
+ if( word.tqfind(*it, 0, false) != -1 )
word_syllables--;
}
- for ( QStringList::Iterator it = subs_syl_regexp.begin(); it != subs_syl_regexp.end(); ++it ) {
+ for ( TQStringList::Iterator it = subs_syl_regexp.begin(); it != subs_syl_regexp.end(); ++it ) {
re.setPattern(*it);
- if( word.find(re) != -1 )
+ if( word.tqfind(re) != -1 )
word_syllables--;
}
- for ( QStringList::Iterator it = add_syl.begin(); it != add_syl.end(); ++it ) {
- if( word.find(*it, 0, false) != -1 )
+ for ( TQStringList::Iterator it = add_syl.begin(); it != add_syl.end(); ++it ) {
+ if( word.tqfind(*it, 0, false) != -1 )
word_syllables++;
}
- for ( QStringList::Iterator it = add_syl_regexp.begin(); it != add_syl_regexp.end(); ++it ) {
+ for ( TQStringList::Iterator it = add_syl_regexp.begin(); it != add_syl_regexp.end(); ++it ) {
re.setPattern(*it);
- if( word.find(re) != -1 )
+ if( word.tqfind(re) != -1 )
word_syllables++;
}
word_syllables += syls.count();
@@ -2370,19 +2370,19 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// Sentence count
// Clean up for better result, destroys the original text but we only want to count
s = s.stripWhiteSpace();
- QChar lastchar = s.at(s.length());
+ TQChar lastchar = s.at(s.length());
if( ! s.isEmpty() && ! KoAutoFormat::isMark( lastchar ) ) { // e.g. for headlines
s = s + ".";
}
re.setPattern("[.?!]+"); // count "..." as only one "."
- s.replace(re, ".");
+ s.tqreplace(re, ".");
re.setPattern("\\d\\.\\d"); // don't count floating point numbers as sentences
- s.replace(re, "0,0");
+ s.tqreplace(re, "0,0");
re.setPattern("[A-Z]\\.+"); // don't count "U.S.A." as three sentences
- s.replace(re, "*");
+ s.tqreplace(re, "*");
for ( uint i = 0 ; i < s.length() ; ++i )
{
- QChar ch = s[i];
+ TQChar ch = s[i];
if ( KoAutoFormat::isMark( ch ) )
++sentences;
}
@@ -2403,7 +2403,7 @@ int KoTextObject::numberOfparagraphLineSelected( KoTextParag *parag)
return (lineEnd - lineStart+1);
}
-KoVariable* KoTextObject::variableAtPoint( const QPoint& iPoint ) const
+KoVariable* KoTextObject::variableAtPoint( const TQPoint& iPoint ) const
{
KoTextCursor cursor( textDocument() );
int variablePosition = -1;
@@ -2426,13 +2426,13 @@ const char * KoTextObject::acceptSelectionMimeType()
return "application/vnd.oasis.opendocument.";
}
-QCString KoTextObject::providesOasis( QMimeSource* mime )
+TQCString KoTextObject::providesOasis( TQMimeSource* mime )
{
const char* fmt;
const char* acceptMimeType = acceptSelectionMimeType();
for ( int i = 0; (fmt = mime->format(i)); ++i )
{
- if ( QString( fmt ).startsWith( acceptMimeType ) )
+ if ( TQString( fmt ).startsWith( acceptMimeType ) )
{
return fmt;
}
@@ -2478,7 +2478,7 @@ KCommand *KoTextFormatInterface::setUnderlineCommand( bool on )
return setFormatCommand( &format, KoTextFormat::ExtendUnderLine );
}
-KCommand *KoTextFormatInterface::setUnderlineColorCommand( const QColor &color )
+KCommand *KoTextFormatInterface::setUnderlineColorCommand( const TQColor &color )
{
KoTextFormat format( *currentFormat() );
format.setTextUnderlineColor( color);
@@ -2499,7 +2499,7 @@ KCommand *KoTextFormatInterface::setStrikeOutCommand( bool on )
return setFormatCommand( &format, KoTextFormat::StrikeOut );
}
-KCommand *KoTextFormatInterface::setTextBackgroundColorCommand(const QColor & col)
+KCommand *KoTextFormatInterface::setTextBackgroundColorCommand(const TQColor & col)
{
KoTextFormat format( *currentFormat() );
format.setTextBackgroundColor( col );
@@ -2513,24 +2513,24 @@ KCommand *KoTextFormatInterface::setPointSizeCommand( int s )
return setFormatCommand( &format, KoTextFormat::Size, true /* zoom the font size */ );
}
-KCommand *KoTextFormatInterface::setFamilyCommand(const QString &font)
+KCommand *KoTextFormatInterface::setFamilyCommand(const TQString &font)
{
KoTextFormat format( *currentFormat() );
format.setFamily( font );
return setFormatCommand( &format, KoTextFormat::Family );
}
-QColor KoTextFormatInterface::textBackgroundColor() const
+TQColor KoTextFormatInterface::textBackgroundColor() const
{
return currentFormat()->textBackgroundColor();
}
-QColor KoTextFormatInterface::textUnderlineColor()const
+TQColor KoTextFormatInterface::textUnderlineColor()const
{
return currentFormat()->textUnderlineColor();
}
-QColor KoTextFormatInterface::textColor() const
+TQColor KoTextFormatInterface::textColor() const
{
return currentFormat()->color();
}
@@ -2580,7 +2580,7 @@ double KoTextFormatInterface::shadowDistanceY() const
return currentFormat()->shadowDistanceY();
}
-QColor KoTextFormatInterface::shadowColor() const
+TQColor KoTextFormatInterface::shadowColor() const
{
return currentFormat()->shadowColor();
}
@@ -2630,25 +2630,25 @@ KoTextFormat::StrikeOutStyle KoTextFormatInterface::strikeOutStyle()const
return currentFormat()->strikeOutStyle();
}
-QFont KoTextFormatInterface::textFont() const
+TQFont KoTextFormatInterface::textFont() const
{
- QFont fn( currentFormat()->font() );
+ TQFont fn( currentFormat()->font() );
// "unzoom" the font size
- //fn.setPointSize( static_cast<int>( KoTextZoomHandler::layoutUnitPtToPt( fn.pointSize() ) ) );
+ //fn.setPointSize( static_cast<int>( KoTextZoomHandler::tqlayoutUnitPtToPt( fn.pointSize() ) ) );
return fn;
}
-QString KoTextFormatInterface::textFontFamily()const
+TQString KoTextFormatInterface::textFontFamily()const
{
return currentFormat()->font().family();
}
-QString KoTextFormatInterface::language() const
+TQString KoTextFormatInterface::language() const
{
return currentFormat()->language();
}
-KCommand *KoTextFormatInterface::setTextColorCommand(const QColor &color)
+KCommand *KoTextFormatInterface::setTextColorCommand(const TQColor &color)
{
KoTextFormat format( *currentFormat() );
format.setColor( color );
@@ -2677,7 +2677,7 @@ KCommand *KoTextFormatInterface::setTextSuperScriptCommand(bool on)
KCommand *KoTextFormatInterface::setDefaultFormatCommand()
{
- KoTextFormatCollection * coll = currentFormat()->parent();
+ KoTextFormatCollection * coll = currentFormat()->tqparent();
Q_ASSERT(coll);
if(coll)
{
@@ -2692,7 +2692,7 @@ KCommand *KoTextFormatInterface::setDefaultFormatCommand()
KCommand *KoTextFormatInterface::setAlignCommand(int align)
{
KoParagLayout format( *currentParagLayoutFormat() );
- format.alignment=align;
+ format.tqalignment=align;
return setParagLayoutFormatCommand(&format,KoParagLayout::Alignment);
}
@@ -2704,7 +2704,7 @@ KCommand *KoTextFormatInterface::setHyphenationCommand( bool _b )
}
-KCommand *KoTextFormatInterface::setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor )
+KCommand *KoTextFormatInterface::setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor )
{
KoTextFormat format( *currentFormat() );
format.setShadow( shadowDistanceX, shadowDistanceY, shadowColor );
@@ -2746,7 +2746,7 @@ void KoTextFormatInterface::setAlign(int align)
emitNewCommand( cmd );
}
-void KoTextFormatInterface::setMargin(QStyleSheetItem::Margin m, double margin)
+void KoTextFormatInterface::setMargin(TQStyleSheetItem::Margin m, double margin)
{
KCommand *cmd = setMarginCommand( m, margin );
emitNewCommand( cmd );
@@ -2771,7 +2771,7 @@ void KoTextFormatInterface::setParagLayoutFormat( KoParagLayout *newLayout, int
}
#endif
-KCommand *KoTextFormatInterface::setMarginCommand(QStyleSheetItem::Margin m, double margin)
+KCommand *KoTextFormatInterface::setMarginCommand(TQStyleSheetItem::Margin m, double margin)
{
KoParagLayout format( *currentParagLayoutFormat() );
format.margins[m]=margin;
@@ -2794,14 +2794,14 @@ KCommand *KoTextFormatInterface::setCounterCommand(const KoParagCounter & counte
return setParagLayoutFormatCommand(&format,KoParagLayout::BulletNumber);
}
-KCommand *KoTextFormatInterface::setLanguageCommand(const QString &_lang)
+KCommand *KoTextFormatInterface::setLanguageCommand(const TQString &_lang)
{
KoTextFormat format( *currentFormat() );
format.setLanguage(_lang);
return setFormatCommand( &format, KoTextFormat::Language );
}
-KoTextDocCommand *KoTextFormatInterface::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts )
+KoTextDocCommand *KoTextFormatInterface::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts )
{
return textdoc->deleteTextCommand( textdoc, id, index, str, customItemsMap, oldParagLayouts );
}
diff --git a/lib/kotext/KoTextObject.h b/lib/kotext/KoTextObject.h
index 58c92e9b..e6414f99 100644
--- a/lib/kotext/KoTextObject.h
+++ b/lib/kotext/KoTextObject.h
@@ -29,12 +29,12 @@
class KoSavingContext;
class KCommand;
class KoTextFormat;
-class QProgressDialog;
+class TQProgressDialog;
class KoLinkVariable;
class KoVariable;
//#define TIMING_FORMAT
-//#include <qdatetime.h>
+//#include <tqdatetime.h>
/**
* The KoTextFormatInterface is a pure interface that allows access to the
@@ -64,11 +64,11 @@ public:
*/
virtual KCommand *setFormatCommand( const KoTextFormat *format, int flags, bool zoomFont = false ) = 0;
- /** Interface for accessing the current parag layout */
+ /** Interface for accessing the current parag tqlayout */
virtual const KoParagLayout * currentParagLayoutFormat() const = 0;
- /** Interface for changing the paragraph layout.
- * @param newLayout pointer to the new layout to apply
+ /** Interface for changing the paragraph tqlayout.
+ * @param newLayout pointer to the new tqlayout to apply
* @param flags one of the KoParagLayout flags
* @param marginIndex type of margin. Only used if flags==KoParagLayout::Margins
*/
@@ -76,7 +76,7 @@ public:
virtual KCommand *setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type)=0;
- KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts );
+ KoTextDocCommand *deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts );
void setParagLayoutFormat( KoParagLayout *newLayout,int flags, int marginIndex=-1);
void setFormat( KoTextFormat * newFormat, int flags, bool zoomFont = false );
@@ -90,14 +90,14 @@ public:
KCommand *setUnderlineCommand(bool on);
//void setStrikeOut(bool on);
KCommand *setDoubleUnderlineCommand( bool on );
- KCommand *setUnderlineColorCommand( const QColor &color );
+ KCommand *setUnderlineColorCommand( const TQColor &color );
KCommand *setStrikeOutCommand(bool on);
- //void setTextColor(const QColor &color);
- KCommand *setTextColorCommand(const QColor &color);
+ //void setTextColor(const TQColor &color);
+ KCommand *setTextColorCommand(const TQColor &color);
//void setPointSize( int s );
KCommand *setPointSizeCommand( int s );
- //void setFamily(const QString &font);
- KCommand *setFamilyCommand(const QString &font);
+ //void setFamily(const TQString &font);
+ KCommand *setFamilyCommand(const TQString &font);
//void setTextSubScript(bool on);
KCommand *setTextSubScriptCommand(bool on);
//void setTextSuperScript(bool on);
@@ -106,27 +106,27 @@ public:
//void setDefaultFormat();
KCommand *setDefaultFormatCommand();
- //void setTextBackgroundColor(const QColor &);
- KCommand *setTextBackgroundColorCommand(const QColor &);
+ //void setTextBackgroundColor(const TQColor &);
+ KCommand *setTextBackgroundColorCommand(const TQColor &);
//void setAlign(int align);
KCommand *setAlignCommand(int align);
- //void setMargin(QStyleSheetItem::Margin m, double margin);
- KCommand *setMarginCommand(QStyleSheetItem::Margin m, double margin);
+ //void setMargin(TQStyleSheetItem::Margin m, double margin);
+ KCommand *setMarginCommand(TQStyleSheetItem::Margin m, double margin);
//void setTabList(const KoTabulatorList & tabList );
KCommand *setTabListCommand(const KoTabulatorList & tabList );
- //void setBackgroundColor(const QColor & color );
- KCommand *setBackgroundColorCommand(const QColor & color );
+ //void setBackgroundColor(const TQColor & color );
+ KCommand *setBackgroundColorCommand(const TQColor & color );
//void setCounter(const KoParagCounter & counter );
KCommand *setCounterCommand(const KoParagCounter & counter );
- KCommand *setLanguageCommand(const QString &);
+ KCommand *setLanguageCommand(const TQString &);
- KCommand *setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor );
+ KCommand *setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor );
KCommand *setHyphenationCommand( bool _b );
@@ -140,12 +140,12 @@ public:
KCommand *setWordByWordCommand( bool _b );
- QColor textColor() const;
- QFont textFont() const;
- QString textFontFamily()const;
- QString language() const;
- QColor textBackgroundColor()const;
- QColor textUnderlineColor()const;
+ TQColor textColor() const;
+ TQFont textFont() const;
+ TQString textFontFamily()const;
+ TQString language() const;
+ TQColor textBackgroundColor()const;
+ TQColor textUnderlineColor()const;
KoTextFormat::UnderlineType underlineType()const;
KoTextFormat::StrikeOutType strikeOutType()const;
@@ -164,7 +164,7 @@ public:
bool textSuperScript() const;
double shadowDistanceX() const;
double shadowDistanceY() const;
- QColor shadowColor() const;
+ TQColor shadowColor() const;
KoTextFormat::AttributeStyle fontAttribute() const;
double relativeTextSize() const;
int offsetFromBaseLine()const;
@@ -178,9 +178,10 @@ public:
* the undo/redo commands).
* Editing the text isn't done by KoTextObject but by KoTextView (document/view design).
*/
-class KOTEXT_EXPORT KoTextObject : public QObject, public KoTextFormatInterface
+class KOTEXT_EXPORT KoTextObject : public TQObject, public KoTextFormatInterface
{
Q_OBJECT
+ TQ_OBJECT
public:
/** Constructor.
* This constructor creates the contained KoTextDocument automatically.
@@ -191,13 +192,13 @@ public:
* @param defaultHyphenation the default setting for hyphenation (see KoTextFormatCollection)
* @param defaultStyle the style to use by default (initial pararaph, and when deleting a used style)
* @param tabStopWidth the global value for the tabstop width
- * @param parent parent widget for this object
+ * @param tqparent tqparent widget for this object
* @param name name for this object
*
*/
- KoTextObject( KoTextZoomHandler *zh, const QFont& defaultFont, const QString &defaultLanguage,
+ KoTextObject( KoTextZoomHandler *zh, const TQFont& defaultFont, const TQString &defaultLanguage,
bool defaultHyphenation, KoParagStyle* defaultStyle, int tabStopWidth = -1,
- QObject* parent = 0, const char *name = 0 );
+ TQObject* tqparent = 0, const char *name = 0 );
/** Alternative constructor.
* This constructor allows to use a derived class from KoTextDocument.
@@ -205,11 +206,11 @@ public:
* @param textdoc the text document to use in this text object. Ownership is transferred
* to the text object.
* @param defaultStyle the style to use by default (initial pararaph, and when deleting a used style)
- * @param parent parent widget for this object
+ * @param tqparent tqparent widget for this object
* @param name name for this object
*/
KoTextObject( KoTextDocument *textdoc, KoParagStyle* defaultStyle,
- QObject* parent = 0, const char *name = 0 );
+ TQObject* tqparent = 0, const char *name = 0 );
virtual ~KoTextObject();
@@ -217,7 +218,7 @@ public:
static const char * acceptSelectionMimeType();
/// Check if the mimesource @p mime provides one of the OASIS mimetypes,
/// and if so, return it. Otherwise return an empty string.
- static QCString providesOasis( QMimeSource* mime );
+ static TQCString providesOasis( TQMimeSource* mime );
void setNeedSpellCheck(bool b);
bool needSpellCheck() const { return m_needsSpellCheck;}
@@ -239,7 +240,7 @@ public:
/** return true if some text is selected */
bool hasSelection() const { return textdoc->hasSelection( KoTextDocument::Standard, true ); }
/** returns the selected text [without formatting] if hasSelection() */
- QString selectedText( KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ) const {
+ TQString selectedText( KoTextDocument::SelectionId selectionId = KoTextDocument::Standard ) const {
return textdoc->selectedText( selectionId );
}
/** returns true if the given selection has any custom item in it */
@@ -250,7 +251,7 @@ public:
CheckNewLine = 1, /// < if true, the text to be inserted is checked for '\\n' (as a paragraph delimiter)
OverwriteMode = 2,
DoNotRemoveSelected = 4, ///< whether to remove selected text before
- DoNotRepaint = 8 ///< usually we repaint in insert(), this allows to turn it off
+ DoNotRepaint = 8 ///< usually we tqrepaint in insert(), this allows to turn it off
};
/**
@@ -264,10 +265,10 @@ public:
* @param customItemsMap the map of custom items to include in the new text
* @param selectionId which selection to use (See KoTextDocument::SelectionId)
*/
- void insert( KoTextCursor * cursor, KoTextFormat * currentFormat, const QString &text,
- const QString & commandName,
+ void insert( KoTextCursor * cursor, KoTextFormat * currentFormat, const TQString &text,
+ const TQString & commandName,
KoTextDocument::SelectionId selectionId = KoTextDocument::Standard,
- int insertFlags = DefaultInsertFlags, // KDE4: TODO use QFlags
+ int insertFlags = DefaultInsertFlags, // KDE4: TODO use TQFlags
CustomItemsMap customItemsMap = CustomItemsMap() );
/**
@@ -278,14 +279,14 @@ public:
* @param createUndoRedo create an undo history entry for this removal
*/
void removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard,
- const QString & cmdName = QString::null, bool createUndoRedo=true );
+ const TQString & cmdName = TQString(), bool createUndoRedo=true );
- KCommand * replaceSelectionCommand( KoTextCursor * cursor, const QString & replacement,
- const QString & cmdName,
+ KCommand * replaceSelectionCommand( KoTextCursor * cursor, const TQString & replacement,
+ const TQString & cmdName,
KoTextDocument::SelectionId selectionId = KoTextDocument::Standard,
- int insertFlags = DefaultInsertFlags, // KDE4: TODO use QFlags
+ int insertFlags = DefaultInsertFlags, // KDE4: TODO use TQFlags
CustomItemsMap customItemsMap = CustomItemsMap() );
- KCommand * removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool repaint = true );
+ KCommand * removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint = true );
KCommand* insertParagraphCommand( KoTextCursor * cursor );
/**
@@ -300,15 +301,15 @@ public:
* what it does (presumably, removes the selection and replaces it
* with the pasted text).
*/
- void pasteText( KoTextCursor * cursor, const QString & text, KoTextFormat * currentFormat,
+ void pasteText( KoTextCursor * cursor, const TQString & text, KoTextFormat * currentFormat,
bool removeSelected );
void selectAll( bool select );
- /** Highlighting support (for search/replace, spellchecking etc.).
+ /** Highlighting support (for search/tqreplace, spellchecking etc.).
* Don't forget to ensure the paragraph is visible.
*/
- void highlightPortion( KoTextParag * parag, int index, int length, bool repaint );
- void removeHighlight( bool repaint );
+ void highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint );
+ void removeHighlight( bool tqrepaint );
/** Implementation of setFormatCommand from KoTextFormatInterface - apply change to the whole document */
KCommand *setFormatCommand( const KoTextFormat *format, int flags, bool zoomFont = false );
@@ -317,7 +318,7 @@ public:
Returns a command if the format was applied to a selection */
KCommand *setFormatCommand( KoTextCursor * cursor, KoTextFormat ** currentFormat, const KoTextFormat *format, int flags, bool zoomFont = false, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
- enum KeyboardAction { // keep in sync with QTextEdit
+ enum KeyboardAction { // keep in sync with TQTextEdit
ActionBackspace,
ActionDelete,
ActionReturn,
@@ -333,21 +334,21 @@ public:
KCommand * setLineSpacingCommand( KoTextCursor * cursor, double spacing, KoParagLayout::SpacingType _type,KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
KCommand * setBordersCommand( KoTextCursor * cursor, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
KCommand * setJoinBordersCommand( KoTextCursor * cursor, bool join, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
- KCommand * setMarginCommand( KoTextCursor * cursor, QStyleSheetItem::Margin m, double margin, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard);
+ KCommand * setMarginCommand( KoTextCursor * cursor, TQStyleSheetItem::Margin m, double margin, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard);
KCommand* setTabListCommand( KoTextCursor * cursor,const KoTabulatorList & tabList , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
- KCommand* setBackgroundColorCommand( KoTextCursor * cursor,const QColor & color , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
+ KCommand* setBackgroundColorCommand( KoTextCursor * cursor,const TQColor & color , KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
- KCommand * setParagDirectionCommand( KoTextCursor * cursor, QChar::Direction d, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
+ KCommand * setParagDirectionCommand( KoTextCursor * cursor, TQChar::Direction d, KoTextDocument::SelectionId selectionId = KoTextDocument::Standard );
/**
* Apply a KoParagStyle to a selection.
* @param cursor the current cursor; used if there is no selection. Can be 0L if there is one.
* @param style the KoParagStyle to apply
* @param selectionId the id of the selection, usually Standard or Temp
- * @param paragLayoutFlags which settings from the paragraph layout to apply
+ * @param paragLayoutFlags which settings from the paragraph tqlayout to apply
* @param formatFlags which settings from the text format to apply
* @param createUndoRedo if true, an undo/redo command will be created and emitted
- * @param interactive if true, the text will be reformatted/repainted to show the new style
+ * @param interactive if true, the text will be reformatted/tqrepainted to show the new style
*/
void applyStyle( KoTextCursor * cursor, const KoParagStyle * style,
KoTextDocument::SelectionId selectionId = KoTextDocument::Standard,
@@ -409,14 +410,14 @@ public:
int zoomedFontSize( int docFontSize ) const;
/** Set the bottom of the view - in LU */
- void setViewArea( QWidget* w, int maxY );
+ void setViewArea( TQWidget* w, int maxY );
/** Make sure that @p parag is formatted */
void ensureFormatted( KoTextParag * parag, bool emitAfterFormatting = true );
void setLastFormattedParag( KoTextParag *parag );
- static QChar customItemChar() { return QChar( s_customItemChar ); }
+ static TQChar customItemChar() { return TQChar( s_customItemChar ); }
- // Qt should really have support for public signals
+ // TQt should really have support for public signals
void emitHideCursor() { emit hideCursor(); }
void emitShowCursor() { emit showCursor(); }
void emitEnsureCursorVisible() { emit ensureCursorVisible(); }
@@ -428,7 +429,7 @@ public:
/**
* Abort the current formatMore() loop, or prevent the next one from starting.
* Use with care. This is e.g. for KWFootNoteVariable, so that it can do
- * a frame layout before formatting the main text again.
+ * a frame tqlayout before formatting the main text again.
* It is important to make sure that formatMore will be called again ;)
*/
void abortFormatting();
@@ -440,29 +441,29 @@ public:
virtual KCommand *setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type);
KCommand *changeCaseOfText(KoTextCursor *cursor, KoChangeCaseDia::TypeOfCase _type);
- QString textChangedCase(const QString& _text, KoChangeCaseDia::TypeOfCase _type);
+ TQString textChangedCase(const TQString& _text, KoChangeCaseDia::TypeOfCase _type);
KCommand *changeCaseOfTextParag(int cursorPosStart, int cursorPosEnd,KoChangeCaseDia::TypeOfCase _type,KoTextCursor *cursor, KoTextParag *parag);
- void loadOasisContent( const QDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl );
+ void loadOasisContent( const TQDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl );
void saveOasisContent( KoXmlWriter& writer, KoSavingContext& context ) const;
// Similar to KoTextDocument::loadOasisText but there's no newline inserted before the first paragraph
// or after the last one - so it's possible to paste just a few chars.
// It also handles m_lastFormatted
- KoTextCursor pasteOasisText( const QDomElement &bodyElem, KoOasisContext& context,
+ KoTextCursor pasteOasisText( const TQDomElement &bodyElem, KoOasisContext& context,
KoTextCursor& cursor, KoStyleCollection * styleColl );
#ifndef NDEBUG
void printRTDebug(int);
#endif
- bool statistics( QProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected );
+ bool statistics( TQProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected );
int numberOfparagraphLineSelected( KoTextParag *parag);
/**
* Return the variable at the given point (in document coordinates), if any
*/
- KoVariable* variableAtPoint( const QPoint& iPoint ) const;
+ KoVariable* variableAtPoint( const TQPoint& iPoint ) const;
/**
* Return the variable at the given position, if any.
@@ -499,8 +500,8 @@ signals:
*/
void newCommand( KCommand *cmd );
- /** Tell the world that we'd like some repainting to happen */
- void repaintChanged( KoTextObject * );
+ /** Tell the world that we'd like some tqrepainting to happen */
+ void tqrepaintChanged( KoTextObject * );
void hideCursor();
void showCursor();
@@ -528,7 +529,7 @@ public slots:
// The return value is used by ensureFormatted
bool formatMore( int count = 10, bool emitAfterFormatting = true );
- void emitRepaintChanged() { emit repaintChanged( this ); }
+ void emitRepaintChanged() { emit tqrepaintChanged( this ); }
public: // made public for KWTextFrameSet...
@@ -549,7 +550,7 @@ public: // made public for KWTextFrameSet...
* See also the place-holder command (in fact an empty macro-command is created
* right at the beginning, so that it's possible to undo at any time).
*/
- struct KOTEXT_EXPORT UndoRedoInfo { // borrowed from QTextEdit
+ struct KOTEXT_EXPORT UndoRedoInfo { // borrowed from TQTextEdit
enum Type { Invalid, Insert, Delete, Return, RemoveSelected };
UndoRedoInfo( KoTextObject* textobj );
~UndoRedoInfo() {}
@@ -561,9 +562,9 @@ public: // made public for KWTextFrameSet...
int eid; // id of last parag
int index; // index (for insertion/deletion)
Type type; // type of command
- KoTextObject* textobj; // parent
+ KoTextObject* textobj; // tqparent
CustomItemsMap customItemsMap; // character position -> qtextcustomitem
- QValueList<KoParagLayout> oldParagLayouts;
+ TQValueList<KoParagLayout> oldParagLayouts;
KoParagLayout newParagLayout;
KoTextCursor *cursor; // basically a "mark" of the view that started this undo/redo info
// If the view changes, the next call to checkUndoRedoInfo will terminate the previous view's edition
@@ -575,7 +576,7 @@ public: // made public for KWTextFrameSet...
* build delayed (see the UndoRedoInfo structure), in order to
* have an entry in the undo/redo history asap.
*/
- void newPlaceHolderCommand( const QString & name );
+ void newPlaceHolderCommand( const TQString & name );
void checkUndoRedoInfo( KoTextCursor * cursor, UndoRedoInfo::Type t );
/** for KWTextFrameSet */
@@ -617,20 +618,20 @@ private:
Any operation on a paragraph pushes this backward. */
KoTextParag *m_lastFormatted;
/** Idle-time formatting */
- QTimer *formatTimer, *changeIntervalTimer;
+ TQTimer *formatTimer, *changeIntervalTimer;
int interval;
/** The total height available for our text object at the moment */
int m_availableHeight;
/** Store the "needs" of each view */
- QMap<QWidget *, int> m_mapViewAreas;
+ TQMap<TQWidget *, int> m_mapViewAreas;
- //QPtrDict<int> m_origFontSizes; // Format -> doc font size.
+ //TQPtrDict<int> m_origFontSizes; // Format -> doc font size.
bool m_highlightSelectionAdded;
#ifdef TIMING_FORMAT
- QTime m_time;
+ TQTime m_time;
#endif
static const char s_customItemChar;
diff --git a/lib/kotext/KoTextParag.cpp b/lib/kotext/KoTextParag.cpp
index d28bc110..8f948596 100644
--- a/lib/kotext/KoTextParag.cpp
+++ b/lib/kotext/KoTextParag.cpp
@@ -120,7 +120,7 @@ KoTextParag::~KoTextParag()
}
delete [] tArray;
//delete eData;
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
for ( ; it != lineStarts.end(); ++it )
delete *it;
if ( mSelections ) delete mSelections;
@@ -154,14 +154,14 @@ void KoTextParag::setPrev( KoTextParag *s )
doc->setFirstParag( this );
}
-void KoTextParag::invalidate( int /*chr, ignored*/ )
+void KoTextParag::tqinvalidate( int /*chr, ignored*/ )
{
m_invalid = true;
#if 0
if ( invalid < 0 )
invalid = chr;
else
- invalid = QMIN( invalid, chr );
+ invalid = TQMIN( invalid, chr );
#endif
}
@@ -178,15 +178,15 @@ void KoTextParag::setLineChanged( short int line )
m_lineChanged = line;
}
else
- m_lineChanged = QMIN( m_lineChanged, line ); // also works if line=-1
+ m_lineChanged = TQMIN( m_lineChanged, line ); // also works if line=-1
changed = true;
//kdDebug(32500) << "KoTextParag::setLineChanged line=" << line << " -> m_lineChanged=" << m_lineChanged << endl;
}
-void KoTextParag::insert( int index, const QString &s )
+void KoTextParag::insert( int index, const TQString &s )
{
str->insert( index, s, formatCollection()->defaultFormat() );
- invalidate( index );
+ tqinvalidate( index );
//needPreProcess = TRUE;
}
@@ -209,7 +209,7 @@ void KoTextParag::remove( int index, int len )
}
}
str->remove( index, len );
- invalidate( 0 );
+ tqinvalidate( 0 );
//needPreProcess = TRUE;
}
@@ -239,7 +239,7 @@ void KoTextParag::join( KoTextParag *s )
KoTextCustomItem * item = s->str->at( i ).customItem();
str->at( i + start ).setCustomItem( item );
s->str->at( i ).loseCustomItem();
- doc->unregisterCustomItem( item, s ); // ### missing in QRT
+ doc->unregisterCustomItem( item, s ); // ### missing in TQRT
doc->registerCustomItem( item, this );
}
}
@@ -252,9 +252,9 @@ void KoTextParag::join( KoTextParag *s )
extraData()->join( s->extraData() );
}*/
delete s;
- invalidate( 0 );
+ tqinvalidate( 0 );
//// kotext
- invalidateCounters();
+ tqinvalidateCounters();
////
r.setHeight( oh );
//needPreProcess = TRUE;
@@ -285,7 +285,7 @@ void KoTextParag::move( int &dy )
}
}
//if ( p )
- // p->lastInFrame = TRUE; // Qt does this, but the loop at the end of format() calls move a lot!
+ // p->lastInFrame = TRUE; // TQt does this, but the loop at the end of format() calls move a lot!
movedDown = FALSE;
@@ -310,7 +310,7 @@ void KoTextParag::format( int start, bool doMove )
//kdDebug(32500) << "KoTextParag::format " << this << " id:" << paragId() << endl;
- r.moveTopLeft( QPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
+ r.moveTopLeft( TQPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
//if ( p )
// p->lastInFrame = FALSE;
@@ -329,16 +329,16 @@ void KoTextParag::format( int start, bool doMove )
i->move( i->x(), r.y() );
}
}
- QMap<int, KoTextParagLineStart*> oldLineStarts = lineStarts;
+ TQMap<int, KoTextParagLineStart*> oldLineStarts = lineStarts;
lineStarts.clear();
int y;
bool formatterWorked = formatter()->format( doc, this, start, oldLineStarts, y, m_wused );
// It can't happen that width < minimumWidth -- hopefully.
- //r.setWidth( QMAX( r.width(), formatter()->minimumWidth() ) );
+ //r.setWidth( TQMAX( r.width(), formatter()->minimumWidth() ) );
//m_minw = formatter()->minimumWidth();
- QMap<int, KoTextParagLineStart*>::Iterator it = oldLineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = oldLineStarts.begin();
for ( ; it != oldLineStarts.end(); ++it )
delete *it;
@@ -364,7 +364,7 @@ void KoTextParag::format( int start, bool doMove )
it = lineStarts.begin();
int usedw = 0; int lineid = 0;
for ( ; it != lineStarts.end(); ++it, ++lineid ) {
- usedw = QMAX( usedw, (*it)->w );
+ usedw = TQMAX( usedw, (*it)->w );
}
if ( r.width() <= 0 ) {
// if the user specifies an invalid rect, this means that the
@@ -372,7 +372,7 @@ void KoTextParag::format( int start, bool doMove )
// needs
r.setWidth( usedw );
} else {
- r.setWidth( QMIN( usedw, r.width() ) );
+ r.setWidth( TQMIN( usedw, r.width() ) );
}
}
}
@@ -403,14 +403,14 @@ void KoTextParag::format( int start, bool doMove )
bool makeInvalid = false; //p && p->lastInFrame;
//kdDebug(32500) << "might move of dy=" << dy << ". previous's lastInFrame (=makeInvalid): " << makeInvalid << endl;
while ( s && dy ) {
- if ( s->movedDown ) { // (not in QRT) : moved down -> invalidate and stop moving down
- s->invalidate( 0 ); // (there is no point in moving down a parag that has a frame break...)
+ if ( s->movedDown ) { // (not in TQRT) : moved down -> tqinvalidate and stop moving down
+ s->tqinvalidate( 0 ); // (there is no point in moving down a parag that has a frame break...)
break;
}
if ( !s->isFullWidth() )
makeInvalid = TRUE;
if ( makeInvalid )
- s->invalidate( 0 );
+ s->tqinvalidate( 0 );
s->move( dy );
//if ( s->lastInFrame )
// makeInvalid = TRUE;
@@ -428,7 +428,7 @@ void KoTextParag::format( int start, bool doMove )
int line = -1;
int lineY = 0; // the one called "cy" in other algos
int baseLine = 0;
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
for ( int i = 0 ; i < len; ++i ) {
KoTextStringChar *chr = &str->at( i );
if ( chr->lineStart ) {
@@ -469,7 +469,7 @@ int KoTextParag::lineHeightOfChar( int i, int *bl, int *y ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
--it;
for ( ;; ) {
if ( i >= it.key() ) {
@@ -494,7 +494,7 @@ KoTextStringChar *KoTextParag::lineStartOfChar( int i, int *index, int *line ) c
( (KoTextParag*)this )->format();
int l = (int)lineStarts.count() - 1;
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
--it;
for ( ;; ) {
if ( i >= it.key() ) {
@@ -510,7 +510,7 @@ KoTextStringChar *KoTextParag::lineStartOfChar( int i, int *index, int *line ) c
--l;
}
- kdWarning(32500) << "KoTextParag::lineStartOfChar: couldn't find " << i << endl;
+ kdWarning(32500) << "KoTextParag::lineStartOfChar: couldn't tqfind " << i << endl;
return 0;
}
@@ -528,7 +528,7 @@ KoTextStringChar *KoTextParag::lineStartOfLine( int line, int *index ) const
( (KoTextParag*)this )->format();
if ( line >= 0 && line < (int)lineStarts.count() ) {
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
int i = it.key();
@@ -537,7 +537,7 @@ KoTextStringChar *KoTextParag::lineStartOfLine( int line, int *index ) const
return &str->at( i );
}
- kdWarning(32500) << "KoTextParag::lineStartOfLine: couldn't find " << line << endl;
+ kdWarning(32500) << "KoTextParag::lineStartOfLine: couldn't tqfind " << line << endl;
return 0;
}
@@ -550,14 +550,14 @@ int KoTextParag::leftGap() const
int x = str->at(0).x; /* set x to x of first char */
if ( str->isBidi() ) {
for ( int i = 1; i < str->length(); ++i )
- x = QMIN(x, str->at(i).x);
+ x = TQMIN(x, str->at(i).x);
return x;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while (line < (int)lineStarts.count()) {
int i = it.key(); /* char index */
- x = QMIN(x, str->at(i).x);
+ x = TQMIN(x, str->at(i).x);
++it;
++line;
}
@@ -600,7 +600,7 @@ void KoTextParag::setFormat( int index, int len, const KoTextFormat *_f, bool us
_f->shadowDistanceX() != of->shadowDistanceX() ||
_f->shadowDistanceY() != of->shadowDistanceY()
) ) {
- invalidate( 0 );
+ tqinvalidate( 0 );
}
if ( flags == -1 || flags == KoTextFormat::Format || !fc ) {
#ifdef DEBUG_COLLECTION
@@ -621,18 +621,18 @@ void KoTextParag::setFormat( int index, int len, const KoTextFormat *_f, bool us
}
}
-void KoTextParag::drawCursorDefault( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg )
+void KoTextParag::drawCursorDefault( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg )
{
- painter.fillRect( QRect( curx, cury, 1, curh ), cg.color( QColorGroup::Text ) );
+ painter.fillRect( TQRect( curx, cury, 1, curh ), cg.color( TQColorGroup::Text ) );
painter.save();
if ( str->isBidi() ) {
const int d = 4;
if ( at( cursor->index() )->rightToLeft ) {
- painter.setPen( Qt::black );
+ painter.setPen( TQt::black );
painter.drawLine( curx, cury, curx - d / 2, cury + d / 2 );
painter.drawLine( curx, cury + d, curx - d / 2, cury + d / 2 );
} else {
- painter.setPen( Qt::black );
+ painter.setPen( TQt::black );
painter.drawLine( curx, cury, curx + d / 2, cury + d / 2 );
painter.drawLine( curx, cury + d, curx + d / 2, cury + d / 2 );
}
@@ -686,26 +686,26 @@ void KoTextParag::hide()
visible = FALSE;
}
-void KoTextParag::setDirection( QChar::Direction d )
+void KoTextParag::setDirection( TQChar::Direction d )
{
if ( str && str->direction() != d ) {
str->setDirection( d );
- invalidate( 0 );
+ tqinvalidate( 0 );
//// kotext
m_layout.direction = d;
- invalidateCounters(); // #47178
+ tqinvalidateCounters(); // #47178
////
}
}
-QChar::Direction KoTextParag::direction() const
+TQChar::Direction KoTextParag::direction() const
{
- return (str ? str->direction() : QChar::DirON );
+ return (str ? str->direction() : TQChar::DirON );
}
void KoTextParag::setSelection( int id, int start, int end )
{
- QMap<int, KoTextParagSelection>::ConstIterator it = selections().find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = selections().tqfind( id );
if ( it != mSelections->end() ) {
if ( start == ( *it ).start && end == ( *it ).end )
return;
@@ -731,7 +731,7 @@ int KoTextParag::selectionStart( int id ) const
{
if ( !mSelections )
return -1;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return -1;
return ( *it ).start;
@@ -741,7 +741,7 @@ int KoTextParag::selectionEnd( int id ) const
{
if ( !mSelections )
return -1;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return -1;
return ( *it ).end;
@@ -751,7 +751,7 @@ bool KoTextParag::hasSelection( int id ) const
{
if ( !mSelections )
return FALSE;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return FALSE;
return ( *it ).start != ( *it ).end || length() == 1;
@@ -761,7 +761,7 @@ bool KoTextParag::fullSelected( int id ) const
{
if ( !mSelections )
return FALSE;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return FALSE;
return ( *it ).start == 0 && ( *it ).end == str->length() - 1;
@@ -777,7 +777,7 @@ int KoTextParag::lineY( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->y;
@@ -793,7 +793,7 @@ int KoTextParag::lineBaseLine( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->baseLine;
@@ -809,7 +809,7 @@ int KoTextParag::lineHeight( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->h;
@@ -829,7 +829,7 @@ void KoTextParag::lineInfo( int l, int &y, int &h, int &bl ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
y = ( *it )->y;
@@ -837,7 +837,7 @@ void KoTextParag::lineInfo( int l, int &y, int &h, int &bl ) const
bl = ( *it )->baseLine;
}
-uint KoTextParag::alignment() const
+uint KoTextParag::tqalignment() const
{
return align;
}
@@ -892,29 +892,29 @@ void KoTextParag::setTabStops( int tw )
// tabStopWidth = tw;
}
-QMap<int, KoTextParagSelection> &KoTextParag::selections() const
+TQMap<int, KoTextParagSelection> &KoTextParag::selections() const
{
if ( !mSelections )
- ((KoTextParag *)this)->mSelections = new QMap<int, KoTextParagSelection>;
+ ((KoTextParag *)this)->mSelections = new TQMap<int, KoTextParagSelection>;
return *mSelections;
}
-QPtrList<KoTextCustomItem> &KoTextParag::floatingItems() const
+TQPtrList<KoTextCustomItem> &KoTextParag::floatingItems() const
{
if ( !mFloatingItems )
- ((KoTextParag *)this)->mFloatingItems = new QPtrList<KoTextCustomItem>;
+ ((KoTextParag *)this)->mFloatingItems = new TQPtrList<KoTextCustomItem>;
return *mFloatingItems;
}
void KoTextCursor::setIndex( int i, bool /*restore*/ )
{
-// Note: QRT doesn't allow to position the cursor at string->length
+// Note: TQRT doesn't allow to position the cursor at string->length
// However we need it, when applying a style to a paragraph, so that
// the trailing space gets the style change applied as well.
// Obviously "right of the trailing space" isn't a good place for a real
// cursor, but this needs to be checked somewhere else.
if ( i < 0 || i > string->length() ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
kdWarning(32500) << "KoTextCursor::setIndex: " << i << " out of range" << endl;
//abort();
#endif
@@ -941,78 +941,78 @@ KoParagCounter *KoTextParag::counter()
return m_layout.counter;
}
-void KoTextParag::setMargin( QStyleSheetItem::Margin m, double _i )
+void KoTextParag::setMargin( TQStyleSheetItem::Margin m, double _i )
{
//kdDebug(32500) << "KoTextParag::setMargin " << m << " margin " << _i << endl;
m_layout.margins[m] = _i;
- if ( m == QStyleSheetItem::MarginTop && prev() )
- prev()->invalidate(0); // for top margin (post-1.1: remove this, not necessary anymore)
- invalidate(0);
+ if ( m == TQStyleSheetItem::MarginTop && prev() )
+ prev()->tqinvalidate(0); // for top margin (post-1.1: remove this, not necessary anymore)
+ tqinvalidate(0);
}
void KoTextParag::setMargins( const double * margins )
{
for ( int i = 0 ; i < 5 ; ++i )
m_layout.margins[i] = margins[i];
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setAlign( int align )
{
- Q_ASSERT( align <= Qt::AlignJustify );
- align &= Qt::AlignHorizontal_Mask;
- setAlignment( align );
- m_layout.alignment = align;
+ Q_ASSERT( align <= TQt::AlignJustify );
+ align &= TQt::AlignHorizontal_Mask;
+ tqsetAlignment( align );
+ m_layout.tqalignment = align;
}
int KoTextParag::resolveAlignment() const
{
- if ( (int)m_layout.alignment == Qt::AlignAuto )
- return str->isRightToLeft() ? Qt::AlignRight : Qt::AlignLeft;
- return m_layout.alignment;
+ if ( (int)m_layout.tqalignment == TQt::AlignAuto )
+ return str->isRightToLeft() ? TQt::AlignRight : TQt::AlignLeft;
+ return m_layout.tqalignment;
}
void KoTextParag::setLineSpacing( double _i )
{
m_layout.setLineSpacingValue(_i);
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setLineSpacingType( KoParagLayout::SpacingType _type )
{
m_layout.lineSpacingType = _type;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setTopBorder( const KoBorder & _brd )
{
m_layout.topBorder = _brd;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setBottomBorder( const KoBorder & _brd )
{
m_layout.bottomBorder = _brd;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setJoinBorder( bool join )
{
m_layout.joinBorder = join;
- invalidate(0);
+ tqinvalidate(0);
}
-void KoTextParag::setBackgroundColor ( const QColor& color )
+void KoTextParag::setBackgroundColor ( const TQColor& color )
{
m_layout.backgroundColor = color;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setNoCounter()
{
delete m_layout.counter;
m_layout.counter = 0L;
- invalidateCounters();
+ tqinvalidateCounters();
}
void KoTextParag::setCounter( const KoParagCounter * pCounter )
@@ -1021,14 +1021,14 @@ void KoTextParag::setCounter( const KoParagCounter * pCounter )
const bool isFootNote = m_layout.counter &&
m_layout.counter->numbering() == KoParagCounter::NUM_FOOTNOTE;
if ( isFootNote ) {
- const QString footNotePrefix = m_layout.counter->prefix(); // this is where the number is
+ const TQString footNotePrefix = m_layout.counter->prefix(); // this is where the number is
delete m_layout.counter;
m_layout.counter = pCounter ? new KoParagCounter( *pCounter ) : new KoParagCounter();
m_layout.counter->setNumbering( KoParagCounter::NUM_FOOTNOTE );
m_layout.counter->setStyle( KoParagCounter::STYLE_NONE ); // no number after the 'prefix'
m_layout.counter->setPrefix( footNotePrefix );
- m_layout.counter->setSuffix( QString::null );
- invalidateCounters();
+ m_layout.counter->setSuffix( TQString() );
+ tqinvalidateCounters();
} else {
if ( pCounter )
setCounter( *pCounter );
@@ -1052,25 +1052,25 @@ void KoTextParag::setCounter( const KoParagCounter & counter )
m_layout.counter = new KoParagCounter( counter );
// Invalidate the counters
- invalidateCounters();
+ tqinvalidateCounters();
}
}
-void KoTextParag::invalidateCounters()
+void KoTextParag::tqinvalidateCounters()
{
// Invalidate this paragraph and all the following ones
// (Numbering may have changed)
- invalidate( 0 );
+ tqinvalidate( 0 );
if ( m_layout.counter )
- m_layout.counter->invalidate();
+ m_layout.counter->tqinvalidate();
KoTextParag *s = next();
// #### Possible optimization: since any invalidation propagates down,
- // it's enough to stop at the first paragraph with an already-invalidated counter, isn't it?
- // This is only true if nobody else calls counter->invalidate...
+ // it's enough to stop at the first paragraph with an already-tqinvalidated counter, isn't it?
+ // This is only true if nobody else calls counter->tqinvalidate...
while ( s ) {
if ( s->m_layout.counter )
- s->m_layout.counter->invalidate();
- s->invalidate( 0 );
+ s->m_layout.counter->tqinvalidate();
+ s->tqinvalidate( 0 );
s = s->next();
}
}
@@ -1085,7 +1085,7 @@ int KoTextParag::counterWidth() const
// Draw the complete label (i.e. heading/list numbers/bullets) for this paragraph.
// This is called by KoTextParag::paint.
-void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*hLU*/, int baseLU, const QColorGroup& /*cg*/ )
+void KoTextParag::drawLabel( TQPainter* p, int xLU, int yLU, int /*wLU*/, int /*hLU*/, int baseLU, const TQColorGroup& /*cg*/ )
{
if ( !m_layout.counter ) // shouldn't happen
return;
@@ -1107,46 +1107,46 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
KoTextFormat* format = &counterFormat;
p->save();
- QColor textColor( format->color() );
+ TQColor textColor( format->color() );
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( p );
- p->setPen( QPen( textColor ) );
+ p->setPen( TQPen( textColor ) );
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert( zh );
- //bool forPrint = ( p->device()->devType() == QInternal::Printer );
+ //bool forPrint = ( p->device()->devType() == TQInternal::Printer );
bool rtl = str->isRightToLeft(); // when true, we put suffix+counter+prefix at the RIGHT of the paragraph.
- int xLeft = zh->layoutUnitToPixelX( xLU - (rtl ? 0 : counterWidthLU) );
- int y = zh->layoutUnitToPixelY( yLU );
- //int h = zh->layoutUnitToPixelY( yLU, hLU );
- int base = zh->layoutUnitToPixelY( yLU, baseLU );
- int counterWidth = zh->layoutUnitToPixelX( xLU, counterWidthLU );
- int height = zh->layoutUnitToPixelY( yLU, format->height() );
-
- QFont font( format->screenFont( zh ) );
+ int xLeft = zh->tqlayoutUnitToPixelX( xLU - (rtl ? 0 : counterWidthLU) );
+ int y = zh->tqlayoutUnitToPixelY( yLU );
+ //int h = zh->tqlayoutUnitToPixelY( yLU, hLU );
+ int base = zh->tqlayoutUnitToPixelY( yLU, baseLU );
+ int counterWidth = zh->tqlayoutUnitToPixelX( xLU, counterWidthLU );
+ int height = zh->tqlayoutUnitToPixelY( yLU, format->height() );
+
+ TQFont font( format->screenFont( zh ) );
// Footnote numbers are in superscript (in WP and Word, not in OO)
if ( m_layout.counter->numbering() == KoParagCounter::NUM_FOOTNOTE )
{
int pointSize = ( ( font.pointSize() * 2 ) / 3 );
font.setPointSize( pointSize );
- y -= ( height - QFontMetrics(font).height() );
+ y -= ( height - TQFontMetrics(font).height() );
}
p->setFont( font );
// Now draw any bullet that is required over the space left for it.
if ( m_layout.counter->isBullet() )
{
- int xBullet = xLeft + zh->layoutUnitToPixelX( m_layout.counter->bulletX() );
+ int xBullet = xLeft + zh->tqlayoutUnitToPixelX( m_layout.counter->bulletX() );
//kdDebug(32500) << "KoTextParag::drawLabel xLU=" << xLU << " counterWidthLU=" << counterWidthLU << endl;
// The width and height of the bullet is the width of one space
- int width = zh->layoutUnitToPixelX( xLeft, format->width( ' ' ) );
+ int width = zh->tqlayoutUnitToPixelX( xLeft, format->width( ' ' ) );
//kdDebug(32500) << "Pix: xLeft=" << xLeft << " counterWidth=" << counterWidth
// << " xBullet=" << xBullet << " width=" << width << endl;
- QString prefix = m_layout.counter->prefix();
+ TQString prefix = m_layout.counter->prefix();
if ( !prefix.isEmpty() )
{
if ( rtl )
@@ -1163,18 +1163,18 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
p->drawText( xLeft, posY, prefix );
}
- QRect er( xBullet + (rtl ? width : 0), y + height / 2 - width / 2, width, width );
+ TQRect er( xBullet + (rtl ? width : 0), y + height / 2 - width / 2, width, width );
// Draw the bullet.
int posY = 0;
switch ( m_layout.counter->style() )
{
case KoParagCounter::STYLE_DISCBULLET:
- p->setBrush( QBrush(textColor) );
+ p->setBrush( TQBrush(textColor) );
p->drawEllipse( er );
- p->setBrush( Qt::NoBrush );
+ p->setBrush( TQt::NoBrush );
break;
case KoParagCounter::STYLE_SQUAREBULLET:
- p->fillRect( er, QBrush(textColor) );
+ p->fillRect( er, TQBrush(textColor) );
break;
case KoParagCounter::STYLE_BOXBULLET:
p->drawRect( er );
@@ -1188,7 +1188,7 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
// font with the given family. This conserves the right size etc.
if ( !m_layout.counter->customBulletFont().isEmpty() )
{
- QFont bulletFont( p->font() );
+ TQFont bulletFont( p->font() );
bulletFont.setFamily( m_layout.counter->customBulletFont() );
p->setFont( bulletFont );
}
@@ -1201,14 +1201,14 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
if ( sy < 0)
posY -= sy;
- p->drawText( xBullet, posY, m_layout.counter->customBulletCharacter() );
+ p->drawText( xBullet, posY, TQString(m_layout.counter->customBulletCharacter()) );
break;
}
default:
break;
}
- QString suffix = m_layout.counter->suffix();
+ TQString suffix = m_layout.counter->suffix();
if ( !suffix.isEmpty() )
{
if ( !rtl )
@@ -1228,8 +1228,8 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
}
else
{
- QString counterText = m_layout.counter->text( this );
- // There are no bullets...any parent bullets have already been suppressed.
+ TQString counterText = m_layout.counter->text( this );
+ // There are no bullets...any tqparent bullets have already been suppressed.
// Just draw the text! Note: one space is always appended.
if ( !counterText.isEmpty() )
{
@@ -1254,14 +1254,14 @@ int KoTextParag::breakableTopMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginTop ] );
+ m_layout.margins[ TQStyleSheetItem::MarginTop ] );
}
int KoTextParag::topMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginTop ]
+ m_layout.margins[ TQStyleSheetItem::MarginTop ]
+ ( ( prev() && prev()->joinBorder() && prev()->bottomBorder() == m_layout.bottomBorder &&
prev()->topBorder() == m_layout.topBorder && prev()->leftBorder() == m_layout.leftBorder &&
prev()->rightBorder() == m_layout.rightBorder) ? 0 : m_layout.topBorder.width() ) );
@@ -1271,7 +1271,7 @@ int KoTextParag::bottomMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginBottom ]
+ m_layout.margins[ TQStyleSheetItem::MarginBottom ]
+ ( ( joinBorder() && next() && next()->bottomBorder() == m_layout.bottomBorder &&
next()->topBorder() == m_layout.topBorder && next()->leftBorder() == m_layout.leftBorder &&
next()->rightBorder() == m_layout.rightBorder) ? 0 : m_layout.bottomBorder.width() ) );
@@ -1281,7 +1281,7 @@ int KoTextParag::leftMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixX(
- m_layout.margins[ QStyleSheetItem::MarginLeft ]
+ m_layout.margins[ TQStyleSheetItem::MarginLeft ]
+ m_layout.leftBorder.width() );
}
@@ -1290,20 +1290,20 @@ int KoTextParag::rightMargin() const
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
int cw=0;
if( m_layout.counter && str->isRightToLeft() &&
- (( m_layout.counter->alignment() == Qt::AlignRight ) || ( m_layout.counter->alignment() == Qt::AlignAuto )))
+ (( m_layout.counter->tqalignment() == TQt::AlignRight ) || ( m_layout.counter->tqalignment() == TQt::AlignAuto )))
cw = counterWidth();
return zh->ptToLayoutUnitPixX(
- m_layout.margins[ QStyleSheetItem::MarginRight ]
+ m_layout.margins[ TQStyleSheetItem::MarginRight ]
+ m_layout.rightBorder.width() )
- + cw; /* in layout units already */
+ + cw; /* in tqlayout units already */
}
int KoTextParag::firstLineMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginFirstLine ] );
+ m_layout.margins[ TQStyleSheetItem::MarginFirstLine ] );
}
int KoTextParag::lineSpacing( int line ) const
@@ -1317,7 +1317,7 @@ int KoTextParag::lineSpacing( int line ) const
kdError() << "KoTextParag::lineSpacing assert(line<lines) failed: line=" << line << " lines=" << lineStarts.count() << endl;
return 0;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
return (*it)->lineSpacing;
@@ -1329,7 +1329,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
// TODO add shadow in KoTextFormatter!
- int shadow = 0; //QABS( zh->ptToLayoutUnitPixY( shadowDistanceY() ) );
+ int shadow = 0; //TQABS( zh->ptToLayoutUnitPixY( shadowDistanceY() ) );
if ( m_layout.lineSpacingType == KoParagLayout::LS_SINGLE )
return shadow;
else if ( m_layout.lineSpacingType == KoParagLayout::LS_CUSTOM )
@@ -1340,7 +1340,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
kdError() << "KoTextParag::lineSpacing assert(line<lines) failed: line=" << line << " lines=" << lineStarts.count() << endl;
return 0+shadow;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
@@ -1350,7 +1350,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
case KoParagLayout::LS_MULTIPLE:
{
double n = m_layout.lineSpacingValue() - 1.0; // yes, can be negative
- return shadow + qRound( n * heightForLineSpacing( startChar, lastChar ) );
+ return shadow + tqRound( n * heightForLineSpacing( startChar, lastChar ) );
}
case KoParagLayout::LS_ONEANDHALF:
{
@@ -1366,7 +1366,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
{
int atLeast = zh->ptToLayoutUnitPixY( m_layout.lineSpacingValue() );
const int lineHeight = ( *it )->h;
- int h = QMAX( lineHeight, atLeast );
+ int h = TQMAX( lineHeight, atLeast );
// height is now the required total height
return shadow + h - lineHeight;
}
@@ -1385,16 +1385,16 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
return 0+shadow;
}
-QRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
+TQRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
{
- QRect rct( zh->layoutUnitToPixel( rect() ) );
+ TQRect rct( zh->tqlayoutUnitToPixel( rect() ) );
//kdDebug(32500) << " pixelRect for parag " << paragId()
// << ": rect=" << rect() << " pixelRect=" << rct << endl;
// After division we almost always end up with the top overwriting the bottom of the parag above
if ( prev() )
{
- QRect prevRect( zh->layoutUnitToPixel( prev()->rect() ) );
+ TQRect prevRect( zh->tqlayoutUnitToPixel( prev()->rect() ) );
if ( rct.top() < prevRect.bottom() + 1 )
{
//kdDebug(32500) << " pixelRect: rct.top() adjusted to " << prevRect.bottom() + 1 << " (was " << rct.top() << ")" << endl;
@@ -1406,27 +1406,27 @@ QRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
// Paint this paragraph. This is called by KoTextDocument::drawParagWYSIWYG
// (KoTextDocument::drawWithoutDoubleBuffer when printing)
-void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+void KoTextParag::paint( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph )
{
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::paint ===== id=" << paragId() << " clipx=" << clipx << " clipy=" << clipy << " clipw=" << clipw << " cliph=" << cliph << endl;
- kdDebug(32500) << " clipw in pix (approx) : " << textDocument()->paintingZoomHandler()->layoutUnitToPixelX( clipw ) << " cliph in pix (approx) : " << textDocument()->paintingZoomHandler()->layoutUnitToPixelX( cliph ) << endl;
+ kdDebug(32500) << " clipw in pix (approx) : " << textDocument()->paintingZoomHandler()->tqlayoutUnitToPixelX( clipw ) << " cliph in pix (approx) : " << textDocument()->paintingZoomHandler()->tqlayoutUnitToPixelX( cliph ) << endl;
#endif
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert(zh);
- QRect paraRect = pixelRect( zh );
+ TQRect paraRect = pixelRect( zh );
// Find left margin size, first line offset and right margin in pixels
- int leftMarginPix = zh->layoutUnitToPixelX( leftMargin() );
- int firstLineOffset = zh->layoutUnitToPixelX( firstLineMargin() );
+ int leftMarginPix = zh->tqlayoutUnitToPixelX( leftMargin() );
+ int firstLineOffset = zh->tqlayoutUnitToPixelX( firstLineMargin() );
// The furthest left and right x-coords of the paragraph,
// including the bullet/counter, but not the borders.
- int leftExtent = QMIN ( leftMarginPix, leftMarginPix + firstLineOffset );
- int rightExtent = paraRect.width() - zh->layoutUnitToPixelX( rightMargin() );
+ int leftExtent = TQMIN ( leftMarginPix, leftMarginPix + firstLineOffset );
+ int rightExtent = paraRect.width() - zh->tqlayoutUnitToPixelX( rightMargin() );
// Draw the paragraph background color
if ( backgroundColor().isValid() )
@@ -1440,7 +1440,7 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
backgroundColor() );
}
- // Let's call drawLabel ourselves, rather than having to deal with QStyleSheetItem to get paintLines to call it!
+ // Let's call drawLabel ourselves, rather than having to deal with TQStyleSheetItem to get paintLines to call it!
if ( m_layout.counter && m_layout.counter->numbering() != KoParagCounter::NUM_NONE && m_lineChanged <= 0 )
{
int cy, h, baseLine;
@@ -1467,10 +1467,10 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
// drawBorders paints outside the give rect, so for the
// x-coords, it just needs to know the left and right extent
// of the paragraph.
- QRect r;
+ TQRect r;
r.setLeft( leftExtent );
r.setRight( rightExtent );
- r.setTop( zh->layoutUnitToPixelY(lineY( 0 )) );
+ r.setTop( zh->tqlayoutUnitToPixelY(lineY( 0 )) );
int lastLine = lines() - 1;
// We need to start from the pixelRect, to make sure the bottom border is entirely painted.
@@ -1479,21 +1479,21 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
// If we don't have a bottom border, we need go as low as possible ( to touch the next parag's border ).
// If we have a bottom border, then we rather exclude the linespacing. Looks nicer. OO does that too.
if ( m_layout.bottomBorder.width() > 0 && drawBottomBorder)
- paragBottom -= zh->layoutUnitToPixelY( lineSpacing( lastLine ) );
+ paragBottom -= zh->tqlayoutUnitToPixelY( lineSpacing( lastLine ) );
paragBottom -= KoBorder::zoomWidthY( m_layout.bottomBorder.width(), zh, 0 );
//kdDebug(32500) << "Parag border: paragBottom=" << paragBottom
// << " bottom border width = " << KoBorder::zoomWidthY( m_layout.bottomBorder.width(), zh, 0 ) << endl;
r.setBottom( paragBottom );
- //kdDebug(32500) << "KoTextParag::paint documentWidth=" << documentWidth() << " LU (" << zh->layoutUnitToPixelX(documentWidth()) << " pixels) bordersRect=" << r << endl;
+ //kdDebug(32500) << "KoTextParag::paint documentWidth=" << documentWidth() << " LU (" << zh->tqlayoutUnitToPixelX(documentWidth()) << " pixels) bordersRect=" << r << endl;
KoBorder::drawBorders( painter, zh, r,
m_layout.leftBorder, m_layout.rightBorder, m_layout.topBorder, m_layout.bottomBorder,
- 0, QPen(), drawTopBorder, drawBottomBorder );
+ 0, TQPen(), drawTopBorder, drawBottomBorder );
}
}
-void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+void KoTextParag::paintLines( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph )
{
if ( !visible )
@@ -1508,12 +1508,12 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
int curx = -1, cury = 0, curh = 0, curline = 0;
int xstart, xend = 0;
- QString qstr = str->toString();
- qstr.replace( QChar(0x00a0U), ' ' ); // Not all fonts have non-breakable-space glyph
+ TQString qstr = str->toString();
+ qstr.tqreplace( TQChar(0x00a0U), ' ' ); // Not all fonts have non-breakable-space glyph
const int nSels = doc ? doc->numSelections() : 1;
- QMemArray<int> selectionStarts( nSels );
- QMemArray<int> selectionEnds( nSels );
+ TQMemArray<int> selectionStarts( nSels );
+ TQMemArray<int> selectionEnds( nSels );
if ( drawSelections ) {
bool hasASelection = FALSE;
for ( int i = 0; i < nSels; ++i ) {
@@ -1572,7 +1572,7 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// we flush at end of line
bool flush = ( i == nextLine - 1 );
- // Optimization note: QRT uses "flush |=", which doesn't have shortcut optimization
+ // Optimization note: TQRT uses "flush |=", which doesn't have shortcut optimization
// we flush on format changes
flush = flush || ( nextchr->format() != chr->format() );
@@ -1597,14 +1597,14 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// we flush before and after tabs
flush = flush || ( chr->c == '\t' || nextchr->c == '\t' );
// we flush on soft hypens
- flush = flush || ( chr->c.unicode() == 0xad );
+ flush = flush || ( chr->c.tqunicode() == 0xad );
// we flush on custom items
flush = flush || chr->isCustom();
// we flush before custom items
flush = flush || nextchr->isCustom();
// when painting justified we flush on spaces
- if ((alignment() & Qt::AlignJustify) == Qt::AlignJustify )
- //flush = flush || QTextFormatter::isBreakable( str, i );
+ if ((tqalignment() & TQt::AlignJustify) == TQt::AlignJustify )
+ //flush = flush || TQTextFormatter::isBreakable( str, i );
flush = flush || chr->whiteSpace;
// when underlining or striking "word by word" we flush before/after spaces
if (!flush && chr->format()->wordByWord() && chr->format()->isStrikedOrUnderlined())
@@ -1613,7 +1613,7 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
flush = flush || ( i - paintStart >= 256 );
// we flush when the selection state changes
if ( drawSelections ) {
- // check if selection state changed - TODO update from QRT
+ // check if selection state changed - TODO update from TQRT
bool selectionChange = FALSE;
if ( drawSelections ) {
for ( int j = 0; j < nSels; ++j ) {
@@ -1679,10 +1679,10 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// Called by KoTextParag::paintLines
// Draw a set of characters with the same formattings.
// Reimplemented here to convert coordinates first, and call @ref drawFormattingChars.
-void KoTextParag::drawParagString( QPainter &painter, const QString &str, int start, int len, int startX,
+void KoTextParag::drawParagString( TQPainter &painter, const TQString &str, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *format, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line )
+ KoTextFormat *format, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line )
{
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert(zh);
@@ -1696,19 +1696,19 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
// Calculate offset (e.g. due to shadow on left or top)
// Important: don't use the 2-args methods here, offsets are not heights
// (0 should be 0, not 1) (#63256)
- int shadowOffsetX_pix = zh->layoutUnitToPixelX( format->offsetX() );
- int shadowOffsetY_pix = zh->layoutUnitToPixelY( format->offsetY() );
+ int shadowOffsetX_pix = zh->tqlayoutUnitToPixelX( format->offsetX() );
+ int shadowOffsetY_pix = zh->tqlayoutUnitToPixelY( format->offsetY() );
// Calculate startX in pixels
- int startX_pix = zh->layoutUnitToPixelX( startX ) /* + at( rightToLeft ? start+len-1 : start )->pixelxadj */;
+ int startX_pix = zh->tqlayoutUnitToPixelX( startX ) /* + at( rightToLeft ? start+len-1 : start )->pixelxadj */;
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagString startX in pixels : " << startX_pix /*<< " adjustment:" << at( rightToLeft ? start+len-1 : start )->pixelxadj*/ << " bw=" << bw << endl;
#endif
- int bw_pix = zh->layoutUnitToPixelX( startX, bw );
- int lastY_pix = zh->layoutUnitToPixelY( lastY );
- int baseLine_pix = zh->layoutUnitToPixelY( lastY, baseLine ); // 2 args=>+1. Is that correct?
- int h_pix = zh->layoutUnitToPixelY( lastY, h );
+ int bw_pix = zh->tqlayoutUnitToPixelX( startX, bw );
+ int lastY_pix = zh->tqlayoutUnitToPixelY( lastY );
+ int baseLine_pix = zh->tqlayoutUnitToPixelY( lastY, baseLine ); // 2 args=>+1. Is that correct?
+ int h_pix = zh->tqlayoutUnitToPixelY( lastY, h );
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagString h(LU)=" << h << " lastY(LU)=" << lastY
<< " h(PIX)=" << h_pix << " lastY(PIX)=" << lastY_pix
@@ -1740,13 +1740,13 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
inSelection = true;
switch (j) {
case KoTextDocument::Standard:
- painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, cg.color( QColorGroup::Highlight ) );
+ painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, cg.color( TQColorGroup::Highlight ) );
break;
case KoTextDocument::InputMethodPreedit:
// no highlight
break;
default:
- painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, doc ? doc->selectionColor( j ) : cg.color( QColorGroup::Highlight ) );
+ painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, doc ? doc->selectionColor( j ) : cg.color( TQColorGroup::Highlight ) );
break;
}
}
@@ -1762,17 +1762,17 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
&& start >= selectionStarts[ KoTextDocument::InputMethodPreedit ]
&& start < selectionEnds[ KoTextDocument::InputMethodPreedit ] )
{
- QColor textColor( format->color() );
- painter.setPen( QPen( textColor ) );
+ TQColor textColor( format->color() );
+ painter.setPen( TQPen( textColor ) );
- QPoint p1( startX_pix, lastY_pix + h_pix - 1 );
- QPoint p2( startX_pix + bw_pix, lastY_pix + h_pix - 1 );
+ TQPoint p1( startX_pix, lastY_pix + h_pix - 1 );
+ TQPoint p2( startX_pix + bw_pix, lastY_pix + h_pix - 1 );
painter.drawLine( p1, p2 );
}
if ( draw_len > 0 )
{
- int draw_startX_pix = zh->layoutUnitToPixelX( draw_startX ) /* + at( rightToLeft ? start+draw_len-1 : start )->pixelxadj*/;
+ int draw_startX_pix = zh->tqlayoutUnitToPixelX( draw_startX ) /* + at( rightToLeft ? start+draw_len-1 : start )->pixelxadj*/;
draw_startX_pix += shadowOffsetX_pix;
lastY_pix += shadowOffsetY_pix;
@@ -1800,7 +1800,7 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
selectionEnds, cg, rightToLeft, line, zh, false );
}
- bool forPrint = ( painter.device()->devType() == QInternal::Printer );
+ bool forPrint = ( painter.device()->devType() == TQInternal::Printer );
if ( textDocument()->drawFormattingChars() && !forPrint )
{
drawFormattingChars( painter, start, len,
@@ -1816,10 +1816,10 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
// (we have to copy it here, so that color & font changes don't require changing
// a local copy of the text format)
// And we have to keep it separate from drawParagString to avoid s/startX/startX_pix/ etc.
-void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s, int start, int len, int startX,
+void KoTextParag::drawParagStringInternal( TQPainter &painter, const TQString &s, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *format, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow )
+ KoTextFormat *format, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow )
{
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagStringInternal start=" << start << " len=" << len << " : '" << s.mid(start,len) << "'" << endl;
@@ -1829,27 +1829,27 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
if ( drawingShadow && format->shadowDistanceX() == 0 && format->shadowDistanceY() == 0 )
return;
// 1) Sort out the color
- QColor textColor( drawingShadow ? format->shadowColor() : format->color() );
+ TQColor textColor( drawingShadow ? format->shadowColor() : format->color() );
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( &painter );
// 2) Sort out the font
- QFont font( format->screenFont( zh ) );
+ TQFont font( format->screenFont( zh ) );
if ( format->attributeFont() == KoTextFormat::ATT_SMALL_CAPS && s[start].upper() != s[start] )
font = format->smallCapsFont( zh, true );
#if 0
- QFontInfo fi( font );
+ TQFontInfo fi( font );
kdDebug(32500) << "KoTextParag::drawParagStringInternal requested font " << font.pointSizeFloat() << " using font " << fi.pointSize() << "pt (format font: " << format->font().pointSizeFloat() << "pt)" << endl;
- QFontMetrics fm( font );
+ TQFontMetrics fm( font );
kdDebug(32500) << "Real font: " << fi.family() << ". Font height in pixels: " << fm.height() << endl;
#endif
// 3) Paint
- QString str( s );
- if ( str[ (int)str.length() - 1 ].unicode() == 0xad )
+ TQString str( s );
+ if ( str[ (int)str.length() - 1 ].tqunicode() == 0xad )
str.remove( str.length() - 1, 1 );
- painter.setPen( QPen( textColor ) );
+ painter.setPen( TQPen( textColor ) );
painter.setFont( font );
KoTextDocument* doc = document();
@@ -1859,16 +1859,16 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
for ( int j = 0; j < nSels; ++j ) {
if ( start >= selectionStarts[ j ] && start < selectionEnds[ j ] ) {
if ( !doc || doc->invertSelectionText( j ) )
- textColor = cg.color( QColorGroup::HighlightedText );
- painter.setPen( QPen( textColor ) );
+ textColor = cg.color( TQColorGroup::HighlightedText );
+ painter.setPen( TQPen( textColor ) );
break;
}
}
}
- QPainter::TextDirection dir = rightToLeft ? QPainter::RTL : QPainter::LTR;
+ TQPainter::TextDirection dir = rightToLeft ? TQPainter::RTL : TQPainter::LTR;
- if ( dir != QPainter::RTL && start + len == length() ) // don't draw the last character (trailing space)
+ if ( dir != TQPainter::RTL && start + len == length() ) // don't draw the last character (trailing space)
{
len--;
if ( len <= 0 )
@@ -1877,7 +1877,7 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
}
KoTextParag::drawFontEffects( &painter, format, zh, font, textColor, startX, baseLine, bw, lastY, h, str[start] );
- if ( str[ start ] != '\t' && str[ start ].unicode() != 0xad ) {
+ if ( str[ start ] != '\t' && str[ start ].tqunicode() != 0xad ) {
str = format->displayedString( str ); // #### This converts the whole string, instead of from start to start+len!
if ( format->vAlign() == KoTextFormat::AlignNormal ) {
int posY = lastY + baseLine;
@@ -1889,14 +1889,14 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
painter.drawText( startX, posY, str, start, len, dir );
#ifdef BIDI_DEBUG
painter.save();
- painter.setPen ( Qt::red );
+ painter.setPen ( TQt::red );
painter.drawLine( startX, lastY, startX, lastY + baseLine );
painter.drawLine( startX, lastY + baseLine/2, startX + 10, lastY + baseLine/2 );
int w = 0;
int i = 0;
while( i < len )
w += painter.fontMetrics().charWidth( str, start + i++ );
- painter.setPen ( Qt::blue );
+ painter.setPen ( TQt::blue );
painter.drawLine( startX + w - 1, lastY, startX + w - 1, lastY + baseLine );
painter.drawLine( startX + w - 1, lastY + baseLine/2, startX + w - 1 - 10, lastY + baseLine/2 );
painter.restore();
@@ -1927,30 +1927,30 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
painter.drawText( startX, posY, str, start, len, dir );
}
}
- if ( str[ start ] == '\t' && m_tabCache.contains( start ) ) {
+ if ( str[ start ] == '\t' && m_tabCache.tqcontains( start ) ) {
painter.save();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
const KoTabulator& tab = m_layout.tabList()[ m_tabCache[ start ] ];
int lineWidth = zh->zoomItY( tab.ptWidth );
switch ( tab.filling ) {
case TF_DOTS:
- painter.setPen( QPen( textColor, lineWidth, Qt::DotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_LINE:
- painter.setPen( QPen( textColor, lineWidth, Qt::SolidLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::SolidLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH_DOT:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashDotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashDotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH_DOT_DOT:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashDotDotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashDotDotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
@@ -1965,25 +1965,25 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
#ifdef DEBUG_PAINT
//kdDebug(32500) << "we are drawing the end of line " << line << ". Auto-hyphenated: " << lineHyphenated( line ) << endl;
#endif
- bool drawHyphen = at( start+len-1 )->c.unicode() == 0xad;
+ bool drawHyphen = at( start+len-1 )->c.tqunicode() == 0xad;
drawHyphen = drawHyphen || lineHyphenated( line );
if ( drawHyphen ) {
#ifdef DEBUG_PAINT
kdDebug(32500) << "drawing hyphen at x=" << startX+bw << endl;
#endif
- painter.drawText( startX + bw, lastY + baseLine, "-" ); // \xad gives squares with some fonts (!?)
+ painter.drawText( startX + bw, lastY + baseLine, TQString("-") ); // \xad gives squares with some fonts (!?)
}
}
// Paint a zigzag line for "wrong" background spellchecking checked words:
if(
- painter.device()->devType() != QInternal::Printer &&
+ painter.device()->devType() != TQInternal::Printer &&
format->isMisspelled() &&
!drawingShadow &&
textDocument()->drawingMissingSpellLine() )
{
painter.save();
- painter.setPen( QPen( Qt::red, 1 ) );
+ painter.setPen( TQPen( TQt::red, 1 ) );
// Draw 3 pixel lines with increasing offset and distance 4:
for( int zigzag_line = 0; zigzag_line < 3; ++zigzag_line )
@@ -2018,21 +2018,21 @@ bool KoTextParag::lineHyphenated( int l ) const
if ( !isValid() )
const_cast<KoTextParag*>(this)->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->hyphenated;
}
/** Draw the cursor mark. Reimplemented from KoTextParag to convert coordinates first. */
-void KoTextParag::drawCursor( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg )
+void KoTextParag::drawCursor( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg )
{
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
- int x = zh->layoutUnitToPixelX( curx ) /*+ cursor->parag()->at( cursor->index() )->pixelxadj*/;
- //kdDebug(32500) << " drawCursor: LU: [cur]x=" << curx << ", cury=" << cury << " -> PIX: x=" << x << ", y=" << zh->layoutUnitToPixelY( cury ) << endl;
+ int x = zh->tqlayoutUnitToPixelX( curx ) /*+ cursor->parag()->at( cursor->index() )->pixelxadj*/;
+ //kdDebug(32500) << " drawCursor: LU: [cur]x=" << curx << ", cury=" << cury << " -> PIX: x=" << x << ", y=" << zh->tqlayoutUnitToPixelY( cury ) << endl;
KoTextParag::drawCursorDefault( painter, cursor, x,
- zh->layoutUnitToPixelY( cury ),
- zh->layoutUnitToPixelY( cury, curh ), cg );
+ zh->tqlayoutUnitToPixelY( cury ),
+ zh->tqlayoutUnitToPixelY( cury, curh ), cg );
}
// Reimplemented from KoTextParag
@@ -2059,7 +2059,7 @@ void KoTextParag::copyParagData( KoTextParag *parag )
//else
// kdWarning() << "Paragraph has no style " << paragId() << endl;
- // No "following style" setting, or same style -> copy layout & format of previous paragraph
+ // No "following style" setting, or same style -> copy tqlayout & format of previous paragraph
if (!styleApplied)
{
setParagLayout( parag->paragLayout() );
@@ -2082,7 +2082,7 @@ void KoTextParag::copyParagData( KoTextParag *parag )
// Note: we don't call the original KoTextParag::copyParagData on purpose.
// We don't want setListStyle to get called - it ruins our stylesheetitems
// And we don't care about copying the stylesheetitems directly,
- // applying the parag layout will create them
+ // applying the parag tqlayout will create them
}
void KoTextParag::setTabList( const KoTabulatorList &tabList )
@@ -2104,7 +2104,7 @@ void KoTextParag::setTabList( const KoTabulatorList &tabList )
{
setTabArray( 0 );
}
- invalidate( 0 );
+ tqinvalidate( 0 );
}
/** "Reimplemented" (compared to nextTabDefault) to implement non-left-aligned tabs */
@@ -2240,43 +2240,43 @@ void KoTextParag::applyStyle( KoParagStyle *style )
setFormat( newFormat );
}
-void KoTextParag::setParagLayout( const KoParagLayout & layout, int flags, int marginIndex )
+void KoTextParag::setParagLayout( const KoParagLayout & tqlayout, int flags, int marginIndex )
{
//kdDebug(32500) << "KoTextParag::setParagLayout flags=" << flags << endl;
if ( flags & KoParagLayout::Alignment )
- setAlign( layout.alignment );
+ setAlign( tqlayout.tqalignment );
if ( flags & KoParagLayout::Margins ) {
if ( marginIndex == -1 )
- setMargins( layout.margins );
+ setMargins( tqlayout.margins );
else
- setMargin( (QStyleSheetItem::Margin)marginIndex, layout.margins[marginIndex] );
+ setMargin( (TQStyleSheetItem::Margin)marginIndex, tqlayout.margins[marginIndex] );
}
if ( flags & KoParagLayout::LineSpacing )
{
- setLineSpacingType( layout.lineSpacingType );
- setLineSpacing( layout.lineSpacingValue() );
+ setLineSpacingType( tqlayout.lineSpacingType );
+ setLineSpacing( tqlayout.lineSpacingValue() );
}
if ( flags & KoParagLayout::Borders )
{
- setLeftBorder( layout.leftBorder );
- setRightBorder( layout.rightBorder );
- setTopBorder( layout.topBorder );
- setBottomBorder( layout.bottomBorder );
- setJoinBorder( layout.joinBorder );
+ setLeftBorder( tqlayout.leftBorder );
+ setRightBorder( tqlayout.rightBorder );
+ setTopBorder( tqlayout.topBorder );
+ setBottomBorder( tqlayout.bottomBorder );
+ setJoinBorder( tqlayout.joinBorder );
}
if ( flags & KoParagLayout::BackgroundColor )
{
- setBackgroundColor( layout.backgroundColor );
+ setBackgroundColor( tqlayout.backgroundColor );
}
if ( flags & KoParagLayout::BulletNumber )
- setCounter( layout.counter );
+ setCounter( tqlayout.counter );
if ( flags & KoParagLayout::Tabulator )
- setTabList( layout.tabList() );
+ setTabList( tqlayout.tabList() );
if ( flags == 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 );
}
}
@@ -2290,7 +2290,7 @@ void KoTextParag::setCustomItem( int index, KoTextCustomItem * custom, KoTextFor
//addCustomItem();
document()->registerCustomItem( custom, this );
custom->recalc(); // calc value (e.g. for variables) and set initial size
- invalidate( 0 );
+ tqinvalidate( 0 );
setChanged( true );
}
@@ -2321,7 +2321,7 @@ int KoTextParag::findCustomItem( const KoTextCustomItem * custom ) const
#ifndef NDEBUG
void KoTextParag::printRTDebug( int info )
{
- QString specialFlags;
+ TQString specialFlags;
if ( str->needsSpellCheck() )
specialFlags += " needsSpellCheck=true";
if ( wasMovedDown() )
@@ -2349,10 +2349,10 @@ void KoTextParag::printRTDebug( int info )
static const char * const s_align[] = { "Auto", "Left", "Right", "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", };
static const char * const s_linespacing[] = { "Single", "1.5", "2", "custom", "atLeast", "Multiple", "Fixed" };
static const char * const s_dir[] = { "DirL", "DirR", "DirEN", "DirES", "DirET", "DirAN", "DirCS", "DirB", "DirS", "DirWS", "DirON", "DirLRE", "DirLRO", "DirAL", "DirRLE", "DirRLO", "DirPDF", "DirNSM", "DirBN" };
- kdDebug(32500) << " align: " << s_align[alignment()] << " resolveAlignment: " << s_align[resolveAlignment()]
+ kdDebug(32500) << " align: " << s_align[tqalignment()] << " resolveAlignment: " << s_align[resolveAlignment()]
<< " isRTL:" << str->isRightToLeft()
<< " dir: " << s_dir[direction()] << endl;
- QRect pixr = pixelRect( textDocument()->paintingZoomHandler() );
+ TQRect pixr = pixelRect( textDocument()->paintingZoomHandler() );
kdDebug(32500) << " rect() : " << DEBUGRECT( rect() )
<< " pixelRect() : " << DEBUGRECT( pixr ) << endl;
kdDebug(32500) << " topMargin()=" << topMargin()
@@ -2364,7 +2364,7 @@ void KoTextParag::printRTDebug( int info )
kdDebug(32500) << " linespacing type=" << s_linespacing[ -kwLineSpacingType() ]
<< " value=" << kwLineSpacing() << endl;
const int pageBreaking = m_layout.pageBreaking;
- QStringList pageBreakingFlags;
+ TQStringList pageBreakingFlags;
if ( pageBreaking & KoParagLayout::KeepLinesTogether )
pageBreakingFlags.append( "KeepLinesTogether" );
if ( pageBreaking & KoParagLayout::HardFrameBreakBefore )
@@ -2381,7 +2381,7 @@ void KoTextParag::printRTDebug( int info )
static const char * const tabtype[] = { "T_LEFT", "T_CENTER", "T_RIGHT", "T_DEC_PNT", "error!!!" };
KoTabulatorList tabList = m_layout.tabList();
if ( tabList.isEmpty() ) {
- if ( str->toString().find( '\t' ) != -1 )
+ if ( str->toString().tqfind( '\t' ) != -1 )
kdDebug(32500) << "Tab width: " << textDocument()->tabStopWidth() << endl;
} else {
KoTabulatorList::Iterator it = tabList.begin();
@@ -2407,11 +2407,11 @@ void KoTextParag::printRTDebug( int info )
for ( int i = 0 ; i < s->length() ; ++i )
{
KoTextStringChar & ch = s->at(i);
- int pixelx = textDocument()->formattingZoomHandler()->layoutUnitToPixelX( ch.x )
+ int pixelx = textDocument()->formattingZoomHandler()->tqlayoutUnitToPixelX( ch.x )
+ ch.pixelxadj;
if ( ch.lineStart )
kdDebug(32500) << "LINESTART" << endl;
- QString attrs = " ";
+ TQString attrs = " ";
if ( ch.whiteSpace )
attrs += "whitespace ";
if ( !ch.charStop )
@@ -2420,8 +2420,8 @@ void KoTextParag::printRTDebug( int info )
attrs += "wordStop ";
attrs.truncate( attrs.length() - 1 );
- kdDebug(32500) << i << ": '" << QString(ch.c).rightJustify(2)
- << "' (" << QString::number( ch.c.unicode() ).rightJustify(3) << ")"
+ kdDebug(32500) << i << ": '" << TQString(ch.c).rightJustify(2)
+ << "' (" << TQString::number( ch.c.tqunicode() ).rightJustify(3) << ")"
<< " x(LU)=" << ch.x
<< " w(LU)=" << ch.width//s->width(i)
<< " x(PIX)=" << pixelx
@@ -2456,14 +2456,14 @@ void KoTextParag::printRTDebug( int info )
}
#endif
-void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, QFont font, const QColor & color, int startX, int baseLine, int bw, int lastY, int /*h*/, QChar firstChar )
+void KoTextParag::drawFontEffects( TQPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, TQFont font, const TQColor & color, int startX, int baseLine, int bw, int lastY, int /*h*/, TQChar firstChar )
{
// This is about drawing underlines and strikeouts
// So abort immediately if there's none to draw.
if ( !format->isStrikedOrUnderlined() )
return;
//kdDebug(32500) << "drawFontEffects wordByWord=" << format->wordByWord() <<
- // " firstChar='" << QString(firstChar) << "'" << endl;
+ // " firstChar='" << TQString(firstChar) << "'" << endl;
// paintLines ensures that we're called word by word if wordByWord is true.
if ( format->wordByWord() && firstChar.isSpace() )
return;
@@ -2484,7 +2484,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
if ( format->doubleUnderline())
{
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
int dim=static_cast<int>(0.75*dimd);
dim=dim?dim:1; //width of line should be at least 1
p->save();
@@ -2492,22 +2492,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->underlineStyle())
{
case KoTextFormat::U_SOLID:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
break;
case KoTextFormat::U_DASH:
- p->setPen( QPen( col, dim, Qt::DashLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashLine ) );
break;
case KoTextFormat::U_DOT:
- p->setPen( QPen( col, dim, Qt::DotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DotLine ) );
break;
case KoTextFormat::U_DASH_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::U_DASH_DOT_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y += static_cast<int>(1.125*dimd); // slightly under the baseline if possible
@@ -2524,7 +2524,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
format->underlineType() == KoTextFormat::U_SIMPLE_BOLD)
{
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
p->save();
int dim=(format->underlineType() == KoTextFormat::U_SIMPLE_BOLD)?static_cast<int>(2*dimd):static_cast<int>(dimd);
dim=dim?dim:1; //width of line should be at least 1
@@ -2533,22 +2533,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->underlineStyle() )
{
case KoTextFormat::U_SOLID:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
break;
case KoTextFormat::U_DASH:
- p->setPen( QPen( col, dim, Qt::DashLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashLine ) );
break;
case KoTextFormat::U_DOT:
- p->setPen( QPen( col, dim, Qt::DotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DotLine ) );
break;
case KoTextFormat::U_DASH_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::U_DASH_DOT_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
}
p->drawLine( startX, y, startX + bw, y );
@@ -2561,10 +2561,10 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
int dim=static_cast<int>(dimd);
dim=dim?dim:1; //width of line should be at least 1
y += dim;
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
p->save();
int offset = 2 * dim;
- QPen pen(col, dim, Qt::SolidLine);
+ TQPen pen(col, dim, TQt::SolidLine);
pen.setCapStyle(Qt::RoundCap);
p->setPen(pen);
Q_ASSERT(offset);
@@ -2574,7 +2574,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
if(2*((startX/offset)/2)==startX/offset)
pos*=-1;
//draw first part of wave
- p->drawArc( (startX/offset)*offset, y, offset, offset, 0, -qRound(pos*anc*16) );
+ p->drawArc( (startX/offset)*offset, y, offset, offset, 0, -tqRound(pos*anc*16) );
//now the main part
int zigzag_x = (startX/offset+1)*offset;
for ( ; zigzag_x + offset <= bw+startX; zigzag_x += offset)
@@ -2584,7 +2584,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
}
//and here we finish
anc=acos(1.0-2*(static_cast<double>((startX+bw)%offset)/static_cast<double>(offset)))/3.1415*180;
- p->drawArc( zigzag_x, y, offset, offset, 180*16, -qRound(pos*anc*16) );
+ p->drawArc( zigzag_x, y, offset, offset, 180*16, -tqRound(pos*anc*16) );
p->restore();
font.setUnderline( FALSE );
p->setFont( font );
@@ -2605,22 +2605,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->strikeOutStyle() )
{
case KoTextFormat::S_SOLID:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
break;
case KoTextFormat::S_DASH:
- p->setPen( QPen( color, dim, Qt::DashLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashLine ) );
break;
case KoTextFormat::S_DOT:
- p->setPen( QPen( color, dim, Qt::DotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DotLine ) );
break;
case KoTextFormat::S_DASH_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::S_DASH_DOT_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y -= static_cast<int>(5*dimd);
@@ -2637,22 +2637,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->strikeOutStyle() )
{
case KoTextFormat::S_SOLID:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
break;
case KoTextFormat::S_DASH:
- p->setPen( QPen( color, dim, Qt::DashLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashLine ) );
break;
case KoTextFormat::S_DOT:
- p->setPen( QPen( color, dim, Qt::DotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DotLine ) );
break;
case KoTextFormat::S_DASH_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::S_DASH_DOT_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y -= static_cast<int>(4*dimd);
@@ -2667,9 +2667,9 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
}
// ### is this method correct for RTL text?
-QString KoTextParag::toString( int from, int length ) const
+TQString KoTextParag::toString( int from, int length ) const
{
- QString str;
+ TQString str;
if ( from == 0 && m_layout.counter && m_layout.counter->numbering() != KoParagCounter::NUM_FOOTNOTE )
str += m_layout.counter->text( this ) + ' ';
if ( length == -1 )
@@ -2691,27 +2691,27 @@ QString KoTextParag::toString( int from, int length ) const
return str;
}
-// we cannot use QString::simplifyWhiteSpace() because it removes
+// we cannot use TQString::simplifyWhiteSpace() because it removes
// leading and trailing whitespace, but such whitespace is significant
// in ODF -- so we use this function to compress sequences of space characters
// into single spaces
-static QString normalizeWhitespace( const QString& in, bool leadingSpace )
+static TQString normalizeWhitespace( const TQString& in, bool leadingSpace )
{
- QString text = in;
+ TQString text = in;
int r, w = 0;
int len = text.length();
for ( r = 0; r < len; ++r )
{
- QCharRef ch = text[r];
+ TQCharRef ch = text[r];
// check for space, tab, line feed, carriage return
if ( ch == ' ' || ch == '\t' ||ch == '\r' || ch == '\n')
{
- // if we were lead by whitespace in some parent or previous sibling element,
+ // if we were lead by whitespace in some tqparent or previous sibling element,
// we completely collapse this space
if ( r != 0 || !leadingSpace )
- text[w++] = QChar( ' ' );
+ text[w++] = TQChar( ' ' );
// find the end of the whitespace run
while ( r < len && text[r].isSpace() )
@@ -2733,23 +2733,23 @@ static QString normalizeWhitespace( const QString& in, bool leadingSpace )
return text;
}
-void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace )
+void KoTextParag::loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace )
{
bool dummy;
- return loadOasisSpan( parent, context, pos, stripLeadingSpace, &dummy );
+ return loadOasisSpan( tqparent, context, pos, stripLeadingSpace, &dummy );
}
-void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace )
+void KoTextParag::loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace )
{
- // Parse every child node of the parent
+ // Parse every child node of the tqparent
// Can't use forEachElement here since we also care about text nodes
- QDomNode node;
- for ( node = parent.firstChild(); !node.isNull(); node = node.nextSibling() )
+ TQDomNode node;
+ for ( node = tqparent.firstChild(); !node.isNull(); node = node.nextSibling() )
{
- QDomElement ts = node.toElement();
- QString textData;
- const QString localName( ts.localName() );
+ TQDomElement ts = node.toElement();
+ TQString textData;
+ const TQString localName( ts.localName() );
const bool isTextNS = ts.namespaceURI() == KoXmlNS::text;
KoTextCustomItem* customItem = 0;
@@ -2772,7 +2772,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
// should only have one space between each of "Foo", "Bar", and "Baz"
// so we need to keep track of whether there was any trailing whitespace
// in sub-spans so that we can propogate the whitespace compression state
- // back up to the parent element
+ // back up to the tqparent element
loadOasisSpan( ts, context, pos, stripLeadingSpace, hasTrailingSpace ); // recurse
stripLeadingSpace = *hasTrailingSpace;
context.styleStack().restore();
@@ -2781,7 +2781,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
{
int howmany = 1;
if (ts.hasAttributeNS( KoXmlNS::text, "c"))
- howmany = ts.attributeNS( KoXmlNS::text, "c", QString::null).toInt();
+ howmany = ts.attributeNS( KoXmlNS::text, "c", TQString()).toInt();
textData.fill(32, howmany);
}
@@ -2800,7 +2800,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
}
else if ( node.isProcessingInstruction() )
{
- QDomProcessingInstruction pi = node.toProcessingInstruction();
+ TQDomProcessingInstruction pi = node.toProcessingInstruction();
if ( pi.target() == "opendocument" && pi.data().startsWith( "cursor-position" ) )
{
context.setCursorPosition( this, pos );
@@ -2849,7 +2849,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleCollection *styleCollection, bool findStyle )
{
- KoParagLayout layout;
+ KoParagLayout tqlayout;
// Only when loading paragraphs, not when loading styles
if ( findStyle )
@@ -2857,7 +2857,7 @@ KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleColl
KoParagStyle *style;
// Name of the style. If there is no style, then we do not supply
// any default!
- QString styleName = context.styleStack().userStyleName( "paragraph" );
+ TQString styleName = context.styleStack().userStyleName( "paragraph" );
if ( !styleName.isEmpty() )
{
style = styleCollection->findStyle( styleName );
@@ -2877,17 +2877,17 @@ KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleColl
style = styleCollection->findStyle( "Standard" );
}
Q_ASSERT(style);
- layout.style = style;
+ tqlayout.style = style;
}
- KoParagLayout::loadOasisParagLayout( layout, context );
+ KoParagLayout::loadOasisParagLayout( tqlayout, context );
- return layout;
+ return tqlayout;
}
-void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos )
+void KoTextParag::loadOasis( const TQDomElement& tqparent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos )
{
- // First load layout from style
+ // First load tqlayout from style
KoParagLayout paragLayout = loadParagLayout( context, styleCollection, true );
setParagLayout( paragLayout );
@@ -2898,7 +2898,7 @@ void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context,
// Load text
// OO.o compatibility: ignore leading whitespace in <p> and <h> elements
- loadOasisSpan( parent, context, pos, true );
+ loadOasisSpan( tqparent, context, pos, true );
// Apply default format to trailing space
const int len = str->length();
@@ -2906,7 +2906,7 @@ void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context,
setFormat( len - 1, 1, paragFormat(), TRUE );
setChanged( true );
- invalidate( 0 );
+ tqinvalidate( 0 );
}
void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
@@ -2915,25 +2915,25 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
{
KoGenStyles& mainStyles = context.mainStyles();
- // Write paraglayout to styles (with parent == the parag's style)
- QString parentStyleName;
+ // Write paragtqlayout to styles (with tqparent == the parag's style)
+ TQString tqparentStyleName;
if ( m_layout.style )
- parentStyleName = m_layout.style->name();
+ tqparentStyleName = m_layout.style->name();
- KoGenStyle autoStyle( KoGenStyle::STYLE_AUTO, "paragraph", parentStyleName );
+ KoGenStyle autoStyle( KoGenStyle::STYLE_AUTO, "paragraph", tqparentStyleName );
paragFormat()->save( autoStyle, context );
m_layout.saveOasis( autoStyle, context, false );
- // First paragraph is special, it includes page-layout info (for word-processing at least)
+ // First paragraph is special, it includes page-tqlayout info (for word-processing at least)
if ( !prev() ) {
if ( context.variableSettings() )
autoStyle.addProperty( "style:page-number", context.variableSettings()->startingPageNumber() );
- // Well we support only one page layout, so the first parag always points to "Standard".
+ // Well we support only one page tqlayout, so the first parag always points to "Standard".
autoStyle.addAttribute( "style:master-page-name", "Standard" );
}
- QString autoParagStyleName = mainStyles.lookup( autoStyle, "P", KoGenStyles::ForceNumbering );
+ TQString autoParagStyleName = mainStyles.lookup( autoStyle, "P", KoGenStyles::ForceNumbering );
KoParagCounter* paragCounter = m_layout.counter;
// outline (text:h) assumes paragCounter != 0 (because depth is mandatory)
@@ -2949,10 +2949,10 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
KoGenStyle listStyle( KoGenStyle::STYLE_AUTO_LIST /*, no family*/ );
paragCounter->saveOasis( listStyle );
- QString autoListStyleName = mainStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering );
+ TQString autoListStyleName = mainStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering );
writer.addAttribute( "text:style-name", autoListStyleName );
- QString textNumber = m_layout.counter->text( this );
+ TQString textNumber = m_layout.counter->text( this );
if ( !textNumber.isEmpty() )
{
// This is to help export filters
@@ -2969,7 +2969,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
if ( paragCounter->numbering() == KoParagCounter::NUM_NONE )
writer.addAttribute( "text:is-list-header", "true" );
- QString textNumber = paragCounter->text( this );
+ TQString textNumber = paragCounter->text( this );
if ( !textNumber.isEmpty() )
{
// This is to help export filters
@@ -2985,7 +2985,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
writer.addAttribute( "text:style-name", autoParagStyleName );
}
- QString text = str->toString();
+ TQString text = str->toString();
Q_ASSERT( text.right(1)[0] == ' ' );
const int cursorIndex = context.cursorTextParagraph() == this ? context.cursorTextIndex() : -1;
@@ -3001,7 +3001,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
curFormat->save( gs, context, paragFormat() ); \
writer.startElement( "text:span" ); \
if ( !gs.isEmpty() ) { \
- const QString autoStyleName = mainStyles.lookup( gs, "T" ); \
+ const TQString autoStyleName = mainStyles.lookup( gs, "T" ); \
writer.addAttribute( "text:style-name", autoStyleName ); \
} \
writer.addTextSpan( text.mid( startPos, next - startPos ), m_tabCache ); \
@@ -3059,7 +3059,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
{
lastFormatRaw = newFormat;
// Remove isMisspelled from format, to avoid useless derived styles
- // (which would be indentical to their parent style)
+ // (which would be indentical to their tqparent style)
KoTextFormat tmpFormat( *newFormat );
tmpFormat.setMisspelled( false );
newFormat = formatCollection()->format( &tmpFormat );
@@ -3081,7 +3081,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
curFormat->save( gs, context, paragFormat() );
writer.startElement( "text:span" );
if ( !gs.isEmpty() ) {
- const QString autoStyleName = mainStyles.lookup( gs, "T" );
+ const TQString autoStyleName = mainStyles.lookup( gs, "T" );
writer.addAttribute( "text:style-name", autoStyleName );
}
KoTextCustomItem* customItem = ch.customItem();
@@ -3110,13 +3110,13 @@ void KoTextParag::applyListStyle( KoOasisContext& context, int restartNumbering,
m_layout.counter = new KoParagCounter;
m_layout.counter->loadOasis( context, restartNumbering, orderedList, heading, level );
// We emulate space-before with a left paragraph indent (#109223)
- const QDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
+ const TQDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
if ( listStyleProperties.hasAttributeNS( KoXmlNS::text, "space-before" ) )
{
- double spaceBefore = KoUnit::parseValue( listStyleProperties.attributeNS( KoXmlNS::text, "space-before", QString::null ) );
- m_layout.margins[ QStyleSheetItem::MarginLeft ] += spaceBefore; // added to left-margin, see 15.12 in spec.
+ double spaceBefore = KoUnit::parseValue( listStyleProperties.attributeNS( KoXmlNS::text, "space-before", TQString() ) );
+ m_layout.margins[ TQStyleSheetItem::MarginLeft ] += spaceBefore; // added to left-margin, see 15.12 in spec.
}
- // need to call invalidateCounters() ? Not during the initial loading at least.
+ // need to call tqinvalidateCounters() ? Not during the initial loading at least.
}
int KoTextParag::documentWidth() const
@@ -3145,25 +3145,25 @@ void KoTextParag::fixParagWidth( bool viewFormattingChars )
if ( viewFormattingChars && lineStartList().count() == 1 ) // don't use lines() here, parag not formatted yet
{
KoTextFormat * lastFormat = at( length() - 1 )->format();
- setWidth( QMIN( rect().width() + lastFormat->width('x'), doc->width() ) );
+ setWidth( TQMIN( rect().width() + lastFormat->width('x'), doc->width() ) );
}
// Warning, if adding anything else here, adjust KWTextFrameSet::fixParagWidth
}
// Called by KoTextParag::drawParagString - all params are in pixel coordinates
-void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
+void KoTextParag::drawFormattingChars( TQPainter &painter, int start, int len,
int lastY_pix, int baseLine_pix, int h_pix, // in pixels
bool /*drawSelections*/,
- KoTextFormat * /*lastFormat*/, const QMemArray<int> &/*selectionStarts*/,
- const QMemArray<int> &/*selectionEnds*/, const QColorGroup & /*cg*/,
+ KoTextFormat * /*lastFormat*/, const TQMemArray<int> &/*selectionStarts*/,
+ const TQMemArray<int> &/*selectionEnds*/, const TQColorGroup & /*cg*/,
bool rightToLeft, int /*line*/, KoTextZoomHandler* zh,
int whichFormattingChars )
{
if ( !whichFormattingChars )
return;
painter.save();
- //QPen pen( cg.color( QColorGroup::Highlight ) );
- QPen pen( KGlobalSettings::linkColor() ); // #101820
+ //TQPen pen( cg.color( TQColorGroup::Highlight ) );
+ TQPen pen( KGlobalSettings::linkColor() ); // #101820
painter.setPen( pen );
//kdDebug() << "KWTextParag::drawFormattingChars start=" << start << " len=" << len << " length=" << length() << endl;
if ( start + len == length() && ( whichFormattingChars & FormattingEndParag ) )
@@ -3172,14 +3172,14 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
KoTextStringChar &ch = str->at( length() - 1 );
KoTextFormat* format = static_cast<KoTextFormat *>( ch.format() );
int w = format->charWidth( zh, true, &ch, this, 'X' );
- int size = QMIN( w, h_pix * 3 / 4 );
+ int size = TQMIN( w, h_pix * 3 / 4 );
// x,y is the bottom right corner of the
//kdDebug() << "startX=" << startX << " bw=" << bw << " w=" << w << endl;
int x;
if ( rightToLeft )
- x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
+ x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
else
- x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w;
+ x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w;
int y = lastY_pix + baseLine_pix;
//kdDebug() << "KWTextParag::drawFormattingChars drawing CR at " << x << "," << y << endl;
painter.drawLine( (int)(x - size * 0.2), y - size, (int)(x - size * 0.2), y );
@@ -3188,9 +3188,9 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
painter.drawLine( x, y - size, (int)(x - size * 0.5), y - size);
painter.drawArc( x - size, y - size, size, (int)(size / 2), -90*16, -180*16 );
#ifdef DEBUG_FORMATTING
- painter.setPen( Qt::blue );
- painter.drawRect( zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
- QPen pen( cg.color( QColorGroup::Highlight ) );
+ painter.setPen( TQt::blue );
+ painter.drawRect( zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
+ TQPen pen( cg.color( TQColorGroup::Highlight ) );
painter.setPen( pen );
#endif
}
@@ -3200,28 +3200,28 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
(whichFormattingChars & FormattingTabs) ||
(whichFormattingChars & FormattingBreak) )
{
- int end = QMIN( start + len, length() - 1 ); // don't look at the trailing space
+ int end = TQMIN( start + len, length() - 1 ); // don't look at the trailing space
for ( int i = start ; i < end ; ++i )
{
KoTextStringChar &ch = str->at(i);
#ifdef DEBUG_FORMATTING
- painter.setPen( (i % 2)? Qt::red: Qt::green );
- painter.drawRect( zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
- QPen pen( cg.color( QColorGroup::Highlight ) );
+ painter.setPen( (i % 2)? TQt::red: TQt::green );
+ painter.drawRect( zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
+ TQPen pen( cg.color( TQColorGroup::Highlight ) );
painter.setPen( pen );
#endif
if ( ch.isCustom() )
continue;
- if ( (ch.c == ' ' || ch.c.unicode() == 0x00a0U)
+ if ( (ch.c == ' ' || ch.c.tqunicode() == 0x00a0U)
&& (whichFormattingChars & FormattingSpace))
{
// Don't use ch.pixelwidth here. We want a square with
// the same size for all spaces, even the justified ones
- int w = zh->layoutUnitToPixelX( ch.format()->width( ' ' ) );
- int height = zh->layoutUnitToPixelY( ch.ascent() );
- int size = QMAX( 2, QMIN( w/2, height/3 ) ); // Enfore that it's a square, and that it's visible
- int x = zh->layoutUnitToPixelX( ch.x ); // + ch.pixelxadj;
- QRect spcRect( x + (ch.pixelwidth - size) / 2, lastY_pix + baseLine_pix - (height - size) / 2, size, size );
+ int w = zh->tqlayoutUnitToPixelX( ch.format()->width( ' ' ) );
+ int height = zh->tqlayoutUnitToPixelY( ch.ascent() );
+ int size = TQMAX( 2, TQMIN( w/2, height/3 ) ); // Enfore that it's a square, and that it's visible
+ int x = zh->tqlayoutUnitToPixelX( ch.x ); // + ch.pixelxadj;
+ TQRect spcRect( x + (ch.pixelwidth - size) / 2, lastY_pix + baseLine_pix - (height - size) / 2, size, size );
if ( ch.c == ' ' )
painter.drawRect( spcRect );
else // nbsp
@@ -3234,15 +3234,15 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
//kdDebug() << "tab x=" << ch.x << " nextch.x=" << nextch.x
// << " nextx=" << nextx << " startX=" << startX << " bw=" << bw << endl;
int availWidth = nextx - ch.x - 1;
- availWidth=zh->layoutUnitToPixelX(availWidth);*/
+ availWidth=zh->tqlayoutUnitToPixelX(availWidth);*/
int availWidth = ch.pixelwidth;
KoTextFormat* format = ch.format();
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + availWidth / 2;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + availWidth / 2;
int charWidth = format->screenFontMetrics( zh ).width( 'W' );
- int size = QMIN( availWidth, charWidth ) / 2 ; // actually the half size
- int y = lastY_pix + baseLine_pix - zh->layoutUnitToPixelY( ch.ascent()/2 );
+ int size = TQMIN( availWidth, charWidth ) / 2 ; // actually the half size
+ int y = lastY_pix + baseLine_pix - zh->tqlayoutUnitToPixelY( ch.ascent()/2 );
int arrowsize = zh->zoomItY( 2 );
painter.drawLine( x - size, y, x + size, y );
if ( rightToLeft )
@@ -3261,7 +3261,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
// draw line break
KoTextFormat* format = static_cast<KoTextFormat *>( ch.format() );
int w = format->charWidth( zh, true, &ch, this, 'X' );
- int size = QMIN( w, h_pix * 3 / 4 );
+ int size = TQMIN( w, h_pix * 3 / 4 );
int arrowsize = zh->zoomItY( 2 );
// x,y is the bottom right corner of the reversed L
//kdDebug() << "startX=" << startX << " bw=" << bw << " w=" << w << endl;
@@ -3269,7 +3269,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
//kdDebug() << "KWTextParag::drawFormattingChars drawing Line Break at " << x << "," << y << endl;
if ( rightToLeft )
{
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
painter.drawLine( x - size, y - size, x - size, y );
painter.drawLine( x - size, y, (int)(x - size * 0.3), y );
// Now the arrow
@@ -3278,7 +3278,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
}
else
{
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w - 1;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w - 1;
painter.drawLine( x, y - size, x, y );
painter.drawLine( x, y, (int)(x - size * 0.7), y );
// Now the arrow
@@ -3294,12 +3294,12 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
int KoTextParag::heightForLineSpacing( int startChar, int lastChar ) const
{
int h = 0;
- int end = QMIN( lastChar, length() - 1 ); // don't look at the trailing space
+ int end = TQMIN( lastChar, length() - 1 ); // don't look at the trailing space
for( int i = startChar; i <= end; ++i )
{
const KoTextStringChar &chr = str->at( i );
if ( !chr.isCustom() )
- h = QMAX( h, chr.format()->height() );
+ h = TQMAX( h, chr.format()->height() );
}
return h;
}
diff --git a/lib/kotext/KoTextParag.h b/lib/kotext/KoTextParag.h
index 1b65b8c3..486a4ae3 100644
--- a/lib/kotext/KoTextParag.h
+++ b/lib/kotext/KoTextParag.h
@@ -42,11 +42,11 @@ struct KoTextParagSelection
int start, end;
};
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QMap<int, KoTextParagSelection>;
-template class QMap<int, KoTextParagLineStart*>;
-// MOC_SKIP_END
+#if defined(TQ_TEMPLATEDLL)
+// TQMOC_SKIP_BEGIN
+template class TQMap<int, KoTextParagSelection>;
+template class TQMap<int, KoTextParagLineStart*>;
+// TQMOC_SKIP_END
#endif
class KOTEXT_EXPORT KoTextParag
@@ -71,8 +71,8 @@ public:
KoTextDocument *document() const;
- QRect rect() const;
- void setRect( const QRect& rect ) { r = rect; }
+ TQRect rect() const;
+ void setRect( const TQRect& rect ) { r = rect; }
void setHeight( int h ) { r.setHeight( h ); }
void setWidth( int w ) { r.setWidth( w ); }
void show();
@@ -84,8 +84,8 @@ public:
void setPrev( KoTextParag *s );
void setNext( KoTextParag *s );
- void insert( int index, const QString &s );
- void append( const QString &s, bool reallyAtEnd = FALSE );
+ void insert( int index, const TQString &s );
+ void append( const TQString &s, bool reallyAtEnd = FALSE );
void truncate( int index );
void remove( int index, int len );
@@ -93,7 +93,7 @@ public:
void format( int start = -1, bool doMove = TRUE );
/// Call this to ensure that format() will be called on this paragraph later on
- void invalidate( int chr /*ignored*/ = 0 );
+ void tqinvalidate( int chr /*ignored*/ = 0 );
/// Returns false if format() needs to be called on this paragraph
bool isValid() const;
@@ -126,15 +126,15 @@ public:
void setParagId( int i );
int paragId() const;
- QMap<int, KoTextParagLineStart*> &lineStartList();
+ TQMap<int, KoTextParagLineStart*> &lineStartList();
void setFormat( int index, int len, const KoTextFormat *f, bool useCollection = TRUE, int flags = -1 );
- void setAlignment( uint a );
- void setAlignmentDirect( uint a ) { align = a; }
- uint alignment() const;
+ void tqsetAlignment( uint a );
+ void tqsetAlignmentDirect( uint a ) { align = a; }
+ uint tqalignment() const;
- virtual void paint( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+ virtual void paint( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph ); // kotextparag.cc
@@ -154,7 +154,7 @@ public:
int customItems() const;
- void setDocumentRect( const QRect &r );
+ void setDocumentRect( const TQRect &r );
int documentWidth() const;
//int documentVisibleWidth() const;
int documentX() const;
@@ -186,8 +186,8 @@ public:
void setMovedDown( bool b ) { movedDown = b; }
bool wasMovedDown() const { return movedDown; }
- void setDirection( QChar::Direction d );
- QChar::Direction direction() const;
+ void setDirection( TQChar::Direction d );
+ TQChar::Direction direction() const;
/// Mark a paragraph as being part of the table of contents (kword only)
void setPartOfTableOfContents( bool b ) { m_toc = b; }
@@ -197,9 +197,9 @@ public:
void insertLineStart( int index, KoTextParagLineStart *ls );
protected:
- void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg );
- void drawCursorDefault( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg );
- void drawCursor( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg );
+ void drawLabel( TQPainter* p, int x, int y, int w, int h, int base, const TQColorGroup& cg );
+ void drawCursorDefault( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg );
+ void drawCursor( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg );
/**
* We extend KoTextParag with more (zoom-aware) features,
@@ -214,15 +214,15 @@ public:
/** Sets all or some parameters from a paragLayout struct.
* @param flags selects which settings to apply, see KoParagLayout's enum. */
- virtual void setParagLayout( const KoParagLayout &layout, int flags = KoParagLayout::All,
+ virtual void setParagLayout( const KoParagLayout &tqlayout, int flags = KoParagLayout::All,
int marginIndex = -1 );
const KoParagLayout & paragLayout() { return m_layout; }
// Margins
- double margin( QStyleSheetItem::Margin m ) { return m_layout.margins[m]; }
+ double margin( TQStyleSheetItem::Margin m ) { return m_layout.margins[m]; }
const double * margins() const { return m_layout.margins; }
- void setMargin( QStyleSheetItem::Margin m, double _i );
+ void setMargin( TQStyleSheetItem::Margin m, double _i );
void setMargins( const double * _i );
/** Line spacing in pt if >=0, can also be one of the LS_* values */
@@ -235,9 +235,9 @@ public:
void setLineSpacingType( KoParagLayout::SpacingType _type );
- /** Use this to change the paragraph alignment, not KoTextParag::setAlignment ! */
+ /** Use this to change the paragraph tqalignment, not KoTextParag::tqsetAlignment ! */
void setAlign( int align );
- /** Return the real alignment: Auto is resolved to either Left or Right */
+ /** Return the real tqalignment: Auto is resolved to either Left or Right */
int resolveAlignment() const;
/// The part of the top margin that can be broken by a page break
@@ -259,8 +259,8 @@ public:
void setJoinBorder( bool join );
// Paragraph background
- QColor backgroundColor() { return m_layout.backgroundColor; }
- void setBackgroundColor( const QColor& color);
+ TQColor backgroundColor() { return m_layout.backgroundColor; }
+ void setBackgroundColor( const TQColor& color);
// Counters are used to implement list and heading numbering/bullets.
void setCounter( const KoParagCounter & counter );
@@ -301,25 +301,25 @@ public:
* Returns the index in the paragraph */
int findCustomItem( const KoTextCustomItem * custom ) const;
- /** Cache to find a tab by char index, QMap<char index, tab index> */
- QMap<int, int>& tabCache() { return m_tabCache; }
+ /** Cache to find a tab by char index, TQMap<char index, tab index> */
+ TQMap<int, int>& tabCache() { return m_tabCache; }
/** @return the parag rect, in pixels. This takes care of some rounding problems */
- QRect pixelRect( KoTextZoomHandler* zh ) const;
+ TQRect pixelRect( KoTextZoomHandler* zh ) const;
/** draw underline and double underline. Static because it's used
* for draw double/simple in variable.
*/
- static void drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, QFont font, const QColor & color, int startX, int baseLine, int bw, int y, int h, QChar firstChar );
+ static void drawFontEffects( TQPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, TQFont font, const TQColor & color, int startX, int baseLine, int bw, int y, int h, TQChar firstChar );
/** a bit more clever than KoTextString::toString, e.g. with numbered lists */
- QString toString( int from = 0, int length = 0xffffffff) const;
+ TQString toString( int from = 0, int length = 0xffffffff) const;
/// The app should call this during formatting - e.g. in formatVertically
void fixParagWidth( bool viewFormattingChars );
/// Load from XML
- virtual void loadOasis( const QDomElement& e, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos );
+ virtual void loadOasis( const TQDomElement& e, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos );
/// Save to XML
/// By default the whole paragraph is saved. from/to allow to save only a portion of it.
/// The 'from' and 'to' characters are both included.
@@ -328,20 +328,20 @@ public:
/**
* Load a section of text from a oasis based xml tree.
- * @param parent the xml element that has content as children.
+ * @param tqparent the xml element that has content as tqchildren.
* @param context the context
* @param stripLeadingSpace whether to remove leading literal whitespace
*/
- void loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace = false );
+ void loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace = false );
/**
* Load a section of text from a oasis based xml tree.
- * @param parent the xml element that has content as children.
+ * @param tqparent the xml element that has content as tqchildren.
* @param context the context
* @param stripLeadingSpace whether to remove leading literal whitespace
* @param hasTrailingSpace whether there was trailing literal whitespace in the span's text
*/
- void loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace );
+ void loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace );
void applyListStyle( KoOasisContext& context, int restartNumbering, bool orderedList, bool heading, int level );
@@ -350,20 +350,20 @@ public:
#endif
protected:
- void invalidateCounters();
+ void tqinvalidateCounters();
bool lineHyphenated( int l ) const;
- void paintLines( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+ void paintLines( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph );
- void drawParagString( QPainter &painter, const QString &str, int start, int len, int startX,
+ void drawParagString( TQPainter &painter, const TQString &str, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line );
- void drawParagStringInternal( QPainter &painter, const QString &s, int start, int len, int startX,
+ KoTextFormat *lastFormat, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line );
+ void drawParagStringInternal( TQPainter &painter, const TQString &s, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow );
+ KoTextFormat *lastFormat, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow );
/// Bitfield for drawFormattingChars's "whichFormattingChars" param
enum { FormattingSpace = 1, FormattingBreak = 2, FormattingEndParag = 4, FormattingTabs = 8,
@@ -373,17 +373,17 @@ protected:
/// kotextdocument drawingflag for it was set.
/// The last arg is a bit special: drawParagStringInternal always sets it to "all",
/// but reimplementations can change its value.
- virtual void drawFormattingChars( QPainter &painter, int start, int len,
+ virtual void drawFormattingChars( TQPainter &painter, int start, int len,
int lastY_pix, int baseLine_pix, int h_pix, // in pixels
bool drawSelections,
- KoTextFormat *format, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg,
+ KoTextFormat *format, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg,
bool rightToLeft, int line, KoTextZoomHandler* zh,
int whichFormattingChars );
protected:
KoParagLayout m_layout;
- QMap<int, int> m_tabCache;
+ TQMap<int, int> m_tabCache;
private:
KoParagLayout loadParagLayout( KoOasisContext& context, KoStyleCollection *styleCollection, bool findStyle );
@@ -392,13 +392,13 @@ private:
/////// End of kotext-specific additions
private:
- QMap<int, KoTextParagSelection> &selections() const;
- QPtrList<KoTextCustomItem> &floatingItems() const;
+ TQMap<int, KoTextParagSelection> &selections() const;
+ TQPtrList<KoTextCustomItem> &floatingItems() const;
/// Returns the height of the biggest character in that line
int heightForLineSpacing( int startChar, int lastChar ) const;
- QMap<int, KoTextParagLineStart*> lineStarts;
- QRect r;
+ TQMap<int, KoTextParagLineStart*> lineStarts;
+ TQRect r;
KoTextParag *p, *n;
KoTextDocument *doc;
bool m_invalid : 1;
@@ -413,17 +413,17 @@ private:
int id;
int m_wused;
KoTextString *str;
- QMap<int, KoTextParagSelection> *mSelections;
- QPtrList<KoTextCustomItem> *mFloatingItems;
+ TQMap<int, KoTextParagSelection> *mSelections;
+ TQPtrList<KoTextCustomItem> *mFloatingItems;
KoTextFormat *defFormat; // is this really used?
int *tArray;
- // Those things are used by QRT for the case of a paragraph without document
+ // Those things are used by TQRT for the case of a paragraph without document
// We don't use this currently, and it's not worth making EVERY parag bigger
// just for a special case that's rarely used. Better have lightweight KoTextDocument
// replacement (with common base class), if we ever want efficient single-parag docs...
//int tabStopWidth;
- //QRect docRect;
+ //TQRect docRect;
//KoTextFormatterBase *pFormatter;
//KoTextDocCommandHistory *commandHistory;
};
@@ -433,7 +433,7 @@ inline int KoTextParag::length() const
return str->length();
}
-inline QRect KoTextParag::rect() const
+inline TQRect KoTextParag::rect() const
{
return r;
}
@@ -458,12 +458,12 @@ inline short int KoTextParag::lineChanged()
return m_lineChanged;
}
-inline void KoTextParag::append( const QString &s, bool reallyAtEnd )
+inline void KoTextParag::append( const TQString &s, bool reallyAtEnd )
{
if ( reallyAtEnd )
insert( str->length(), s );
else
- insert( QMAX( str->length() - 1, 0 ), s );
+ insert( TQMAX( str->length() - 1, 0 ), s );
}
inline KoTextParag *KoTextParag::prev() const
@@ -505,7 +505,7 @@ inline int KoTextParag::paragId() const
return id;
}
-inline QMap<int, KoTextParagLineStart*> &KoTextParag::lineStartList()
+inline TQMap<int, KoTextParagLineStart*> &KoTextParag::lineStartList()
{
return lineStarts;
}
@@ -520,21 +520,21 @@ inline KoTextDocument *KoTextParag::document() const
return doc;
}
-inline void KoTextParag::setAlignment( uint a )
+inline void KoTextParag::tqsetAlignment( uint a )
{
if ( a == align )
return;
align = a;
- invalidate( 0 );
+ tqinvalidate( 0 );
}
-/*inline void KoTextParag::setListStyle( QStyleSheetItem::ListStyle ls )
+/*inline void KoTextParag::setListStyle( TQStyleSheetItem::ListStyle ls )
{
lstyle = ls;
- invalidate( 0 );
+ tqinvalidate( 0 );
}
-inline QStyleSheetItem::ListStyle KoTextParag::listStyle() const
+inline TQStyleSheetItem::ListStyle KoTextParag::listStyle() const
{
return lstyle;
}*/
diff --git a/lib/kotext/KoTextView.cpp b/lib/kotext/KoTextView.cpp
index c5edcf61..68df4992 100644
--- a/lib/kotext/KoTextView.cpp
+++ b/lib/kotext/KoTextView.cpp
@@ -39,9 +39,9 @@
#include <kbookmark.h>
#include <kurldrag.h>
-#include <qapplication.h>
-#include <qtimer.h>
-#include <qclipboard.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
+#include <tqclipboard.h>
class KoTextView::KoTextViewPrivate
{
@@ -68,27 +68,27 @@ KoTextView::KoTextView( KoTextObject *textobj )
m_bReadWrite = true;
m_textobj = textobj;
dcop=0;
- connect( m_textobj, SIGNAL( hideCursor() ), this, SLOT( hideCursor() ) );
- connect( m_textobj, SIGNAL( showCursor() ), this, SLOT( showCursor() ) );
- connect( m_textobj, SIGNAL( setCursor( KoTextCursor * ) ), this, SLOT( setCursor( KoTextCursor * ) ) );
- connect( m_textobj, SIGNAL( updateUI(bool, bool) ), this, SLOT( updateUI(bool, bool) ) );
- connect( m_textobj, SIGNAL( showCurrentFormat() ), this, SLOT( showCurrentFormat() ) );
- connect( m_textobj, SIGNAL( ensureCursorVisible() ), this, SLOT( ensureCursorVisible() ) );
+ connect( m_textobj, TQT_SIGNAL( hideCursor() ), this, TQT_SLOT( hideCursor() ) );
+ connect( m_textobj, TQT_SIGNAL( showCursor() ), this, TQT_SLOT( showCursor() ) );
+ connect( m_textobj, TQT_SIGNAL( setCursor( KoTextCursor * ) ), this, TQT_SLOT( setCursor( KoTextCursor * ) ) );
+ connect( m_textobj, TQT_SIGNAL( updateUI(bool, bool) ), this, TQT_SLOT( updateUI(bool, bool) ) );
+ connect( m_textobj, TQT_SIGNAL( showCurrentFormat() ), this, TQT_SLOT( showCurrentFormat() ) );
+ connect( m_textobj, TQT_SIGNAL( ensureCursorVisible() ), this, TQT_SLOT( ensureCursorVisible() ) );
m_cursor = new KoTextCursor( m_textobj->textDocument() );
m_cursorVisible = false;
showCursor();
- blinkTimer = new QTimer( this );
- connect( blinkTimer, SIGNAL( timeout() ),
- this, SLOT( blinkCursor() ) );
- if ( QApplication::cursorFlashTime() > 0 )
- blinkTimer->start( QApplication::cursorFlashTime() / 2 );
+ blinkTimer = new TQTimer( this );
+ connect( blinkTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( blinkCursor() ) );
+ if ( TQApplication::cursorFlashTime() > 0 )
+ blinkTimer->start( TQApplication::cursorFlashTime() / 2 );
- dragStartTimer = new QTimer( this );
- connect( dragStartTimer, SIGNAL( timeout() ),
- this, SLOT( startDrag() ) );
+ dragStartTimer = new TQTimer( this );
+ connect( dragStartTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( startDrag() ) );
m_textobj->formatMore( 2 );
@@ -160,8 +160,8 @@ void KoTextView::deleteWordLeft()
textObject()->removeSelectedText( m_cursor, KoTextDocument::Standard, i18n("Remove Word") );
}
-// Compare with QTextEdit::keyPressEvent
-void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoint &pos)
+// Compare with TQTextEdit::keyPressEvent
+void KoTextView::handleKeyPressEvent( TQKeyEvent * e, TQWidget *widget, const TQPoint &pos)
{
textObject()->typingStarted();
@@ -275,24 +275,24 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
emit cut();
break;
case Key_Direction_L: {
- if ( m_cursor->parag() && m_cursor->parag()->direction() != QChar::DirL )
+ if ( m_cursor->parag() && m_cursor->parag()->direction() != TQChar::DirL )
{
- KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, QChar::DirL );
+ KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, TQChar::DirL );
textObject()->emitNewCommand( cmd );
}
break;
}
case Key_Direction_R: {
- if ( m_cursor->parag() && m_cursor->parag()->direction() != QChar::DirR )
+ if ( m_cursor->parag() && m_cursor->parag()->direction() != TQChar::DirR )
{
- KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, QChar::DirR );
+ KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, TQChar::DirR );
textObject()->emitNewCommand( cmd );
}
break;
}
default: {
- //kdDebug(32500) << "KoTextView::keyPressEvent ascii=" << e->ascii() << " text=" << e->text()[0].unicode() << " state=" << e->state() << endl;
- if (e->key() == Qt::Key_Tab)
+ //kdDebug(32500) << "KoTextView::keyPressEvent ascii=" << e->ascii() << " text=" << e->text()[0].tqunicode() << " state=" << e->state() << endl;
+ if (e->key() == TQt::Key_Tab)
{
if (doToolTipCompletion(m_cursor, m_cursor->parag(), m_cursor->index() - 1, e->key()) )
break;
@@ -303,7 +303,7 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
}
}
- if ( e->key() == Qt::Key_Space )
+ if ( e->key() == TQt::Key_Space )
{
if (doToolTipCompletion(m_cursor, m_cursor->parag(), m_cursor->index() - 1, e->key()) )
break;
@@ -312,7 +312,7 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
( !e->ascii() || e->ascii() >= 32 ) ||
( e->text() == "\t" && !( e->state() & ControlButton ) ) ) {
clearUndoRedoInfo = FALSE;
- QString text = e->text();
+ TQString text = e->text();
if ( d->m_backSpeller ) {
d->m_backSpeller->setIntraWordEditing( m_cursor->parag(), m_cursor->index() );
@@ -328,10 +328,10 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
}
if ( !text.isEmpty() )
{
- // Bidi support: need to reverse mirrored chars (e.g. parenthesis)
+ // Bidi support: need to reverse mirrored chars (e.g. tqparenthesis)
KoTextParag *p = m_cursor->parag();
if ( p && p->string() && p->string()->isRightToLeft() ) {
- QChar *c = (QChar *)text.unicode();
+ TQChar *c = (TQChar *)text.tqunicode();
int l = text.length();
while( l-- ) {
if ( c->mirrored() )
@@ -409,7 +409,7 @@ void KoTextView::setOverwriteMode( bool overwriteMode )
m_overwriteMode = overwriteMode;
}
-void KoTextView::insertText( const QString &text )
+void KoTextView::insertText( const TQString &text )
{
int insertFlags = KoTextObject::DefaultInsertFlags;
if ( m_overwriteMode )
@@ -422,11 +422,11 @@ void KoTextView::newParagraph()
textObject()->insert( m_cursor, m_currentFormat, "\n", i18n("Insert Text"), KoTextDocument::Standard, KoTextObject::CheckNewLine );
}
-void KoTextView::handleKeyReleaseEvent( QKeyEvent * e )
+void KoTextView::handleKeyReleaseEvent( TQKeyEvent * e )
{
if ( e->key() == Key_Alt && d->currentUnicodeNumber() >= 32 )
{
- QString text = QChar( d->currentUnicodeNumber() );
+ TQString text = TQChar( d->currentUnicodeNumber() );
d->clearCurrentUnicodeNumber();
insertText( text );
doAutoFormat( m_cursor, m_cursor->parag(),
@@ -434,12 +434,12 @@ void KoTextView::handleKeyReleaseEvent( QKeyEvent * e )
}
}
-void KoTextView::handleImStartEvent( QIMEvent * )
+void KoTextView::handleImStartEvent( TQIMEvent * )
{
// nothing to do
}
-void KoTextView::handleImComposeEvent( QIMEvent * e )
+void KoTextView::handleImComposeEvent( TQIMEvent * e )
{
// remove old preedit
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
@@ -471,7 +471,7 @@ void KoTextView::handleImComposeEvent( QIMEvent * e )
textObject()->selectionChangedNotify();
}
-void KoTextView::handleImEndEvent( QIMEvent * e )
+void KoTextView::handleImEndEvent( TQIMEvent * e )
{
// remove old preedit
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
@@ -605,13 +605,13 @@ KoTextCursor KoTextView::selectWordUnderCursor( const KoTextCursor& cursor, int
bool beginFound = false;
for ( int i = c1.index(); i< c2.index(); i++)
{
- const QChar ch = s->at(i).c;
+ const TQChar ch = s->at(i).c;
// This list comes from KoTextCursor::gotoPreviousWord.
- // Can't use QChar::isPunct since "'" and "-" are not word separators
+ // Can't use TQChar::isPunct since "'" and "-" are not word separators
const bool isWordDelimiter = ch.isSpace()
- || ch.category() == QChar::Punctuation_Open // e.g. '('
- || ch.category() == QChar::Punctuation_Close // e.g. ')'
- || ch.category() == QChar::Punctuation_Other // see http://www.fileformat.info/info/unicode/category/Po/list.htm
+ || ch.category() == TQChar::Punctuation_Open // e.g. '('
+ || ch.category() == TQChar::Punctuation_Close // e.g. ')'
+ || ch.category() == TQChar::Punctuation_Other // see http://www.fileformat.info/info/tqunicode/category/Po/list.htm
;
if( !beginFound && !isWordDelimiter )
@@ -643,14 +643,14 @@ KoTextCursor KoTextView::selectParagUnderCursor( const KoTextCursor& cursor, int
{
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
}
return c2;
}
-void KoTextView::extendParagraphSelection( const QPoint& iPoint )
+void KoTextView::extendParagraphSelection( const TQPoint& iPoint )
{
hideCursor();
KoTextCursor oldCursor = *m_cursor;
@@ -675,18 +675,18 @@ void KoTextView::extendParagraphSelection( const QPoint& iPoint )
showCursor();
}
-QString KoTextView::wordUnderCursor( const KoTextCursor& cursor )
+TQString KoTextView::wordUnderCursor( const KoTextCursor& cursor )
{
selectWordUnderCursor( cursor, KoTextDocument::Temp );
- QString text = textObject()->selectedText( KoTextDocument::Temp );
+ TQString text = textObject()->selectedText( KoTextDocument::Temp );
bool hasCustomItems = textObject()->selectionHasCustomItems( KoTextDocument::Temp );
textDocument()->removeSelection( KoTextDocument::Temp );
if( !hasCustomItems )
return text;
- return QString::null;
+ return TQString();
}
-bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bool canStartDrag, bool insertDirectCursor )
+bool KoTextView::handleMousePressEvent( TQMouseEvent *e, const TQPoint &iPoint, bool canStartDrag, bool insertDirectCursor )
{
bool addParag = false;
mightStartDrag = FALSE;
@@ -702,7 +702,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
addParag = placeCursor( iPoint, insertDirectCursor&& isReadWrite() );
ensureCursorVisible();
- if ( e->button() != LeftButton )
+ if ( e->button() != Qt::LeftButton )
{
showCursor();
return addParag;
@@ -718,7 +718,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
if ( canStartDrag && textdoc->inSelection( KoTextDocument::Standard, iPoint ) ) {
mightStartDrag = TRUE;
m_textobj->emitShowCursor();
- dragStartTimer->start( QApplication::startDragTime(), TRUE );
+ dragStartTimer->start( TQApplication::startDragTime(), TRUE );
dragStartPos = e->pos();
return addParag;
}
@@ -749,7 +749,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
return addParag;
}
-void KoTextView::handleMouseMoveEvent( QMouseEvent*, const QPoint& iPoint )
+void KoTextView::handleMouseMoveEvent( TQMouseEvent*, const TQPoint& iPoint )
{
hideCursor();
KoTextCursor oldCursor = *m_cursor;
@@ -762,9 +762,9 @@ void KoTextView::handleMouseMoveEvent( QMouseEvent*, const QPoint& iPoint )
KoTextCursor cr = *m_cursor;
cr.gotoWordRight();
- int diff = QABS( oldCursor.parag()->at( oldCursor.index() )->x - iPoint.x() );
- int ldiff = QABS( cl.parag()->at( cl.index() )->x - iPoint.x() );
- int rdiff = QABS( cr.parag()->at( cr.index() )->x - iPoint.x() );
+ int diff = TQABS( oldCursor.parag()->at( oldCursor.index() )->x - iPoint.x() );
+ int ldiff = TQABS( cl.parag()->at( cl.index() )->x - iPoint.x() );
+ int rdiff = TQABS( cr.parag()->at( cr.index() )->x - iPoint.x() );
if ( m_cursor->parag()->lineStartOfChar( m_cursor->index() ) !=
oldCursor.parag()->lineStartOfChar( oldCursor.index() ) )
@@ -808,16 +808,16 @@ void KoTextView::handleMouseReleaseEvent()
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
}
inDoubleClick = FALSE;
m_textobj->emitShowCursor();
}
-void KoTextView::handleMouseDoubleClickEvent( QMouseEvent*ev, const QPoint& i )
+void KoTextView::handleMouseDoubleClickEvent( TQMouseEvent*ev, const TQPoint& i )
{
//after a triple click it's not a double click but a simple click
//but as triple click didn't exist it's necessary to do it.
@@ -831,13 +831,13 @@ void KoTextView::handleMouseDoubleClickEvent( QMouseEvent*ev, const QPoint& i )
*m_cursor = selectWordUnderCursor( *m_cursor );
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
possibleTripleClick=true;
- QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(tripleClickTimeout()));
+ TQTimer::singleShot(TQApplication::doubleClickInterval(),this,TQT_SLOT(tripleClickTimeout()));
}
void KoTextView::tripleClickTimeout()
@@ -845,9 +845,9 @@ void KoTextView::tripleClickTimeout()
possibleTripleClick=false;
}
-void KoTextView::handleMouseTripleClickEvent( QMouseEvent*ev, const QPoint& /* Currently unused */ )
+void KoTextView::handleMouseTripleClickEvent( TQMouseEvent*ev, const TQPoint& /* Currently unused */ )
{
- if ( ev->button() != LeftButton)
+ if ( ev->button() != Qt::LeftButton)
{
showCursor();
return;
@@ -855,7 +855,7 @@ void KoTextView::handleMouseTripleClickEvent( QMouseEvent*ev, const QPoint& /* C
afterTripleClick= true;
inDoubleClick = FALSE;
*m_cursor = selectParagUnderCursor( *m_cursor );
- QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(afterTripleClickTimeout()));
+ TQTimer::singleShot(TQApplication::doubleClickInterval(),this,TQT_SLOT(afterTripleClickTimeout()));
}
void KoTextView::afterTripleClickTimeout()
@@ -863,18 +863,18 @@ void KoTextView::afterTripleClickTimeout()
afterTripleClick=false;
}
-bool KoTextView::maybeStartDrag( QMouseEvent* e )
+bool KoTextView::maybeStartDrag( TQMouseEvent* e )
{
if ( mightStartDrag ) {
dragStartTimer->stop();
- if ( ( e->pos() - dragStartPos ).manhattanLength() > QApplication::startDragDistance() )
+ if ( ( e->pos() - dragStartPos ).manhattanLength() > TQApplication::startDragDistance() )
startDrag();
return true;
}
return false;
}
-bool KoTextView::insertParagraph(const QPoint &pos)
+bool KoTextView::insertParagraph(const TQPoint &pos)
{
KoTextParag *last = textDocument()->lastParag();
KoTextFormat *f = 0;
@@ -884,7 +884,7 @@ bool KoTextView::insertParagraph(const QPoint &pos)
f = last->at( last->length()-1 )->format();
int height =f->height();
int nbParag = (diff / height);
- QFontMetrics fm = f->refFontMetrics();
+ TQFontMetrics fm = f->refFontMetrics();
for (int i = 0; i < nbParag ;i++)
{
KoTextParag *s=textDocument()->createParag( textDocument(), last );
@@ -900,13 +900,13 @@ bool KoTextView::insertParagraph(const QPoint &pos)
if ( pos.x() + f->width(' ') >= textDocument()->width())
{
//FIXME me bidi.
- //change parag alignment => right alignment
- last->setAlignment( Qt::AlignRight );
+ //change parag tqalignment => right tqalignment
+ last->tqsetAlignment( TQt::AlignRight );
}
else
{
int nbSpace = pos.x()/f->width(' ');
- QString tmp;
+ TQString tmp;
for (int i = 0; i< nbSpace; i++)
{
tmp+=' ';
@@ -918,7 +918,7 @@ bool KoTextView::insertParagraph(const QPoint &pos)
}
-bool KoTextView::placeCursor( const QPoint &pos, bool insertDirectCursor )
+bool KoTextView::placeCursor( const TQPoint &pos, bool insertDirectCursor )
{
bool addParag = false;
if ( insertDirectCursor && (pos.y()>textDocument()->height()) )
@@ -955,8 +955,8 @@ void KoTextView::drawCursor( bool visible )
void KoTextView::focusInEvent()
{
- if ( QApplication::cursorFlashTime() > 0 )
- blinkTimer->start( QApplication::cursorFlashTime() / 2 );
+ if ( TQApplication::cursorFlashTime() > 0 )
+ blinkTimer->start( TQApplication::cursorFlashTime() / 2 );
showCursor();
}
@@ -1056,7 +1056,7 @@ KCommand * KoTextView::setJoinBordersCommand( bool join )
{
return textObject()->setJoinBordersCommand( m_cursor, join );
}
-KCommand * KoTextView::setMarginCommand( QStyleSheetItem::Margin m, double margin )
+KCommand * KoTextView::setMarginCommand( TQStyleSheetItem::Margin m, double margin )
{
return textObject()->setMarginCommand( m_cursor, m, margin );
}
@@ -1064,7 +1064,7 @@ KCommand * KoTextView::setTabListCommand( const KoTabulatorList & tabList )
{
return textObject()->setTabListCommand( m_cursor, tabList );
}
-KCommand * KoTextView::setBackgroundColorCommand( const QColor & color )
+KCommand * KoTextView::setBackgroundColorCommand( const TQColor & color )
{
return textObject()->setBackgroundColorCommand( m_cursor, color );
}
@@ -1087,15 +1087,15 @@ KoLinkVariable * KoTextView::linkVariable()
return dynamic_cast<KoLinkVariable *>(variable());
}
-QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QString& word, bool & _singleWord )
+TQPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const TQString& word, bool & _singleWord )
{
m_singleWord = false;
- m_wordUnderCursor = QString::null;
- QString text;
+ m_wordUnderCursor = TQString();
+ TQString text;
if ( textObject()->hasSelection() )
{
text = textObject()->selectedText();
- if ( text.find(' ') == -1 && text.find('\t') == -1 && text.find(KoTextObject::customItemChar()) == -1 )
+ if ( text.tqfind(' ') == -1 && text.tqfind('\t') == -1 && text.tqfind(KoTextObject::customItemChar()) == -1 )
{
m_singleWord = true;
}
@@ -1103,8 +1103,8 @@ QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QSt
{
m_singleWord = false;
//laurent : don't try to search thesaurus when we have a customItemChar.
- if( text.find(KoTextObject::customItemChar())!=-1)
- text = QString::null;
+ if( text.tqfind(KoTextObject::customItemChar())!=-1)
+ text = TQString();
}
}
else // No selection -> use word under cursor
@@ -1118,25 +1118,25 @@ QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QSt
}
if ( text.isEmpty() || textObject()->protectContent()) // Nothing to apply a tool to
- return QPtrList<KAction>();
+ return TQPtrList<KAction>();
// Any tool that works on plain text is relevant
- QValueList<KDataToolInfo> tools;
- tools +=KDataToolInfo::query( "QString", "text/plain", instance );
+ TQValueList<KDataToolInfo> tools;
+ tools +=KDataToolInfo::query( TQSTRING_OBJECT_NAME_STRING, "text/plain", instance );
// Add tools that work on a single word if that is the case
if ( m_singleWord )
{
_singleWord = true;
- tools += KDataToolInfo::query( "QString", "application/x-singleword", instance );
+ tools += KDataToolInfo::query( TQSTRING_OBJECT_NAME_STRING, "application/x-singleword", instance );
}
// Maybe one day we'll have tools that use libkotext (or qt3's qrt), to act on formatted text
tools += KDataToolInfo::query( "KoTextString", "application/x-qrichtext", instance );
- return KDataToolAction::dataToolActionList( tools, this, SLOT( slotToolActivated( const KDataToolInfo &, const QString & ) ) );
+ return KDataToolAction::dataToolActionList( tools, this, TQT_SLOT( slotToolActivated( const KDataToolInfo &, const TQString & ) ) );
}
-QString KoTextView::currentWordOrSelection() const
+TQString KoTextView::currentWordOrSelection() const
{
if ( textObject()->hasSelection() )
return textObject()->selectedText();
@@ -1144,7 +1144,7 @@ QString KoTextView::currentWordOrSelection() const
return m_wordUnderCursor;
}
-void KoTextView::slotToolActivated( const KDataToolInfo & info, const QString & command )
+void KoTextView::slotToolActivated( const KDataToolInfo & info, const TQString & command )
{
KDataTool* tool = info.createTool( );
if ( !tool )
@@ -1156,28 +1156,28 @@ void KoTextView::slotToolActivated( const KDataToolInfo & info, const QString &
kdDebug(32500) << "KWTextFrameSetEdit::slotToolActivated command=" << command
<< " dataType=" << info.dataType() << endl;
- QString text;
+ TQString text;
if ( textObject()->hasSelection() )
text = textObject()->selectedText();
else
text = m_wordUnderCursor;
// Preferred type is richtext
- QString mimetype = "application/x-qrichtext";
- QString datatype = "KoTextString";
+ TQString mimetype = "application/x-qrichtext";
+ TQString datatype = "KoTextString";
// If unsupported, try text/plain
- if ( !info.mimeTypes().contains( mimetype ) )
+ if ( !info.mimeTypes().tqcontains( mimetype ) )
{
mimetype = "text/plain";
- datatype = "QString";
+ datatype = TQSTRING_OBJECT_NAME_STRING;
}
// If unsupported (and if we have a single word indeed), try application/x-singleword
- if ( !info.mimeTypes().contains( mimetype ) && m_singleWord )
+ if ( !info.mimeTypes().tqcontains( mimetype ) && m_singleWord )
mimetype = "application/x-singleword";
kdDebug(32500) << "Running tool with datatype=" << datatype << " mimetype=" << mimetype << endl;
- QString origText = text;
+ TQString origText = text;
if ( tool->run( command, &text, datatype, mimetype) )
{
kdDebug(32500) << "Tool ran. Text is now " << text << endl;
@@ -1207,7 +1207,7 @@ bool KoTextView::openLink( KoLinkVariable* variable )
}
else
{
- KMessageBox::sorry( 0, i18n("%1 is not a valid link.").arg( variable->url() ) );
+ KMessageBox::sorry( 0, i18n("%1 is not a valid link.").tqarg( variable->url() ) );
return false;
}
}
@@ -1215,29 +1215,29 @@ bool KoTextView::openLink( KoLinkVariable* variable )
void KoTextView::insertSoftHyphen()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0xad) /* see QRichText */,
+ textObject()->insert( cursor(), currentFormat(), TQChar(0xad) /* see TQRichText */,
i18n("Insert Soft Hyphen") );
}
void KoTextView::insertLineBreak()
{
- textObject()->insert( cursor(), currentFormat(), QChar('\n'),
+ textObject()->insert( cursor(), currentFormat(), TQChar('\n'),
i18n("Insert Line Break") );
}
void KoTextView::insertNonbreakingSpace()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0xa0) /* see QRichText */,
+ textObject()->insert( cursor(), currentFormat(), TQChar(0xa0) /* see TQRichText */,
i18n("Insert Non-Breaking Space") );
}
void KoTextView::insertNonbreakingHyphen()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0x2013),
+ textObject()->insert( cursor(), currentFormat(), TQChar(0x2013),
i18n("Insert Non-Breaking Hyphen") );
}
-void KoTextView::insertSpecialChar(QChar _c, const QString& font)
+void KoTextView::insertSpecialChar(TQChar _c, const TQString& font)
{
KoTextFormat * newFormat = new KoTextFormat(*currentFormat());
newFormat->setFamily( font );
@@ -1250,7 +1250,7 @@ void KoTextView::insertSpecialChar(QChar _c, const QString& font)
KMacroCommand* macroCmd = new KMacroCommand( i18n("Insert Special Char") );
macroCmd->addCommand( cmd );
macroCmd->addCommand( textObject()->replaceSelectionCommand(
- cursor(), _c, QString::null) );
+ cursor(), _c, TQString()) );
textObject()->emitNewCommand( macroCmd );
}
else
@@ -1288,7 +1288,7 @@ void KoTextView::increaseNumberingLevel( const KoStyleCollection* styleCollectio
level = counter->depth() + 1;
if ( m_cursor->parag()->style()->isOutline() )
{
- QValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
+ TQValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
while ( level < 10 && !style ) {
style = outlineStyles[ level ];
++level;
@@ -1332,7 +1332,7 @@ void KoTextView::decreaseNumberingLevel( const KoStyleCollection* styleCollectio
{
if ( level == -1 ) // nothing higher than Heading1
return;
- QValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
+ TQValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
while ( level >= 0 && !style ) {
style = outlineStyles[ level ];
--level;
@@ -1362,7 +1362,7 @@ void KoTextView::decreaseNumberingLevel( const KoStyleCollection* styleCollectio
KCommand *KoTextView::setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type)
{
- QString text;
+ TQString text;
if ( textObject()->hasSelection() )
text = textObject()->selectedText();
if(!text.isEmpty())
@@ -1429,7 +1429,7 @@ KCommand *KoTextView::prepareDropMove( KoTextCursor dropCursor )
int dropIndex = dropCursor.index();
dropCursor.setParag( startSel.parag() );
// If dropCursor - endSel < 0, selection ends after, we're dropping into selection (no-op)
- dropCursor.setIndex( dropIndex - QMIN( endSel.index(), dropIndex ) + startSel.index() );
+ dropCursor.setIndex( dropIndex - TQMIN( endSel.index(), dropIndex ) + startSel.index() );
}
kdDebug(32500) << "dropCursor: parag=" << dropCursor.parag()->paragId() << " index=" << dropCursor.index() << endl;
}
@@ -1450,10 +1450,10 @@ void KoTextView::copyTextOfComment()
{
KURL::List lst;
lst.append( var->note() );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(true);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(false);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
}
}
@@ -1470,19 +1470,19 @@ void KoTextView::removeComment()
}
}
-KoParagStyle * KoTextView::createStyleFromSelection(const QString & name)
+KoParagStyle * KoTextView::createStyleFromSelection(const TQString & name)
{
KoTextCursor cursor = *m_cursor;
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
cursor = textDocument()->selectionStartCursor( KoTextDocument::Standard );
KoParagStyle * style = new KoParagStyle (name);
- KoParagLayout layout(cursor.parag()->paragLayout());
- layout.style = style;
+ KoParagLayout tqlayout(cursor.parag()->paragLayout());
+ tqlayout.style = style;
style->setFollowingStyle( style );
style->format() = *(cursor.parag()->at(cursor.index())->format());
- style->paragLayout() = layout;
- // Select this new style - hmm only the parag layout, we don't want to erase any text-formatting
+ style->paragLayout() = tqlayout;
+ // Select this new style - hmm only the parag tqlayout, we don't want to erase any text-formatting
cursor.parag()->setParagLayout( style->paragLayout() );
return style;
}
@@ -1498,9 +1498,9 @@ void KoTextView::updateStyleFromSelection( KoParagStyle* style )
style->format() = *(cursor.parag()->at(cursor.index())->format());
}
-void KoTextView::addBookmarks(const QString &url)
+void KoTextView::addBookmarks(const TQString &url)
{
- QString filename = locateLocal( "data", QString::fromLatin1("konqueror/bookmarks.xml") );
+ TQString filename = locateLocal( "data", TQString::tqfromLatin1("konqueror/bookmarks.xml") );
KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename,false );
KBookmarkGroup group = bookManager->root();
group.addBookmark( bookManager, url, KURL( url));
@@ -1515,10 +1515,10 @@ void KoTextView::copyLink()
{
KURL::List lst;
lst.append( var->url() );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(true);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(false);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
}
}
diff --git a/lib/kotext/KoTextView.h b/lib/kotext/KoTextView.h
index 51da4fb2..f094053d 100644
--- a/lib/kotext/KoTextView.h
+++ b/lib/kotext/KoTextView.h
@@ -20,10 +20,10 @@
#ifndef kotextview_h
#define kotextview_h
-#include <qobject.h>
-#include <qpoint.h>
-#include <qcolor.h>
-#include <qfont.h>
+#include <tqobject.h>
+#include <tqpoint.h>
+#include <tqcolor.h>
+#include <tqfont.h>
#include <KoRuler.h> // for KoTabulatorList
#include <KoTextObject.h> // for KoTextView
#include <koffice_export.h>
@@ -34,7 +34,7 @@ class KoTextParag;
class KoTextFormat;
class KoParagCounter;
class KCommand;
-class QTimer;
+class TQTimer;
class KAction;
class KInstance;
class KDataToolInfo;
@@ -50,9 +50,10 @@ class KoParagStyle;
* It handles all the events for it (mouse, keyboard).
* There can be several KoTextView instances for the same KoTextObject.
*/
-class KOTEXT_EXPORT KoTextView : public QObject, public KoTextFormatInterface
+class KOTEXT_EXPORT KoTextView : public TQObject, public KoTextFormatInterface
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor. A KoTextView is associated to a KoTextObject.
@@ -104,36 +105,36 @@ public:
KCommand * setLineSpacingCommand( double spacing, KoParagLayout::SpacingType _type );
KCommand * setBordersCommand( const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& bottomBorder, const KoBorder& topBorder );
KCommand * setJoinBordersCommand( bool join );
- KCommand * setMarginCommand( QStyleSheetItem::Margin m, double margin );
+ KCommand * setMarginCommand( TQStyleSheetItem::Margin m, double margin );
KCommand * setTabListCommand( const KoTabulatorList & tabList );
- KCommand * setBackgroundColorCommand( const QColor & color );
+ KCommand * setBackgroundColorCommand( const TQColor & color );
void applyStyle( const KoParagStyle * style );
void dragStarted();
void focusInEvent();
void focusOutEvent();
- void handleKeyPressEvent( QKeyEvent * e, QWidget *, const QPoint& );
- void handleKeyReleaseEvent( QKeyEvent * e );
- void handleImStartEvent( QIMEvent * e );
- void handleImComposeEvent( QIMEvent * e );
- void handleImEndEvent( QIMEvent * e );
+ void handleKeyPressEvent( TQKeyEvent * e, TQWidget *, const TQPoint& );
+ void handleKeyReleaseEvent( TQKeyEvent * e );
+ void handleImStartEvent( TQIMEvent * e );
+ void handleImComposeEvent( TQIMEvent * e );
+ void handleImEndEvent( TQIMEvent * e );
// iPoint is in Layout Unit pixels
// return true if we add new parag with "insert direct cursor"
- bool handleMousePressEvent( QMouseEvent* e, const QPoint& iPoint, bool canStartDrag = true, bool insertDirectCursor = false );
- void handleMouseMoveEvent( QMouseEvent* e, const QPoint& iPoint );
+ bool handleMousePressEvent( TQMouseEvent* e, const TQPoint& iPoint, bool canStartDrag = true, bool insertDirectCursor = false );
+ void handleMouseMoveEvent( TQMouseEvent* e, const TQPoint& iPoint );
void handleMouseReleaseEvent();
- void handleMouseDoubleClickEvent( QMouseEvent* e, const QPoint& iPoint );
- void handleMouseTripleClickEvent( QMouseEvent* e, const QPoint& /* Currently unused */ );
- bool maybeStartDrag( QMouseEvent* e );
+ void handleMouseDoubleClickEvent( TQMouseEvent* e, const TQPoint& iPoint );
+ void handleMouseTripleClickEvent( TQMouseEvent* e, const TQPoint& /* Currently unused */ );
+ bool maybeStartDrag( TQMouseEvent* e );
KoTextCursor selectWordUnderCursor( const KoTextCursor& cursor, int selectionId = KoTextDocument::Standard );
KoTextCursor selectParagUnderCursor( const KoTextCursor& cursor, int selectionId = KoTextDocument::Standard, bool copyAndNotify = true );
- void extendParagraphSelection( const QPoint& iPoint );
+ void extendParagraphSelection( const TQPoint& iPoint );
- QString wordUnderCursor( const KoTextCursor& cursor );
+ TQString wordUnderCursor( const KoTextCursor& cursor );
/** Return the list of actions from data-tools. Used to populate a RMB popupmenu usually. */
- QPtrList<KAction> dataToolActionList( KInstance * instance, const QString& word, bool & _singleWord );
+ TQPtrList<KAction> dataToolActionList( KInstance * instance, const TQString& word, bool & _singleWord );
void insertSoftHyphen();
void insertLineBreak();
@@ -141,10 +142,10 @@ public:
void insertNonbreakingHyphen();
void increaseNumberingLevel( const KoStyleCollection* styleCollection );
void decreaseNumberingLevel( const KoStyleCollection* styleCollection );
- void insertSpecialChar( QChar _c, const QString& font );
+ void insertSpecialChar( TQChar _c, const TQString& font );
void changeCaseOfText( KoChangeCaseDia::TypeOfCase _type );
- void addBookmarks( const QString& );
+ void addBookmarks( const TQString& );
//return a pointer to the variable under the cursor, if any
KoVariable *variable();
@@ -161,15 +162,15 @@ public:
void copyTextOfComment();
// This is in fact "from selection or cursor"
- KoParagStyle * createStyleFromSelection( const QString & name );
+ KoParagStyle * createStyleFromSelection( const TQString & name );
void updateStyleFromSelection( KoParagStyle* style );
- QString currentWordOrSelection() const;
+ TQString currentWordOrSelection() const;
virtual void removeToolTipCompletion() {}
// return true if we "insert direct cursor" and we insert new parag
- bool placeCursor( const QPoint &pos /* in internal coordinates */, bool insertDirectCursor=false );
+ bool placeCursor( const TQPoint &pos /* in internal coordinates */, bool insertDirectCursor=false );
void setOverwriteMode( bool overwriteMode );
public slots:
@@ -185,7 +186,7 @@ public slots:
void showCursor() { drawCursor( true ); }
/** This is a slot so that it's accessible from DCOP */
- void insertText( const QString &text );
+ void insertText( const TQString &text );
void newParagraph();
void copyLink();
@@ -197,7 +198,7 @@ public slots:
protected slots:
/** Start a drag */
virtual void startDrag() = 0;
- void slotToolActivated( const KDataToolInfo & info, const QString & command );
+ void slotToolActivated( const KDataToolInfo & info, const TQString & command );
signals:
void copy();
void cut();
@@ -209,25 +210,25 @@ protected:
* This is a virtual method rather than a signal for performance reasons.
*/
virtual void doAutoFormat( KoTextCursor* /*cursor*/, KoTextParag * /*parag*/,
- int /*index*/, QChar /*ch*/ ) { }
+ int /*index*/, TQChar /*ch*/ ) { }
virtual bool doCompletion( KoTextCursor* , KoTextParag *, int ) { return false; }
virtual bool doToolTipCompletion( KoTextCursor* , KoTextParag *, int, int ) { return false; }
- virtual void showToolTipBox( KoTextParag *, int , QWidget *, const QPoint& ) {}
+ virtual void showToolTipBox( KoTextParag *, int , TQWidget *, const TQPoint& ) {}
virtual void textIncreaseIndent() {}
virtual bool textDecreaseIndent() { return true; }
//return true if we are a doubleSpace
virtual bool doIgnoreDoubleSpace(KoTextParag * /*parag*/,
- int /*index*/,QChar /*ch*/ ) { return false;}
+ int /*index*/,TQChar /*ch*/ ) { return false;}
/** Show the settings of this format in the GUI. Needs to be implemented in the application. */
virtual void showFormat( KoTextFormat *format ) = 0;
/** Draws the cursor (or hides it if b is false).
* The default implementation only changes an internal flag, make sure to reimplement
- * and to call the parent implementation (in all cases)
+ * and to call the tqparent implementation (in all cases)
*/
virtual void drawCursor( bool b );
@@ -247,7 +248,7 @@ protected:
void deleteWordLeft();
void deleteWordRight();
- bool insertParagraph( const QPoint &pos );
+ bool insertParagraph( const TQPoint &pos );
private slots:
void blinkCursor();
@@ -256,7 +257,7 @@ private slots:
protected:
KoTextViewIface *dcop;
public: // necessary to be public to allow script action in KoTextViewIface
- enum CursorAction { // keep in sync with QTextEdit
+ enum CursorAction { // keep in sync with TQTextEdit
MoveBackward,
MoveForward,
MoveWordBackward,
@@ -287,10 +288,10 @@ private:
bool m_overwriteMode;
KoTextFormat *m_currentFormat;
- QTimer *blinkTimer, *dragStartTimer;
+ TQTimer *blinkTimer, *dragStartTimer;
class KoTextViewPrivate;
KoTextViewPrivate *d;
- QPoint dragStartPos;
+ TQPoint dragStartPos;
bool m_cursorVisible;
bool blinkCursorVisible;
bool inDoubleClick;
@@ -300,7 +301,7 @@ private:
bool afterTripleClick;
bool m_singleWord;
- QString m_wordUnderCursor;
+ TQString m_wordUnderCursor;
};
#endif
diff --git a/lib/kotext/KoTextViewIface.cc b/lib/kotext/KoTextViewIface.cc
index 642fb097..8338ecde 100644
--- a/lib/kotext/KoTextViewIface.cc
+++ b/lib/kotext/KoTextViewIface.cc
@@ -39,7 +39,7 @@ void KoTextViewIface::insertSoftHyphen()
m_textView->insertSoftHyphen();
}
-void KoTextViewIface::insertText( const QString &text )
+void KoTextViewIface::insertText( const TQString &text )
{
m_textView->insertText(text);
}
@@ -99,13 +99,13 @@ void KoTextViewIface::setTextSuperScript(bool on)
delete cmd;
}
-void KoTextViewIface::setLanguage(const QString & _lang)
+void KoTextViewIface::setLanguage(const TQString & _lang)
{
KCommand *cmd=m_textView->setLanguageCommand(_lang);
delete cmd;
}
-QString KoTextViewIface::language() const
+TQString KoTextViewIface::language() const
{
return m_textView->language();
}
@@ -116,22 +116,22 @@ void KoTextViewIface::setDefaultFormat()
delete cmd;
}
-QColor KoTextViewIface::textColor() const
+TQColor KoTextViewIface::textColor() const
{
return m_textView->textColor();
}
-QString KoTextViewIface::textFontFamily()const
+TQString KoTextViewIface::textFontFamily()const
{
return m_textView->textFontFamily();
}
-QColor KoTextViewIface::textBackgroundColor()const
+TQColor KoTextViewIface::textBackgroundColor()const
{
return m_textView->textBackgroundColor();
}
-QColor KoTextViewIface::textUnderlineColor() const
+TQColor KoTextViewIface::textUnderlineColor() const
{
return m_textView->textUnderlineColor();
}
@@ -147,19 +147,19 @@ void KoTextViewIface::setRelativeTextSize( double _size)
delete cmd;
}
-void KoTextViewIface::setUnderlineColor( const QColor & color )
+void KoTextViewIface::setUnderlineColor( const TQColor & color )
{
KCommand *cmd=m_textView->setUnderlineColorCommand(color);
delete cmd;
}
-void KoTextViewIface::setTextColor(const QColor &color)
+void KoTextViewIface::setTextColor(const TQColor &color)
{
KCommand *cmd=m_textView->setTextColorCommand(color);
delete cmd;
}
-void KoTextViewIface::setTextBackgroundColor(const QColor &color)
+void KoTextViewIface::setTextBackgroundColor(const TQColor &color)
{
KCommand *cmd=m_textView->setTextBackgroundColorCommand(color);
delete cmd;
@@ -171,21 +171,21 @@ void KoTextViewIface::setAlign(int align)
delete cmd;
}
-void KoTextViewIface::setAlign(const QString &align)
+void KoTextViewIface::setAlign(const TQString &align)
{
KCommand *cmd=0L;
if( align=="AlignLeft")
- cmd=m_textView->setAlignCommand(Qt::AlignLeft);
+ cmd=m_textView->setAlignCommand(TQt::AlignLeft);
else if (align=="AlignRight")
- cmd=m_textView->setAlignCommand(Qt::AlignRight);
+ cmd=m_textView->setAlignCommand(TQt::AlignRight);
else if (align=="AlignCenter" || align=="AlignHCenter")
- cmd=m_textView->setAlignCommand(Qt::AlignHCenter);
+ cmd=m_textView->setAlignCommand(TQt::AlignHCenter);
else if (align=="AlignJustify")
- cmd=m_textView->setAlignCommand(Qt::AlignJustify);
+ cmd=m_textView->setAlignCommand(TQt::AlignJustify);
else
{
kdDebug(32500)<<"Align value not recognized...\n";
- cmd=m_textView->setAlignCommand(Qt::AlignLeft);
+ cmd=m_textView->setAlignCommand(TQt::AlignLeft);
}
delete cmd;
}
@@ -317,32 +317,32 @@ double KoTextViewIface::lineSpacing() const
double KoTextViewIface::leftMargin() const
{
- return m_textView->cursor()->parag()->margin( QStyleSheetItem::MarginLeft);
+ return m_textView->cursor()->parag()->margin( TQStyleSheetItem::MarginLeft);
}
double KoTextViewIface::rightMargin() const
{
- return m_textView->cursor()->parag()->margin( QStyleSheetItem::MarginRight);
+ return m_textView->cursor()->parag()->margin( TQStyleSheetItem::MarginRight);
}
double KoTextViewIface::spaceBeforeParag() const
{
- return m_textView->cursor()->parag()->margin( QStyleSheetItem::MarginTop);
+ return m_textView->cursor()->parag()->margin( TQStyleSheetItem::MarginTop);
}
double KoTextViewIface::spaceAfterParag() const
{
- return m_textView->cursor()->parag()->margin( QStyleSheetItem::MarginBottom);
+ return m_textView->cursor()->parag()->margin( TQStyleSheetItem::MarginBottom);
}
double KoTextViewIface::marginFirstLine() const
{
- return m_textView->cursor()->parag()->margin( QStyleSheetItem::MarginFirstLine);
+ return m_textView->cursor()->parag()->margin( TQStyleSheetItem::MarginFirstLine);
}
void KoTextViewIface::setMarginFirstLine(double pt)
{
- m_textView->cursor()->parag()->setMargin( QStyleSheetItem::MarginFirstLine,pt);
+ m_textView->cursor()->parag()->setMargin( TQStyleSheetItem::MarginFirstLine,pt);
}
void KoTextViewIface::setLineSpacing(double pt)
@@ -352,45 +352,45 @@ void KoTextViewIface::setLineSpacing(double pt)
void KoTextViewIface::setLeftMargin(double pt)
{
- m_textView->cursor()->parag()->setMargin( QStyleSheetItem::MarginLeft,pt);
+ m_textView->cursor()->parag()->setMargin( TQStyleSheetItem::MarginLeft,pt);
}
void KoTextViewIface::setRightMargin(double pt)
{
- m_textView->cursor()->parag()->setMargin( QStyleSheetItem::MarginRight,pt);
+ m_textView->cursor()->parag()->setMargin( TQStyleSheetItem::MarginRight,pt);
}
void KoTextViewIface::setSpaceBeforeParag(double pt)
{
- m_textView->cursor()->parag()->setMargin( QStyleSheetItem::MarginTop,pt);
+ m_textView->cursor()->parag()->setMargin( TQStyleSheetItem::MarginTop,pt);
}
void KoTextViewIface::setSpaceAfterParag(double pt)
{
- m_textView->cursor()->parag()->setMargin( QStyleSheetItem::MarginBottom,pt);
+ m_textView->cursor()->parag()->setMargin( TQStyleSheetItem::MarginBottom,pt);
}
-void KoTextViewIface::setLeftBorder( const QColor & c,double width )
+void KoTextViewIface::setLeftBorder( const TQColor & c,double width )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->setLeftBorder(KoBorder( c, KoBorder::SOLID, width ));
}
-void KoTextViewIface::setRightBorder( const QColor & c,double width )
+void KoTextViewIface::setRightBorder( const TQColor & c,double width )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->setRightBorder(KoBorder( c, KoBorder::SOLID, width ));
}
-void KoTextViewIface::setTopBorder( const QColor & c,double width )
+void KoTextViewIface::setTopBorder( const TQColor & c,double width )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->setTopBorder(KoBorder( c, KoBorder::SOLID, width ));
}
-void KoTextViewIface::setBottomBorder(const QColor & c,double width )
+void KoTextViewIface::setBottomBorder(const TQColor & c,double width )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->setBottomBorder(KoBorder( c, KoBorder::SOLID, width ));
@@ -422,49 +422,49 @@ double KoTextViewIface::bottomBorderWidth() const
}
-QColor KoTextViewIface::leftBorderColor() const
+TQColor KoTextViewIface::leftBorderColor() const
{
KoTextParag *parag= m_textView->cursor()->parag();
return parag->leftBorder().color;
}
-QColor KoTextViewIface::rightBorderColor() const
+TQColor KoTextViewIface::rightBorderColor() const
{
KoTextParag *parag= m_textView->cursor()->parag();
return parag->rightBorder().color;
}
-QColor KoTextViewIface::topBorderColor() const
+TQColor KoTextViewIface::topBorderColor() const
{
KoTextParag *parag= m_textView->cursor()->parag();
return parag->topBorder().color;
}
-QColor KoTextViewIface::bottomBorderColor() const
+TQColor KoTextViewIface::bottomBorderColor() const
{
KoTextParag *parag= m_textView->cursor()->parag();
return parag->bottomBorder().color;
}
-void KoTextViewIface::setLeftBorderColor( const QColor & c )
+void KoTextViewIface::setLeftBorderColor( const TQColor & c )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->leftBorder().color = c ;
}
-void KoTextViewIface::setRightBorderColor( const QColor & c )
+void KoTextViewIface::setRightBorderColor( const TQColor & c )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->rightBorder().color = c ;
}
-void KoTextViewIface::setTopBorderColor( const QColor & c )
+void KoTextViewIface::setTopBorderColor( const TQColor & c )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->topBorder().color = c ;
}
-void KoTextViewIface::setBottomBorderColor(const QColor & c )
+void KoTextViewIface::setBottomBorderColor(const TQColor & c )
{
KoTextParag *parag= m_textView->cursor()->parag();
parag->bottomBorder().color = c ;
@@ -495,7 +495,7 @@ void KoTextViewIface::setBottomBorderWidth( double _witdh )
}
-void KoTextViewIface::changeCaseOfText( const QString & caseType)
+void KoTextViewIface::changeCaseOfText( const TQString & caseType)
{
KCommand *cmd=0L;
if( caseType.lower() == "uppercase" )
@@ -520,7 +520,7 @@ void KoTextViewIface::changeCaseOfText( const QString & caseType)
}
else
- kdDebug(32500)<<"Error in void KoTextViewIface::changeCaseOfText( const QString & caseType) parameter\n";
+ kdDebug(32500)<<"Error in void KoTextViewIface::changeCaseOfText( const TQString & caseType) parameter\n";
delete cmd;
}
@@ -529,22 +529,22 @@ bool KoTextViewIface::isALinkVariable() const
return (m_textView->linkVariable()!=0);
}
-QString KoTextViewIface::linkVariableUrl( ) const
+TQString KoTextViewIface::linkVariableUrl( ) const
{
KoLinkVariable *var=m_textView->linkVariable();
if ( !var)
- return QString::null;
+ return TQString();
else
{
return var->url();
}
}
-QString KoTextViewIface::linkVariableName( ) const
+TQString KoTextViewIface::linkVariableName( ) const
{
KoLinkVariable *var=m_textView->linkVariable();
if ( !var)
- return QString::null;
+ return TQString();
else
{
return var->value();
@@ -552,7 +552,7 @@ QString KoTextViewIface::linkVariableName( ) const
}
-bool KoTextViewIface::changeLinkVariableUrl( const QString & _url) const
+bool KoTextViewIface::changeLinkVariableUrl( const TQString & _url) const
{
KoLinkVariable *var=m_textView->linkVariable();
if ( !var)
@@ -565,7 +565,7 @@ bool KoTextViewIface::changeLinkVariableUrl( const QString & _url) const
return true;
}
-bool KoTextViewIface::changeLinkVariableName( const QString & _name) const
+bool KoTextViewIface::changeLinkVariableName( const TQString & _name) const
{
KoLinkVariable *var=m_textView->linkVariable();
if ( !var)
@@ -584,16 +584,16 @@ bool KoTextViewIface::isANoteVariable() const
return (var!=0);
}
-QString KoTextViewIface::noteVariableText() const
+TQString KoTextViewIface::noteVariableText() const
{
KoNoteVariable *var = dynamic_cast<KoNoteVariable *>(m_textView->variable());
if( var )
return var->note();
else
- return QString::null;
+ return TQString();
}
-bool KoTextViewIface::setNoteVariableText(const QString & note) const
+bool KoTextViewIface::setNoteVariableText(const TQString & note) const
{
KoNoteVariable *var = dynamic_cast<KoNoteVariable *>(m_textView->variable());
if( var )
@@ -610,17 +610,17 @@ void KoTextViewIface::removeComment()
removeComment();
}
-QString KoTextViewIface::underlineStyle() const
+TQString KoTextViewIface::underlineStyle() const
{
return KoTextFormat::underlineStyleToString( m_textView->underlineStyle() );
}
-QString KoTextViewIface::strikeOutStyle()const
+TQString KoTextViewIface::strikeOutStyle()const
{
return KoTextFormat::strikeOutStyleToString( m_textView->strikeOutStyle() );
}
-void KoTextViewIface::addBookmarks(const QString &url)
+void KoTextViewIface::addBookmarks(const TQString &url)
{
m_textView->addBookmarks(url);
}
@@ -651,7 +651,7 @@ void KoTextViewIface::copyTextOfComment()
m_textView->copyTextOfComment();
}
-QString KoTextViewIface::fontAttibute()const
+TQString KoTextViewIface::fontAttibute()const
{
return KoTextFormat::attributeFontToString( m_textView->fontAttribute() );
}
diff --git a/lib/kotext/KoTextViewIface.h b/lib/kotext/KoTextViewIface.h
index cee86f06..1d993932 100644
--- a/lib/kotext/KoTextViewIface.h
+++ b/lib/kotext/KoTextViewIface.h
@@ -23,8 +23,8 @@
#include <KoDocumentIface.h>
#include <dcopref.h>
-#include <qstring.h>
-#include <qcolor.h>
+#include <tqstring.h>
+#include <tqcolor.h>
#include <KoRichText.h>
#include <koffice_export.h>
class KoTextView;
@@ -39,7 +39,7 @@ k_dcop:
void insertSoftHyphen();
void insertNonbreakingSpace();
void insertNonbreakingHyphen();
- void insertText( const QString &text );
+ void insertText( const TQString &text );
void newParagraph();
void setBold(bool b);
void setItalic(bool on);
@@ -49,14 +49,14 @@ k_dcop:
void setPointSize( int s );
void setTextSubScript(bool on);
void setTextSuperScript(bool on);
- void setUnderlineColor( const QColor & color );
+ void setUnderlineColor( const TQColor & color );
void setDefaultFormat();
void setRelativeTextSize( double _size);
- QColor textColor() const;
- QString textFontFamily()const;
- QColor textBackgroundColor()const;
- QColor textUnderlineColor() const;
+ TQColor textColor() const;
+ TQString textFontFamily()const;
+ TQColor textBackgroundColor()const;
+ TQColor textUnderlineColor() const;
bool textDoubleUnderline() const;
bool textItalic() const;
@@ -70,10 +70,10 @@ k_dcop:
bool wordByWord() const;
void setWordByWord( bool _b );
- void setTextColor(const QColor &color);
- void setTextBackgroundColor(const QColor &);
+ void setTextColor(const TQColor &color);
+ void setTextBackgroundColor(const TQColor &);
void setAlign(int align);
- void setAlign(const QString &);
+ void setAlign(const TQString &);
bool isReadWrite() const ;
void setReadWrite( bool b );
@@ -114,16 +114,16 @@ k_dcop:
void setSpaceAfterParag(double pt);
// apply border, for the futur add border style
- void setLeftBorder( const QColor & c,double width );
- void setRightBorder( const QColor & c,double width );
+ void setLeftBorder( const TQColor & c,double width );
+ void setRightBorder( const TQColor & c,double width );
- void setTopBorder( const QColor & c,double width );
- void setBottomBorder(const QColor & c,double width );
+ void setTopBorder( const TQColor & c,double width );
+ void setBottomBorder(const TQColor & c,double width );
- void setLeftBorderColor( const QColor & c );
- void setRightBorderColor( const QColor & c );
- void setTopBorderColor( const QColor & c);
- void setBottomBorderColor(const QColor & c );
+ void setLeftBorderColor( const TQColor & c );
+ void setRightBorderColor( const TQColor & c );
+ void setTopBorderColor( const TQColor & c);
+ void setBottomBorderColor(const TQColor & c );
void setLeftBorderWidth( double _witdh );
void setRightBorderWidth( double _witdh );
void setTopBorderWidth( double _witdh );
@@ -136,43 +136,43 @@ k_dcop:
double topBorderWidth() const;
double bottomBorderWidth() const;
- QColor leftBorderColor() const ;
- QColor rightBorderColor() const;
- QColor topBorderColor() const;
- QColor bottomBorderColor() const;
+ TQColor leftBorderColor() const ;
+ TQColor rightBorderColor() const;
+ TQColor topBorderColor() const;
+ TQColor bottomBorderColor() const;
- void changeCaseOfText( const QString & caseType);
+ void changeCaseOfText( const TQString & caseType);
bool isALinkVariable() const;
//return false if there is not a link
- bool changeLinkVariableUrl( const QString & _url) const;
+ bool changeLinkVariableUrl( const TQString & _url) const;
//return false if there is not a link
- bool changeLinkVariableName( const QString & _name) const;
+ bool changeLinkVariableName( const TQString & _name) const;
- //be carefull these functions return QString::null when there is not
+ //be carefull these functions return TQString() when there is not
//a variable
- QString linkVariableUrl( ) const;
- QString linkVariableName( ) const;
+ TQString linkVariableUrl( ) const;
+ TQString linkVariableName( ) const;
bool isANoteVariable() const ;
- QString noteVariableText() const;
+ TQString noteVariableText() const;
//return false if there is not a note variable
- bool setNoteVariableText(const QString & note) const;
+ bool setNoteVariableText(const TQString & note) const;
void removeComment();
- QString underlineStyle() const;
- QString strikeOutStyle()const;
+ TQString underlineStyle() const;
+ TQString strikeOutStyle()const;
- void setLanguage(const QString & _lang);
- QString language() const;
- void addBookmarks(const QString &url);
+ void setLanguage(const TQString & _lang);
+ TQString language() const;
+ void addBookmarks(const TQString &url);
void copyLink();
void removeLink();
void copyTextOfComment();
- QString fontAttibute()const;
+ TQString fontAttibute()const;
private:
KoTextView *m_textView;
protected:
- //QString lineStyleToString( KoTextFormat::LineStyle _style ) const;
+ //TQString lineStyleToString( KoTextFormat::LineStyle _style ) const;
};
#endif
diff --git a/lib/kotext/KoTextZoomHandler.cpp b/lib/kotext/KoTextZoomHandler.cpp
index 306c7f2f..e7e6d1b4 100644
--- a/lib/kotext/KoTextZoomHandler.cpp
+++ b/lib/kotext/KoTextZoomHandler.cpp
@@ -19,7 +19,7 @@
#include "KoTextZoomHandler.h"
#include <kdebug.h>
-#include <qpaintdevice.h>
+#include <tqpaintdevice.h>
#include <KoUnit.h>
#include <KoGlobal.h>
@@ -36,54 +36,54 @@ int KoTextZoomHandler::fontSizeToLayoutUnit( double ptSizeFloat, bool forPrint )
}
#endif
-double KoTextZoomHandler::layoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const
+double KoTextZoomHandler::tqlayoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const
{
- // Qt will use QPaintDevice::x11AppDpiY() to go from pt to pixel for fonts
- return layoutUnitPtToPt( luSize ) * m_zoomedResolutionY
-#ifdef Q_WS_X11
- / POINT_TO_INCH(QPaintDevice::x11AppDpiY())
+ // TQt will use TQPaintDevice::x11AppDpiY() to go from pt to pixel for fonts
+ return tqlayoutUnitPtToPt( luSize ) * m_zoomedResolutionY
+#ifdef TQ_WS_X11
+ / POINT_TO_INCH(TQPaintDevice::x11AppDpiY())
#endif
;
}
-int KoTextZoomHandler::layoutUnitToPixelX( int x, int w ) const
+int KoTextZoomHandler::tqlayoutUnitToPixelX( int x, int w ) const
{
- // We call layoutUnitToPixelX on the right value, i.e. x+w-1,
+ // We call tqlayoutUnitToPixelX on the right value, i.e. x+w-1,
// and then determine the height from the result (i.e. right-left+1).
- // Calling layoutUnitToPixelX(w) leads to rounding problems.
- return layoutUnitToPixelY( x + w - 1 ) - layoutUnitToPixelY( x ) + 1;
+ // Calling tqlayoutUnitToPixelX(w) leads to rounding problems.
+ return tqlayoutUnitToPixelY( x + w - 1 ) - tqlayoutUnitToPixelY( x ) + 1;
}
-int KoTextZoomHandler::layoutUnitToPixelY( int y, int h ) const
+int KoTextZoomHandler::tqlayoutUnitToPixelY( int y, int h ) const
{
- // We call layoutUnitToPixelY on the bottom value, i.e. y+h-1,
+ // We call tqlayoutUnitToPixelY on the bottom value, i.e. y+h-1,
// and then determine the height from the result (i.e. bottom-top+1).
- // Calling layoutUnitToPixelY(h) leads to rounding problems.
- return layoutUnitToPixelY( y + h - 1 ) - layoutUnitToPixelY( y ) + 1;
+ // Calling tqlayoutUnitToPixelY(h) leads to rounding problems.
+ return tqlayoutUnitToPixelY( y + h - 1 ) - tqlayoutUnitToPixelY( y ) + 1;
}
-int KoTextZoomHandler::layoutUnitToPixelX( int lupix ) const
+int KoTextZoomHandler::tqlayoutUnitToPixelX( int lupix ) const
{
return int( static_cast<double>( lupix * m_zoomedResolutionX )
/ ( static_cast<double>( m_layoutUnitFactor ) * m_resolutionX ) );
}
-int KoTextZoomHandler::layoutUnitToPixelY( int lupix ) const
+int KoTextZoomHandler::tqlayoutUnitToPixelY( int lupix ) const
{
- // qRound replaced with a truncation, too many problems (e.g. bottom of parags)
+ // tqRound replaced with a truncation, too many problems (e.g. bottom of parags)
return int( static_cast<double>( lupix * m_zoomedResolutionY )
/ ( static_cast<double>( m_layoutUnitFactor ) * m_resolutionY ) );
}
int KoTextZoomHandler::pixelToLayoutUnitX( int x ) const
{
- return qRound( static_cast<double>( x * m_layoutUnitFactor * m_resolutionX )
+ return tqRound( static_cast<double>( x * m_layoutUnitFactor * m_resolutionX )
/ m_zoomedResolutionX );
}
int KoTextZoomHandler::pixelToLayoutUnitY( int y ) const
{
- return qRound( static_cast<double>( y * m_layoutUnitFactor * m_resolutionY )
+ return tqRound( static_cast<double>( y * m_layoutUnitFactor * m_resolutionY )
/ m_zoomedResolutionY );
}
diff --git a/lib/kotext/KoTextZoomHandler.h b/lib/kotext/KoTextZoomHandler.h
index 2490cfa6..81211086 100644
--- a/lib/kotext/KoTextZoomHandler.h
+++ b/lib/kotext/KoTextZoomHandler.h
@@ -23,7 +23,7 @@
#include <KoZoomHandler.h>
/**
- * This class extends KoZoomHandler to add support for WYSIWYG text layouting.
+ * This class extends KoZoomHandler to add support for WYSIWYG text tqlayouting.
*/
class KOTEXT_EXPORT KoTextZoomHandler : public KoZoomHandler
{
@@ -31,51 +31,51 @@ public:
KoTextZoomHandler() {}
virtual ~KoTextZoomHandler() {}
- //// Support for WYSIWYG text layouting /////
+ //// Support for WYSIWYG text tqlayouting /////
- /** The "[zoomed] view pixel" -> "layout unit pixel" conversions. */
+ /** The "[zoomed] view pixel" -> "tqlayout unit pixel" conversions. */
int pixelToLayoutUnitX( int x ) const;
int pixelToLayoutUnitY( int y ) const;
- QPoint pixelToLayoutUnit( const QPoint &p ) const
- { return QPoint( pixelToLayoutUnitX( p.x() ),
+ TQPoint pixelToLayoutUnit( const TQPoint &p ) const
+ { return TQPoint( pixelToLayoutUnitX( p.x() ),
pixelToLayoutUnitY( p.y() ) ); }
- QRect pixelToLayoutUnit( const QRect &r ) const
- { return QRect( pixelToLayoutUnit( r.topLeft() ),
+ TQRect pixelToLayoutUnit( const TQRect &r ) const
+ { return TQRect( pixelToLayoutUnit( r.topLeft() ),
pixelToLayoutUnit( r.bottomRight() ) ); }
- /** The "layout unit pixel" -> "[zoomed] view pixel" conversions. */
- int layoutUnitToPixelX( int lupix ) const;
- int layoutUnitToPixelY( int lupix ) const;
+ /** The "tqlayout unit pixel" -> "[zoomed] view pixel" conversions. */
+ int tqlayoutUnitToPixelX( int lupix ) const;
+ int tqlayoutUnitToPixelY( int lupix ) const;
/** This variant converts a width, using a reference X position.
* This prevents rounding problems. */
- int layoutUnitToPixelX( int x, int w ) const;
+ int tqlayoutUnitToPixelX( int x, int w ) const;
/** This variant converts a height, using a reference Y position.
* This prevents rounding problems. */
- int layoutUnitToPixelY( int y, int h ) const;
+ int tqlayoutUnitToPixelY( int y, int h ) const;
- QPoint layoutUnitToPixel( const QPoint &p ) const
- { return QPoint( layoutUnitToPixelX( p.x() ),
- layoutUnitToPixelY( p.y() ) ); }
- QRect layoutUnitToPixel( const QRect &r ) const
- { return QRect( layoutUnitToPixel( r.topLeft() ),
- layoutUnitToPixel( r.bottomRight() ) ); }
+ TQPoint tqlayoutUnitToPixel( const TQPoint &p ) const
+ { return TQPoint( tqlayoutUnitToPixelX( p.x() ),
+ tqlayoutUnitToPixelY( p.y() ) ); }
+ TQRect tqlayoutUnitToPixel( const TQRect &r ) const
+ { return TQRect( tqlayoutUnitToPixel( r.topLeft() ),
+ tqlayoutUnitToPixel( r.bottomRight() ) ); }
/** Basic pt to pixel and pixel to pt conversions, valid at any zoom level,
as well as at the Layout Unit level (and mostly useful for Layout Units).
Don't confuse with zoomIt, which also converts pt to pixels, but applying the zoom! */
int ptToPixelX( double pt ) const
- { return qRound( pt * m_resolutionX ); }
+ { return tqRound( pt * m_resolutionX ); }
int ptToPixelY( double pt ) const
- { return qRound( pt * m_resolutionY ); }
- QPoint ptToPixel( const KoPoint & p ) const {
- return QPoint( ptToPixelX( p.x() ), ptToPixelY( p.y() ) );
+ { return tqRound( pt * m_resolutionY ); }
+ TQPoint ptToPixel( const KoPoint & p ) const {
+ return TQPoint( ptToPixelX( p.x() ), ptToPixelY( p.y() ) );
}
double pixelXToPt( int x ) const
{ return static_cast<double>(x) / m_resolutionX; }
double pixelYToPt( int y ) const
{ return static_cast<double>(y) / m_resolutionY; }
- KoPoint pixelToPt( const QPoint& p ) const {
+ KoPoint pixelToPt( const TQPoint& p ) const {
return KoPoint( pixelXToPt( p.x() ), pixelYToPt( p.y() ) );
}
@@ -84,31 +84,31 @@ public:
{ return ptToPixelX( ptToLayoutUnitPt( x_pt ) ); }
int ptToLayoutUnitPixY( double y_pt ) const
{ return ptToPixelY( ptToLayoutUnitPt( y_pt ) ); }
- QPoint ptToLayoutUnitPix( const KoPoint & p ) const {
- return QPoint( ptToLayoutUnitPixX( p.x() ), ptToLayoutUnitPixY( p.y() ) );
+ TQPoint ptToLayoutUnitPix( const KoPoint & p ) const {
+ return TQPoint( ptToLayoutUnitPixX( p.x() ), ptToLayoutUnitPixY( p.y() ) );
}
/**
- * Given the font size for the font in layout units, in pt (use pointSize())
+ * Given the font size for the font in tqlayout units, in pt (use pointSize())
* this returns the font size to use on screen the current zoom, in pt (use setPointSizeFloat()),
*/
- double layoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const;
+ double tqlayoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const;
- // Note: For converting fontsizes from/to layout units and zoom-independent
+ // Note: For converting fontsizes from/to tqlayout units and zoom-independent
// pt sizes (like the one the user sees, e.g. 12pt),
- // use ptToLayoutUnit and layoutUnitToPt, not layoutToFontSize.
+ // use ptToLayoutUnit and tqlayoutUnitToPt, not tqlayoutToFontSize.
- // The conversions below convert between an internal text layout resolution of
+ // The conversions below convert between an internal text tqlayout resolution of
// ~1440 DPI (by default) and the point-size for the fonts (those known by the user).
// Those conversions don't depend on the zoom level.
/** Change the factor that converts between pointsizes
- * and layout units (by default 20 - for 1440 DPI at 72 DPI) */
+ * and tqlayout units (by default 20 - for 1440 DPI at 72 DPI) */
static void setPtToLayoutUnitFactor( int factor ) { m_layoutUnitFactor = factor; }
/** Not zoom dependent. Simply convert a pt value (e.g. a frame)
- * to high-resolution layout unit coordinates (in pt). */
+ * to high-resolution tqlayout unit coordinates (in pt). */
static double ptToLayoutUnitPt( double pt )
{ return pt * static_cast<double>( m_layoutUnitFactor ); }
/** Same thing for integer values, e.g. a font size in pt */
@@ -122,11 +122,11 @@ public:
{ return KoRect( ptToLayoutUnitPt( r.topLeft() ),
ptToLayoutUnitPt( r.bottomRight() ) ); }
- static double layoutUnitPtToPt( double lupt )
+ static double tqlayoutUnitPtToPt( double lupt )
{ return lupt / static_cast<double>( m_layoutUnitFactor ); }
- static KoPoint layoutUnitPtToPt( const KoPoint& p )
- { return KoPoint( layoutUnitPtToPt( p.x() ),
- layoutUnitPtToPt( p.y() ) ); }
+ static KoPoint tqlayoutUnitPtToPt( const KoPoint& p )
+ { return KoPoint( tqlayoutUnitPtToPt( p.x() ),
+ tqlayoutUnitPtToPt( p.y() ) ); }
protected:
/** This being static ensures that the same value is used by all KoTextZoomHandler instances */
diff --git a/lib/kotext/KoUserStyle.cpp b/lib/kotext/KoUserStyle.cpp
index 1dc92a9e..33de3421 100644
--- a/lib/kotext/KoUserStyle.cpp
+++ b/lib/kotext/KoUserStyle.cpp
@@ -19,17 +19,17 @@
#include "KoUserStyle.h"
#include <klocale.h>
-KoUserStyle::KoUserStyle( const QString & name )
+KoUserStyle::KoUserStyle( const TQString & name )
: m_name( name ), m_displayName( i18n( "Style name", name.utf8() ) )
{
}
-QString KoUserStyle::displayName() const
+TQString KoUserStyle::displayName() const
{
return m_displayName;
}
-void KoUserStyle::setDisplayName( const QString& name )
+void KoUserStyle::setDisplayName( const TQString& name )
{
m_displayName = name;
}
diff --git a/lib/kotext/KoUserStyle.h b/lib/kotext/KoUserStyle.h
index 51603f10..7f964f90 100644
--- a/lib/kotext/KoUserStyle.h
+++ b/lib/kotext/KoUserStyle.h
@@ -20,7 +20,7 @@
#define KOUSERSTYLE_H
#include <koffice_export.h>
-#include <qstring.h>
+#include <tqstring.h>
/**
* Base class for any kind of style that the user can create/modify/delete/display.
@@ -33,23 +33,23 @@
class KOTEXT_EXPORT KoUserStyle
{
public:
- KoUserStyle( const QString & name );
+ KoUserStyle( const TQString & name );
/// The internal name (used for loading/saving, but not shown to the user)
/// Should be unique in a given style collection.
- QString name() const { return m_name; }
+ TQString name() const { return m_name; }
/// Set the internal name - see generateUniqueName() if needed
/// Should be unique in a given style collection.
- void setName( const QString & name ) { m_name = name; }
+ void setName( const TQString & name ) { m_name = name; }
/// The user-visible name (e.g. translated, or set by the user)
- QString displayName() const;
+ TQString displayName() const;
/// Set the user-visible name
- void setDisplayName( const QString& name );
+ void setDisplayName( const TQString& name );
protected:
- QString m_name;
- QString m_displayName;
+ TQString m_name;
+ TQString m_displayName;
};
#endif
diff --git a/lib/kotext/KoUserStyleCollection.cpp b/lib/kotext/KoUserStyleCollection.cpp
index 1b9b8ccf..1cf5b333 100644
--- a/lib/kotext/KoUserStyleCollection.cpp
+++ b/lib/kotext/KoUserStyleCollection.cpp
@@ -20,20 +20,20 @@
#include "KoUserStyle.h"
#include <kdebug.h>
-KoUserStyleCollection::KoUserStyleCollection( const QString& prefix )
+KoUserStyleCollection::KoUserStyleCollection( const TQString& prefix )
: m_prefix( prefix ),
m_lastStyle( 0 ),
m_default( false /*to be safe*/ )
{
}
-KoUserStyle* KoUserStyleCollection::findStyle( const QString & _name, const QString& defaultStyleName ) const
+KoUserStyle* KoUserStyleCollection::findStyle( const TQString & _name, const TQString& defaultStyleName ) const
{
// Caching, to speed things up
if ( m_lastStyle && m_lastStyle->name() == _name )
return m_lastStyle;
- 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 ) {
if ( (*styleIt)->name() == _name ) {
m_lastStyle = *styleIt;
return m_lastStyle;
@@ -46,12 +46,12 @@ KoUserStyle* KoUserStyleCollection::findStyle( const QString & _name, const QStr
return 0;
}
-KoUserStyle* KoUserStyleCollection::findStyleByDisplayName( const QString& displayName ) const
+KoUserStyle* KoUserStyleCollection::findStyleByDisplayName( const TQString& displayName ) const
{
if ( m_lastStyle && m_lastStyle->displayName() == displayName )
return m_lastStyle;
- 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 ) {
if ( (*styleIt)->displayName() == displayName ) {
m_lastStyle = *styleIt;
return m_lastStyle;
@@ -61,13 +61,13 @@ KoUserStyle* KoUserStyleCollection::findStyleByDisplayName( const QString& displ
return 0;
}
-QString KoUserStyleCollection::generateUniqueName() const
+TQString KoUserStyleCollection::generateUniqueName() const
{
int count = 1;
- QString name;
+ TQString name;
do {
- name = m_prefix + QString::number( count++ );
- } while ( findStyle( name, QString::null ) );
+ name = m_prefix + TQString::number( count++ );
+ } while ( findStyle( name, TQString() ) );
return name;
}
@@ -79,19 +79,19 @@ KoUserStyleCollection::~KoUserStyleCollection()
void KoUserStyleCollection::clear()
{
// KDE4: qDeleteAll
- 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 )
delete *styleIt;
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_deletedStyles.begin(), styleEnd = m_deletedStyles.end() ; styleIt != styleEnd ; ++styleIt )
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_deletedStyles.begin(), styleEnd = m_deletedStyles.end() ; styleIt != styleEnd ; ++styleIt )
delete *styleIt;
m_styleList.clear();
m_deletedStyles.clear();
m_lastStyle = 0;
}
-QStringList KoUserStyleCollection::displayNameList() const
+TQStringList KoUserStyleCollection::displayNameList() const
{
- QStringList lst;
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt )
+ TQStringList lst;
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt )
lst.append( (*styleIt)->displayName() );
return lst;
}
@@ -99,7 +99,7 @@ QStringList KoUserStyleCollection::displayNameList() const
KoUserStyle* KoUserStyleCollection::addStyle( KoUserStyle* sty )
{
// First check for duplicates.
- 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 )
{
KoUserStyle* p = *styleIt;
if ( p->name() == sty->name() ) {
@@ -129,12 +129,12 @@ void KoUserStyleCollection::removeStyle ( KoUserStyle *style ) {
}
}
-void KoUserStyleCollection::updateStyleListOrder( const QStringList &lst )
+void KoUserStyleCollection::updateStyleListOrder( const TQStringList &lst )
{
- QValueList<KoUserStyle *> orderStyle;
- for ( QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ TQValueList<KoUserStyle *> orderStyle;
+ for ( TQStringList::const_iterator it = lst.begin(); it != lst.end(); ++it )
{
- KoUserStyle* style = findStyle( *it, QString::null );
+ KoUserStyle* style = findStyle( *it, TQString() );
if ( style )
orderStyle.append( style );
else
diff --git a/lib/kotext/KoUserStyleCollection.h b/lib/kotext/KoUserStyleCollection.h
index 70910399..9330ca4d 100644
--- a/lib/kotext/KoUserStyleCollection.h
+++ b/lib/kotext/KoUserStyleCollection.h
@@ -21,7 +21,7 @@
class KoUserStyle;
#include <koffice_export.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
* Generic style collection class, for all "user styles" (see KoUserStyle).
@@ -37,7 +37,7 @@ public:
* @param prefix used by generateUniqueName to prefix new style names
* (to avoid clashes between different kinds of styles)
*/
- KoUserStyleCollection( const QString& prefix );
+ KoUserStyleCollection( const TQString& prefix );
/**
* Destructor
@@ -61,24 +61,24 @@ public:
/**
* @return the index of @p style in the collection
*/
- int indexOf( KoUserStyle* style ) const { return m_styleList.findIndex( style ); }
+ int indexOf( KoUserStyle* style ) const { return m_styleList.tqfindIndex( style ); }
/**
* Return the list of all styles in the collection.
*/
- QValueList<KoUserStyle *> styleList() const { return m_styleList; }
+ TQValueList<KoUserStyle *> styleList() const { return m_styleList; }
/**
* Generate a new unique name, to create a style whose internal name
* differs from the internal name of all existing styles.
* The prefix passed to the constructor is used here.
*/
- QString generateUniqueName() const;
+ TQString generateUniqueName() const;
/**
* Return the list composed of the display-name of each style in the collection
*/
- QStringList displayNameList() const;
+ TQStringList displayNameList() const;
/**
* Find style based on the internal name @p name.
@@ -86,7 +86,7 @@ public:
* 1) if @p name equals @p defaultStyleName, return the first one, never 0<br>
* 2) otherwise return 0
*/
- KoUserStyle* findStyle( const QString & name, const QString& defaultStyleName ) const;
+ KoUserStyle* findStyle( const TQString & name, const TQString& defaultStyleName ) const;
/**
* Find style based on the display name @p displayName.
@@ -95,7 +95,7 @@ public:
* This is mostly useful to detect similar styles when importing styles
* from another document.
*/
- KoUserStyle* findStyleByDisplayName( const QString& displayName ) const;
+ KoUserStyle* findStyleByDisplayName( const TQString& displayName ) const;
/**
* Remove @p style from the collection. If the style isn't in the collection, nothing happens.
@@ -108,7 +108,7 @@ public:
* @param list the list of internal names of the styles
* WARNING, if an existing style isn't listed, it will be lost
*/
- void updateStyleListOrder( const QStringList& list );
+ void updateStyleListOrder( const TQStringList& list );
/**
* Try adding @p sty to the collection.
@@ -136,11 +136,11 @@ protected:
KoUserStyleCollection( const KoUserStyleCollection& rhs ); ///< forbidden
void operator=( const KoUserStyleCollection& rhs ); ///< forbidden
- QValueList<KoUserStyle *> m_styleList;
+ TQValueList<KoUserStyle *> m_styleList;
private:
- QValueList<KoUserStyle *> m_deletedStyles;
- const QString m_prefix;
+ TQValueList<KoUserStyle *> m_deletedStyles;
+ const TQString m_prefix;
// can become d pointer if needed
mutable KoUserStyle *m_lastStyle; ///< Last style that was searched
bool m_default;
diff --git a/lib/kotext/KoVariable.cpp b/lib/kotext/KoVariable.cpp
index d110f02c..2e5663af 100644
--- a/lib/kotext/KoVariable.cpp
+++ b/lib/kotext/KoVariable.cpp
@@ -46,11 +46,11 @@
#include <kcalendarsystem.h>
#include <kaboutdata.h>
-#include <qstringlist.h>
-#include <qcombobox.h>
-#include <qvaluelist.h>
-#include <qdom.h>
-#include <qradiobutton.h>
+#include <tqstringlist.h>
+#include <tqcombobox.h>
+#include <tqvaluelist.h>
+#include <tqdom.h>
+#include <tqradiobutton.h>
#include "IsoDuration.h"
@@ -61,9 +61,9 @@ public:
{
m_lastPrintingDate.setTime_t(0); // Default is 1970-01-01 midnight locale time
}
- QDateTime m_lastPrintingDate;
- QDateTime m_creationDate;
- QDateTime m_modificationDate;
+ TQDateTime m_lastPrintingDate;
+ TQDateTime m_creationDate;
+ TQDateTime m_modificationDate;
};
@@ -83,32 +83,32 @@ KoVariableSettings::~KoVariableSettings()
d = 0;
}
-QDateTime KoVariableSettings::lastPrintingDate() const
+TQDateTime KoVariableSettings::lastPrintingDate() const
{
return d->m_lastPrintingDate;
}
-void KoVariableSettings::setLastPrintingDate( const QDateTime & _date)
+void KoVariableSettings::setLastPrintingDate( const TQDateTime & _date)
{
d->m_lastPrintingDate = _date;
}
-QDateTime KoVariableSettings::creationDate() const
+TQDateTime KoVariableSettings::creationDate() const
{
return d->m_creationDate;
}
-void KoVariableSettings::setCreationDate( const QDateTime & _date )
+void KoVariableSettings::setCreationDate( const TQDateTime & _date )
{
d->m_creationDate = _date;
}
-QDateTime KoVariableSettings::modificationDate() const
+TQDateTime KoVariableSettings::modificationDate() const
{
return d->m_modificationDate;
}
-void KoVariableSettings::setModificationDate( const QDateTime & _date)
+void KoVariableSettings::setModificationDate( const TQDateTime & _date)
{
d->m_modificationDate = _date;
}
@@ -123,7 +123,7 @@ void KoVariableSettings::saveOasis( KoXmlWriter &settingsWriter ) const
settingsWriter.addConfigItem( "displayfieldcode", m_displayFieldCode);
// m_startingPageNumber isn't saved to OASIS. Applications must use either
// style:page-number in the first parag of a page (see KoTextParag), or
- // style:first-page-number in style:page-layout, for spreadsheets etc.
+ // style:first-page-number in style:page-tqlayout, for spreadsheets etc.
if ( d->m_lastPrintingDate.isValid())
settingsWriter.addConfigItem("lastPrintingDate", d->m_lastPrintingDate.toString(Qt::ISODate));
@@ -146,29 +146,29 @@ void KoVariableSettings::loadOasis(const KoOasisSettings&settingsDoc)
m_displayComment = configurationSettings.parseConfigItemBool( "displaycomment", true );
m_displayFieldCode = configurationSettings.parseConfigItemBool( "displayfieldcode", false );
- QString str = configurationSettings.parseConfigItemString( "lastPrintingDate" );
+ TQString str = configurationSettings.parseConfigItemString( "lastPrintingDate" );
if ( !str.isEmpty() )
- d->m_lastPrintingDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_lastPrintingDate = TQDateTime::fromString( str, Qt::ISODate );
else
d->m_lastPrintingDate.setTime_t(0); // 1970-01-01 00:00:00.000 locale time
str = configurationSettings.parseConfigItemString( "creationDate" );
if ( !str.isEmpty() ) {
- d->m_creationDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_creationDate = TQDateTime::fromString( str, Qt::ISODate );
}
str = configurationSettings.parseConfigItemString( "modificationDate" );
if ( !str.isEmpty() )
- d->m_modificationDate = QDateTime::fromString( str, Qt::ISODate );
+ d->m_modificationDate = TQDateTime::fromString( str, Qt::ISODate );
// m_startingPageNumber isn't loaded from OASIS here. KWTextParag::loadOasis does it.
}
}
-void KoVariableSettings::save( QDomElement &parentElem )
+void KoVariableSettings::save( TQDomElement &tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "VARIABLESETTINGS" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "VARIABLESETTINGS" );
+ tqparentElem.appendChild( elem );
if(m_startingPageNumber!=1)
{
elem.setAttribute( "startingPageNumber", m_startingPageNumber );
@@ -188,9 +188,9 @@ void KoVariableSettings::save( QDomElement &parentElem )
elem.setAttribute("modificationDate", d->m_modificationDate.toString(Qt::ISODate));
}
-void KoVariableSettings::load( QDomElement &elem )
+void KoVariableSettings::load( TQDomElement &elem )
{
- QDomElement e = elem.namedItem( "VARIABLESETTINGS" ).toElement();
+ TQDomElement e = elem.namedItem( "VARIABLESETTINGS" ).toElement();
if (!e.isNull())
{
if(e.hasAttribute("startingPageNumber"))
@@ -205,16 +205,16 @@ void KoVariableSettings::load( QDomElement &elem )
m_displayFieldCode=(bool)e.attribute("displayfieldcode").toInt();
if (e.hasAttribute("lastPrintingDate"))
- d->m_lastPrintingDate = QDateTime::fromString( e.attribute( "lastPrintingDate" ), Qt::ISODate );
+ d->m_lastPrintingDate = TQDateTime::fromString( e.attribute( "lastPrintingDate" ), Qt::ISODate );
else
d->m_lastPrintingDate.setTime_t(0); // 1970-01-01 00:00:00.000 locale time
if (e.hasAttribute("creationDate")) {
- d->m_creationDate = QDateTime::fromString( e.attribute( "creationDate" ), Qt::ISODate );
+ d->m_creationDate = TQDateTime::fromString( e.attribute( "creationDate" ), Qt::ISODate );
}
if (e.hasAttribute("modificationDate"))
- d->m_modificationDate = QDateTime::fromString( e.attribute( "modificationDate" ), Qt::ISODate );
+ d->m_modificationDate = TQDateTime::fromString( e.attribute( "modificationDate" ), Qt::ISODate );
}
}
@@ -222,15 +222,15 @@ KoVariableDateFormat::KoVariableDateFormat() : KoVariableFormat()
{
}
-QString KoVariableDateFormat::convert( const QVariant& data ) const
+TQString KoVariableDateFormat::convert( const TQVariant& data ) const
{
- if ( data.type() != QVariant::Date && data.type() != QVariant::DateTime )
+ if ( data.type() != TQVariant::Date && data.type() != TQVariant::DateTime )
{
kdWarning(32500)<<" Error in KoVariableDateFormat::convert. Value is a "
<< data.typeName() << "(" << data.type() << ")" << endl;
// dateTime will be invalid, then set to 1970-01-01
}
- QDateTime dateTime ( data.toDateTime() );
+ TQDateTime dateTime ( data.toDateTime() );
if ( !dateTime.isValid() )
return i18n("No date set"); // e.g. old KWord documents
@@ -243,39 +243,39 @@ QString KoVariableDateFormat::convert( const QVariant& data ) const
else if ( m_strFormat.lower() == "localedatetimeshort" )
return KGlobal::locale()->formatDateTime( dateTime, true );
- QString tmp ( dateTime.toString(m_strFormat) );
+ TQString tmp ( dateTime.toString(m_strFormat) );
const int month = dateTime.date().month();
- tmp.replace("PPPP", KGlobal::locale()->calendar()->monthNamePossessive(month, false)); //long possessive month name
- tmp.replace("PPP", KGlobal::locale()->calendar()->monthNamePossessive(month, true)); //short possessive month name
+ tmp.tqreplace("PPPP", KGlobal::locale()->calendar()->monthNamePossessive(month, false)); //long possessive month name
+ tmp.tqreplace("PPP", KGlobal::locale()->calendar()->monthNamePossessive(month, true)); //short possessive month name
return tmp;
}
-QCString KoVariableDateFormat::key() const
+TQCString KoVariableDateFormat::key() const
{
return getKey( m_strFormat );
}
-QCString KoVariableDateFormat::getKey( const QString& props ) const
+TQCString KoVariableDateFormat::getKey( const TQString& props ) const
{
- return QCString("DATE") + props.utf8();
+ return TQCString("DATE") + props.utf8();
}
-void KoVariableDateFormat::load( const QCString &key )
+void KoVariableDateFormat::load( const TQCString &key )
{
- QCString params( key.mid( 4 ) ); // skip "DATE"
+ TQCString params( key.mid( 4 ) ); // skip "DATE"
if ( !params.isEmpty() )
{
if (params[0] == '1' || params[0] == '0') // old m_bShort crap
params = params.mid(1); // skip it
- m_strFormat = QString::fromUtf8( params );
+ m_strFormat = TQString::fromUtf8( params );
}
}
// Used by KoVariableFormatCollection::popupActionList(), to apply all formats
// to the current data, in the popup menu.
-QStringList KoVariableDateFormat::staticFormatPropsList()
+TQStringList KoVariableDateFormat::staticFormatPropsList()
{
- QStringList listDateFormat;
+ TQStringList listDateFormat;
listDateFormat<<"locale";
listDateFormat<<"localeshort";
listDateFormat<<"localedatetime";
@@ -301,9 +301,9 @@ QStringList KoVariableDateFormat::staticFormatPropsList()
// Used by dateformatwidget_impl
// TODO: shouldn't it apply the formats to the value, like the popupmenu does?
-QStringList KoVariableDateFormat::staticTranslatedFormatPropsList()
+TQStringList KoVariableDateFormat::staticTranslatedFormatPropsList()
{
- QStringList listDateFormat;
+ TQStringList listDateFormat;
listDateFormat<<i18n("Locale date format");
listDateFormat<<i18n("Short locale date format");
listDateFormat<<i18n("Locale date & time format");
@@ -333,20 +333,20 @@ KoVariableTimeFormat::KoVariableTimeFormat() : KoVariableFormat()
{
}
-void KoVariableTimeFormat::load( const QCString &key )
+void KoVariableTimeFormat::load( const TQCString &key )
{
- QCString params( key.mid( 4 ) );
+ TQCString params( key.mid( 4 ) );
if ( !params.isEmpty() )
- m_strFormat = QString::fromUtf8(params);
+ m_strFormat = TQString::fromUtf8(params);
}
-QString KoVariableTimeFormat::convert( const QVariant & time ) const
+TQString KoVariableTimeFormat::convert( const TQVariant & time ) const
{
- if ( time.type() != QVariant::Time )
+ if ( time.type() != TQVariant::Time )
{
kdDebug(32500)<<" Error in KoVariableTimeFormat::convert. Value is a "
<< time.typeName() << "(" << time.type() << ")" << endl;
- return QString::null;
+ return TQString();
}
if( m_strFormat.lower() == "locale" || m_strFormat.isEmpty() )
@@ -354,21 +354,21 @@ QString KoVariableTimeFormat::convert( const QVariant & time ) const
return time.toTime().toString(m_strFormat);
}
-QCString KoVariableTimeFormat::key() const
+TQCString KoVariableTimeFormat::key() const
{
return getKey( m_strFormat );
}
-QCString KoVariableTimeFormat::getKey( const QString& props ) const
+TQCString KoVariableTimeFormat::getKey( const TQString& props ) const
{
- return QCString("TIME") + props.utf8();
+ return TQCString("TIME") + props.utf8();
}
// Used by KoVariableFormatCollection::popupActionList(), to apply all formats
// to the current data, in the popup menu.
-QStringList KoVariableTimeFormat::staticFormatPropsList()
+TQStringList KoVariableTimeFormat::staticFormatPropsList()
{
- QStringList listTimeFormat;
+ TQStringList listTimeFormat;
listTimeFormat<<"locale";
listTimeFormat<<"hh:mm";
listTimeFormat<<"hh:mm:ss";
@@ -379,9 +379,9 @@ QStringList KoVariableTimeFormat::staticFormatPropsList()
}
// Used by timeformatwidget_impl
-QStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
+TQStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
{
- QStringList listTimeFormat;
+ TQStringList listTimeFormat;
listTimeFormat<<i18n("Locale format");
listTimeFormat<<"hh:mm";
listTimeFormat<<"hh:mm:ss";
@@ -393,49 +393,49 @@ QStringList KoVariableTimeFormat::staticTranslatedFormatPropsList()
////
-QString KoVariableStringFormat::convert( const QVariant & string ) const
+TQString KoVariableStringFormat::convert( const TQVariant & string ) const
{
- if ( string.type() != QVariant::String )
+ if ( string.type() != TQVariant::String )
{
kdDebug(32500)<<" Error in KoVariableStringFormat::convert. Value is a " << string.typeName() << endl;
- return QString::null;
+ return TQString();
}
return string.toString();
}
-QCString KoVariableStringFormat::key() const
+TQCString KoVariableStringFormat::key() const
{
- return getKey( QString::null );
+ return getKey( TQString() );
// TODO prefix & suffix
}
-QCString KoVariableStringFormat::getKey( const QString& props ) const
+TQCString KoVariableStringFormat::getKey( const TQString& props ) const
{
- return QCString("STRING") + props.utf8();
+ return TQCString("STRING") + props.utf8();
}
////
-QString KoVariableNumberFormat::convert( const QVariant &value ) const
+TQString KoVariableNumberFormat::convert( const TQVariant &value ) const
{
- if ( value.type() != QVariant::Int )
+ if ( value.type() != TQVariant::Int )
{
kdDebug(32500)<<" Error in KoVariableNumberFormat::convert. Value is a " << value.typeName() << endl;
- return QString::null;
+ return TQString();
}
- return QString::number( value.toInt() );
+ return TQString::number( value.toInt() );
}
-QCString KoVariableNumberFormat::key() const
+TQCString KoVariableNumberFormat::key() const
{
- return getKey(QString::null);
+ return getKey(TQString());
}
-QCString KoVariableNumberFormat::getKey( const QString& props ) const
+TQCString KoVariableNumberFormat::getKey( const TQString& props ) const
{
- return QCString("NUMB") + props.utf8();
+ return TQCString("NUMB") + props.utf8();
}
////
@@ -445,7 +445,7 @@ KoVariableFormatCollection::KoVariableFormatCollection()
m_dict.setAutoDelete( true );
}
-KoVariableFormat * KoVariableFormatCollection::format( const QCString &key )
+KoVariableFormat * KoVariableFormatCollection::format( const TQCString &key )
{
KoVariableFormat *f = m_dict[ key.data() ];
if (f)
@@ -454,12 +454,12 @@ KoVariableFormat * KoVariableFormatCollection::format( const QCString &key )
return createFormat( key );
}
-KoVariableFormat * KoVariableFormatCollection::createFormat( const QCString &key )
+KoVariableFormat * KoVariableFormatCollection::createFormat( const TQCString &key )
{
kdDebug(32500) << "KoVariableFormatCollection: creating format for key=" << key << endl;
KoVariableFormat * format = 0L;
// The first 4 chars identify the class
- QCString type = key.left(4);
+ TQCString type = key.left(4);
if ( type == "DATE" )
format = new KoVariableDateFormat();
else if ( type == "TIME" )
@@ -508,13 +508,13 @@ void KoVariableCollection::registerVariable( KoVariable *var )
void KoVariableCollection::unregisterVariable( KoVariable *var )
{
- variables.take( variables.findRef( var ) );
+ variables.take( variables.tqfindRef( var ) );
}
-QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
+TQValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
{
- QValueList<KoVariable *> modifiedVariables;
- QPtrListIterator<KoVariable> it( variables );
+ TQValueList<KoVariable *> modifiedVariables;
+ TQPtrListIterator<KoVariable> it( variables );
for ( ; it.current() ; ++it )
{
KoVariable* variable = it.current();
@@ -522,7 +522,7 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
continue;
if ( variable->type() == type || type == VT_ALL )
{
- QVariant oldValue = variable->varValue();
+ TQVariant oldValue = variable->varValue();
variable->recalc();
if(variable->height == 0)
variable->resize();
@@ -532,7 +532,7 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
if ( parag )
{
//kdDebug(32500) << "KoDoc::recalcVariables -> invalidating parag " << parag->paragId() << endl;
- parag->invalidate( 0 );
+ parag->tqinvalidate( 0 );
parag->setChanged( true );
}
}
@@ -541,27 +541,27 @@ QValueList<KoVariable *> KoVariableCollection::recalcVariables(int type)
// TODO pass list of textdocuments as argument
// Or even better, call emitRepaintChanged on all modified textobjects
if( !modifiedVariables.isEmpty() )
- emit repaintVariable();
+ emit tqrepaintVariable();
#endif
return modifiedVariables;
}
-void KoVariableCollection::setVariableValue( const QString &name, const QString &value )
+void KoVariableCollection::setVariableValue( const TQString &name, const TQString &value )
{
varValues[ name ] = value;
}
-QString KoVariableCollection::getVariableValue( const QString &name ) const
+TQString KoVariableCollection::getVariableValue( const TQString &name ) const
{
- if ( !varValues.contains( name ) )
+ if ( !varValues.tqcontains( name ) )
return i18n( "No value" );
return varValues[ name ];
}
-bool KoVariableCollection::customVariableExist(const QString &varname) const
+bool KoVariableCollection::customVariableExist(const TQString &varname) const
{
- return varValues.contains( varname );
+ return varValues.tqcontains( varname );
}
void KoVariableCollection::setVariableSelected(KoVariable * var)
@@ -569,22 +569,22 @@ void KoVariableCollection::setVariableSelected(KoVariable * var)
m_varSelected=var;
}
-// TODO change to QValueList<KAction *>, but only once plugActionList takes that
-QPtrList<KAction> KoVariableCollection::popupActionList() const
+// TODO change to TQValueList<KAction *>, but only once plugActionList takes that
+TQPtrList<KAction> KoVariableCollection::popupActionList() const
{
- QPtrList<KAction> listAction;
+ TQPtrList<KAction> listAction;
// Insert list of actions that change the subtype
- const QStringList subTypeList = m_varSelected->subTypeList();
+ const TQStringList subTypeList = m_varSelected->subTypeList();
kdDebug() << k_funcinfo << "current subtype=" << m_varSelected->subType() << endl;
- QStringList::ConstIterator it = subTypeList.begin();
+ TQStringList::ConstIterator it = subTypeList.begin();
for ( int i = 0; it != subTypeList.end() ; ++it, ++i )
{
if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
{
// We store the subtype number as the action name
- QCString name; name.setNum(i);
+ TQCString name; name.setNum(i);
KToggleAction * act = new KToggleAction( *it, KShortcut(), 0, name );
- connect( act, SIGNAL(activated()), this, SLOT(slotChangeSubType()) );
+ connect( act, TQT_SIGNAL(activated()), this, TQT_SLOT(slotChangeSubType()) );
if ( i == m_varSelected->subType() )
act->setChecked( true );
//m_subTextMap.insert( act, i );
@@ -593,9 +593,9 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
}
// Insert list of actions that change the format properties
KoVariableFormat* format = m_varSelected->variableFormat();
- QString currentFormat = format->formatProperties();
+ TQString currentFormat = format->formatProperties();
- const QStringList list = format->formatPropsList();
+ const TQStringList list = format->formatPropsList();
it = list.begin();
for ( int i = 0; it != list.end() ; ++it, ++i )
{
@@ -605,10 +605,10 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
{
format->setFormatProperties( *it ); // temporary change
- QString text = format->convert( m_varSelected->varValue() );
+ TQString text = format->convert( m_varSelected->varValue() );
// We store the raw format as the action name
KToggleAction * act = new KToggleAction(text, KShortcut(), 0, (*it).utf8());
- connect( act, SIGNAL(activated()), this, SLOT(slotChangeFormat()) );
+ connect( act, TQT_SIGNAL(activated()), this, TQT_SLOT(slotChangeFormat()) );
if ( (*it) == currentFormat )
act->setChecked( true );
listAction.append( act );
@@ -623,7 +623,7 @@ QPtrList<KAction> KoVariableCollection::popupActionList() const
void KoVariableCollection::slotChangeSubType()
{
KAction * act = (KAction *)(sender());
- int menuNumber = QCString(act->name()).toInt();
+ int menuNumber = TQCString(act->name()).toInt();
int newSubType = m_varSelected->variableSubType(menuNumber);
kdDebug(32500) << "slotChangeSubType: menuNumber=" << menuNumber << " newSubType=" << newSubType << endl;
if ( m_varSelected->subType() != newSubType )
@@ -638,8 +638,8 @@ void KoVariableCollection::slotChangeSubType()
void KoVariableCollection::slotChangeFormat()
{
KAction * act = (KAction *)(sender());
- QString newFormat = QString::fromUtf8(act->name());
- QString oldFormat = m_varSelected->variableFormat()->formatProperties();
+ TQString newFormat = TQString::fromUtf8(act->name());
+ TQString oldFormat = m_varSelected->variableFormat()->formatProperties();
if (oldFormat != newFormat )
{
KCommand *cmd=new KoChangeVariableFormatProperties(
@@ -652,8 +652,8 @@ void KoVariableCollection::slotChangeFormat()
KoVariable * KoVariableCollection::createVariable( int type, short int subtype, KoVariableFormatCollection * coll, KoVariableFormat *varFormat,KoTextDocument *textdoc, KoDocument * doc, int _correct, bool _forceDefaultFormat, bool /*loadFootNote*/ )
{
Q_ASSERT( coll == m_formatCollection ); // why do we need a parameter ?!?
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
if ( varFormat == 0L )
{
// Get the default format for this variable (this method is only called in the interactive case, not when loading)
@@ -665,7 +665,7 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
varFormat = coll->format( KoDateVariable::defaultFormat() );
else
{
- QCString result = KoDateVariable::formatStr(_correct);
+ TQCString result = KoDateVariable::formatStr(_correct);
if ( result.isNull() )//we cancel insert variable
return 0L;
varFormat = coll->format( result );
@@ -679,7 +679,7 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
varFormat = coll->format( KoTimeVariable::defaultFormat() );
else
{
- QCString result = KoTimeVariable::formatStr(_correct);
+ TQCString result = KoTimeVariable::formatStr(_correct);
if ( result.isNull() )//we cancel insert variable
return 0L;
varFormat = coll->format( result );
@@ -727,16 +727,16 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
var = new KoFieldVariable( textdoc, subtype, varFormat,this,doc );
break;
case VT_CUSTOM:
- var = new KoCustomVariable( textdoc, QString::null, varFormat, this);
+ var = new KoCustomVariable( textdoc, TQString(), varFormat, this);
break;
case VT_MAILMERGE:
- var = new KoMailMergeVariable( textdoc, QString::null, varFormat ,this);
+ var = new KoMailMergeVariable( textdoc, TQString(), varFormat ,this);
break;
case VT_LINK:
- var = new KoLinkVariable( textdoc,QString::null, QString::null, varFormat ,this);
+ var = new KoLinkVariable( textdoc,TQString(), TQString(), varFormat ,this);
break;
case VT_NOTE:
- var = new KoNoteVariable( textdoc, QString::null, varFormat ,this);
+ var = new KoNoteVariable( textdoc, TQString(), varFormat ,this);
break;
}
Q_ASSERT( var );
@@ -744,20 +744,20 @@ KoVariable * KoVariableCollection::createVariable( int type, short int subtype,
}
-KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context )
+KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context )
{
- const QString localName( tag.localName() );
+ const TQString localName( tag.localName() );
const bool isTextNS = tag.namespaceURI() == KoXmlNS::text;
- QString key;
+ TQString key;
int type = -1;
if ( isTextNS )
{
if ( localName.endsWith( "date" ) || localName.endsWith( "time" ) )
{
- QString dataStyleName = tag.attributeNS( KoXmlNS::style, "data-style-name", QString::null );
- QString dateFormat = "locale";
+ TQString dataStyleName = tag.attributeNS( KoXmlNS::style, "data-style-name", TQString() );
+ TQString dateFormat = "locale";
const KoOasisStyles::DataFormatsMap& map = context.oasisStyles().dataFormats();
- KoOasisStyles::DataFormatsMap::const_iterator it = map.find( dataStyleName );
+ KoOasisStyles::DataFormatsMap::const_iterator it = map.tqfind( dataStyleName );
if ( it != map.end() )
dateFormat = (*it).formatStr;
@@ -835,7 +835,7 @@ KoVariable* KoVariableCollection::loadOasisField( KoTextDocument* textdoc, const
return loadOasisFieldCreateVariable( textdoc, tag, context, key, type );
}
-KoVariable* KoVariableCollection::loadOasisFieldCreateVariable( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context, const QString &key, int type )
+KoVariable* KoVariableCollection::loadOasisFieldCreateVariable( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context, const TQString &key, int type )
{
KoVariableFormat * varFormat = key.isEmpty() ? 0 : m_formatCollection->format( key.latin1() );
// If varFormat is 0 (no key specified), the default format will be used.
@@ -865,9 +865,9 @@ KoVariable::~KoVariable()
//delete d;
}
-QStringList KoVariable::subTypeList()
+TQStringList KoVariable::subTypeList()
{
- return QStringList();
+ return TQStringList();
}
void KoVariable::resize()
@@ -875,15 +875,15 @@ void KoVariable::resize()
if ( m_deleted )
return;
KoTextFormat *fmt = format();
- QFontMetrics fm = fmt->refFontMetrics();
- QString txt = text();
+ TQFontMetrics fm = fmt->refFontMetrics();
+ TQString txt = text();
width = 0;
// size at 100%
for ( int i = 0 ; i < (int)txt.length() ; ++i )
width += fm.width( txt[i] ); // was fm.charWidth(txt,i), but see drawCustomItemHelper...
// zoom to LU
- width = qRound( KoTextZoomHandler::ptToLayoutUnitPt( width ) );
+ width = tqRound( KoTextZoomHandler::ptToLayoutUnitPt( width ) );
height = fmt->height();
m_ascent = fmt->ascent();
//kdDebug(32500) << "KoVariable::resize text=" << txt << " width=" << width << " height=" << height << " ascent=" << m_ascent << endl;
@@ -896,21 +896,21 @@ void KoVariable::recalcAndRepaint()
if ( parag )
{
//kdDebug(32500) << "KoVariable::recalcAndRepaint -> invalidating parag " << parag->paragId() << endl;
- parag->invalidate( 0 );
+ parag->tqinvalidate( 0 );
parag->setChanged( true );
}
textDocument()->emitRepaintChanged();
}
-QString KoVariable::fieldCode()
+TQString KoVariable::fieldCode()
{
return i18n("Variable");
}
-QString KoVariable::text(bool realValue)
+TQString KoVariable::text(bool realValue)
{
KoTextFormat *fmt = format();
- QString str;
+ TQString str;
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
str = fieldCode();
else
@@ -919,15 +919,15 @@ QString KoVariable::text(bool realValue)
return fmt->displayedString( str);
}
-void KoVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
KoTextFormat * fmt = format();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
- QFont font( fmt->screenFont( zh ) );
+ TQFont font( fmt->screenFont( zh ) );
drawCustomItemHelper( p, x, y, wpix, hpix, ascentpix, cg, selected, offset, fmt, font, fmt->color(), drawingShadow );
}
-void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const QColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const QFont& font, QColor textColor, bool drawingShadow )
+void KoVariable::drawCustomItemHelper( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const TQColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const TQFont& font, TQColor textColor, bool drawingShadow )
{
// Important: the y value already includes the difference between the parag baseline
// and the char's own baseline (ascent) (see paintDefault in korichtext.cpp)
@@ -946,26 +946,26 @@ void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int
}
else if ( selected )
{
- textColor = cg.color( QColorGroup::HighlightedText );
- p->setPen( QPen( textColor ) );
- p->fillRect( x, y, wpix, hpix, cg.color( QColorGroup::Highlight ) );
+ textColor = cg.color( TQColorGroup::HighlightedText );
+ p->setPen( TQPen( textColor ) );
+ p->fillRect( x, y, wpix, hpix, cg.color( TQColorGroup::Highlight ) );
}
else if ( textDocument() && textDocument()->drawFormattingChars()
- && p->device()->devType() != QInternal::Printer )
+ && p->device()->devType() != TQInternal::Printer )
{
- textColor = cg.color( QColorGroup::Highlight );
- p->setPen( QPen ( textColor, 0, Qt::DotLine ) );
+ textColor = cg.color( TQColorGroup::Highlight );
+ p->setPen( TQPen ( textColor, 0, TQt::DotLine ) );
p->drawRect( x, y, wpix, hpix );
}
else {
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( p );
- p->setPen( QPen( textColor ) );
+ p->setPen( TQPen( textColor ) );
}
p->setFont( font ); // already done by KoTextCustomItem::draw but someone might
// change the font passed to drawCustomItemHelper (e.g. KoLinkVariable)
- QString str = text();
+ TQString str = text();
KoTextParag::drawFontEffects( p, fmt, zh, font, textColor, x, ascentpix, wpix, y, hpix, str[0] );
int posY = y + ascentpix + offset;
if ( fmt->vAlign() == KoTextFormat::AlignSubScript )
@@ -978,49 +978,49 @@ void KoVariable::drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int
//p->drawText( x, posY, str );
// We can't just drawText, it wouldn't use the same kerning as the one
// that resize() planned for [which is zoom-independent].
- // We need to do the layout using layout units instead, so for simplicity
+ // We need to do the tqlayout using tqlayout units instead, so for simplicity
// I just draw every char individually (whereas KoTextFormatter/KoTextParag
// detect runs of text that can be drawn together)
const int len = str.length();
int xLU = zh->pixelToLayoutUnitX( x );
- QFontMetrics fm = fmt->refFontMetrics();
+ TQFontMetrics fm = fmt->refFontMetrics();
for ( int i = 0; i < len; ++i )
{
- const QChar ch = str[i];
- p->drawText( x, posY, ch );
- // Do like KoTextFormatter: do the layout in layout units.
+ const TQChar ch = str[i];
+ p->drawText( x, posY, TQString(ch) );
+ // Do like KoTextFormatter: do the tqlayout in tqlayout units.
xLU += KoTextZoomHandler::ptToLayoutUnitPt( fm.width( ch ) );
- // And then compute the X position in pixels from the layout unit X.
- x = zh->layoutUnitToPixelX( xLU );
+ // And then compute the X position in pixels from the tqlayout unit X.
+ x = zh->tqlayoutUnitToPixelX( xLU );
}
p->restore();
}
-void KoVariable::save( QDomElement &parentElem )
+void KoVariable::save( TQDomElement &tqparentElem )
{
//kdDebug(32500) << "KoVariable::save" << endl;
- QDomElement variableElem = parentElem.ownerDocument().createElement( "VARIABLE" );
- parentElem.appendChild( variableElem );
- QDomElement typeElem = parentElem.ownerDocument().createElement( "TYPE" );
+ TQDomElement variableElem = tqparentElem.ownerDocument().createElement( "VARIABLE" );
+ tqparentElem.appendChild( variableElem );
+ TQDomElement typeElem = tqparentElem.ownerDocument().createElement( "TYPE" );
variableElem.appendChild( typeElem );
typeElem.setAttribute( "type", static_cast<int>( type() ) );
//// Of course, saving the key is ugly. We'll drop this when
//// switching to the OO format.
- typeElem.setAttribute( "key", m_varFormat->key() );
+ typeElem.setAttribute( "key", m_varFormat->key().data() );
typeElem.setAttribute( "text", text(true) );
if ( correctValue() != 0)
typeElem.setAttribute( "correct", correctValue() );
saveVariable( variableElem );
}
-void KoVariable::load( QDomElement & )
+void KoVariable::load( TQDomElement & )
{
}
-void KoVariable::loadOasis( const QDomElement &/*elem*/, KoOasisContext& /*context*/ )
+void KoVariable::loadOasis( const TQDomElement &/*elem*/, KoOasisContext& /*context*/ )
{
// nothing to do here, reimplemented in subclasses (make it pure virtual?)
}
@@ -1044,11 +1044,11 @@ void KoVariable::setVariableFormat( KoVariableFormat *_varFormat )
} \
}
-QString KoVariable::convertKlocaleToQDateTimeFormat( const QString & _format )
+TQString KoVariable::convertKlocaleToTQDateTimeFormat( const TQString & _format )
{
- QString newFormat;
- QString format( _format );
- QString text;
+ TQString newFormat;
+ TQString format( _format );
+ TQString text;
do
{
if ( format.startsWith( "%Y" ) )
@@ -1176,7 +1176,7 @@ KoDateVariable::KoDateVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoDateVariable::fieldCode()
+TQString KoDateVariable::fieldCode()
{
if ( m_subtype == VST_DATE_FIX )
return i18n("Date (Fixed)");
@@ -1195,7 +1195,7 @@ QString KoDateVariable::fieldCode()
void KoDateVariable::resize()
{
KoTextFormat * fmt = format();
- QString oldLanguage;
+ TQString oldLanguage;
if ( !fmt->language().isEmpty())
{
oldLanguage=KGlobal::locale()->language();
@@ -1211,7 +1211,7 @@ void KoDateVariable::resize()
void KoDateVariable::recalc()
{
if ( m_subtype == VST_DATE_CURRENT )
- m_varValue = QDateTime::currentDateTime().addDays(m_correctDate);
+ m_varValue = TQDateTime(TQDateTime::tqcurrentDateTime().addDays(m_correctDate));
else if ( m_subtype == VST_DATE_LAST_PRINTING )
m_varValue = m_varColl->variableSetting()->lastPrintingDate();
else if ( m_subtype == VST_DATE_CREATE_FILE )
@@ -1222,17 +1222,17 @@ void KoDateVariable::recalc()
{
// Only if never set before (i.e. upon insertion)
if ( m_varValue.isNull() )
- m_varValue = QDateTime::currentDateTime().addDays(m_correctDate);
+ m_varValue = TQDateTime(TQDateTime::tqcurrentDateTime().addDays(m_correctDate));
}
resize();
}
-void KoDateVariable::saveVariable( QDomElement& varElem )
+void KoDateVariable::saveVariable( TQDomElement& varElem )
{
- QDomElement elem = varElem.ownerDocument().createElement( "DATE" );
+ TQDomElement elem = varElem.ownerDocument().createElement( "DATE" );
varElem.appendChild( elem );
- QDate date = m_varValue.toDate(); // works with Date and DateTime
+ TQDate date = m_varValue.toDate(); // works with Date and DateTime
date = date.addDays( -m_correctDate );//remove correctDate value otherwise value stored is bad
elem.setAttribute( "year", date.year() );
elem.setAttribute( "month", date.month() );
@@ -1240,20 +1240,20 @@ void KoDateVariable::saveVariable( QDomElement& varElem )
elem.setAttribute( "fix", m_subtype == VST_DATE_FIX ); // for compat
elem.setAttribute( "correct", m_correctDate);
elem.setAttribute( "subtype", m_subtype);
- if ( m_varValue.type() == QVariant::DateTime )
+ if ( m_varValue.type() == TQVariant::DateTime )
{
- QTime time = m_varValue.toTime();
+ TQTime time = m_varValue.toTime();
elem.setAttribute( "hour", time.hour() );
elem.setAttribute( "minute", time.minute() );
elem.setAttribute( "second", time.second() );
}
}
-void KoDateVariable::load( QDomElement& elem )
+void KoDateVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "DATE" ).toElement();
+ TQDomElement e = elem.namedItem( "DATE" ).toElement();
if (!e.isNull())
{
const bool fix = e.attribute("fix").toInt() == 1;
@@ -1268,13 +1268,13 @@ void KoDateVariable::load( QDomElement& elem )
const int min = e.attribute("minute").toInt();
const int s = e.attribute("second").toInt();
const int ms = e.attribute("msecond").toInt();
- QDate date( y, month, d );
+ TQDate date( y, month, d );
date = date.addDays( m_correctDate );
- const QTime time( h, min, s, ms );
+ const TQTime time( h, min, s, ms );
if (time.isValid())
- m_varValue = QVariant ( QDateTime( date, time ) );
+ m_varValue = TQVariant ( TQDateTime( date, time ) );
else
- m_varValue = QVariant( date );
+ m_varValue = TQVariant( date );
}
//old date variable format
m_subtype = fix ? VST_DATE_FIX : VST_DATE_CURRENT;
@@ -1306,7 +1306,7 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.startElement( "text:modification-date" );
break;
}
- QString value( m_varFormat->formatProperties() );
+ TQString value( m_varFormat->formatProperties() );
bool klocaleFormat = false;
if ( value.lower() == "locale" ||
value.isEmpty() ||
@@ -1319,9 +1319,9 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
else if ( value.lower() == "localeshort" )
value = KGlobal::locale()->dateFormatShort();
else if ( value.lower() == "localedatetime" )
- value = QString( "%1 %2" ).arg( KGlobal::locale()->dateFormat() ).arg( KGlobal::locale()->timeFormat() );
+ value = TQString( "%1 %2" ).tqarg( KGlobal::locale()->dateFormat() ).tqarg( KGlobal::locale()->timeFormat() );
else if ( value.lower() == "localedatetimeshort" )
- value = QString( "%1 %2" ).arg( KGlobal::locale()->dateFormatShort() ).arg( KGlobal::locale()->timeFormat() );
+ value = TQString( "%1 %2" ).tqarg( KGlobal::locale()->dateFormatShort() ).tqarg( KGlobal::locale()->timeFormat() );
klocaleFormat = true;
}
writer.addAttribute( "style:data-style-name", KoOasisStyles::saveOasisDateStyle(context.mainStyles(), value, klocaleFormat ) );
@@ -1331,22 +1331,22 @@ void KoDateVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.endElement();
}
-void KoDateVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoDateVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "date" ) // current (or fixed) date
{
// Standard form of the date is in text:date-value. Example: 2004-01-21T10:57:05
- const QString dateValue = elem.attributeNS( KoXmlNS::text, "date-value", QString::null);
- QDateTime dt;
- if ( !dateValue.isEmpty() ) // avoid QDate warning
- dt = QDate::fromString(dateValue, Qt::ISODate);
+ const TQString dateValue = elem.attributeNS( KoXmlNS::text, "date-value", TQString());
+ TQDateTime dt;
+ if ( !dateValue.isEmpty() ) // avoid TQDate warning
+ dt = TQDate::fromString(dateValue, Qt::ISODate);
- bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", QString::null)=="true");
+ bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", TQString())=="true");
if (!dt.isValid())
fixed = false; // OOo docs say so: not valid = current datetime
if ( fixed )
- m_varValue = QVariant( dt );
+ m_varValue = TQVariant( dt );
m_subtype = fixed ? VST_DATE_FIX : VST_DATE_CURRENT;
}
// For all those the value of the date will be retrieved from meta.xml
@@ -1356,14 +1356,14 @@ void KoDateVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*conte
m_subtype = VST_DATE_CREATE_FILE;
else if ( localName.startsWith( "modification" ) )
m_subtype = VST_DATE_MODIFY_FILE;
- const QString adjustStr = elem.attributeNS( KoXmlNS::text, "date-adjust", QString::null );
+ const TQString adjustStr = elem.attributeNS( KoXmlNS::text, "date-adjust", TQString() );
if ( !adjustStr.isEmpty() )
m_correctDate = ISODurationToDays( adjustStr );
}
-QStringList KoDateVariable::actionTexts()
+TQStringList KoDateVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Current Date (fixed)" );
lst << i18n( "Current Date (variable)" );
lst << i18n( "Date of Last Printing" );
@@ -1372,20 +1372,20 @@ QStringList KoDateVariable::actionTexts()
return lst;
}
-QStringList KoDateVariable::subTypeList()
+TQStringList KoDateVariable::subTypeList()
{
return KoDateVariable::actionTexts();
}
-QCString KoDateVariable::defaultFormat()
+TQCString KoDateVariable::defaultFormat()
{
- return QCString("DATE") + "locale";
+ return TQCString("DATE") + "locale";
}
-QCString KoDateVariable::formatStr(int & correct)
+TQCString KoDateVariable::formatStr(int & correct)
{
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
KDialogBase* dialog=new KDialogBase(0, 0, true, i18n("Date Format"), KDialogBase::Ok|KDialogBase::Cancel);
DateFormatWidget* widget=new DateFormatWidget(dialog);
int count=0;
@@ -1397,12 +1397,12 @@ QCString KoDateVariable::formatStr(int & correct)
const int noe=config->readNumEntry("Number Of Entries", 5);
for(int i=0;i<noe;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
- const QString tmpString(config->readEntry("Last Used"+num));
+ const TQString tmpString(config->readEntry("Last Used"+num));
if(tmpString.startsWith("locale"))
continue;
- else if(stringList.contains(tmpString))
+ else if(stringList.tqcontains(tmpString))
continue;
else if(!tmpString.isEmpty())
{
@@ -1418,12 +1418,12 @@ QCString KoDateVariable::formatStr(int & correct)
widget->combo1->insertStringList(stringList);
}
if(false) { // ### TODO: select the last used item
- QComboBox *combo= widget->combo1;
+ TQComboBox *combo= widget->combo1;
combo->setCurrentItem(combo->count() -1);
widget->updateLabel();
}
- if(dialog->exec()==QDialog::Accepted)
+ if(dialog->exec()==TQDialog::Accepted)
{
string = widget->resultString().utf8();
correct = widget->correctValue();
@@ -1438,13 +1438,13 @@ QCString KoDateVariable::formatStr(int & correct)
stringList.prepend(string);
for(int i=0;i<=count;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
config->writeEntry("Last Used"+num, stringList[i]);
}
config->sync();
delete dialog;
- return QCString("DATE") + string;
+ return TQCString("DATE") + string;
}
/******************************************************************/
@@ -1455,7 +1455,7 @@ KoTimeVariable::KoTimeVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoTimeVariable::fieldCode()
+TQString KoTimeVariable::fieldCode()
{
return (m_subtype == VST_TIME_FIX)?i18n("Time (Fixed)"):i18n("Time");
}
@@ -1466,7 +1466,7 @@ void KoTimeVariable::resize()
KoTextFormat * fmt = format();
if ( !fmt->language().isEmpty() )
{
- QString oldLanguage = KGlobal::locale()->language();
+ TQString oldLanguage = KGlobal::locale()->language();
bool changeLanguage = KGlobal::locale()->setLanguage( fmt->language() );
KoVariable::resize();
if ( changeLanguage )
@@ -1479,23 +1479,23 @@ void KoTimeVariable::resize()
void KoTimeVariable::recalc()
{
if ( m_subtype == VST_TIME_CURRENT )
- m_varValue = QVariant( QTime::currentTime().addSecs(60*m_correctTime));
+ m_varValue = TQVariant( TQTime(TQTime::currentTime().addSecs(60*m_correctTime)));
else
{
// Only if never set before (i.e. upon insertion)
if ( m_varValue.toTime().isNull() )
- m_varValue = QVariant( QTime::currentTime().addSecs(60*m_correctTime));
+ m_varValue = TQVariant( TQTime(TQTime::currentTime().addSecs(60*m_correctTime)));
}
resize();
}
-void KoTimeVariable::saveVariable( QDomElement& parentElem )
+void KoTimeVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "TIME" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "TIME" );
+ tqparentElem.appendChild( elem );
- QTime time = m_varValue.toTime();
+ TQTime time = m_varValue.toTime();
time = time.addSecs(-60*m_correctTime);
elem.setAttribute( "hour", time.hour() );
elem.setAttribute( "minute", time.minute() );
@@ -1505,11 +1505,11 @@ void KoTimeVariable::saveVariable( QDomElement& parentElem )
elem.setAttribute( "correct", m_correctTime );
}
-void KoTimeVariable::load( QDomElement& elem )
+void KoTimeVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "TIME" ).toElement();
+ TQDomElement e = elem.namedItem( "TIME" ).toElement();
if (!e.isNull())
{
int h = e.attribute("hour").toInt();
@@ -1522,10 +1522,10 @@ void KoTimeVariable::load( QDomElement& elem )
bool fix = static_cast<bool>( e.attribute("fix").toInt() );
if ( fix )
{
- QTime time;
+ TQTime time;
time.setHMS( h, m, s, ms );
time = time.addSecs( 60*m_correctTime );
- m_varValue = QVariant( time);
+ m_varValue = TQVariant( time);
}
m_subtype = fix ? VST_TIME_FIX : VST_TIME_CURRENT;
@@ -1533,22 +1533,22 @@ void KoTimeVariable::load( QDomElement& elem )
}
}
-void KoTimeVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoTimeVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
Q_ASSERT( localName == "time" ); // caller checked for it
if ( localName == "time" ) // current (or fixed) time
{
- // Use QDateTime to work around a possible problem of QTime::fromString in Qt 3.2.2
- QDateTime dt(QDateTime::fromString(elem.attributeNS( KoXmlNS::text, "time-value", QString::null), Qt::ISODate));
+ // Use TQDateTime to work around a possible problem of TQTime::fromString in TQt 3.2.2
+ TQDateTime dt(TQDateTime::fromString(elem.attributeNS( KoXmlNS::text, "time-value", TQString()), Qt::ISODate));
- bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", QString::null)=="true");
+ bool fixed = (elem.hasAttributeNS( KoXmlNS::text, "fixed") && elem.attributeNS( KoXmlNS::text, "fixed", TQString())=="true");
if (!dt.isValid())
fixed = false; // OOo docs say so: not valid = current datetime
if ( fixed )
- m_varValue = QVariant( dt.time() );
+ m_varValue = TQVariant( dt.time() );
m_subtype = fixed ? VST_TIME_FIX : VST_TIME_CURRENT;
- QString adjustStr = elem.attributeNS( KoXmlNS::text, "time-adjust", QString::null );
+ TQString adjustStr = elem.attributeNS( KoXmlNS::text, "time-adjust", TQString() );
if ( !adjustStr.isEmpty() )
m_correctTime = ISODurationToMinutes( adjustStr );
}
@@ -1566,7 +1566,7 @@ void KoTimeVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
writer.addAttribute( "text:time-value", m_varValue.toTime().toString( Qt::ISODate ) );
}
- QString value( m_varFormat->formatProperties() );
+ TQString value( m_varFormat->formatProperties() );
bool klocaleFormat = false;
if ( value.lower() == "locale" )
{
@@ -1581,23 +1581,23 @@ void KoTimeVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& context )
}
-QStringList KoTimeVariable::actionTexts()
+TQStringList KoTimeVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Current Time (fixed)" );
lst << i18n( "Current Time (variable)" );
return lst;
}
-QStringList KoTimeVariable::subTypeList()
+TQStringList KoTimeVariable::subTypeList()
{
return KoTimeVariable::actionTexts();
}
-QCString KoTimeVariable::formatStr(int & _correct)
+TQCString KoTimeVariable::formatStr(int & _correct)
{
- QCString string;
- QStringList stringList;
+ TQCString string;
+ TQStringList stringList;
KDialogBase* dialog=new KDialogBase(0, 0, true, i18n("Time Format"), KDialogBase::Ok|KDialogBase::Cancel);
TimeFormatWidget* widget=new TimeFormatWidget(dialog);
dialog->setMainWidget(widget);
@@ -1609,12 +1609,12 @@ QCString KoTimeVariable::formatStr(int & _correct)
const int noe=config->readNumEntry("Number Of Entries", 5);
for(int i=0;i<noe;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
- QString tmpString(config->readEntry("Last Used"+num));
+ TQString tmpString(config->readEntry("Last Used"+num));
if(tmpString.startsWith("locale"))
continue;
- else if(stringList.contains(tmpString))
+ else if(stringList.tqcontains(tmpString))
continue;
else if(!tmpString.isEmpty())
{
@@ -1630,10 +1630,10 @@ QCString KoTimeVariable::formatStr(int & _correct)
}
if(false) // ### TODO: select the last used item
{
- QComboBox *combo= widget->combo1;
+ TQComboBox *combo= widget->combo1;
combo->setCurrentItem(combo->count() -1);
}
- if(dialog->exec()==QDialog::Accepted)
+ if(dialog->exec()==TQDialog::Accepted)
{
string = widget->resultString().utf8();
_correct = widget->correctValue();
@@ -1648,36 +1648,36 @@ QCString KoTimeVariable::formatStr(int & _correct)
stringList.prepend(string);
for(int i=0;i<=count;i++)
{
- QString num;
+ TQString num;
num.setNum(i);
config->writeEntry("Last Used"+num, stringList[i]);
}
config->sync();
delete dialog;
- return QCString("TIME"+string );
+ return TQCString("TIME"+string );
}
-QCString KoTimeVariable::defaultFormat()
+TQCString KoTimeVariable::defaultFormat()
{
- return QCString(QCString("TIME")+QCString("locale") );
+ return TQCString(TQCString("TIME")+TQCString("locale") );
}
/******************************************************************/
/* Class: KoCustomVariable */
/******************************************************************/
-KoCustomVariable::KoCustomVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl )
+KoCustomVariable::KoCustomVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
{
- m_varValue = QVariant( name );
+ m_varValue = TQVariant( name );
}
-QString KoCustomVariable::fieldCode()
+TQString KoCustomVariable::fieldCode()
{
return i18n("Custom Variable");
}
-QString KoCustomVariable::text(bool realValue)
+TQString KoCustomVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -1687,28 +1687,28 @@ QString KoCustomVariable::text(bool realValue)
-void KoCustomVariable::saveVariable( QDomElement& parentElem )
+void KoCustomVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "CUSTOM" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "CUSTOM" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "name", m_varValue.toString() );
elem.setAttribute( "value", value() );
}
-void KoCustomVariable::load( QDomElement& elem )
+void KoCustomVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "CUSTOM" ).toElement();
+ TQDomElement e = elem.namedItem( "CUSTOM" ).toElement();
if (!e.isNull())
{
- m_varValue = QVariant (e.attribute( "name" ));
+ m_varValue = TQVariant (e.attribute( "name" ));
setValue( e.attribute( "value" ) );
}
}
-void KoCustomVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoCustomVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
// We treat all those the same. For OO/OpenDocument the difference is that
// - user-field-get is related to text:user-field-decls in <body>
// - variable-set is related to variable-decls (defined in <body>);
@@ -1717,7 +1717,7 @@ void KoCustomVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*con
if ( localName == "variable-set"
|| localName == "user-defined"
|| localName == "user-field-get" ) {
- m_varValue = elem.attributeNS( KoXmlNS::text, "name", QString::null );
+ m_varValue = elem.attributeNS( KoXmlNS::text, "name", TQString() );
setValue( elem.text() );
}
}
@@ -1731,19 +1731,19 @@ void KoCustomVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*contex
writer.endElement();
}
-QString KoCustomVariable::value() const
+TQString KoCustomVariable::value() const
{
return m_varColl->getVariableValue( m_varValue.toString() );
}
-void KoCustomVariable::setValue( const QString &v )
+void KoCustomVariable::setValue( const TQString &v )
{
m_varColl->setVariableValue( m_varValue.toString(), v );
}
-QStringList KoCustomVariable::actionTexts()
+TQStringList KoCustomVariable::actionTexts()
{
- return QStringList( i18n( "Custom..." ) );
+ return TQStringList( i18n( "Custom..." ) );
}
void KoCustomVariable::recalc()
@@ -1754,18 +1754,18 @@ void KoCustomVariable::recalc()
/******************************************************************/
/* Class: KoMailMergeVariable */
/******************************************************************/
-KoMailMergeVariable::KoMailMergeVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoMailMergeVariable::KoMailMergeVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat, _varColl )
{
- m_varValue = QVariant ( name );
+ m_varValue = TQVariant ( name );
}
-QString KoMailMergeVariable::fieldCode()
+TQString KoMailMergeVariable::fieldCode()
{
return i18n("Mail Merge");
}
-void KoMailMergeVariable::loadOasis( const QDomElement &/*elem*/, KoOasisContext& /*context*/ )
+void KoMailMergeVariable::loadOasis( const TQDomElement &/*elem*/, KoOasisContext& /*context*/ )
{
// TODO
}
@@ -1777,38 +1777,38 @@ void KoMailMergeVariable::saveOasis( KoXmlWriter& /*writer*/, KoSavingContext& /
-void KoMailMergeVariable::saveVariable( QDomElement& parentElem )
+void KoMailMergeVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement elem = parentElem.ownerDocument().createElement( "MAILMERGE" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "MAILMERGE" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "name", m_varValue.toString() );
}
-void KoMailMergeVariable::load( QDomElement& elem )
+void KoMailMergeVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "MAILMERGE" ).toElement();
+ TQDomElement e = elem.namedItem( "MAILMERGE" ).toElement();
if (!e.isNull())
- m_varValue = QVariant( e.attribute( "name" ) );
+ m_varValue = TQVariant( e.attribute( "name" ) );
}
-QString KoMailMergeVariable::value() const
+TQString KoMailMergeVariable::value() const
{
- return QString();//m_doc->getMailMergeDataBase()->getValue( m_name );
+ return TQString();//m_doc->getMailMergeDataBase()->getValue( m_name );
}
-QString KoMailMergeVariable::text(bool /*realValue*/)
+TQString KoMailMergeVariable::text(bool /*realValue*/)
{
// ## should use a format maybe
- QString v = value();
+ TQString v = value();
if ( v == name() )
return "<" + v + ">";
return v;
}
-QStringList KoMailMergeVariable::actionTexts()
+TQStringList KoMailMergeVariable::actionTexts()
{
- return QStringList( i18n( "&Mail Merge..." ) );
+ return TQStringList( i18n( "&Mail Merge..." ) );
}
/******************************************************************/
@@ -1819,7 +1819,7 @@ KoPageVariable::KoPageVariable( KoTextDocument *textdoc, short int subtype, KoVa
{
}
-QString KoPageVariable::fieldCode()
+TQString KoPageVariable::fieldCode()
{
if ( m_subtype == VST_PGNUM_CURRENT )
return i18n("Page Current Num");
@@ -1837,10 +1837,10 @@ QString KoPageVariable::fieldCode()
}
-void KoPageVariable::saveVariable( QDomElement& parentElem )
+void KoPageVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement pgNumElem = parentElem.ownerDocument().createElement( "PGNUM" );
- parentElem.appendChild( pgNumElem );
+ TQDomElement pgNumElem = tqparentElem.ownerDocument().createElement( "PGNUM" );
+ tqparentElem.appendChild( pgNumElem );
pgNumElem.setAttribute( "subtype", m_subtype );
if ( m_subtype != VST_CURRENT_SECTION )
pgNumElem.setAttribute( "value", m_varValue.toInt() );
@@ -1848,18 +1848,18 @@ void KoPageVariable::saveVariable( QDomElement& parentElem )
pgNumElem.setAttribute( "value", m_varValue.toString() );
}
-void KoPageVariable::load( QDomElement& elem )
+void KoPageVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement pgNumElem = elem.namedItem( "PGNUM" ).toElement();
+ TQDomElement pgNumElem = elem.namedItem( "PGNUM" ).toElement();
if (!pgNumElem.isNull())
{
m_subtype = pgNumElem.attribute("subtype").toInt();
// ### This could use the format...
if ( m_subtype != VST_CURRENT_SECTION )
- m_varValue = QVariant(pgNumElem.attribute("value").toInt());
+ m_varValue = TQVariant(pgNumElem.attribute("value").toInt());
else
- m_varValue = QVariant(pgNumElem.attribute("value"));
+ m_varValue = TQVariant(pgNumElem.attribute("value"));
}
}
@@ -1905,28 +1905,28 @@ void KoPageVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
}
}
-void KoPageVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoPageVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "page-number" )
{
m_subtype = VST_PGNUM_CURRENT;
if ( elem.hasAttributeNS( KoXmlNS::text, "select-page") )
{
- const QString select = elem.attributeNS( KoXmlNS::text, "select-page", QString::null);
+ const TQString select = elem.attributeNS( KoXmlNS::text, "select-page", TQString());
if (select == "previous")
m_subtype = VST_PGNUM_PREVIOUS;
else if (select == "next")
m_subtype = VST_PGNUM_NEXT;
}
// Missing: fixed, page adjustment, formatting style
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "chapter" )
{
m_subtype = VST_CURRENT_SECTION;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
// text:display attribute can be name, number (i.e. with prefix/suffix),
// number-and-name, plain-number-and-name, plain-number
// TODO: a special format class for this, so that it can be easily switched using the RMB
@@ -1934,13 +1934,13 @@ void KoPageVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*conte
else if ( localName == "page-count" )
{
m_subtype = VST_PGNUM_TOTAL;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
}
}
-QStringList KoPageVariable::actionTexts()
+TQStringList KoPageVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Page Number" );
lst << i18n( "Number of Pages" );
lst << i18n( "Section Title" );
@@ -1949,7 +1949,7 @@ QStringList KoPageVariable::actionTexts()
return lst;
}
-QStringList KoPageVariable::subTypeList()
+TQStringList KoPageVariable::subTypeList()
{
return KoPageVariable::actionTexts();
}
@@ -1970,7 +1970,7 @@ KoFieldVariable::KoFieldVariable( KoTextDocument *textdoc, short int subtype, Ko
{
}
-QString KoFieldVariable::fieldCode()
+TQString KoFieldVariable::fieldCode()
{
switch( m_subtype ) {
case VST_FILENAME:
@@ -2037,7 +2037,7 @@ QString KoFieldVariable::fieldCode()
return i18n("Field");
}
-QString KoFieldVariable::text(bool realValue)
+TQString KoFieldVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -2046,34 +2046,34 @@ QString KoFieldVariable::text(bool realValue)
} // use a format when they are customizable
-void KoFieldVariable::saveVariable( QDomElement& parentElem )
+void KoFieldVariable::saveVariable( TQDomElement& tqparentElem )
{
//kdDebug(32500) << "KoFieldVariable::saveVariable" << endl;
- QDomElement elem = parentElem.ownerDocument().createElement( "FIELD" );
- parentElem.appendChild( elem );
+ TQDomElement elem = tqparentElem.ownerDocument().createElement( "FIELD" );
+ tqparentElem.appendChild( elem );
elem.setAttribute( "subtype", m_subtype );
elem.setAttribute( "value", m_varValue.toString() );
}
-void KoFieldVariable::load( QDomElement& elem )
+void KoFieldVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "FIELD" ).toElement();
+ TQDomElement e = elem.namedItem( "FIELD" ).toElement();
if (!e.isNull())
{
m_subtype = e.attribute( "subtype" ).toInt();
if ( m_subtype == VST_NONE )
kdWarning() << "Field subtype of -1 found in the file !" << endl;
- m_varValue = QVariant( e.attribute( "value" ) );
+ m_varValue = TQVariant( e.attribute( "value" ) );
} else
kdWarning() << "FIELD element not found !" << endl;
}
-void KoFieldVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoFieldVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "file-name" ) {
- const QString display = elem.attributeNS( KoXmlNS::text, "display", QString::null );
+ const TQString display = elem.attributeNS( KoXmlNS::text, "display", TQString() );
if (display == "path")
m_subtype = VST_DIRECTORYNAME;
else if (display == "name")
@@ -2125,7 +2125,7 @@ void KoFieldVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*cont
else if ( localName == "sender-email" )
m_subtype = VST_EMAIL;
- m_varValue = QVariant( elem.text() );
+ m_varValue = TQVariant( elem.text() );
}
void KoFieldVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*/ ) const
@@ -2208,7 +2208,7 @@ void KoFieldVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context
void KoFieldVariable::recalc()
{
- QString value;
+ TQString value;
switch( m_subtype ) {
case VST_NONE:
kdWarning() << "KoFieldVariable::recalc() called with m_subtype = VST_NONE !" << endl;
@@ -2224,8 +2224,8 @@ void KoFieldVariable::recalc()
break;
case VST_FILENAMEWITHOUTEXTENSION:
{
- QString file=m_doc->url().fileName();
- int pos=file.findRev(".");
+ TQString file=m_doc->url().fileName();
+ int pos=file.tqfindRev(".");
if(pos !=-1)
value=file.mid(0,pos);
else
@@ -2311,15 +2311,15 @@ void KoFieldVariable::recalc()
if (value.isEmpty()) // still empty? give up
value = i18n("<None>");
- m_varValue = QVariant( value );
+ m_varValue = TQVariant( value );
resize();
}
-QStringList KoFieldVariable::actionTexts()
+TQStringList KoFieldVariable::actionTexts()
{
// NOTE: if you change here, also change fieldSubType()
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Author Name" );
lst << i18n( "Title" );
lst << i18n( "Initials" );
@@ -2407,7 +2407,7 @@ KoFieldVariable::FieldSubType KoFieldVariable::fieldSubType(short int menuNumber
return v;
}
-QStringList KoFieldVariable::subTypeList()
+TQStringList KoFieldVariable::subTypeList()
{
return KoFieldVariable::actionTexts();
}
@@ -2415,23 +2415,23 @@ QStringList KoFieldVariable::subTypeList()
/******************************************************************/
/* Class: KoLinkVariable */
/******************************************************************/
-KoLinkVariable::KoLinkVariable( KoTextDocument *textdoc, const QString & _linkName, const QString & _ulr,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoLinkVariable::KoLinkVariable( KoTextDocument *textdoc, const TQString & _linkName, const TQString & _ulr,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
,m_url(_ulr)
{
- m_varValue = QVariant( _linkName );
+ m_varValue = TQVariant( _linkName );
}
-QString KoLinkVariable::fieldCode()
+TQString KoLinkVariable::fieldCode()
{
return i18n("Link");
}
-void KoLinkVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoLinkVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
if ( elem.localName() == "a" && elem.namespaceURI() == KoXmlNS::text ) {
- m_url = elem.attributeNS( KoXmlNS::xlink, "href", QString::null);
- m_varValue = QVariant(elem.text());
+ m_url = elem.attributeNS( KoXmlNS::xlink, "href", TQString());
+ m_varValue = TQVariant(elem.text());
}
}
@@ -2447,7 +2447,7 @@ void KoLinkVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
}
-QString KoLinkVariable::text(bool realValue)
+TQString KoLinkVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayFieldCode()&&!realValue)
return fieldCode();
@@ -2455,21 +2455,21 @@ QString KoLinkVariable::text(bool realValue)
return value();
}
-void KoLinkVariable::saveVariable( QDomElement& parentElem )
+void KoLinkVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement linkElem = parentElem.ownerDocument().createElement( "LINK" );
- parentElem.appendChild( linkElem );
+ TQDomElement linkElem = tqparentElem.ownerDocument().createElement( "LINK" );
+ tqparentElem.appendChild( linkElem );
linkElem.setAttribute( "linkName", m_varValue.toString() );
linkElem.setAttribute( "hrefName", m_url );
}
-void KoLinkVariable::load( QDomElement& elem )
+void KoLinkVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement linkElem = elem.namedItem( "LINK" ).toElement();
+ TQDomElement linkElem = elem.namedItem( "LINK" ).toElement();
if (!linkElem.isNull())
{
- m_varValue = QVariant(linkElem.attribute("linkName"));
+ m_varValue = TQVariant(linkElem.attribute("linkName"));
m_url = linkElem.attribute("hrefName");
}
}
@@ -2479,22 +2479,22 @@ void KoLinkVariable::recalc()
resize();
}
-QStringList KoLinkVariable::actionTexts()
+TQStringList KoLinkVariable::actionTexts()
{
- return QStringList( i18n( "Link..." ) );
+ return TQStringList( i18n( "Link..." ) );
}
-void KoLinkVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoLinkVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
KoTextFormat * fmt = format();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
bool displayLink = m_varColl->variableSetting()->displayLink();
- QFont font( fmt->screenFont( zh ) );
+ TQFont font( fmt->screenFont( zh ) );
if ( m_varColl->variableSetting()->underlineLink() )
font.setUnderline( true );
- QColor textColor = displayLink ? cg.color( QColorGroup::Link ) : fmt->color();
+ TQColor textColor = displayLink ? cg.color( TQColorGroup::Link ) : fmt->color();
drawCustomItemHelper( p, x, y, wpix, hpix, ascentpix, cg, selected, offset, fmt, font, textColor, drawingShadow );
}
@@ -2503,42 +2503,42 @@ void KoLinkVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
/******************************************************************/
/* Class: KoNoteVariable */
/******************************************************************/
-KoNoteVariable::KoNoteVariable( KoTextDocument *textdoc, const QString & _note,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
+KoNoteVariable::KoNoteVariable( KoTextDocument *textdoc, const TQString & _note,KoVariableFormat *varFormat,KoVariableCollection *_varColl )
: KoVariable( textdoc, varFormat,_varColl )
- , m_createdNoteDate( QDate::currentDate() )
+ , m_createdNoteDate( TQDate::tqcurrentDate() )
{
- m_varValue = QVariant( _note );
+ m_varValue = TQVariant( _note );
}
-QString KoNoteVariable::fieldCode()
+TQString KoNoteVariable::fieldCode()
{
return i18n("Note");
}
-QString KoNoteVariable::createdNote() const
+TQString KoNoteVariable::createdNote() const
{
return KGlobal::locale()->formatDate( m_createdNoteDate, false );
}
-void KoNoteVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoNoteVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName = elem.localName();
- QString note;
+ const TQString localName = elem.localName();
+ TQString note;
if ( localName == "annotation" && elem.namespaceURI() == KoXmlNS::office )
{
- QDomElement date = KoDom::namedItemNS( elem, KoXmlNS::dc, "date" );
- m_createdNoteDate = QDate::fromString( date.text(), Qt::ISODate );
- QDomNode text = KoDom::namedItemNS( elem, KoXmlNS::text, "p" );
+ TQDomElement date = KoDom::namedItemNS( elem, KoXmlNS::dc, "date" );
+ m_createdNoteDate = TQDate::fromString( date.text(), Qt::ISODate );
+ TQDomNode text = KoDom::namedItemNS( elem, KoXmlNS::text, "p" );
for ( ; !text.isNull(); text = text.nextSibling() )
{
if ( text.isElement() )
{
- QDomElement t = text.toElement();
+ TQDomElement t = text.toElement();
note += t.text() + "\n";
}
}
}
- m_varValue = QVariant( note );
+ m_varValue = TQVariant( note );
}
void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*/ ) const
@@ -2548,8 +2548,8 @@ void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
writer.startElement( "dc:date" );
writer.addTextNode( m_createdNoteDate.toString(Qt::ISODate) );
writer.endElement();
- QStringList text = QStringList::split( "\n", m_varValue.toString() );
- for ( QStringList::Iterator it = text.begin(); it != text.end(); ++it ) {
+ TQStringList text = TQStringList::split( "\n", m_varValue.toString() );
+ for ( TQStringList::Iterator it = text.begin(); it != text.end(); ++it ) {
writer.startElement( "text:p" );
writer.addTextNode( *it );
writer.endElement();
@@ -2557,20 +2557,20 @@ void KoNoteVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*context*
writer.endElement();
}
-void KoNoteVariable::saveVariable( QDomElement& parentElem )
+void KoNoteVariable::saveVariable( TQDomElement& tqparentElem )
{
- QDomElement linkElem = parentElem.ownerDocument().createElement( "NOTE" );
- parentElem.appendChild( linkElem );
+ TQDomElement linkElem = tqparentElem.ownerDocument().createElement( "NOTE" );
+ tqparentElem.appendChild( linkElem );
linkElem.setAttribute( "note", m_varValue.toString() );
}
-void KoNoteVariable::load( QDomElement& elem )
+void KoNoteVariable::load( TQDomElement& elem )
{
KoVariable::load( elem );
- QDomElement linkElem = elem.namedItem( "NOTE" ).toElement();
+ TQDomElement linkElem = elem.namedItem( "NOTE" ).toElement();
if (!linkElem.isNull())
{
- m_varValue = QVariant(linkElem.attribute("note"));
+ m_varValue = TQVariant(linkElem.attribute("note"));
}
}
@@ -2579,12 +2579,12 @@ void KoNoteVariable::recalc()
resize();
}
-QStringList KoNoteVariable::actionTexts()
+TQStringList KoNoteVariable::actionTexts()
{
- return QStringList( i18n( "Note..." ) );
+ return TQStringList( i18n( "Note..." ) );
}
-QString KoNoteVariable::text(bool realValue)
+TQString KoNoteVariable::text(bool realValue)
{
if (m_varColl->variableSetting()->displayComment() &&
m_varColl->variableSetting()->displayFieldCode()&&!realValue)
@@ -2592,11 +2592,11 @@ QString KoNoteVariable::text(bool realValue)
else
//for a note return just a "space" we can look at
//note when we "right button"
- return QString(" ");
+ return TQString(" ");
}
-void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected, int offset, bool drawingShadow )
+void KoNoteVariable::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow )
{
if ( !m_varColl->variableSetting()->displayComment())
return;
@@ -2605,19 +2605,19 @@ void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
//kdDebug(32500) << "KoNoteVariable::drawCustomItem index=" << index() << " x=" << x << " y=" << y << endl;
p->save();
- p->setPen( QPen( fmt->color() ) );
+ p->setPen( TQPen( fmt->color() ) );
if ( fmt->textBackgroundColor().isValid() )
p->fillRect( x, y, wpix, hpix, fmt->textBackgroundColor() );
if ( selected )
{
- p->setPen( QPen( cg.color( QColorGroup::HighlightedText ) ) );
- p->fillRect( x, y, wpix, hpix, cg.color( QColorGroup::Highlight ) );
+ p->setPen( TQPen( cg.color( TQColorGroup::HighlightedText ) ) );
+ p->fillRect( x, y, wpix, hpix, cg.color( TQColorGroup::Highlight ) );
}
- else if ( textDocument() && p->device()->devType() != QInternal::Printer
+ else if ( textDocument() && p->device()->devType() != TQInternal::Printer
&& !textDocument()->dontDrawingNoteVariable())
{
- p->fillRect( x, y, wpix, hpix, Qt::yellow);
- p->setPen( QPen( cg.color( QColorGroup::Highlight ), 0, Qt::DotLine ) );
+ p->fillRect( x, y, wpix, hpix, TQt::yellow);
+ p->setPen( TQPen( cg.color( TQColorGroup::Highlight ), 0, TQt::DotLine ) );
p->drawRect( x, y, wpix, hpix );
}
//call it for use drawCustomItemHelper just for draw font effect
@@ -2626,14 +2626,14 @@ void KoNoteVariable::drawCustomItem( QPainter* p, int x, int y, int wpix, int hp
p->restore();
}
-void KoPageVariable::setSectionTitle( const QString& _title )
+void KoPageVariable::setSectionTitle( const TQString& _title )
{
- QString title( _title );
+ TQString title( _title );
if ( title.isEmpty() )
{
title = i18n("<No title>");
}
- m_varValue = QVariant( title );
+ m_varValue = TQVariant( title );
}
@@ -2654,9 +2654,9 @@ KoStatisticVariable::KoStatisticVariable( KoTextDocument *textdoc,
}
-QStringList KoStatisticVariable::actionTexts()
+TQStringList KoStatisticVariable::actionTexts()
{
- QStringList lst;
+ TQStringList lst;
lst << i18n( "Number of Words" );
lst << i18n( "Number of Sentences" );
lst << i18n( "Number of Lines" );
@@ -2681,27 +2681,27 @@ void KoStatisticVariable::setVariableSubType( short int subtype )
}
-QStringList KoStatisticVariable::subTypeList()
+TQStringList KoStatisticVariable::subTypeList()
{
return KoStatisticVariable::actionTexts();
}
-void KoStatisticVariable::saveVariable( QDomElement& varElem )
+void KoStatisticVariable::saveVariable( TQDomElement& varElem )
{
- QDomElement elem = varElem.ownerDocument().createElement( "STATISTIC" );
+ TQDomElement elem = varElem.ownerDocument().createElement( "STATISTIC" );
varElem.appendChild( elem );
- elem.setAttribute( "type", QString::number(m_subtype) );
- elem.setAttribute( "value", QString::number(m_varValue.toInt()) );
+ elem.setAttribute( "type", TQString::number(m_subtype) );
+ elem.setAttribute( "value", TQString::number(m_varValue.toInt()) );
}
-void KoStatisticVariable::load( QDomElement &elem )
+void KoStatisticVariable::load( TQDomElement &elem )
{
KoVariable::load( elem );
- QDomElement e = elem.namedItem( "STATISTIC" ).toElement();
+ TQDomElement e = elem.namedItem( "STATISTIC" ).toElement();
if ( !e.isNull() ) {
// FIXME: Error handling.
m_subtype = e.attribute( "type" ).toInt();
@@ -2710,58 +2710,58 @@ void KoStatisticVariable::load( QDomElement &elem )
}
-void KoStatisticVariable::loadOasis( const QDomElement &elem, KoOasisContext& /*context*/ )
+void KoStatisticVariable::loadOasis( const TQDomElement &elem, KoOasisContext& /*context*/ )
{
- const QString localName( elem.localName() );
+ const TQString localName( elem.localName() );
if ( localName == "object-count" )
{
m_subtype = VST_STATISTIC_NB_EMBEDDED;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "table-count" )
{
m_subtype = VST_STATISTIC_NB_TABLE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "picture-count" )
{
m_subtype = VST_STATISTIC_NB_PICTURE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "word-count" )
{
m_subtype = VST_STATISTIC_NB_WORD;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "character-count" )
{
m_subtype = VST_STATISTIC_NB_CHARACTERE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "frame-count" )
{
m_subtype = VST_STATISTIC_NB_FRAME;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "line-count" )
{
m_subtype = VST_STATISTIC_NB_LINES;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "sentence-count" )
{
m_subtype = VST_STATISTIC_NB_SENTENCE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "non-whitespace-character-count" )
{
m_subtype = VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
else if ( localName == "syllable-count" )
{
m_subtype = VST_STATISTIC_NB_SYLLABLE;
- m_varValue = QVariant( elem.text().toInt() );
+ m_varValue = TQVariant( elem.text().toInt() );
}
//TODO other copy
}
@@ -2772,63 +2772,63 @@ void KoStatisticVariable::saveOasis( KoXmlWriter& writer, KoSavingContext& /*con
{
case VST_STATISTIC_NB_EMBEDDED:
writer.startElement( "text:object-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_TABLE:
writer.startElement( "text:table-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_PICTURE:
writer.startElement( "text:picture-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_FRAME:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:frame-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_WORD:
writer.startElement( "text:word-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_SENTENCE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:sentence-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_CHARACTERE:
writer.startElement( "text:character-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_LINES:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:line-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:non-whitespace-character-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
case VST_STATISTIC_NB_SYLLABLE:
//TODO verify that it's implemented into oasis file format
writer.startElement( "text:syllable-count" );
- writer.addTextNode( QString::number( m_varValue.toInt() ) );
+ writer.addTextNode( TQString::number( m_varValue.toInt() ) );
writer.endElement();
break;
}
}
-QString KoStatisticVariable::fieldCode()
+TQString KoStatisticVariable::fieldCode()
{
if ( m_subtype == VST_STATISTIC_NB_FRAME )
{
diff --git a/lib/kotext/KoVariable.h b/lib/kotext/KoVariable.h
index 0129bbc2..d00dcb5c 100644
--- a/lib/kotext/KoVariable.h
+++ b/lib/kotext/KoVariable.h
@@ -20,18 +20,18 @@
#ifndef kovariable_h
#define kovariable_h
-#include <qstring.h>
-#include <qdatetime.h>
-#include <qasciidict.h>
-#include <qptrlist.h>
-#include <qmap.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+#include <tqasciidict.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+#include <tqobject.h>
#include <kaction.h>
#include "KoRichText.h"
-#include <qvariant.h>
+#include <tqvariant.h>
#include <koffice_export.h>
-class QDomElement;
+class TQDomElement;
// Always add new types at the _end_ of this list (but before VT_ALL of course).
// (and update KWView::setupActions)
enum VariableType {
@@ -85,17 +85,17 @@ class KOTEXT_EXPORT KoVariableSettings
bool displayFieldCode() const { return m_displayFieldCode; }
void setDisplayFieldCode( bool b) { m_displayFieldCode=b; }
- virtual void save( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
+ virtual void save( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
- QDateTime lastPrintingDate() const;
- void setLastPrintingDate( const QDateTime & _date);
+ TQDateTime lastPrintingDate() const;
+ void setLastPrintingDate( const TQDateTime & _date);
- QDateTime creationDate() const;
- void setCreationDate( const QDateTime & _date);
+ TQDateTime creationDate() const;
+ void setCreationDate( const TQDateTime & _date);
- QDateTime modificationDate() const;
- void setModificationDate( const QDateTime & _date);
+ TQDateTime modificationDate() const;
+ void setModificationDate( const TQDateTime & _date);
virtual void saveOasis( KoXmlWriter &settingsWriter ) const;
virtual void loadOasis(const KoOasisSettings&settingsDoc);
@@ -127,72 +127,72 @@ public:
* Return a key describing this format.
* Used for the flyweight pattern in KoVariableFormatCollection
*/
- virtual QCString key() const = 0;
+ virtual TQCString key() const = 0;
/**
* @return the key for a given set of properties.
* Use this key to lookup the format in the "variable format" collection.
* @param props properties of this format, e.g. DD/MM/YYYY for a date format.
*/
- virtual QCString getKey( const QString& props ) const = 0;
+ virtual TQCString getKey( const TQString& props ) const = 0;
/**
* Create a format from this key.
*/
- virtual void load( const QCString &key ) = 0;
+ virtual void load( const TQCString &key ) = 0;
/**
* Use this format to convert a piece of data into a string.
*/
- virtual QString convert(const QVariant& data ) const = 0;
+ virtual TQString convert(const TQVariant& data ) const = 0;
/**
* Set the properties of this format, e.g. DD/MM/YYYY for a date format.
* WARNING: if you call this, you might be modifying a format that
* other variables use as well. Don't do it, use getKey.
*/
- virtual void setFormatProperties( const QString& ) {}
+ virtual void setFormatProperties( const TQString& ) {}
/**
* @return the properties of this format, e.g. DD/MM/YYYY for a date format.
*/
- virtual QString formatProperties() const { return QString::null; }
+ virtual TQString formatProperties() const { return TQString(); }
/**
* @return the list of available properties strings (e.g. hh:mm:ss)
*/
- virtual QStringList formatPropsList() const { return QStringList(); }
+ virtual TQStringList formatPropsList() const { return TQStringList(); }
/**
* @return the translated version of the list of format properties
*/
- virtual QStringList translatedFormatPropsList() const { return QStringList(); }
+ virtual TQStringList translatedFormatPropsList() const { return TQStringList(); }
};
/**
* Implementation of the "date" formats
- * TODO: merge with KoVariableTimeFormat, for a single QDateTime-based class.
+ * TODO: merge with KoVariableTimeFormat, for a single TQDateTime-based class.
*/
class KOTEXT_EXPORT KoVariableDateFormat : public KoVariableFormat
{
public:
KoVariableDateFormat();
- virtual QString convert(const QVariant& data ) const;
- virtual QCString key() const;
- virtual QCString getKey( const QString& props ) const;
- virtual void load( const QCString &key );
+ virtual TQString convert(const TQVariant& data ) const;
+ virtual TQCString key() const;
+ virtual TQCString getKey( const TQString& props ) const;
+ virtual void load( const TQCString &key );
/// Set the format string (e.g. DDMMYYYY)
- virtual void setFormatProperties( const QString& props ) {
+ virtual void setFormatProperties( const TQString& props ) {
m_strFormat = props;
}
/// @return the format string (e.g. DDMMYYYY)
- virtual QString formatProperties() const { return m_strFormat; }
+ virtual TQString formatProperties() const { return m_strFormat; }
/// @return the list of available format strings
- virtual QStringList formatPropsList() const { return staticFormatPropsList(); }
+ virtual TQStringList formatPropsList() const { return staticFormatPropsList(); }
/// @return the translated version of the list of formats
- virtual QStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); }
+ virtual TQStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); }
- static QStringList staticFormatPropsList();
- static QStringList staticTranslatedFormatPropsList();
+ static TQStringList staticFormatPropsList();
+ static TQStringList staticTranslatedFormatPropsList();
private:
- QString m_strFormat;
+ TQString m_strFormat;
};
/**
@@ -202,29 +202,29 @@ class KOTEXT_EXPORT KoVariableTimeFormat : public KoVariableFormat
{
public:
KoVariableTimeFormat();
- virtual QString convert(const QVariant& data ) const;
- virtual QCString key() const;
- virtual QCString getKey( const QString& props ) const;
- virtual void load( const QCString & /*key*/ );
+ virtual TQString convert(const TQVariant& data ) const;
+ virtual TQCString key() const;
+ virtual TQCString getKey( const TQString& props ) const;
+ virtual void load( const TQCString & /*key*/ );
/// Set the format string (e.g. hh:mm:ss)
- virtual void setFormatProperties( const QString& props ) {
+ virtual void setFormatProperties( const TQString& props ) {
m_strFormat = props;
}
/// @return the format string (e.g. hh:mm:ss)
- virtual QString formatProperties() const { return m_strFormat; }
+ virtual TQString formatProperties() const { return m_strFormat; }
/// @return the list of available properties strings (e.g. hh:mm:ss)
- virtual QStringList formatPropsList() const { return staticFormatPropsList(); }
+ virtual TQStringList formatPropsList() const { return staticFormatPropsList(); }
/// @return the translated version of the list of format properties
- virtual QStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); }
+ virtual TQStringList translatedFormatPropsList() const { return staticTranslatedFormatPropsList(); }
- static QStringList staticFormatPropsList();
- static QStringList staticTranslatedFormatPropsList();
+ static TQStringList staticFormatPropsList();
+ static TQStringList staticTranslatedFormatPropsList();
private:
- QString m_strFormat;
+ TQString m_strFormat;
};
@@ -235,10 +235,10 @@ class KoVariableStringFormat : public KoVariableFormat
{
public:
KoVariableStringFormat() : KoVariableFormat() {}
- virtual QString convert(const QVariant& data ) const;
- virtual QCString key() const;
- virtual QCString getKey( const QString& props ) const;
- virtual void load( const QCString & /*key*/ ) {}
+ virtual TQString convert(const TQVariant& data ) const;
+ virtual TQCString key() const;
+ virtual TQCString getKey( const TQString& props ) const;
+ virtual void load( const TQCString & /*key*/ ) {}
};
@@ -246,10 +246,10 @@ class KOTEXT_EXPORT KoVariableNumberFormat : public KoVariableFormat
{
public:
KoVariableNumberFormat() : KoVariableFormat() {}
- virtual QString convert(const QVariant& data ) const;
- virtual QCString key() const;
- virtual QCString getKey( const QString& props ) const;
- virtual void load( const QCString & /*key*/ ) {}
+ virtual TQString convert(const TQVariant& data ) const;
+ virtual TQCString key() const;
+ virtual TQCString getKey( const TQString& props ) const;
+ virtual void load( const TQCString & /*key*/ ) {}
};
@@ -272,15 +272,15 @@ public:
/**
* Find or create the format for the given @p key
*/
- KoVariableFormat *format( const QCString &key );
+ KoVariableFormat *format( const TQCString &key );
// TODO Refcounting and removing unused formats
// Not critical, that we don't delete unused formats until closing the doc...
protected:
- KoVariableFormat *createFormat( const QCString &key );
+ KoVariableFormat *createFormat( const TQCString &key );
private:
- QAsciiDict<KoVariableFormat> m_dict;
+ TQAsciiDict<KoVariableFormat> m_dict;
};
class KoVariable;
@@ -289,9 +289,10 @@ class KoDocument;
class KoVariableFormatCollection;
class KoTextDocument;
class KoVariableCollection;
-class KOTEXT_EXPORT KoVariableCollection : public QObject
+class KOTEXT_EXPORT KoVariableCollection : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
// Note that the KoVariableSettings becomes owned by the collection;
// we take it as argument so that it can be subclassed though.
@@ -299,24 +300,24 @@ public:
~KoVariableCollection();
void registerVariable( KoVariable *var );
void unregisterVariable( KoVariable *var );
- QValueList<KoVariable *> recalcVariables(int type);
+ TQValueList<KoVariable *> recalcVariables(int type);
// For custom variables
- void setVariableValue( const QString &name, const QString &value );
- QString getVariableValue( const QString &name ) const;
+ void setVariableValue( const TQString &name, const TQString &value );
+ TQString getVariableValue( const TQString &name ) const;
- const QPtrList<KoVariable>& getVariables() const {
+ const TQPtrList<KoVariable>& getVariables() const {
return variables;
}
void clear();
- bool customVariableExist(const QString &varname)const ;
+ bool customVariableExist(const TQString &varname)const ;
virtual KoVariable *createVariable( int type, short int subtype, KoVariableFormatCollection * coll, KoVariableFormat *varFormat,KoTextDocument *textdoc, KoDocument * doc, int _correct , bool _forceDefaultFormat=false, bool loadFootNote= true );
/// Load variable from OASIS file format (called "field" in the OASIS format)
- virtual KoVariable* loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context );
- virtual KoVariable* loadOasisFieldCreateVariable( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context, const QString &key, int type );
+ virtual KoVariable* loadOasisField( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context );
+ virtual KoVariable* loadOasisFieldCreateVariable( KoTextDocument* textdoc, const TQDomElement& tag, KoOasisContext& context, const TQString &key, int type );
KoVariableSettings *variableSetting() const { return m_variableSettings; }
KoVariableFormatCollection *formatCollection() const { return m_formatCollection; }
@@ -326,19 +327,19 @@ public:
KoVariable *selectedVariable()const {return m_varSelected;}
/// List of KActions to put into the popupmenu on a variable
- QPtrList<KAction> popupActionList() const;
+ TQPtrList<KAction> popupActionList() const;
protected slots:
- // This is here because variables and formats are not QObjects
+ // This is here because variables and formats are not TQObjects
void slotChangeSubType();
void slotChangeFormat();
private:
- //typedef QMap<KAction *, int> VariableSubTextMap;
+ //typedef TQMap<KAction *, int> VariableSubTextMap;
//VariableSubTextMap m_variableSubTextMap;
- QPtrList<KoVariable> variables;
- QMap< QString, QString > varValues; // for custom variables
+ TQPtrList<KoVariable> variables;
+ TQMap< TQString, TQString > varValues; // for custom variables
KoVariableSettings *m_variableSettings;
KoVariable *m_varSelected;
KoVariableFormatCollection *m_formatCollection;
@@ -351,7 +352,7 @@ public:
class KoDocument;
class KoVariable;
-class QDomElement;
+class TQDomElement;
class KoTextFormat;
@@ -374,14 +375,14 @@ public:
virtual int ascent() const { return m_ascent; } // for text, ascent != height!
virtual int widthHint() const { return width; }
virtual int minimumWidth() const { return width; }
- virtual void drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected, int offset, bool drawingShadow);
+ virtual void drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow);
/**
* Called by drawCustomItem. Some special variables can
* reimplement drawCustomItem to change the parameters passed to
* drawCustomItemHelper
*/
- void drawCustomItemHelper( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const QColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const QFont& font, QColor textColor, bool drawingShadow );
+ void drawCustomItemHelper( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, const TQColorGroup& cg, bool selected, int offset, KoTextFormat* fmt, const TQFont& font, TQColor textColor, bool drawingShadow );
void setVariableFormat( KoVariableFormat *_varFormat );
@@ -396,26 +397,26 @@ public:
* It doesn't need to be cached, convert() is fast, and it's the actual
* value (date, time etc.) that is cached in the variable already.
*/
- virtual QString text(bool realValue=false);
+ virtual TQString text(bool realValue=false);
- virtual QString fieldCode();
+ virtual TQString fieldCode();
- /// Return the variable value, as a QVariant, before format conversion
- QVariant varValue() const { return m_varValue; }
+ /// Return the variable value, as a TQVariant, before format conversion
+ TQVariant varValue() const { return m_varValue; }
/**
- * Ask this variable to recalculate and to repaint itself
+ * Ask this variable to recalculate and to tqrepaint itself
* Only use this if you're working on a single variable (e.g. popupmenu).
- * Otherwise, better do the repainting all at once.
+ * Otherwise, better do the tqrepainting all at once.
* @see KoVariableCollection::recalcVariables()
*/
void recalcAndRepaint();
/** Save the variable. Public API, does the common job and then calls saveVariable. */
- virtual void save( QDomElement &parentElem );
+ virtual void save( TQDomElement &tqparentElem );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
/** Part of the KoTextCustomItem interface. Returns the code for a variable, see DTD.
* Do NOT reimplement in koVariable-derived classes.
@@ -423,7 +424,7 @@ public:
virtual int typeId() const { return 4; }
/// List of available subtypes (translated). Use variableSubType() to map index to ID
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
/// Set this variable's subtype.
virtual void setVariableSubType( short int /*subtype*/ ) {}
@@ -433,19 +434,19 @@ public:
*/
virtual short int variableSubType(short int menuNumber){ return menuNumber; }
- QString convertKlocaleToQDateTimeFormat( const QString & _format );
+ TQString convertKlocaleToTQDateTimeFormat( const TQString & _format );
protected:
/** Variable should reimplement this to implement saving. */
- virtual void saveVariable( QDomElement &parentElem ) = 0;
+ virtual void saveVariable( TQDomElement &tqparentElem ) = 0;
virtual int correctValue() const { return 0;}
KoVariableFormat *m_varFormat;
KoVariableCollection *m_varColl;
- QVariant m_varValue;
+ TQVariant m_varValue;
int m_ascent;
- //typedef QMap<KAction *, int> SubTextMap;
+ //typedef TQMap<KAction *, int> SubTextMap;
//SubTextMap m_subTextMap;
class Private;
Private *d;
@@ -464,20 +465,20 @@ public:
{ return VT_DATE; }
enum { VST_DATE_FIX = 0, VST_DATE_CURRENT = 1, VST_DATE_LAST_PRINTING = 2, VST_DATE_CREATE_FILE = 3, VST_DATE_MODIFY_FILE =4 };
- static QStringList actionTexts();
+ static TQStringList actionTexts();
virtual void recalc();
- virtual QString fieldCode();
+ virtual TQString fieldCode();
virtual void resize();
- void setDate( const QDate & _date ) { m_varValue = QVariant(_date); }
+ void setDate( const TQDate & _date ) { m_varValue = TQVariant(_date); }
- virtual void saveVariable( QDomElement &parentElem );
+ virtual void saveVariable( TQDomElement &tqparentElem );
virtual int correctValue() const { return m_correctDate;}
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
/// Set this variable's subtype.
virtual void setVariableSubType( short int subtype )
{ m_subtype = subtype; }
@@ -485,11 +486,11 @@ public:
/**
* Ask the user and return the date format string with prefix "DATE"
*/
- static QCString formatStr( int & correct );
+ static TQCString formatStr( int & correct );
/**
* Return the default date format for old file.
*/
- static QCString defaultFormat();
+ static TQCString defaultFormat();
protected:
short int m_subtype;
@@ -509,32 +510,32 @@ public:
{ return VT_TIME; }
enum { VST_TIME_FIX = 0, VST_TIME_CURRENT = 1 };
- static QStringList actionTexts();
+ static TQStringList actionTexts();
virtual void recalc();
virtual void resize();
- virtual QString fieldCode();
+ virtual TQString fieldCode();
- void setTime( const QTime & _time ) { m_varValue = QVariant(_time); }
+ void setTime( const TQTime & _time ) { m_varValue = TQVariant(_time); }
- virtual void saveVariable( QDomElement &parentElem );
+ virtual void saveVariable( TQDomElement &tqparentElem );
virtual int correctValue() const { return m_correctTime;}
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
virtual void setVariableSubType( short int subtype )
{ m_subtype = subtype; }
virtual short int subType() const { return m_subtype; }
/**
* Returns the time format string with prefix "TIME"
*/
- static QCString formatStr(int & _correct);
+ static TQCString formatStr(int & _correct);
/**
* Return the default date format for old file.
*/
- static QCString defaultFormat();
+ static TQCString defaultFormat();
protected:
short int m_subtype;
@@ -550,25 +551,25 @@ protected:
class KOTEXT_EXPORT KoCustomVariable : public KoVariable
{
public:
- KoCustomVariable(KoTextDocument *textdoc , const QString &name, KoVariableFormat *varFormat,KoVariableCollection *_varcoll );
+ KoCustomVariable(KoTextDocument *textdoc , const TQString &name, KoVariableFormat *varFormat,KoVariableCollection *_varcoll );
virtual VariableType type() const
{ return VT_CUSTOM; }
- static QStringList actionTexts();
+ static TQStringList actionTexts();
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- QString name() const { return m_varValue.toString(); }
+ TQString name() const { return m_varValue.toString(); }
virtual void recalc();
- virtual QString fieldCode();
+ virtual TQString fieldCode();
- virtual QString text(bool realValue=false);
+ virtual TQString text(bool realValue=false);
- QString value() const;
- void setValue( const QString &v );
+ TQString value() const;
+ void setValue( const TQString &v );
protected:
};
@@ -597,18 +598,18 @@ public:
virtual VariableType type() const
{ return VT_FIELD; }
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QString fieldCode();
+ virtual TQString fieldCode();
virtual void recalc();
- virtual QString text(bool realValue=false);
+ virtual TQString text(bool realValue=false);
- QString value() const { return m_varValue.toString(); }
+ TQString value() const { return m_varValue.toString(); }
- static QStringList actionTexts();
+ static TQStringList actionTexts();
/**
* Converts @p menuNumber to field variable subtype number
*/
@@ -618,7 +619,7 @@ public:
*/
static FieldSubType fieldSubType( short int menuNumber);
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
virtual void setVariableSubType( short int subtype )
{ m_subtype = subtype; }
virtual short int subType() const { return m_subtype; }
@@ -632,21 +633,21 @@ protected:
class KOTEXT_EXPORT KoMailMergeVariable : public KoVariable
{
public:
- KoMailMergeVariable( KoTextDocument *textdoc, const QString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl );
+ KoMailMergeVariable( KoTextDocument *textdoc, const TQString &name, KoVariableFormat *varFormat, KoVariableCollection *_varColl );
virtual VariableType type() const
{ return VT_MAILMERGE; }
- static QStringList actionTexts();
- virtual QString fieldCode();
+ static TQStringList actionTexts();
+ virtual TQString fieldCode();
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QString text(bool realValue=false);
- QString name() const { return m_varValue.toString(); }
- virtual QString value() const;
+ virtual TQString text(bool realValue=false);
+ TQString name() const { return m_varValue.toString(); }
+ virtual TQString value() const;
protected:
};
@@ -666,26 +667,26 @@ public:
{ return VT_PGNUM; }
enum { VST_PGNUM_CURRENT = 0, VST_PGNUM_TOTAL = 1, VST_CURRENT_SECTION = 2 , VST_PGNUM_PREVIOUS = 3, VST_PGNUM_NEXT = 4 };
- static QStringList actionTexts();
- virtual QString fieldCode();
+ static TQStringList actionTexts();
+ virtual TQString fieldCode();
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
virtual void setVariableSubType( short int subtype );
// For the 'current page' variable. This is called by the app e.g. when painting
// a given page (see KWTextFrameSet::drawFrame and KPTextObject::recalcPageNum)
- void setPgNum( int pgNum ) { m_varValue = QVariant( pgNum); }
+ void setPgNum( int pgNum ) { m_varValue = TQVariant( pgNum); }
// For the 'current section title' variable. Same thing.
- void setSectionTitle( const QString& title );
+ void setSectionTitle( const TQString& title );
virtual short int subType() const { return m_subtype; }
virtual void recalc() = 0;
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
protected:
short int m_subtype;
@@ -695,34 +696,34 @@ protected:
class KOTEXT_EXPORT KoLinkVariable : public KoVariable
{
public:
- KoLinkVariable( KoTextDocument *textdoc, const QString & _linkName, const QString & _ulr,KoVariableFormat *varFormat, KoVariableCollection *_varColl );
- virtual void drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow );
+ KoLinkVariable( KoTextDocument *textdoc, const TQString & _linkName, const TQString & _ulr,KoVariableFormat *varFormat, KoVariableCollection *_varColl );
+ virtual void drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow );
virtual VariableType type() const
{ return VT_LINK; }
- static QStringList actionTexts();
- virtual QString fieldCode();
+ static TQStringList actionTexts();
+ virtual TQString fieldCode();
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QString text(bool realValue=false);
- QString value() const { return m_varValue.toString(); }
- QString url() const { return m_url;}
+ virtual TQString text(bool realValue=false);
+ TQString value() const { return m_varValue.toString(); }
+ TQString url() const { return m_url;}
virtual void recalc();
- void setLink(const QString & _linkName, const QString &_url)
+ void setLink(const TQString & _linkName, const TQString &_url)
{
- m_varValue=QVariant(_linkName);
+ m_varValue=TQVariant(_linkName);
m_url=_url;
}
protected:
- QString m_url;
+ TQString m_url;
};
@@ -730,28 +731,28 @@ protected:
class KOTEXT_EXPORT KoNoteVariable : public KoVariable
{
public:
- KoNoteVariable( KoTextDocument *textdoc, const QString & _note,KoVariableFormat *varFormat, KoVariableCollection *_varColl );
- virtual void drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const QColorGroup& cg, bool selected, int offset, bool drawingShadow );
+ KoNoteVariable( KoTextDocument *textdoc, const TQString & _note,KoVariableFormat *varFormat, KoVariableCollection *_varColl );
+ virtual void drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int /*cx*/, int /*cy*/, int /*cw*/, int /*ch*/, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow );
virtual VariableType type() const
{ return VT_NOTE; }
- static QStringList actionTexts();
- virtual QString fieldCode();
+ static TQStringList actionTexts();
+ virtual TQString fieldCode();
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
- virtual QString text(bool realValue=false);
- QString note() const { return m_varValue.toString(); }
- void setNote( const QString & _note) { m_varValue = QVariant(_note); }
+ virtual TQString text(bool realValue=false);
+ TQString note() const { return m_varValue.toString(); }
+ void setNote( const TQString & _note) { m_varValue = TQVariant(_note); }
virtual void recalc();
- QString createdNote() const;
+ TQString createdNote() const;
protected:
- QDate m_createdNoteDate;
+ TQDate m_createdNoteDate;
};
@@ -777,24 +778,24 @@ public:
virtual VariableType type() const
{ return VT_STATISTIC; }
- static QStringList actionTexts();
+ static TQStringList actionTexts();
- virtual QStringList subTypeList();
+ virtual TQStringList subTypeList();
- virtual void saveVariable( QDomElement &parentElem );
- virtual void load( QDomElement &elem );
- virtual void loadOasis( const QDomElement &elem, KoOasisContext& context );
+ virtual void saveVariable( TQDomElement &tqparentElem );
+ virtual void load( TQDomElement &elem );
+ virtual void loadOasis( const TQDomElement &elem, KoOasisContext& context );
virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context ) const;
virtual short int subType() const { return m_subtype; }
virtual void setVariableSubType( short int subtype );
- QString name() const { return m_varValue.toString(); }
- virtual QString fieldCode();
+ TQString name() const { return m_varValue.toString(); }
+ virtual TQString fieldCode();
- QString value() const;
- void setValue( const QString &v );
+ TQString value() const;
+ void setValue( const TQString &v );
static void setExtendedType( bool _b) { m_extendedType = _b; }
static bool extendedType() { return m_extendedType; }
protected:
diff --git a/lib/kotext/TimeFormatWidget.cpp b/lib/kotext/TimeFormatWidget.cpp
index 7479131d..187b2929 100644
--- a/lib/kotext/TimeFormatWidget.cpp
+++ b/lib/kotext/TimeFormatWidget.cpp
@@ -1,29 +1,29 @@
#include "timedateformatwidget.h"
#include "TimeFormatWidget.h"
#include "TimeFormatWidget.moc"
-#include <qdatetime.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqdatetime.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <knuminput.h>
#include <KoVariable.h>
/*
- * Constructs a TimeFormatWidget which is a child of 'parent', with the
+ * Constructs a TimeFormatWidget which is a child of 'tqparent', with the
* name 'name' and widget flags set to 'f'
*/
-TimeFormatWidget::TimeFormatWidget( QWidget* parent, const char* name, WFlags fl )
- : TimeDateFormatWidgetPrototype( parent, name, fl )
+TimeFormatWidget::TimeFormatWidget( TQWidget* tqparent, const char* name, WFlags fl )
+ : TimeDateFormatWidgetPrototype( tqparent, name, fl )
{
setCaption( i18n( "TimeFormat", "This Dialog Allows You to Set the Format of the Time Variable" ) );
- QStringList listTimeFormat = KoVariableTimeFormat::staticTranslatedFormatPropsList();
+ TQStringList listTimeFormat = KoVariableTimeFormat::staticTranslatedFormatPropsList();
combo1->insertStringList(listTimeFormat);
combo2->insertItem( i18n( "Hour" ) );
@@ -38,10 +38,10 @@ TimeFormatWidget::TimeFormatWidget( QWidget* parent, const char* name, WFlags f
combo2->setCurrentItem( 0 );
label_correction->setText(i18n("Correct in Minutes"));
- connect( CheckBox1, SIGNAL(toggled ( bool )),this,SLOT(slotPersonalizeChanged(bool)));
- connect( combo1, SIGNAL(activated ( const QString & )), this, SLOT(slotDefaultValueChanged(const QString &)));
- connect( combo1, SIGNAL(textChanged ( const QString & )), this, SLOT(slotDefaultValueChanged(const QString &)));
- connect( KIntNumInput1, SIGNAL(valueChanged(int)), this, SLOT( slotOffsetChanged(int)));
+ connect( CheckBox1, TQT_SIGNAL(toggled ( bool )),this,TQT_SLOT(slotPersonalizeChanged(bool)));
+ connect( combo1, TQT_SIGNAL(activated ( const TQString & )), this, TQT_SLOT(slotDefaultValueChanged(const TQString &)));
+ connect( combo1, TQT_SIGNAL(textChanged ( const TQString & )), this, TQT_SLOT(slotDefaultValueChanged(const TQString &)));
+ connect( KIntNumInput1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT( slotOffsetChanged(int)));
slotPersonalizeChanged(false);
}
@@ -50,13 +50,13 @@ TimeFormatWidget::TimeFormatWidget( QWidget* parent, const char* name, WFlags f
*/
TimeFormatWidget::~TimeFormatWidget()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, TQt does it all for us
}
/*
* public slot
*/
-void TimeFormatWidget::slotDefaultValueChanged(const QString & )
+void TimeFormatWidget::slotDefaultValueChanged(const TQString & )
{
updateLabel();
}
@@ -77,7 +77,7 @@ void TimeFormatWidget::slotPersonalizeChanged(bool b)
void TimeFormatWidget::comboActivated()
{
- QString string=combo2->currentText();
+ TQString string=combo2->currentText();
if(string==i18n("Hour"))
combo1->lineEdit()->insert("h");
else if(string==i18n("Hour (2 digits)"))
@@ -108,29 +108,29 @@ void TimeFormatWidget::updateLabel()
KoVariableTimeFormat format;
format.setFormatProperties( resultString() );
- QTime ct = QTime::currentTime().addSecs(correctValue()); // ### TODO: dialog says correct in *minutes*
+ TQTime ct = TQTime::currentTime().addSecs(correctValue()); // ### TODO: dialog says correct in *minutes*
label->setText( format.convert( ct ) );
}
-QString TimeFormatWidget::resultString()
+TQString TimeFormatWidget::resultString()
{
- const QString lookup(combo1->currentText());
- const QStringList listTranslated( KoVariableTimeFormat::staticTranslatedFormatPropsList() );
- const int index = listTranslated.findIndex(lookup);
+ const TQString lookup(combo1->currentText());
+ const TQStringList listTranslated( KoVariableTimeFormat::staticTranslatedFormatPropsList() );
+ const int index = listTranslated.tqfindIndex(lookup);
if (index==-1)
return (lookup); // Either costum or non-locale
// We have now a locale format, so we must "translate" it back;
// Lookup untranslated format
- const QStringList listRaw( KoVariableTimeFormat::staticFormatPropsList() );
+ const TQStringList listRaw( KoVariableTimeFormat::staticFormatPropsList() );
- QStringList::ConstIterator it( listRaw.at(index) );
+ TQStringList::ConstIterator it( listRaw.at(index) );
Q_ASSERT( it != listRaw.end() );
if ( it != listRaw.end() )
return *it;
kdError(32500) << "Internal error: could not find correcponding time format: " << lookup << endl;
- return QString::null; // Something is wrong, give back a default
+ return TQString(); // Something is wrong, give back a default
}
int TimeFormatWidget::correctValue()
diff --git a/lib/kotext/TimeFormatWidget.h b/lib/kotext/TimeFormatWidget.h
index b98bf220..62ee6957 100644
--- a/lib/kotext/TimeFormatWidget.h
+++ b/lib/kotext/TimeFormatWidget.h
@@ -5,17 +5,18 @@
class TimeFormatWidget : public TimeDateFormatWidgetPrototype
{
Q_OBJECT
+ TQ_OBJECT
public:
- TimeFormatWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ TimeFormatWidget( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
~TimeFormatWidget();
- QString resultString();
+ TQString resultString();
int correctValue();
public slots:
void updateLabel();
void comboActivated();
void slotPersonalizeChanged(bool b);
- void slotDefaultValueChanged(const QString & );
+ void slotDefaultValueChanged(const TQString & );
void slotOffsetChanged(int);
};
diff --git a/lib/kotext/kodecorationtabbase.ui b/lib/kotext/kodecorationtabbase.ui
index f9bb8176..31e7b464 100644
--- a/lib/kotext/kodecorationtabbase.ui
+++ b/lib/kotext/kodecorationtabbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoDecorationTabBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>decorationTab</cstring>
</property>
@@ -16,9 +16,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
- <cstring>colorGroupBox</cstring>
+ <cstring>tqcolorGroupBox</cstring>
</property>
<property name="title">
<string>Colors</string>
@@ -27,7 +27,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textColorLabel</cstring>
</property>
@@ -38,7 +38,7 @@
<cstring>textKColorButton</cstring>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>backgroundColorLabel</cstring>
</property>
@@ -67,7 +67,7 @@
</widget>
</grid>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>shadowGroupBox</cstring>
</property>
@@ -78,7 +78,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>shadowColorLabel</cstring>
</property>
@@ -105,7 +105,7 @@
<string></string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>shadowDistanceLabel</cstring>
</property>
@@ -126,7 +126,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>16</width>
<height>20</height>
@@ -143,14 +143,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>21</height>
</size>
</property>
</spacer>
- <widget class="QButtonGroup" row="0" column="3" rowspan="2" colspan="1">
+ <widget class="TQButtonGroup" row="0" column="3" rowspan="2" colspan="1">
<property name="name">
<cstring>shadowDirectionButtonGroup</cstring>
</property>
@@ -341,7 +341,7 @@
<data format="PNG" length="96">89504e470d0a1a0a0000000d49484452000000140000001408060000008d891d0d0000002749444154388d63601805c31f3022b1ffc309d20c40368381895217a1835103478281a360240000f61e021097bbc8b20000000049454e44ae426082</data>
</image>
</images>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kcolorbutton.h</includehint>
<includehint>kcolorbutton.h</includehint>
diff --git a/lib/kotext/kofonttabbase.ui b/lib/kotext/kofonttabbase.ui
index bdaa3549..32800dd8 100644
--- a/lib/kotext/kofonttabbase.ui
+++ b/lib/kotext/kofonttabbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoFontTabBase</class>
- <widget class="QWidget">
+ <widget class="TQWidget">
<property name="name">
<cstring>fontPage</cstring>
</property>
@@ -18,7 +18,7 @@
</widget>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includes>
<include location="local" impldecl="in declaration">KFontDialog_local.h</include>
</includes>
diff --git a/lib/kotext/kohighlightingtabbase.ui b/lib/kotext/kohighlightingtabbase.ui
index 939b66ca..3f0b8512 100644
--- a/lib/kotext/kohighlightingtabbase.ui
+++ b/lib/kotext/kohighlightingtabbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoHighlightingTabBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>highlightingTabBase</cstring>
</property>
@@ -27,7 +27,7 @@
<string></string>
</property>
</widget>
- <widget class="QCheckBox" row="4" column="0">
+ <widget class="TQCheckBox" row="4" column="0">
<property name="name">
<cstring>underlineWordByWordCheckBox</cstring>
</property>
@@ -38,7 +38,7 @@
<string>Word by word</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -49,7 +49,7 @@
<cstring>underlineStyleKComboBox</cstring>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@@ -86,7 +86,7 @@
<cstring>underlineStyleKComboBox</cstring>
</property>
</widget>
- <widget class="QButtonGroup" row="5" column="0" rowspan="1" colspan="3">
+ <widget class="TQButtonGroup" row="5" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>capitalisationButtonGroup</cstring>
</property>
@@ -120,7 +120,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>41</height>
@@ -129,7 +129,7 @@
</spacer>
</grid>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kcolorbutton.h</includehint>
<includehint>kcombobox.h</includehint>
diff --git a/lib/kotext/kohyphen/hyphdicts/hyph_da.dic b/lib/kotext/kohyphen/hyphdicts/hyph_da.dic
index 77d0666f..2a7154fb 100644
--- a/lib/kotext/kohyphen/hyphdicts/hyph_da.dic
+++ b/lib/kotext/kohyphen/hyphdicts/hyph_da.dic
@@ -540,7 +540,7 @@ le4mo
4leu
l1f
lfin4
-lfind5
+ltqfind5
l1go1
l3h
li4ga
diff --git a/lib/kotext/kohyphen/hyphdicts/hyph_es.dic b/lib/kotext/kohyphen/hyphdicts/hyph_es.dic
index 2af6bfa1..05ff239c 100644
--- a/lib/kotext/kohyphen/hyphdicts/hyph_es.dic
+++ b/lib/kotext/kohyphen/hyphdicts/hyph_es.dic
@@ -451,8 +451,8 @@ z1h
2locos.
2loca.
2locas.
-2moco.
-2mocos.
+2tqmoco.
+2tqmocos.
2mula.
2mulas.
2pedo.
diff --git a/lib/kotext/kohyphen/hyphdicts/hyph_hu.dic b/lib/kotext/kohyphen/hyphdicts/hyph_hu.dic
index 66564932..8b1bdce4 100644
--- a/lib/kotext/kohyphen/hyphdicts/hyph_hu.dic
+++ b/lib/kotext/kohyphen/hyphdicts/hyph_hu.dic
@@ -25668,7 +25668,7 @@ fimeg1
fi1me
2f1i2nas
fi1na
-2find
+2tqfind
fin1os2z
fi1no
fi2n1
@@ -26978,7 +26978,7 @@ ge3mell
2g1e2ms
ge1m
2g1eml
-ge2moc
+ge2tqmoc
ge1mo
2g1emp
ge1na2
diff --git a/lib/kotext/kohyphen/hyphdicts/hyph_nl.dic b/lib/kotext/kohyphen/hyphdicts/hyph_nl.dic
index 0a5b745b..a5b6f05c 100644
--- a/lib/kotext/kohyphen/hyphdicts/hyph_nl.dic
+++ b/lib/kotext/kohyphen/hyphdicts/hyph_nl.dic
@@ -3408,7 +3408,7 @@ fik4st
fil4m3a
film5on
fi3lo
-4find
+4tqfind
3fini
f3inj
4fink
diff --git a/lib/kotext/kohyphen/hyphdicts/hyph_sv.dic b/lib/kotext/kohyphen/hyphdicts/hyph_sv.dic
index 6ec0f944..1726d063 100755
--- a/lib/kotext/kohyphen/hyphdicts/hyph_sv.dic
+++ b/lib/kotext/kohyphen/hyphdicts/hyph_sv.dic
@@ -2183,7 +2183,7 @@ mani1k
5ma3ri
mash5
mas3ko
-mask3ro
+tqmask3ro
ma5sk^^f6
mas3ti
mas4v
diff --git a/lib/kotext/kohyphen/kohyphen.cpp b/lib/kotext/kohyphen/kohyphen.cpp
index 584fa247..29d13c37 100644
--- a/lib/kotext/kohyphen/kohyphen.cpp
+++ b/lib/kotext/kohyphen/kohyphen.cpp
@@ -19,10 +19,10 @@
* Boston, MA 02110-1301, USA. *
******************************************************************************/
-#include <qdom.h>
-#include <qfile.h>
-#include <qtextcodec.h>
-#include <qstring.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqtextcodec.h>
+#include <tqstring.h>
#include <klocale.h>
#include <kapplication.h>
@@ -49,31 +49,31 @@ KoHyphenator::KoHyphenator()
{
/* Reading config for dictionary encodings from file...*/
- QString path = kapp->dirs()->findResource("data", "koffice/hyphdicts/dicts.xml");
+ TQString path = kapp->dirs()->findResource("data", "koffice/hyphdicts/dicts.xml");
#ifdef DEBUG_HYPHENATOR
kdDebug() << path << endl;
#endif
- QFile *f;
+ TQFile *f;
if (!path.isNull())
- f = new QFile(path);
+ f = new TQFile(path);
else
throw KoHyphenatorException( "Could not create KoHyphenator instance." );
- QDomDocument config;
- QDomNodeList records;
+ TQDomDocument config;
+ TQDomNodeList records;
config.setContent(f);
- for (QDomNode n = config.firstChild(); !n.isNull(); n = n.nextSibling())
+ for (TQDomNode n = config.firstChild(); !n.isNull(); n = n.nextSibling())
if (n.nodeName() == "dicts")
{
records = n.childNodes();
for (uint i = 0; i < records.count(); i++)
{
- QDomNamedNodeMap attr = records.item(i).attributes();
- if (attr.contains("lang") && attr.contains("encoding")) {
- QString lang = attr.namedItem("lang").nodeValue();
- QString encoding = attr.namedItem("encoding").nodeValue();
+ TQDomNamedNodeMap attr = records.item(i).attributes();
+ if (attr.tqcontains("lang") && attr.tqcontains("encoding")) {
+ TQString lang = attr.namedItem("lang").nodeValue();
+ TQString encoding = attr.namedItem("encoding").nodeValue();
#ifdef DEBUG_HYPHENATOR
kdDebug() << "KoHyphenator: found lang=" << lang << " encoding=" << encoding << endl;
#endif
@@ -88,19 +88,19 @@ KoHyphenator::KoHyphenator()
KoHyphenator::~KoHyphenator()
{
- for (QMap<QString, HyphenDict*>::iterator it = dicts.begin(); it != dicts.end(); ++it)
+ for (TQMap<TQString, HyphenDict*>::iterator it = dicts.begin(); it != dicts.end(); ++it)
{
if ((*it) != 0)
hnj_hyphen_free((*it));
}
}
-char *KoHyphenator::hyphens(const QString& str, const QString& lang) const
+char *KoHyphenator::hyphens(const TQString& str, const TQString& lang) const
{
char *x = new char[str.length()+1];
try
{
- QTextCodec *codec = codecForLang(lang);
+ TQTextCodec *codec = codecForLang(lang);
hnj_hyphen_hyphenate(dict(lang), (const char *)(codec->fromUnicode(str)), str.length(), x);
}
catch (KoHyphenatorException &e)
@@ -115,13 +115,13 @@ char *KoHyphenator::hyphens(const QString& str, const QString& lang) const
return x;
}
-QString KoHyphenator::hyphenate(const QString& str, const QString& lang) const
+TQString KoHyphenator::hyphenate(const TQString& str, const TQString& lang) const
{
char* x = new char[str.length()+1];
- QString res = str;
+ TQString res = str;
try
{
- QTextCodec *codec = codecForLang(lang);
+ TQTextCodec *codec = codecForLang(lang);
hnj_hyphen_hyphenate(dict(lang), (const char *)(codec->fromUnicode(str)), str.length(), x);
}
catch (KoHyphenatorException &e)
@@ -141,7 +141,7 @@ QString KoHyphenator::hyphenate(const QString& str, const QString& lang) const
#endif
if ((x[i] % 2) != 0)
{
- res.insert(j+1, QChar(0xad));
+ res.insert(j+1, TQChar(0xad));
j++;
}
j++;
@@ -150,7 +150,7 @@ QString KoHyphenator::hyphenate(const QString& str, const QString& lang) const
return res;
}
-bool KoHyphenator::checkHyphenPos(const QString& str, int pos, const QString& lang) const
+bool KoHyphenator::checkHyphenPos(const TQString& str, int pos, const TQString& lang) const
{
#ifdef DEBUG_HYPHENATOR
kdDebug() << "string: " << str << endl;
@@ -167,65 +167,65 @@ bool KoHyphenator::checkHyphenPos(const QString& str, int pos, const QString& la
return ret;
}
-HyphenDict *KoHyphenator::dict(const QString &_lang) const
+HyphenDict *KoHyphenator::dict(const TQString &_lang) const
{
- QString lang( _lang );
+ TQString lang( _lang );
//only load dictionary when encoding info is present
- if (encodings.find(lang) == encodings.end())
+ if (encodings.tqfind(lang) == encodings.end())
{
- int underscore = lang.find('_');
+ int underscore = lang.tqfind('_');
if ( underscore > -1 ) {
lang.truncate( underscore );
- if (encodings.find(lang) == encodings.end())
- throw KoHyphenatorException( QString("No dictionary for %1").arg(lang) );
+ if (encodings.tqfind(lang) == encodings.end())
+ throw KoHyphenatorException( TQString("No dictionary for %1").tqarg(lang) );
}
else
- throw KoHyphenatorException( QString("No dictionary for %1").arg(lang) );
+ throw KoHyphenatorException( TQString("No dictionary for %1").tqarg(lang) );
}
- if (dicts.find(lang) == dicts.end())
+ if (dicts.tqfind(lang) == dicts.end())
{
#ifdef DEBUG_HYPHENATOR
kdDebug() << "Searching dictionary for '" << lang << "' language..." << endl;
#endif
- QString path = kapp->dirs()->findResource("data", "koffice/hyphdicts/hyph_" + lang + ".dic");
+ TQString path = kapp->dirs()->findResource("data", "koffice/hyphdicts/hyph_" + lang + ".dic");
if (!path.isNull())
{
#ifdef DEBUG_HYPHENATOR
kdDebug() << "Loading dictionary for '" << lang << "' language: path = " << path << endl;
#endif
- const_cast<KoHyphenator*>(this)->dicts.insert( lang, hnj_hyphen_load(QFile::encodeName(path)) );
- if (dicts.find(lang) == dicts.end())
+ const_cast<KoHyphenator*>(this)->dicts.insert( lang, hnj_hyphen_load(TQFile::encodeName(path)) );
+ if (dicts.tqfind(lang) == dicts.end())
{
#ifdef DEBUG_HYPHENATOR
kdDebug() << "No dictionary loaded" << endl;
#endif
- throw(KoHyphenatorException( QString("Could not load dictionary for the language: %1").arg(lang) ));
+ throw(KoHyphenatorException( TQString("Could not load dictionary for the language: %1").tqarg(lang) ));
}
}
else
- throw(KoHyphenatorException( QString("Could not load dictionary for the language: %1").arg(lang) ));
+ throw(KoHyphenatorException( TQString("Could not load dictionary for the language: %1").tqarg(lang) ));
}
return dicts[lang];
}
-QTextCodec* KoHyphenator::codecForLang(const QString& lang) const
+TQTextCodec* KoHyphenator::codecForLang(const TQString& lang) const
{
- EncodingMap::Iterator it = encodings.find(lang);
+ EncodingMap::Iterator it = encodings.tqfind(lang);
if (it == encodings.end())
{
- int underscore = lang.find('_');
+ int underscore = lang.tqfind('_');
if ( underscore > -1 ) {
- QString _lang( lang );
+ TQString _lang( lang );
_lang.truncate( underscore );
- it = encodings.find(_lang);
+ it = encodings.tqfind(_lang);
}
}
if (it != encodings.end())
{
if ( (*it).codec )
return (*it).codec;
- (*it).codec = QTextCodec::codecForName((*it).encoding);
+ (*it).codec = TQTextCodec::codecForName((*it).encoding);
return (*it).codec;
}
- return QTextCodec::codecForMib(106); // utf-8
+ return TQTextCodec::codecForMib(106); // utf-8
}
diff --git a/lib/kotext/kohyphen/kohyphen.h b/lib/kotext/kohyphen/kohyphen.h
index b36f80c3..af3bef41 100644
--- a/lib/kotext/kohyphen/kohyphen.h
+++ b/lib/kotext/kohyphen/kohyphen.h
@@ -22,16 +22,16 @@
#ifndef KOHYPHEN_H
#define KOHYPHEN_H
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
#include "hyphen.h"
class KoHyphenatorException{
public:
- KoHyphenatorException(const QString& MessageText): messageText(MessageText) {}
- QString message() const { return messageText; }
+ KoHyphenatorException(const TQString& MessageText): messageText(MessageText) {}
+ TQString message() const { return messageText; }
private:
- QString messageText;
+ TQString messageText;
};
/**
@@ -45,11 +45,11 @@ private:
* This library tries to adopt it for KDE.
*
* It handles the hyphenation dictionary loading for the specified language.
- * QString -> char* conversion is done by using of settings in
+ * TQString -> char* conversion is done by using of settings in
* dicts.xml file in datadir/koffice/hyphdicts (dictionaries are also located
* there).
*
- * The @ref hyphenate() functions returns QString containing hyphenation
+ * The @ref hyphenate() functions returns TQString containing hyphenation
* chars (0xad) or char* in format of hnj_hyphen_hyphenate() function from
* libhnj library.
*/
@@ -70,7 +70,7 @@ public:
* Can be used to check if the line break at given position
* should be forced and automatic hyphen added.
*/
- bool checkHyphenPos(const QString& str, int pos, const QString& lang) const;
+ bool checkHyphenPos(const TQString& str, int pos, const TQString& lang) const;
/**
* Returns the pointer to the string in hnj_hyphen_hyphenate() format
@@ -88,7 +88,7 @@ public:
* Language: two chars containing the ISO 639-1 code
* (for example "en", "uk", etc.) (could be lang_COUNTRY as well).
*/
- char *hyphens(const QString& str, const QString& lang) const;
+ char *hyphens(const TQString& str, const TQString& lang) const;
/**
* Hyphenates the string str and returns the string with
@@ -100,27 +100,27 @@ public:
* Language: two chars containing the ISO 639-1 code
* (for example "en", "uk", etc.) (could be lang_COUNTRY as well).
*/
- QString hyphenate(const QString& str, const QString& lang) const;
+ TQString hyphenate(const TQString& str, const TQString& lang) const;
private:
/**
* @return the encoding of dictionary for the language @p lang.
*/
- QTextCodec* codecForLang(const QString& lang) const;
+ TQTextCodec* codecForLang(const TQString& lang) const;
KoHyphenator();
- HyphenDict *dict(const QString &lang) const;
+ HyphenDict *dict(const TQString &lang) const;
- QMap<QString, HyphenDict*> dicts;
+ TQMap<TQString, HyphenDict*> dicts;
struct EncodingStruct {
- EncodingStruct() // for QMap
+ EncodingStruct() // for TQMap
: encoding(), codec(0L) {}
- EncodingStruct(const QCString& _encoding)
+ EncodingStruct(const TQCString& _encoding)
: encoding(_encoding), codec(0L) {}
- QCString encoding;
- QTextCodec* codec;
+ TQCString encoding;
+ TQTextCodec* codec;
};
- typedef QMap<QString, EncodingStruct> EncodingMap;
+ typedef TQMap<TQString, EncodingStruct> EncodingMap;
mutable EncodingMap encodings; // key is the language code
static KoHyphenator* s_self;
diff --git a/lib/kotext/kohyphen/kohyphentest.cpp b/lib/kotext/kohyphen/kohyphentest.cpp
index d19526ce..d5d8daff 100644
--- a/lib/kotext/kohyphen/kohyphentest.cpp
+++ b/lib/kotext/kohyphen/kohyphentest.cpp
@@ -3,19 +3,19 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kapplication.h>
#include "kohyphen.h"
#include <kdebug.h>
-static bool check(QString a, QString b)
+static bool check(TQString a, TQString b)
{
if (a.isEmpty())
- a = QString::null;
+ a = TQString();
if (b.isEmpty())
- b = QString::null;
+ b = TQString();
if (a == b) {
kdDebug() << "checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl;
}
@@ -28,13 +28,13 @@ static bool check(QString a, QString b)
KoHyphenator * hypher = 0L;
-void check_hyphenation( const QStringList& tests, const QStringList& results, const char* lang )
+void check_hyphenation( const TQStringList& tests, const TQStringList& results, const char* lang )
{
- QStringList::ConstIterator it, itres;
+ TQStringList::ConstIterator it, itres;
for ( it = tests.begin(), itres = results.begin(); it != tests.end() ; ++it, ++itres ) {
- QString result = hypher->hyphenate((*it), lang);
+ TQString result = hypher->hyphenate((*it), lang);
kdDebug() << (*it) << " hyphenates like this: " << result << endl;
- check( result.replace(QChar(0xad),'-'), *itres );
+ check( result.tqreplace(TQChar(0xad),'-'), *itres );
}
}
@@ -51,22 +51,22 @@ int main (int argc, char ** argv)
return 1;
}
- QStringList::ConstIterator it, itres;
+ TQStringList::ConstIterator it, itres;
//testing Czech language, this text is in UTF-8!
- QStringList cs_tests = QStringList() << "Žluťoučký" << "kůň" << "úpěl" <<
+ TQStringList cs_tests = TQStringList() << "Žluťoučký" << "kůň" << "úpěl" <<
"ďábelské" << "ódy";
for ( it = cs_tests.begin(); it != cs_tests.end() ; ++it )
kdDebug() << (*it) << " hyphenates like this: " << hypher->hyphenate((*it), "cs") << endl;
//testing English
- QStringList en_tests = QStringList() << "Follow" << "white" << "rabbit";
- QStringList en_results = QStringList() << "Fol-low" << "white" << "rab-bit";
+ TQStringList en_tests = TQStringList() << "Follow" << "white" << "rabbit";
+ TQStringList en_results = TQStringList() << "Fol-low" << "white" << "rab-bit";
check_hyphenation( en_tests, en_results, "en" );
- QStringList fr_tests = QStringList() << "constitution" ;
- QStringList fr_results = QStringList() << "consti-tu-tion" ;
+ TQStringList fr_tests = TQStringList() << "constitution" ;
+ TQStringList fr_results = TQStringList() << "consti-tu-tion" ;
check_hyphenation( fr_tests, fr_results, "fr" );
return 0;
diff --git a/lib/kotext/kolanguagetabbase.ui b/lib/kotext/kolanguagetabbase.ui
index f5f79904..f280097e 100644
--- a/lib/kotext/kolanguagetabbase.ui
+++ b/lib/kotext/kolanguagetabbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoLanguageTabBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>koLanguageTabBase</cstring>
</property>
@@ -16,7 +16,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>languageGroupBox</cstring>
</property>
@@ -35,7 +35,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>languageLabel</cstring>
</property>
@@ -60,7 +60,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>171</height>
@@ -69,7 +69,7 @@
</spacer>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kcombobox.h</includehint>
</includehints>
diff --git a/lib/kotext/kolayouttabbase.ui b/lib/kotext/kolayouttabbase.ui
index d40cd006..9a8e4a93 100644
--- a/lib/kotext/kolayouttabbase.ui
+++ b/lib/kotext/kolayouttabbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KoLayoutTabBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>koLayoutTabBase</cstring>
</property>
@@ -16,7 +16,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QButtonGroup">
+ <widget class="TQButtonGroup">
<property name="name">
<cstring>positionButtonGroup</cstring>
</property>
@@ -38,15 +38,15 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>tqlayout3</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>normalPosRadioButton</cstring>
</property>
@@ -60,7 +60,7 @@
<number>0</number>
</property>
</widget>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>Superscript</cstring>
</property>
@@ -71,7 +71,7 @@
<number>2</number>
</property>
</widget>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>subscriptRadioButton</cstring>
</property>
@@ -94,16 +94,16 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>61</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout2</cstring>
+ <cstring>tqlayout2</cstring>
</property>
<grid>
<property name="name">
@@ -129,7 +129,7 @@
<number>66</number>
</property>
</widget>
- <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2">
+ <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>customRadioButton</cstring>
</property>
@@ -140,7 +140,7 @@
<number>3</number>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>offsetLabel</cstring>
</property>
@@ -151,7 +151,7 @@
<string>Offset:</string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>relativeSizeLabel</cstring>
</property>
@@ -162,7 +162,7 @@
<string>Relative size:</string>
</property>
</widget>
- <widget class="QSpinBox" row="1" column="1">
+ <widget class="TQSpinBox" row="1" column="1">
<property name="name">
<cstring>offsetSpinBox</cstring>
</property>
@@ -186,7 +186,7 @@
</widget>
</hbox>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>hyphenGroupBox</cstring>
</property>
@@ -205,7 +205,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>hyphenateCheckBox</cstring>
</property>
@@ -225,7 +225,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>16</height>
@@ -288,7 +288,7 @@
<include location="global" impldecl="in declaration">knuminput.h</include>
<include location="global" impldecl="in declaration">klocale.h</include>
</includes>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>knuminput.h</includehint>
</includehints>
diff --git a/lib/kotext/tests/KoUserStyleTester.cpp b/lib/kotext/tests/KoUserStyleTester.cpp
index 4fff7085..7eac3881 100644
--- a/lib/kotext/tests/KoUserStyleTester.cpp
+++ b/lib/kotext/tests/KoUserStyleTester.cpp
@@ -53,9 +53,9 @@ void KoUserStyleTester::testAddStyle()
KoUserStyleCollection coll( "test" );
KoUserStyle* style = new KoUserStyle( "test1" );
- COMPARE( style->name(), QString( "test1" ) );
- COMPARE( style->displayName(), QString( "test1" ) );
- const QString displayName = "A lovely name";
+ COMPARE( style->name(), TQString( "test1" ) );
+ COMPARE( style->displayName(), TQString( "test1" ) );
+ const TQString displayName = "A lovely name";
style->setDisplayName( displayName );
COMPARE( style->displayName(), displayName );
@@ -63,7 +63,7 @@ void KoUserStyleTester::testAddStyle()
COMPARE( ret, style );
KoUserStyle* style2 = new KoUserStyle( "test1" );
- COMPARE( style2->name(), QString( "test1" ) );
+ COMPARE( style2->name(), TQString( "test1" ) );
style2->setDisplayName( displayName );
ret = coll.addStyle( style2 );
// here style2 got deleted.
@@ -75,10 +75,10 @@ void KoUserStyleTester::testAddStyle()
// Add another style for good this time
KoUserStyle* style3 = new KoUserStyle( "test3" );
- COMPARE( style3->name(), QString( "test3" ) );
+ COMPARE( style3->name(), TQString( "test3" ) );
ret = coll.addStyle( style3 );
- QStringList displayNames = coll.displayNameList();
+ TQStringList displayNames = coll.displayNameList();
COMPARE( (int)displayNames.count(), 2 );
COMPARE( displayNames[0], displayName );
COMPARE( displayNames[1], style3->name() );
@@ -88,15 +88,15 @@ void KoUserStyleTester::testFindStyle()
{
KoUserStyleCollection coll( "test" );
KoUserStyle* style = new KoUserStyle( "test1" );
- const QString displayName = "A lovely name";
+ const TQString displayName = "A lovely name";
style->setDisplayName( displayName );
coll.addStyle( style );
// --- findStyle tests ---
- KoUserStyle* ret = coll.findStyle( "test1", QString::null );
+ KoUserStyle* ret = coll.findStyle( "test1", TQString() );
COMPARE( ret, style );
- ret = coll.findStyle( "foo", QString::null );
+ ret = coll.findStyle( "foo", TQString() );
COMPARE( ret, (KoUserStyle*)0 );
ret = coll.findStyle( "foo", "test1" ); // fallback not used for style 'foo'
@@ -150,13 +150,13 @@ void KoUserStyleTester::testReorder()
coll.addStyle( style );
COMPARE( coll.count(), 3 );
- QStringList newOrder;
+ TQStringList newOrder;
newOrder << "test3";
newOrder << "test2";
newOrder << "test1";
coll.updateStyleListOrder( newOrder );
COMPARE( coll.count(), 3 );
- QStringList displayNames = coll.displayNameList();
+ TQStringList displayNames = coll.displayNameList();
COMPARE( (int)displayNames.count(), 3 );
COMPARE( displayNames.join(","), newOrder.join(",") );
}
diff --git a/lib/kotext/tests/KoUserStyleTester.h b/lib/kotext/tests/KoUserStyleTester.h
index 79e61c6a..d5b32519 100644
--- a/lib/kotext/tests/KoUserStyleTester.h
+++ b/lib/kotext/tests/KoUserStyleTester.h
@@ -23,6 +23,7 @@
class KoUserStyleTester : public KUnitTest::SlotTester {
Q_OBJECT
+ TQ_OBJECT
private slots:
void testEmptyCollection();
void testAddStyle();
diff --git a/lib/kotext/tests/kobordertest.cpp b/lib/kotext/tests/kobordertest.cpp
index cce43179..36169272 100644
--- a/lib/kotext/tests/kobordertest.cpp
+++ b/lib/kotext/tests/kobordertest.cpp
@@ -2,23 +2,23 @@
#include <KoZoomHandler.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
-#include <qpainter.h>
-#include <qwidget.h>
-#include <qgrid.h>
+#include <tqpainter.h>
+#include <tqwidget.h>
+#include <tqgrid.h>
-class MyWidget : public QWidget
+class MyWidget : public TQWidget
{
public:
- MyWidget( KoZoomHandler* _zh, QWidget* parent )
- : QWidget( parent ), m_zh(_zh) {
- setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ MyWidget( KoZoomHandler* _zh, TQWidget* tqparent )
+ : TQWidget( tqparent ), m_zh(_zh) {
+ tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
}
- QSize sizeHint() const {
- return QSize( 150, 150 );
+ TQSize tqsizeHint() const {
+ return TQSize( 150, 150 );
}
- QSize minimumSizeHint() const {
- return sizeHint();
+ TQSize tqminimumSizeHint() const {
+ return tqsizeHint();
}
KoBorder m_leftBorder;
@@ -27,13 +27,13 @@ public:
KoBorder m_bottomBorder;
protected:
- virtual void paintEvent( QPaintEvent* )
+ virtual void paintEvent( TQPaintEvent* )
{
- QPainter p( this );
- QRect rect( 10, 10, 100, 100 );
+ TQPainter p( this );
+ TQRect rect( 10, 10, 100, 100 );
KoBorder::drawBorders( p, m_zh, rect, m_leftBorder,
m_rightBorder, m_topBorder, m_bottomBorder,
- 0, QPen() );
+ 0, TQPen() );
// Show the corners of the rect - they must apppear _inside_ the borders.
p.setPen( black );
p.drawPoint( rect.topLeft() );
@@ -53,30 +53,30 @@ int main (int argc, char ** argv)
KoZoomHandler* zh = new KoZoomHandler();
- QGrid* grid = new QGrid(2, Qt::Horizontal, 0L); // 2 columns
+ TQGrid* grid = new TQGrid(2, Qt::Horizontal, 0L); // 2 columns
{
// First square
MyWidget* w = new MyWidget(zh, grid);
w->m_leftBorder.setPenWidth( 6 );
- w->m_leftBorder.color = Qt::red;
+ w->m_leftBorder.color = TQt::red;
w->m_rightBorder.setPenWidth( 9 );
- w->m_rightBorder.color = Qt::red;
+ w->m_rightBorder.color = TQt::red;
w->m_topBorder.setPenWidth( 11 );
- w->m_topBorder.color = Qt::blue;
+ w->m_topBorder.color = TQt::blue;
w->m_bottomBorder.setPenWidth( 13 );
- w->m_bottomBorder.color = Qt::green;
+ w->m_bottomBorder.color = TQt::green;
}
{
// Second square, with opposite (odd/even-wise) widths
MyWidget* w = new MyWidget(zh, grid);
w->m_leftBorder.setPenWidth( 7 );
- w->m_leftBorder.color = Qt::red;
+ w->m_leftBorder.color = TQt::red;
w->m_rightBorder.setPenWidth( 8 );
- w->m_rightBorder.color = Qt::red;
+ w->m_rightBorder.color = TQt::red;
w->m_topBorder.setPenWidth( 10 );
- w->m_topBorder.color = Qt::blue;
+ w->m_topBorder.color = TQt::blue;
w->m_bottomBorder.setPenWidth( 12 );
- w->m_bottomBorder.color = Qt::green;
+ w->m_bottomBorder.color = TQt::green;
}
{
// Third square, with double borders
@@ -84,13 +84,13 @@ int main (int argc, char ** argv)
w2->m_leftBorder.setPenWidth( 2 );
w2->m_leftBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_rightBorder.setPenWidth( 6 );
- w2->m_rightBorder.color = Qt::red;
+ w2->m_rightBorder.color = TQt::red;
w2->m_rightBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_topBorder.setPenWidth( 4 );
- w2->m_topBorder.color = Qt::blue;
+ w2->m_topBorder.color = TQt::blue;
w2->m_topBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_bottomBorder.setPenWidth( 6 );
- w2->m_bottomBorder.color = Qt::green;
+ w2->m_bottomBorder.color = TQt::green;
w2->m_bottomBorder.setStyle( KoBorder::DOUBLE_LINE );
}
{
@@ -99,13 +99,13 @@ int main (int argc, char ** argv)
w2->m_leftBorder.setPenWidth( 1 );
w2->m_leftBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_rightBorder.setPenWidth( 5 );
- w2->m_rightBorder.color = Qt::red;
+ w2->m_rightBorder.color = TQt::red;
w2->m_rightBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_topBorder.setPenWidth( 3 );
- w2->m_topBorder.color = Qt::blue;
+ w2->m_topBorder.color = TQt::blue;
w2->m_topBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_bottomBorder.setPenWidth( 5 );
- w2->m_bottomBorder.color = Qt::green;
+ w2->m_bottomBorder.color = TQt::green;
w2->m_bottomBorder.setStyle( KoBorder::DOUBLE_LINE );
}
grid->show();
diff --git a/lib/kotext/tests/kotextformattertest.cpp b/lib/kotext/tests/kotextformattertest.cpp
index 0a4ab140..b6138315 100644
--- a/lib/kotext/tests/kotextformattertest.cpp
+++ b/lib/kotext/tests/kotextformattertest.cpp
@@ -72,8 +72,8 @@ private:
KoTextFormatterTest::KoTextFormatterTest()
{
zh = new KoTextZoomHandler;
- QFont defaultFont( "helvetica", 12 );
- KoTextFormatCollection* fc = new KoTextFormatCollection( defaultFont, Qt::black, "en_US", false /*no hyphenation*/ );
+ TQFont defaultFont( "helvetica", 12 );
+ KoTextFormatCollection* fc = new KoTextFormatCollection( defaultFont, TQt::black, "en_US", false /*no hyphenation*/ );
KoTextFormatter* formatter = new KoTextFormatter;
// fc and formatter are owned by the doc
doc = new KoTextDocument( zh, fc, formatter );
@@ -89,7 +89,7 @@ void KoTextFormatterTest::speedTest()
// Format it 50 times
for ( uint i = 0 ; i < 50 ; ++i )
{
- parag->invalidate(0);
+ parag->tqinvalidate(0);
parag->format();
}
doc->clear(false);
@@ -205,8 +205,8 @@ int main (int argc, char ** argv)
KApplication app(argc, argv, "KoTextFormatter test");
// Don't let locale settings lead to different hyphenation output
- KGlobal::locale()->setLanguage( QString::fromLatin1( "en_US" ) );
- KGlobal::locale()->setCountry( QString::fromLatin1( "C" ) );
+ KGlobal::locale()->setLanguage( TQString::tqfromLatin1( "en_US" ) );
+ KGlobal::locale()->setCountry( TQString::tqfromLatin1( "C" ) );
KoTextFormatterTest test;
//test.speedTest();
diff --git a/lib/kotext/tests/kovariabletest.cpp b/lib/kotext/tests/kovariabletest.cpp
index 05b801c6..6d040350 100644
--- a/lib/kotext/tests/kovariabletest.cpp
+++ b/lib/kotext/tests/kovariabletest.cpp
@@ -16,7 +16,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <qstring.h>
+#include <tqstring.h>
#include <assert.h>
#include "../IsoDuration.h"
@@ -24,7 +24,7 @@
void testMinutes()
{
int minutes = 145;
- QString str = minutesToISODuration( minutes );
+ TQString str = minutesToISODuration( minutes );
int result = ISODurationToMinutes( str );
qDebug( "%d minutes -> %s -> %d", minutes, str.latin1(), result );
assert( result == minutes );
@@ -33,7 +33,7 @@ void testMinutes()
void testNegativeMinutes()
{
int minutes = -15;
- QString str = minutesToISODuration( minutes );
+ TQString str = minutesToISODuration( minutes );
int result = ISODurationToMinutes( str );
qDebug( "%d minutes -> %s -> %d", minutes, str.latin1(), result );
assert( result == minutes );
@@ -42,7 +42,7 @@ void testNegativeMinutes()
void testDays()
{
int days = 14;
- QString str = daysToISODuration( days );
+ TQString str = daysToISODuration( days );
int result = ISODurationToDays( str );
qDebug( "%d days -> %s -> %d", days, str.latin1(), result );
assert( result == days );
@@ -51,7 +51,7 @@ void testDays()
void testNegativeDays()
{
int days = -14;
- QString str = daysToISODuration( days );
+ TQString str = daysToISODuration( days );
int result = ISODurationToDays( str );
qDebug( "%d days -> %s -> %d", days, str.latin1(), result );
assert( result == days );
diff --git a/lib/kotext/timedateformatwidget.ui b/lib/kotext/timedateformatwidget.ui
index 92881747..fbd342cb 100644
--- a/lib/kotext/timedateformatwidget.ui
+++ b/lib/kotext/timedateformatwidget.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>TimeDateFormatWidgetPrototype</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>TimeDateFormatWidgetPrototype</cstring>
</property>
@@ -20,7 +20,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@@ -36,20 +36,20 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget" row="0" column="0">
+ <widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
- <cstring>layout7</cstring>
+ <cstring>tqlayout7</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<property name="name">
<cstring>combo1</cstring>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>CheckBox1</cstring>
</property>
@@ -57,15 +57,15 @@
<string>C&amp;ustom</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout5</cstring>
+ <cstring>tqlayout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>TextLabel1</cstring>
</property>
@@ -86,14 +86,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<property name="name">
<cstring>combo2</cstring>
</property>
@@ -111,15 +111,15 @@
</widget>
</hbox>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>tqlayout4</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>label_correction</cstring>
</property>
@@ -137,7 +137,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>50</width>
<height>20</height>
@@ -151,7 +151,7 @@
</widget>
</hbox>
</widget>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>label</cstring>
</property>
@@ -175,7 +175,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>10</height>
@@ -206,11 +206,11 @@
<includes>
<include location="local" impldecl="in implementation">timedateformatwidget.ui.h</include>
</includes>
-<slots>
+<Q_SLOTS>
<slot>comboActivated()</slot>
<slot>updateLabel()</slot>
-</slots>
-<layoutdefaults spacing="6" margin="11"/>
+</Q_SLOTS>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>