[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/koffice/1.6/koffice/kspread/plugins
From: Sebastian Sauer <mail () dipe ! org>
Date: 2006-07-14 13:36:13
Message-ID: 1152884173.107600.14234.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 562261 by sebsauer:
Backported kspread kross-binding from trunk.
M +4 -2 Makefile.am
A scripting (directory) trunk/koffice/kspread/scripting#562234
D scripting/CMakeLists.txt
A scripting/Makefile.am
A scripting/kspreadcore/Makefile.am
M +5 -9 scripting/kspreadcore/krs_cell.cpp
M +5 -5 scripting/kspreadcore/krs_cell.h
M +9 -8 scripting/kspreadcore/krs_doc.cpp
M +4 -3 scripting/kspreadcore/krs_doc.h
M +8 -8 scripting/kspreadcore/krs_sheet.cpp
M +2 -2 scripting/kspreadcore/krs_sheet.h
M +2 -2 scripting/kspreadcore/kspreadcoremodule.cpp
M +2 -2 scripting/kspreadcore/kspreadcoremodule.h
M +9 -8 scripting/scripting.cc
M +2 -2 scripting/scripting.h
--- branches/koffice/1.6/koffice/kspread/plugins/Makefile.am #562260:562261
@@ -1,3 +1,5 @@
+if compile_kross
+ SCRIPTINGDIR=scripting
+endif
-SUBDIRS = insertcalendar
-
+SUBDIRS = insertcalendar $(SCRIPTINGDIR)
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_cell.cpp \
#562234:562261 @@ -19,13 +19,9 @@
#include "krs_cell.h"
-#include <Sheet.h>
-#include <Cell.h>
-#include <Value.h>
+#include "manipulator.h"
+#include "manipulator_data.h"
-#include "Manipulator.h"
-#include "DataManipulators.h"
-
namespace Kross { namespace KSpreadCore {
Cell::Cell(KSpread::Cell* cell, KSpread::Sheet* sheet, uint col, uint row)
@@ -70,15 +66,15 @@
case KSpread::Value::Boolean:
return QVariant( value.asBoolean() );
case KSpread::Value::Integer:
- return static_cast<qint64>(value.asInteger());
+ return static_cast<Q_LLONG>(value.asInteger());
case KSpread::Value::Float:
return (float)value.asFloat();
case KSpread::Value::String:
return value.asString();
case KSpread::Value::Array: {
- QList<QVariant> colarray;
+ QValueList<QVariant> colarray;
for(uint j = 0; j < value.rows(); j++) {
- QList<QVariant> rowarray;
+ QValueList<QVariant> rowarray;
for( uint i = 0; i < value.columns(); i++) {
KSpread::Value v = value.element(i,j);
rowarray.append( toVariant(v) );
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_cell.h \
#562234:562261 @@ -20,14 +20,14 @@
#ifndef KROSS_KSPREADCOREKRSCELL_H
#define KROSS_KSPREADCOREKRSCELL_H
-#include <Sheet.h>
-#include <Cell.h>
-#include <Value.h>
+#include <kspread_sheet.h>
+#include <kspread_cell.h>
+#include <kspread_value.h>
#include <api/class.h>
-#include <QString>
-#include <QColor>
+#include <qstring.h>
+#include <qcolor.h>
namespace Kross { namespace KSpreadCore {
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_doc.cpp \
#562234:562261 @@ -20,9 +20,8 @@
#include "krs_doc.h"
#include "krs_sheet.h"
-#include <Doc.h>
-#include <Map.h>
-#include <Sheet.h>
+#include <kspread_map.h>
+#include <kspread_sheet.h>
namespace Kross { namespace KSpreadCore {
@@ -53,17 +52,19 @@
Sheet* Doc::sheetByName(const QString& name)
{
- foreach ( KSpread::Sheet* sheet, m_doc->map()->sheetList() )
- if(sheet->sheetName() == name)
- return new Sheet(sheet, m_doc);
+ QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList());
+ for( ; it.current(); ++it )
+ if(it.current()->sheetName() == name)
+ return new Sheet(it.current(), m_doc);
return 0;
}
QStringList Doc::sheetNames()
{
QStringList names;
- foreach ( KSpread::Sheet* sheet, m_doc->map()->sheetList() )
- names.append( sheet->sheetName() );
+ QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList());
+ for( ; it.current(); ++it )
+ names.append( it.current()->sheetName() );
return names;
}
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_doc.h \
#562234:562261 @@ -20,12 +20,13 @@
#ifndef KSPREAD_KROSS_KRS_DOC_H_
#define KSPREAD_KROSS_KRS_DOC_H_
-#include <Doc.h>
+#include <kspread_doc.h>
#include <api/class.h>
-#include <QList>
-#include <QDomDocument>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdom.h>
namespace Kross { namespace KSpreadCore {
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp \
#562234:562261 @@ -21,10 +21,10 @@
#include "krs_sheet.h"
#include "krs_doc.h"
-#include <Doc.h>
-#include <Sheet.h>
-#include <Cell.h>
-#include <Value.h>
+#include <kspread_doc.h>
+#include <kspread_sheet.h>
+#include <kspread_cell.h>
+#include <kspread_value.h>
namespace Kross { namespace KSpreadCore {
@@ -60,8 +60,8 @@
}
Cell* Sheet::cell(uint col, uint row) {
- uint c = qMax(uint(1), col);
- uint r = qMax(uint(1), row);
+ uint c = QMAX(uint(1), col);
+ uint r = QMAX(uint(1), row);
return new Cell(m_sheet->cellAt(c,r),m_sheet,c,r);
}
@@ -74,11 +74,11 @@
}
void Sheet::removeRow(uint row) {
- m_sheet->removeRow( qMax(uint(1), row) );
+ m_sheet->removeRow( QMAX(uint(1), row) );
}
void Sheet::removeColumn(uint col) {
- m_sheet->removeColumn( qMax(uint(1), col) );
+ m_sheet->removeColumn( QMAX(uint(1), col) );
}
}
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/krs_sheet.h \
#562234:562261 @@ -20,8 +20,8 @@
#ifndef KROSS_KSPREADCOREKRSSHEET_H
#define KROSS_KSPREADCOREKRSSHEET_H
-#include <Sheet.h>
-#include <Value.h>
+#include <kspread_sheet.h>
+#include <kspread_value.h>
#include <api/class.h>
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp \
#562234:562261 @@ -46,10 +46,10 @@
: Kross::Api::Module("kspreadcore") , m_manager(manager)
{
QMap<QString, Object::Ptr> children = manager->getChildren();
- kDebug() << " there are " << children.size() << endl;
+ kdDebug() << " there are " << children.size() << endl;
for(QMap<QString, Object::Ptr>::const_iterator it = children.begin(); it != \
children.end(); it++) {
- kDebug() << it.key() << " " << it.value() << endl;
+ kdDebug() << it.key() << " " << it.data() << endl;
}
// Wrap doc
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h \
#562234:562261 @@ -20,8 +20,8 @@
#ifndef KSPREAD_KROSS_KSPREADCOREMODULE_H
#define KSPREAD_KROSS_KSPREADCOREMODULE_H
-#include <QString>
-#include <QVariant>
+#include <qstring.h>
+#include <qvariant.h>
#define KROSS_MAIN_EXPORT KDE_EXPORT
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/scripting.cc \
#562234:562261 @@ -20,8 +20,9 @@
*/
#include "scripting.h"
-#include <QApplication>
+#include <qapplication.h>
+#include <kdebug.h>
#include <kgenericfactory.h>
#include <kstandarddirs.h>
@@ -30,18 +31,18 @@
#include <main/scriptguiclient.h>
#include <main/wdgscriptsmanager.h>
-#include <Doc.h>
-#include <View.h>
+#include <kspread_doc.h>
+#include <kspread_view.h>
typedef KGenericFactory<Scripting> KSpreadScriptingFactory;
K_EXPORT_COMPONENT_FACTORY( kspreadscripting, KSpreadScriptingFactory( "kspread" ) )
-Scripting::Scripting(QObject *parent, const QStringList &)
- : KParts::Plugin(parent)
+Scripting::Scripting(QObject *parent, const char *name, const QStringList &)
+ : KParts::Plugin(parent, name)
{
setInstance(KSpreadScriptingFactory::instance());
- kDebug() << "Scripting plugin. Class: "
+ kdDebug() << "Scripting plugin. Class: "
<< metaObject()->className()
<< ", Parent: "
<< parent->metaObject()->className()
@@ -52,9 +53,9 @@
m_view = (KSpread::View*) parent;
m_scriptguiclient = new Kross::Api::ScriptGUIClient( m_view, m_view );
// m_scriptguiclient \
->setXMLFile(locate("data","kspreadplugins/scripting.rc"), true);
- kDebug() << "Setup actions for scripting !" << endl;
+ kdDebug() << "Setup actions for scripting !" << endl;
//BEGIN TODO: understand why the ScriptGUIClient doesn't "link" its actions \
to the menu
- setXMLFile(KStandardDirs::locate("data","kspread/kpartplugins/scripting.rc"), \
true); + setXMLFile(locate("data","kspread/kpartplugins/scripting.rc"), true);
new KAction(i18n("Execute Script File..."), 0, 0, m_scriptguiclient, \
SLOT(executeScriptFile()), actionCollection(), "executescriptfile");
new KAction(i18n("Script Manager..."), 0, 0, m_scriptguiclient, \
SLOT(showScriptManager()), actionCollection(), "configurescripts"); //END TODO
--- branches/koffice/1.6/koffice/kspread/plugins/scripting/scripting.h #562234:562261
@@ -23,7 +23,7 @@
#define SCRIPTING_H
#include <kparts/plugin.h>
-#include <View.h>
+#include <kspread_view.h>
namespace Kross {
namespace Api {
@@ -36,7 +36,7 @@
{
Q_OBJECT
public:
- Scripting(QObject *parent, const QStringList &);
+ Scripting(QObject *parent, const char *name, const QStringList &);
virtual ~Scripting();
private slots:
void executionFinished(const Kross::Api::ScriptAction*);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic