summaryrefslogtreecommitdiffstats
path: root/kspread/commands.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/commands.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/commands.cc')
-rw-r--r--kspread/commands.cc144
1 files changed, 72 insertions, 72 deletions
diff --git a/kspread/commands.cc b/kspread/commands.cc
index 0a5a8a02..9a7ceda4 100644
--- a/kspread/commands.cc
+++ b/kspread/commands.cc
@@ -51,7 +51,7 @@ void UndoWrapperCommand::unexecute()
undoAction->undo();
}
-QString UndoWrapperCommand::name() const
+TQString UndoWrapperCommand::name() const
{
return undoAction->getName();
}
@@ -67,17 +67,17 @@ MergeCellCommand::MergeCellCommand( Cell* c, int cs, int rs )
oldRowSpan = cell->extraYCells();
if( cell )
{
- QRect area( cell->column(), cell->row(), cs+1, rs+1 );
+ TQRect area( cell->column(), cell->row(), cs+1, rs+1 );
rangeName = util_rangeName( area );
}
}
-QString MergeCellCommand::name() const
+TQString MergeCellCommand::name() const
{
if( rangeName.isEmpty() )
return i18n("Merge Cells");
else
- return i18n("Merge Cells %1").arg( rangeName );
+ return i18n("Merge Cells %1").tqarg( rangeName );
}
void MergeCellCommand::execute()
@@ -103,7 +103,7 @@ DissociateCellCommand::DissociateCellCommand( Cell* c )
oldRowSpan = cell->extraYCells();
}
-QString DissociateCellCommand::name() const
+TQString DissociateCellCommand::name() const
{
return i18n("Dissociate Cell");
}
@@ -124,14 +124,14 @@ void DissociateCellCommand::unexecute()
// ----- RenameSheetCommand -----
-RenameSheetCommand::RenameSheetCommand( Sheet* s, const QString &name )
+RenameSheetCommand::RenameSheetCommand( Sheet* s, const TQString &name )
{
sheet = s;
if( s ) oldName = s->sheetName();
newName = name;
}
-QString RenameSheetCommand::name() const
+TQString RenameSheetCommand::name() const
{
return i18n("Rename Sheet");
}
@@ -172,9 +172,9 @@ void HideSheetCommand::unexecute()
sheet->hideSheet( false );
}
-QString HideSheetCommand::name() const
+TQString HideSheetCommand::name() const
{
- QString n = QString( i18n("Hide Sheet %1") ).arg( sheetName );
+ TQString n = TQString( i18n("Hide Sheet %1") ).tqarg( sheetName );
if( n.length() > 64 ) n = i18n("Hide Sheet");
return n;
}
@@ -203,9 +203,9 @@ void ShowSheetCommand::unexecute()
sheet->hideSheet( true );
}
-QString ShowSheetCommand::name() const
+TQString ShowSheetCommand::name() const
{
- QString n = QString( i18n("Show Sheet %1") ).arg( sheetName );
+ TQString n = TQString( i18n("Show Sheet %1") ).tqarg( sheetName );
if( n.length() > 64 ) n = i18n("Show Sheet");
return n;
}
@@ -232,7 +232,7 @@ void AddSheetCommand::unexecute()
doc->takeSheet( sheet );
}
-QString AddSheetCommand::name() const
+TQString AddSheetCommand::name() const
{
return i18n("Add Sheet");
}
@@ -258,7 +258,7 @@ void RemoveSheetCommand::unexecute()
doc->insertSheet( sheet );
}
-QString RemoveSheetCommand::name() const
+TQString RemoveSheetCommand::name() const
{
return i18n("Remove Sheet");
}
@@ -269,7 +269,7 @@ SheetPropertiesCommand::SheetPropertiesCommand( Doc* d, Sheet* s )
{
sheet = s;
doc = d;
- oldDirection = newDirection = sheet->layoutDirection();
+ oldDirection = newDirection = sheet->tqlayoutDirection();
oldAutoCalc = newAutoCalc = sheet->getAutoCalc();
oldShowGrid = newShowGrid = sheet->getShowGrid();
oldShowPageBorders = newShowPageBorders = sheet->isShowPageBorders();
@@ -282,7 +282,7 @@ SheetPropertiesCommand::SheetPropertiesCommand( Doc* d, Sheet* s )
oldCapitalizeFirstLetter = newCapitalizeFirstLetter = sheet->getFirstLetterUpper();
}
-QString SheetPropertiesCommand::name() const
+TQString SheetPropertiesCommand::name() const
{
return i18n("Change Sheet Properties");
}
@@ -399,7 +399,7 @@ void InsertColumnCommand::unexecute()
sheet->removeColumn( insertPosColumn,nbColumnInserted );
}
-QString InsertColumnCommand::name() const
+TQString InsertColumnCommand::name() const
{
return i18n("Insert Columns");
}
@@ -431,7 +431,7 @@ void DefinePrintRangeCommand::unexecute()
sheet->print()->setPrintRange( printRange );
}
-QString DefinePrintRangeCommand::name() const
+TQString DefinePrintRangeCommand::name() const
{
return i18n("Set Page Layout");
}
@@ -532,12 +532,12 @@ void PaperLayoutCommand::unexecute()
}
-QString PaperLayoutCommand::name() const
+TQString PaperLayoutCommand::name() const
{
return i18n("Set Page Layout");
}
-LinkCommand::LinkCommand( Cell* c, const QString& text, const QString& link )
+LinkCommand::LinkCommand( Cell* c, const TQString& text, const TQString& link )
{
cell = c;
oldText = cell->text();
@@ -570,7 +570,7 @@ void LinkCommand::unexecute()
doc->addDamage( new CellDamage( cell ) );
}
-QString LinkCommand::name() const
+TQString LinkCommand::name() const
{
return newLink.isEmpty() ? i18n("Remove Link") : i18n("Set Link");
}
@@ -590,37 +590,37 @@ ChangeObjectGeometryCommand::~ChangeObjectGeometryCommand()
void ChangeObjectGeometryCommand::execute()
{
- doc->repaint( obj->geometry() );
+ doc->tqrepaint( obj->tqgeometry() );
- KoRect geometry = obj->geometry();
- geometry.moveBy( m_diff.x(), m_diff.y() );
- geometry.setWidth( geometry.width() + r_diff.width() );
- geometry.setHeight( geometry.height() + r_diff.height() );
- obj->setGeometry( geometry );
+ KoRect tqgeometry = obj->tqgeometry();
+ tqgeometry.moveBy( m_diff.x(), m_diff.y() );
+ tqgeometry.setWidth( tqgeometry.width() + r_diff.width() );
+ tqgeometry.setHeight( tqgeometry.height() + r_diff.height() );
+ obj->setGeometry( tqgeometry );
// if ( object->isSelected())
// doc->updateObjectStatusBarItem();
- doc->repaint( obj );
+ doc->tqrepaint( obj );
}
void ChangeObjectGeometryCommand::unexecute()
{
- doc->repaint( obj->geometry() );
+ doc->tqrepaint( obj->tqgeometry() );
- KoRect geometry = obj->geometry();
- geometry.moveBy( -m_diff.x(), -m_diff.y() );
- geometry.setWidth( geometry.width() - r_diff.width() );
- geometry.setHeight( geometry.height() - r_diff.height() );
- obj->setGeometry( geometry );
+ KoRect tqgeometry = obj->tqgeometry();
+ tqgeometry.moveBy( -m_diff.x(), -m_diff.y() );
+ tqgeometry.setWidth( tqgeometry.width() - r_diff.width() );
+ tqgeometry.setHeight( tqgeometry.height() - r_diff.height() );
+ obj->setGeometry( tqgeometry );
// if ( object->isSelected())
// doc->updateObjectStatusBarItem();
- doc->repaint( obj );
+ doc->tqrepaint( obj );
}
-QString ChangeObjectGeometryCommand::name() const
+TQString ChangeObjectGeometryCommand::name() const
{
- /*if ( fabs( obj->geometry().width() - newGeometry.width() )<1e-3 && fabs( obj->geometry().height() - newGeometry.height() ) < 1e-3 )
+ /*if ( fabs( obj->tqgeometry().width() - newGeometry.width() )<1e-3 && fabs( obj->tqgeometry().height() - newGeometry.height() ) < 1e-3 )
return i18n("Move Object");
else */
return i18n("Resize Object");
@@ -665,7 +665,7 @@ void RemoveObjectCommand::execute()
}
obj->setSelected( false );
- doc->repaint( obj );
+ doc->tqrepaint( obj );
executed = true;
}
@@ -677,11 +677,11 @@ void RemoveObjectCommand::unexecute()
EmbeddedKOfficeObject *eko = dynamic_cast<EmbeddedKOfficeObject *>(obj);
eko->embeddedObject()->setDeleted(false);
}
- doc->repaint( obj );
+ doc->tqrepaint( obj );
executed = false;
}
-QString RemoveObjectCommand::name() const
+TQString RemoveObjectCommand::name() const
{
if ( cut )
return i18n("Cut Object");
@@ -689,18 +689,18 @@ QString RemoveObjectCommand::name() const
return i18n("Remove Object");
}
-InsertObjectCommand::InsertObjectCommand( const KoRect& _geometry, KoDocumentEntry& _entry, Canvas *_canvas ) //child
+InsertObjectCommand::InsertObjectCommand( const KoRect& _tqgeometry, KoDocumentEntry& _entry, Canvas *_canvas ) //child
{
- geometry = _geometry;
+ tqgeometry = _tqgeometry;
entry = _entry;
canvas = _canvas;
type = OBJECT_KOFFICE_PART;
obj = 0;
}
-InsertObjectCommand::InsertObjectCommand(const KoRect& _geometry, KoDocumentEntry& _entry, const QRect& _data, Canvas *_canvas ) //chart
+InsertObjectCommand::InsertObjectCommand(const KoRect& _tqgeometry, KoDocumentEntry& _entry, const TQRect& _data, Canvas *_canvas ) //chart
{
- geometry = _geometry;
+ tqgeometry = _tqgeometry;
entry = _entry;
data = _data;
canvas = _canvas;
@@ -708,10 +708,10 @@ InsertObjectCommand::InsertObjectCommand(const KoRect& _geometry, KoDocumentEntr
obj = 0;
}
-InsertObjectCommand::InsertObjectCommand( const KoRect& _geometry , KURL& _file, Canvas *_canvas ) //picture
+InsertObjectCommand::InsertObjectCommand( const KoRect& _tqgeometry , KURL& _file, Canvas *_canvas ) //picture
{
//In the case of pictures, only the top left point of the rectangle is relevant
- geometry = _geometry;
+ tqgeometry = _tqgeometry;
file = _file;
canvas = _canvas;
type = OBJECT_PICTURE;
@@ -737,7 +737,7 @@ void InsertObjectCommand::execute()
if ( obj ) //restore the object which was removed from the object list in InsertObjectCommand::unexecute()
{
canvas->doc()->embeddedObjects().append( obj );
- canvas->doc()->repaint( obj );
+ canvas->doc()->tqrepaint( obj );
}
else
{
@@ -746,17 +746,17 @@ void InsertObjectCommand::execute()
{
case OBJECT_CHART:
{
- success = canvas->activeSheet()->insertChart( geometry, entry, data );
+ success = canvas->activeSheet()->insertChart( tqgeometry, entry, data );
break;
}
case OBJECT_KOFFICE_PART:
{
- success = canvas->activeSheet()->insertChild( geometry, entry );
+ success = canvas->activeSheet()->insertChild( tqgeometry, entry );
break;
}
case OBJECT_PICTURE:
{
- success = canvas->activeSheet()->insertPicture( geometry.topLeft() , file );
+ success = canvas->activeSheet()->insertPicture( tqgeometry.topLeft() , file );
break;
}
default:
@@ -780,17 +780,17 @@ void InsertObjectCommand::unexecute()
canvas->doc()->embeddedObjects().removeRef( obj );
obj->setSelected( false );
- canvas->doc()->repaint( obj );
+ canvas->doc()->tqrepaint( obj );
executed = false;
}
-QString InsertObjectCommand::name() const
+TQString InsertObjectCommand::name() const
{
return i18n("Insert Object");
}
-RenameNameObjectCommand::RenameNameObjectCommand( const QString &_name, const QString &_objectName,
+RenameNameObjectCommand::RenameNameObjectCommand( const TQString &_name, const TQString &_objectName,
EmbeddedObject *_obj, Doc *_doc ):
KNamedCommand( _name ),
newObjectName( _objectName ),
@@ -821,7 +821,7 @@ void RenameNameObjectCommand::unexecute()
// doc->updateSideBarItem( m_page );
}
-GeometryPropertiesCommand::GeometryPropertiesCommand( const QString &name, QPtrList<EmbeddedObject> &objects,
+GeometryPropertiesCommand::GeometryPropertiesCommand( const TQString &name, TQPtrList<EmbeddedObject> &objects,
bool newValue, KgpType type, Doc *_doc )
: KNamedCommand( name )
, m_objects( objects )
@@ -829,7 +829,7 @@ GeometryPropertiesCommand::GeometryPropertiesCommand( const QString &name, QPtrL
, m_type( type )
, m_doc( _doc )
{
- QPtrListIterator<EmbeddedObject> it( m_objects );
+ TQPtrListIterator<EmbeddedObject> it( m_objects );
for ( ; it.current() ; ++it )
{
it.current()->incCmdRef();
@@ -840,8 +840,8 @@ GeometryPropertiesCommand::GeometryPropertiesCommand( const QString &name, QPtrL
}
}
-GeometryPropertiesCommand::GeometryPropertiesCommand( const QString &name, QValueList<bool> &lst,
- QPtrList<EmbeddedObject> &objects, bool newValue,
+GeometryPropertiesCommand::GeometryPropertiesCommand( const TQString &name, TQValueList<bool> &lst,
+ TQPtrList<EmbeddedObject> &objects, bool newValue,
KgpType type, Doc *_doc)
: KNamedCommand( name )
, m_oldValue( lst )
@@ -850,28 +850,28 @@ GeometryPropertiesCommand::GeometryPropertiesCommand( const QString &name, QValu
, m_type( type )
, m_doc ( _doc )
{
- QPtrListIterator<EmbeddedObject> it( m_objects );
+ TQPtrListIterator<EmbeddedObject> it( m_objects );
for ( ; it.current() ; ++it )
it.current()->incCmdRef();
}
GeometryPropertiesCommand::~GeometryPropertiesCommand()
{
- QPtrListIterator<EmbeddedObject> it( m_objects );
+ TQPtrListIterator<EmbeddedObject> it( m_objects );
for ( ; it.current() ; ++it )
it.current()->decCmdRef();
}
void GeometryPropertiesCommand::execute()
{
- QPtrListIterator<EmbeddedObject> it( m_objects );
+ TQPtrListIterator<EmbeddedObject> it( m_objects );
for ( ; it.current() ; ++it )
{
if ( m_type == ProtectSize )
{
it.current()->setProtect( m_newValue );
if ( it.current()->isSelected() )
- m_doc->repaint( it.current() );
+ m_doc->tqrepaint( it.current() );
}
else if ( m_type == KeepRatio)
it.current()->setKeepRatio( m_newValue );
@@ -887,21 +887,21 @@ void GeometryPropertiesCommand::unexecute()
{
obj->setProtect( *m_oldValue.at(i) );
if ( obj->isSelected() )
- m_doc->repaint( obj );
+ m_doc->tqrepaint( obj );
}
else if ( m_type == KeepRatio)
obj->setKeepRatio( *m_oldValue.at(i) );
}
}
-MoveObjectByCmd::MoveObjectByCmd( const QString &_name, const KoPoint &_diff, QPtrList<EmbeddedObject> &_objects,
+MoveObjectByCmd::MoveObjectByCmd( const TQString &_name, const KoPoint &_diff, TQPtrList<EmbeddedObject> &_objects,
Doc *_doc,Sheet *_page )
: KNamedCommand( _name ), diff( _diff ), objects( _objects )
{
objects.setAutoDelete( false );
doc = _doc;
m_page=_page;
- QPtrListIterator<EmbeddedObject> it( objects );
+ TQPtrListIterator<EmbeddedObject> it( objects );
for ( ; it.current() ; ++it )
{
it.current()->incCmdRef();
@@ -910,37 +910,37 @@ MoveObjectByCmd::MoveObjectByCmd( const QString &_name, const KoPoint &_diff, QP
MoveObjectByCmd::~MoveObjectByCmd()
{
- QPtrListIterator<EmbeddedObject> it( objects );
+ TQPtrListIterator<EmbeddedObject> it( objects );
for ( ; it.current() ; ++it )
it.current()->decCmdRef();
}
void MoveObjectByCmd::execute()
{
- QRect oldRect;
+ TQRect oldRect;
for ( unsigned int i = 0; i < objects.count(); i++ ) {
- doc->repaint( objects.at( i )->geometry() );
+ doc->tqrepaint( objects.at( i )->tqgeometry() );
- KoRect r = objects.at( i )->geometry();
+ KoRect r = objects.at( i )->tqgeometry();
r.moveBy( diff.x(), diff.y() );
objects.at( i )->setGeometry( r );
- doc->repaint( objects.at( i ) );
+ doc->tqrepaint( objects.at( i ) );
}
}
void MoveObjectByCmd::unexecute()
{
- QRect oldRect;
+ TQRect oldRect;
for ( unsigned int i = 0; i < objects.count(); i++ ) {
- doc->repaint( objects.at( i )->geometry() );
+ doc->tqrepaint( objects.at( i )->tqgeometry() );
- KoRect r = objects.at( i )->geometry();
+ KoRect r = objects.at( i )->tqgeometry();
r.moveBy( -diff.x(), -diff.y() );
objects.at( i )->setGeometry( r );
- doc->repaint( objects.at( i ) );
+ doc->tqrepaint( objects.at( i ) );
}
}