summaryrefslogtreecommitdiffstats
path: root/kspread/dialogs/kspread_dlg_cons.cc
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 /kspread/dialogs/kspread_dlg_cons.cc
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 'kspread/dialogs/kspread_dlg_cons.cc')
-rw-r--r--kspread/dialogs/kspread_dlg_cons.cc198
1 files changed, 99 insertions, 99 deletions
diff --git a/kspread/dialogs/kspread_dlg_cons.cc b/kspread/dialogs/kspread_dlg_cons.cc
index 7f10e610..ca049ee1 100644
--- a/kspread/dialogs/kspread_dlg_cons.cc
+++ b/kspread/dialogs/kspread_dlg_cons.cc
@@ -28,11 +28,11 @@
#include <assert.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
#include <kdebug.h>
#include <kdialogbase.h>
@@ -54,24 +54,24 @@
using namespace KSpread;
-ConsolidateDialog::ConsolidateDialog( View* parent, const char* name )
- : KDialogBase( parent, name, false, i18n("Consolidate"), Ok|Cancel )
+ConsolidateDialog::ConsolidateDialog( View* tqparent, const char* name )
+ : KDialogBase( tqparent, name, false, i18n("Consolidate"), Ok|Cancel )
{
- m_pView = parent;
+ m_pView = tqparent;
- QWidget* page = new QWidget( this );
+ TQWidget* page = new TQWidget( this );
setMainWidget( page );
- QGridLayout *grid1 = new QGridLayout( page, 12, 2, marginHint(), spacingHint() );
+ TQGridLayout *grid1 = new TQGridLayout( page, 12, 2, marginHint(), spacingHint() );
- QLabel* tmpQLabel;
- tmpQLabel = new QLabel( page, "Label_1" );
- grid1->addWidget(tmpQLabel,0,0);
- tmpQLabel->setText( i18n("&Function:") );
+ TQLabel* tmpTQLabel;
+ tmpTQLabel = new TQLabel( page, "Label_1" );
+ grid1->addWidget(tmpTQLabel,0,0);
+ tmpTQLabel->setText( i18n("&Function:") );
- m_pFunction = new QComboBox( page );
+ m_pFunction = new TQComboBox( page );
grid1->addWidget(m_pFunction,1,0);
- tmpQLabel->setBuddy(m_pFunction);
+ tmpTQLabel->setBuddy(m_pFunction);
m_pFunction->insertItem( i18n("Sum"), Sum );
m_pFunction->insertItem( i18n("Average"), Average );
@@ -82,41 +82,41 @@ ConsolidateDialog::ConsolidateDialog( View* parent, const char* name )
m_pFunction->insertItem( i18n("Standard Deviation"), StdDev );
m_pFunction->insertItem( i18n("Variance"), Var );
- tmpQLabel = new QLabel( page, "Label_1" );
- tmpQLabel->setText( i18n("Re&ference:") );
- grid1->addWidget(tmpQLabel,2,0);
+ tmpTQLabel = new TQLabel( page, "Label_1" );
+ tmpTQLabel->setText( i18n("Re&ference:") );
+ grid1->addWidget(tmpTQLabel,2,0);
- m_pRef = new QLineEdit( page );
+ m_pRef = new TQLineEdit( page );
grid1->addWidget(m_pRef,3,0);
- tmpQLabel->setBuddy(m_pRef);
+ tmpTQLabel->setBuddy(m_pRef);
- tmpQLabel = new QLabel( page, "Label_1" );
- grid1->addWidget(tmpQLabel,4,0);
- tmpQLabel->setText( i18n("&Entered references:") );
+ tmpTQLabel = new TQLabel( page, "Label_1" );
+ grid1->addWidget(tmpTQLabel,4,0);
+ tmpTQLabel->setText( i18n("&Entered references:") );
- m_pRefs = new QListBox( page );
+ m_pRefs = new TQListBox( page );
grid1->addMultiCellWidget( m_pRefs,5,8,0,0);
- tmpQLabel->setBuddy(m_pRefs);
+ tmpTQLabel->setBuddy(m_pRefs);
- m_pRow = new QCheckBox( i18n("&Description in row"), page );
+ m_pRow = new TQCheckBox( i18n("&Description in row"), page );
grid1->addWidget( m_pRow,9,0);
- m_pCol = new QCheckBox( i18n("De&scription in column"), page );
+ m_pCol = new TQCheckBox( i18n("De&scription in column"), page );
grid1->addWidget(m_pCol,10,0);
- m_pCopy = new QCheckBox( i18n("Co&py data"), page );
+ m_pCopy = new TQCheckBox( i18n("Co&py data"), page );
grid1->addWidget(m_pCopy,11,0);
- m_pAdd = new QPushButton( i18n("&Add"), page );
+ m_pAdd = new TQPushButton( i18n("&Add"), page );
grid1->addWidget(m_pAdd,2,1);
- m_pRemove = new QPushButton( i18n("&Remove"), page );
+ m_pRemove = new TQPushButton( i18n("&Remove"), page );
grid1->addWidget(m_pRemove,3,1);
- connect( m_pAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
- connect( m_pRemove, SIGNAL( clicked() ), this, SLOT( slotRemove() ) );
- connect( m_pRef, SIGNAL( returnPressed() ), this, SLOT( slotReturnPressed() ) );
+ connect( m_pAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAdd() ) );
+ connect( m_pRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemove() ) );
+ connect( m_pRef, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotReturnPressed() ) );
- connect(m_pView->selectionInfo(), SIGNAL(changed(const Region&)),
- this, SLOT(slotSelectionChanged()));
+ connect(m_pView->selectionInfo(), TQT_SIGNAL(changed(const Region&)),
+ this, TQT_SLOT(slotSelectionChanged()));
}
ConsolidateDialog::~ConsolidateDialog()
@@ -128,10 +128,10 @@ enum Description { D_ROW, D_COL, D_NONE, D_BOTH };
struct st_cell
{
- QString xdesc;
- QString ydesc;
+ TQString xdesc;
+ TQString ydesc;
Cell* cell;
- QString sheet;
+ TQString sheet;
int x;
int y;
};
@@ -146,7 +146,7 @@ void ConsolidateDialog::slotOk()
int dx = m_pView->selectionInfo()->selection().left();
int dy = m_pView->selectionInfo()->selection().top();
- QString function;
+ TQString function;
switch( m_pFunction->currentItem() )
{
@@ -161,9 +161,9 @@ void ConsolidateDialog::slotOk()
default: break; // bad bad !
}
- QStringList r = refs();
- QValueList<Range> ranges;
- QStringList::Iterator s = r.begin();
+ TQStringList r = refs();
+ TQValueList<Range> ranges;
+ TQStringList::Iterator s = r.begin();
for( ; s != r.end(); ++s )
{
Range r( *s, map );
@@ -190,21 +190,21 @@ void ConsolidateDialog::slotOk()
// Check whether all ranges have same size
Q_ASSERT( ranges.count() > 0 );
- QValueList<Range>::Iterator it = ranges.begin();
+ TQValueList<Range>::Iterator it = ranges.begin();
int w = (*it).range().right() - (*it).range().left() + 1;
int h = (*it).range().bottom() - (*it).range().top() + 1;
if ( w <= ( ( desc == D_BOTH || desc == D_COL ) ? 1 : 0 ) ||
h <= ( ( desc == D_BOTH || desc == D_ROW ) ? 1 : 0 ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- KMessageBox::error( this, i18n( "The range\n%1\nis too small" ).arg( *( r.begin() ) ));
+ KMessageBox::error( this, i18n( "The range\n%1\nis too small" ).tqarg( *( r.begin() ) ));
return;
}
if( (*it).range().bottom()==KS_rowMax || (*it).range().right()== KS_colMax )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- KMessageBox::error( this, i18n( "The range\n%1\nis too large" ).arg( *( r.begin() ) ));
+ KMessageBox::error( this, i18n( "The range\n%1\nis too large" ).tqarg( *( r.begin() ) ));
return;
}
@@ -212,7 +212,7 @@ void ConsolidateDialog::slotOk()
int i = 1;
for( ; it != ranges.end(); ++it, i++ )
{
- QRect currentRange=(*it).range();
+ TQRect currentRange=(*it).range();
int w2 = currentRange.right() - currentRange.left() + 1;
int h2 = currentRange.bottom() - currentRange.top() + 1;
@@ -220,7 +220,7 @@ void ConsolidateDialog::slotOk()
if(currentRange.bottom()==KS_rowMax || currentRange.right()== KS_colMax)
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- KMessageBox::error( this, i18n( "The range\n%1\nis too large" ).arg( r[i]));
+ KMessageBox::error( this, i18n( "The range\n%1\nis too large" ).tqarg( r[i]));
return;
}
if ( ( desc == D_NONE && ( w != w2 || h != h2 ) ) ||
@@ -228,7 +228,7 @@ void ConsolidateDialog::slotOk()
( desc == D_COL && w != w2 ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- QString tmp = i18n( "The ranges\n%1\nand\n%2\nhave different size").arg( *( r.begin() ) ).arg( r[i] );
+ TQString tmp = i18n( "The ranges\n%1\nand\n%2\nhave different size").tqarg( *( r.begin() ) ).tqarg( r[i] );
KMessageBox::error( this, tmp);
return;
}
@@ -238,22 +238,22 @@ void ConsolidateDialog::slotOk()
if ( desc == D_NONE )
{
// Check whether the destination is part of the source ...
- QRect dest;
+ TQRect dest;
dest.setCoords( dx, dy, dx + w - 1, dy + h - 1 );
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
Sheet *t = (*it).sheet();
Q_ASSERT( t );
- QRect r;
+ TQRect r;
- QRect currentRange=(*it).range();
+ TQRect currentRange=(*it).range();
r.setCoords( currentRange.left(), currentRange.top(), currentRange.right(), currentRange.bottom() );
if ( t == sheet && r.intersects( dest ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- QString tmp( i18n("The source tables intersect with the destination table") );
+ TQString tmp( i18n("The source tables intersect with the destination table") );
KMessageBox::error( this, tmp);
return;
}
@@ -264,7 +264,7 @@ void ConsolidateDialog::slotOk()
for( int y = 0; y < h; y++ )
{
bool novalue=true;
- QString formula = "=" + function + "(";
+ TQString formula = "=" + function + "(";
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -289,7 +289,7 @@ void ConsolidateDialog::slotOk()
else if ( desc == D_ROW )
{
// Get list of all descriptions in the rows
- QStringList lst;
+ TQStringList lst;
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -301,8 +301,8 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( x, (*it).range().top() );
if ( c )
{
- QString s = c->value().asString();
- if ( !lst.contains( s ) )
+ TQString s = c->value().asString();
+ if ( !lst.tqcontains( s ) )
lst.append( s );
}
}
@@ -310,20 +310,20 @@ void ConsolidateDialog::slotOk()
lst.sort();
// Check whether the destination is part of the source ...
- QRect dest;
+ TQRect dest;
dest.setCoords( dx, dy, dx + lst.count() - 1, dy + h - 1 );
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
Sheet *t = (*it).sheet();
assert( t );
- QRect r;
- QRect currentRange=(*it).range();
+ TQRect r;
+ TQRect currentRange=(*it).range();
r.setCoords( currentRange.left(), currentRange.top(), currentRange.right(), currentRange.bottom() );
if ( t == sheet && r.intersects( dest ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- QString tmp( i18n("The source tables intersect with the destination table") );
+ TQString tmp( i18n("The source tables intersect with the destination table") );
KMessageBox::error( this, tmp);
return;
}
@@ -331,7 +331,7 @@ void ConsolidateDialog::slotOk()
// Now create the consolidation sheet
int x = 0;
- QStringList::Iterator s = lst.begin();
+ TQStringList::Iterator s = lst.begin();
for( ; s != lst.end(); ++s, ++x )
{
sheet->setText( dy, dx + x, *s );
@@ -339,7 +339,7 @@ void ConsolidateDialog::slotOk()
for( int y = 1; y < h; ++y )
{
int count = 0;
- QString formula = "=" + function + "(";
+ TQString formula = "=" + function + "(";
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -372,7 +372,7 @@ void ConsolidateDialog::slotOk()
else if ( desc == D_COL )
{
// Get list of all descriptions in the columns
- QStringList lst;
+ TQStringList lst;
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -383,8 +383,8 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( (*it).range().left(), y );
if ( c )
{
- QString s = c->value().asString();
- if ( !s.isEmpty() && lst.find( s ) == lst.end() )
+ TQString s = c->value().asString();
+ if ( !s.isEmpty() && lst.tqfind( s ) == lst.end() )
lst.append( s );
}
}
@@ -392,20 +392,20 @@ void ConsolidateDialog::slotOk()
lst.sort();
// Check whether the destination is part of the source ...
- QRect dest;
+ TQRect dest;
dest.setCoords( dx, dy, dx + w - 1, dy + lst.count() - 1 );
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
Sheet *t = (*it).sheet();
assert( t );
- QRect r;
- QRect currentRange=(*it).range();
+ TQRect r;
+ TQRect currentRange=(*it).range();
r.setCoords( currentRange.left(), currentRange.top(), currentRange.right(), currentRange.bottom() );
if ( t == sheet && r.intersects( dest ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- QString tmp( i18n("The source tables intersect with the destination table") );
+ TQString tmp( i18n("The source tables intersect with the destination table") );
KMessageBox::error( this, tmp);
return;
}
@@ -413,7 +413,7 @@ void ConsolidateDialog::slotOk()
// Now create the consolidation sheet
int y = 0;
- QStringList::Iterator s = lst.begin();
+ TQStringList::Iterator s = lst.begin();
for( ; s != lst.end(); ++s, ++y )
{
sheet->setText( dy + y, dx, *s );
@@ -421,7 +421,7 @@ void ConsolidateDialog::slotOk()
for( int x = 1; x < w; ++x )
{
int count = 0;
- QString formula = "=" + function + "(";
+ TQString formula = "=" + function + "(";
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -432,7 +432,7 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( (*it).range().left(), i );
if ( c )
{
- QString v = c->value().asString();
+ TQString v = c->value().asString();
if ( !v.isEmpty() && *s == v )
{
// Cell *c2 = t->cellAt( x + (*it).range.left(), i );
@@ -455,7 +455,7 @@ void ConsolidateDialog::slotOk()
else if ( desc == D_BOTH )
{
// Get list of all descriptions in the columns
- QStringList cols;
+ TQStringList cols;
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -466,8 +466,8 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( (*it).range().left(), y );
if ( c )
{
- QString s = c->value().asString();
- if ( !s.isEmpty() && cols.find( s ) == cols.end() )
+ TQString s = c->value().asString();
+ if ( !s.isEmpty() && cols.tqfind( s ) == cols.end() )
cols.append( s );
}
}
@@ -475,7 +475,7 @@ void ConsolidateDialog::slotOk()
cols.sort();
// Get list of all descriptions in the rows
- QStringList rows;
+ TQStringList rows;
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -486,8 +486,8 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( x, (*it).range().top() );
if ( c )
{
- QString s = c->value().asString();
- if ( !s.isEmpty() && rows.find( s ) == rows.end() )
+ TQString s = c->value().asString();
+ if ( !s.isEmpty() && rows.tqfind( s ) == rows.end() )
rows.append( s );
}
}
@@ -495,27 +495,27 @@ void ConsolidateDialog::slotOk()
rows.sort();
// Check whether the destination is part of the source ...
- QRect dest;
+ TQRect dest;
dest.setCoords( dx, dy, dx + cols.count(), dy + rows.count() );
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
Sheet *t = (*it).sheet();
assert( t );
- QRect r;
- QRect currentRange=(*it).range();
+ TQRect r;
+ TQRect currentRange=(*it).range();
r.setCoords( currentRange.left(), currentRange.top(), currentRange.right(), currentRange.bottom() );
if ( t == sheet && r.intersects( dest ) )
{
m_pView->slotUpdateView( m_pView->activeSheet() );
- QString tmp( i18n("The source tables intersect with the destination table") );
+ TQString tmp( i18n("The source tables intersect with the destination table") );
KMessageBox::error( this, tmp);
return;
}
}
// Fill the list with all interesting cells
- QValueList<st_cell> lst;
+ TQValueList<st_cell> lst;
it = ranges.begin();
for( ; it != ranges.end(); ++it )
{
@@ -526,13 +526,13 @@ void ConsolidateDialog::slotOk()
Cell *c = t->cellAt( x, (*it).range().top() );
if ( c )
{
- QString ydesc = c->value().asString();
+ TQString ydesc = c->value().asString();
for( int y = (*it).range().top() + 1; y <= (*it).range().bottom() ; ++y )
{
Cell *c2 = t->cellAt( (*it).range().left(), y );
if ( c2 )
{
- QString xdesc = c2->value().asString();
+ TQString xdesc = c2->value().asString();
Cell *c3 = t->cellAt( x, y );
if ( c3 && c3->value().isNumber() )
{
@@ -553,7 +553,7 @@ void ConsolidateDialog::slotOk()
// Draw the row description
int i = 1;
- QStringList::Iterator s = rows.begin();
+ TQStringList::Iterator s = rows.begin();
for( ; s != rows.end(); ++s, ++i )
sheet->setText( dy, dx + i, *s );
@@ -565,16 +565,16 @@ void ConsolidateDialog::slotOk()
// Draw the data
int x = 1;
- QStringList::Iterator ydesc = rows.begin();
+ TQStringList::Iterator ydesc = rows.begin();
for( ; ydesc != rows.end(); ++ydesc, x++ )
{
int y = 1;
- QStringList::Iterator xdesc = cols.begin();
+ TQStringList::Iterator xdesc = cols.begin();
for( ; xdesc != cols.end(); ++xdesc, y++ )
{
int count = 0;
- QString formula = "=" + function + "(";
- QValueList<st_cell>::Iterator lit = lst.begin();
+ TQString formula = "=" + function + "(";
+ TQValueList<st_cell>::Iterator lit = lst.begin();
for( ; lit != lst.end(); ++lit )
{
if ( (*lit).xdesc == *xdesc && (*lit).ydesc == *ydesc )
@@ -621,9 +621,9 @@ void ConsolidateDialog::slotRemove()
actionButton( Ok )->setEnabled( false );
}
-QStringList ConsolidateDialog::refs()
+TQStringList ConsolidateDialog::refs()
{
- QStringList list;
+ TQStringList list;
int c = m_pRefs->count();
for( int i = 0; i < c; i++ )
@@ -640,19 +640,19 @@ void ConsolidateDialog::slotSelectionChanged()
return;
}
- QString area = m_pView->selectionInfo()->name();
+ TQString area = m_pView->selectionInfo()->name();
m_pRef->setText( area );
m_pRef->setSelection( 0, area.length() );
}
void ConsolidateDialog::slotReturnPressed()
{
- QString txt = m_pRef->text();
+ TQString txt = m_pRef->text();
Range r( txt, m_pView->doc()->map() );
if ( !r.isValid() )
{
- KMessageBox::error( this, i18n("The range\n%1\n is malformed").arg( txt ));
+ KMessageBox::error( this, i18n("The range\n%1\n is malformed").tqarg( txt ));
return;
}
@@ -663,14 +663,14 @@ void ConsolidateDialog::slotReturnPressed()
}
}
-void ConsolidateDialog::closeEvent ( QCloseEvent * )
+void ConsolidateDialog::closeEvent ( TQCloseEvent * )
{
delete this;
}
-QString ConsolidateDialog::evaluate( const QString& formula, Sheet* sheet )
+TQString ConsolidateDialog::evaluate( const TQString& formula, Sheet* sheet )
{
- QString result = "###";
+ TQString result = "###";
Formula *f = new Formula (sheet);
f->setExpression (formula);
if (!f->isValid()) {