[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [labplot/frameworks] /: Backend ported but with kdelibs4support
From:       Alexander Semke <alexander.semke () web ! de>
Date:       2015-02-28 22:03:02
Message-ID: E1YRpTS-0000jP-6e () scm ! kde ! org
[Download RAW message or body]

Git commit 28b93b71eee884de94a94068da36ba5f15efe75b by Alexander Semke, on behalf of \
Garvit Khatri. Committed on 21/02/2015 at 09:12.
Pushed by asemke into branch 'frameworks'.

Backend ported but with kdelibs4support

M  +1    -0    CMakeLists.txt
M  +1    -1    src/CMakeLists.txt
M  +2    -2    src/backend/worksheet/StandardCurveSymbolFactory.cpp
M  +1    -1    src/backend/worksheet/TextLabel.cpp
M  +1    -1    src/backend/worksheet/interfaces.h
M  +2    -2    src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h
M  +1155 -1154 src/commonfrontend/spreadsheet/SpreadsheetView.cpp
M  +1269 -1269 src/commonfrontend/worksheet/WorksheetView.cpp
M  +1    -1    src/kdefrontend/GuiObserver.cpp
M  +6    -6    src/kdefrontend/MainWin.cpp
M  +2    -2    src/kdefrontend/SettingsDialog.cpp
M  +3    -2    src/kdefrontend/SettingsGeneralPage.cpp
M  +2    -3    src/kdefrontend/TemplateHandler.cpp
M  +1    -1    src/tools/TeXRenderer.cpp

http://commits.kde.org/labplot/28b93b71eee884de94a94068da36ba5f15efe75b

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b91878f..a5bdb00 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,7 @@ find_package(KF5 REQUIRED COMPONENTS
   XmlGui
   KIO
   NotifyConfig
+  Declarative
   KDELibs4Support)
   
 include(FeatureSummary)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 847124f..602675d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -164,7 +164,7 @@ set(LABPLOT_SRCS ${GUI_SOURCES} ${PLOTS_SOURCES})
 INCLUDE_DIRECTORIES(.)
 qt5_wrap_ui(LABPLOT_SRCS ${UI_SOURCES})
 add_executable(labplot2 ${LABPLOT_SRCS} ${BACKEND_SOURCES} ${DATASOURCES_SOURCES} \
                ${COMMONFRONTEND_SOURCES} ${TOOLS_SOURCES} ${QTMOC_HDRS})
-target_link_libraries(labplot2 KF5::KDELibs4Support KF5::Archive Qt5::Declarative \
KF5::Declarative KF5::WidgetsAddons KF5::KIOWidgets KF5::XmlGui ${GSL_LIBRARIES} \
${GSL_CBLAS_LIBRARIES}) +target_link_libraries(labplot2 KF5::KDELibs4Support \
KF5::Archive Qt5::Svg KF5::Declarative KF5::WidgetsAddons KF5::KIOWidgets KF5::XmlGui \
${GSL_LIBRARIES} ${GSL_CBLAS_LIBRARIES})  # ${OPJ_LIBRARY}
 
 ############## installation ################################
diff --git a/src/backend/worksheet/StandardCurveSymbolFactory.cpp \
b/src/backend/worksheet/StandardCurveSymbolFactory.cpp index 87c2a5d..992a0a0 100644
--- a/src/backend/worksheet/StandardCurveSymbolFactory.cpp
+++ b/src/backend/worksheet/StandardCurveSymbolFactory.cpp
@@ -232,5 +232,5 @@ const AbstractCurveSymbol \
*StandardCurveSymbolFactory::prototype(const QString &  return NULL;
 }
 
-Q_EXPORT_PLUGIN2(scidavis_standardcurvesymbolfactory, StandardCurveSymbolFactory)
-Q_IMPORT_PLUGIN(scidavis_standardcurvesymbolfactory)
+//Q_EXPORT_PLUGIN2(scidavis_standardcurvesymbolfactory, StandardCurveSymbolFactory)
+//Q_IMPORT_PLUGIN(scidavis_standardcurvesymbolfactory)
diff --git a/src/backend/worksheet/TextLabel.cpp \
b/src/backend/worksheet/TextLabel.cpp index eb8d7ed..ab9dafa 100644
--- a/src/backend/worksheet/TextLabel.cpp
+++ b/src/backend/worksheet/TextLabel.cpp
@@ -33,7 +33,7 @@
 #include "backend/lib/XmlStreamReader.h"
 
 #include <QApplication>
-#include <QtConcurrentRun>
+#include <QtConcurrent/QtConcurrentRun>
 #include <QDesktopWidget>
 #include <QPainter>
 #include <QGraphicsScene>
diff --git a/src/backend/worksheet/interfaces.h b/src/backend/worksheet/interfaces.h
index eddea4e..6577050 100644
--- a/src/backend/worksheet/interfaces.h
+++ b/src/backend/worksheet/interfaces.h
@@ -30,7 +30,7 @@
 #ifndef WORKSHEET_INTERFACES_H
 #define WORKSHEET_INTERFACES_H
 
-#include <QtPlugin>
+//#include <QtPlugin>
 #include <QStringList>
 #include "backend/worksheet/AbstractCurveSymbol.h"
 
diff --git a/src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h \
b/src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h index \
                ce19857..1ddf590 100644
--- a/src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h
+++ b/src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.h
@@ -44,8 +44,8 @@ class CartesianCoordinateSystem: public AbstractCoordinateSystem {
 	public:
 		class Scale {
 			public:
-				static const double LIMIT_MAX = 1e15;
-				static const double LIMIT_MIN = -1e15;
+                static constexpr double LIMIT_MAX = 1e15;
+                static constexpr double LIMIT_MIN = -1e15;
 
 				virtual ~Scale();
 				enum ScaleType {
diff --git a/src/commonfrontend/spreadsheet/SpreadsheetView.cpp \
b/src/commonfrontend/spreadsheet/SpreadsheetView.cpp index 4cd7f93..6669424 100644
--- a/src/commonfrontend/spreadsheet/SpreadsheetView.cpp
+++ b/src/commonfrontend/spreadsheet/SpreadsheetView.cpp
@@ -54,9 +54,10 @@
 #include <QPrinter>
 #include <QToolBar>
 #include <QTextStream>
+#include <QMimeData>
 // #include <QDebug>
 
-#include <KAction>
+#include <QAction>
 #include <KLocale>
 #include "kdefrontend/spreadsheet/SortDialog.h"
 #include "kdefrontend/spreadsheet/RandomValuesDialog.h"
@@ -64,181 +65,181 @@
 #include "kdefrontend/spreadsheet/FunctionValuesDialog.h"
 
 /*!
-	\class SpreahsheetView
-	\brief View class for Spreadsheet
+    \class SpreahsheetView
+    \brief View class for Spreadsheet
 
-	\ingroup commonfrontend
+    \ingroup commonfrontend
  */
 SpreadsheetView::SpreadsheetView(Spreadsheet *spreadsheet):QWidget(),
-	m_tableView(new QTableView(this)),
-	m_spreadsheet(spreadsheet),
-	m_model( new SpreadsheetModel(spreadsheet) ),
-	m_suppressSelectionChangedEvent(false){
+    m_tableView(new QTableView(this)),
+    m_spreadsheet(spreadsheet),
+    m_model( new SpreadsheetModel(spreadsheet) ),
+    m_suppressSelectionChangedEvent(false){
 
-	QHBoxLayout* layout = new QHBoxLayout(this);
-	layout->setContentsMargins(0,0,0,0);
-	layout->addWidget(m_tableView);
+    QHBoxLayout* layout = new QHBoxLayout(this);
+    layout->setContentsMargins(0,0,0,0);
+    layout->addWidget(m_tableView);
 
-	init();
+    init();
 }
 
 SpreadsheetView::~SpreadsheetView(){
-	delete m_model;
+    delete m_model;
 }
 
 void SpreadsheetView::init(){
-	initActions();
-	initMenus();
+    initActions();
+    initMenus();
 
-	m_tableView->setModel(m_model);
+    m_tableView->setModel(m_model);
 
-	//horizontal header
-	m_horizontalHeader = new SpreadsheetDoubleHeaderView(this);
+    //horizontal header
+    m_horizontalHeader = new SpreadsheetDoubleHeaderView(this);
     m_horizontalHeader->setClickable(true);
     m_horizontalHeader->setHighlightSections(true);
-	m_tableView->setHorizontalHeader(m_horizontalHeader);
-	m_horizontalHeader->setResizeMode(QHeaderView::Interactive);
-	m_horizontalHeader->setMovable(true);
-	m_horizontalHeader->installEventFilter(this);
-	connect(m_horizontalHeader, SIGNAL(sectionMoved(int,int,int)), this, \
                SLOT(handleHorizontalSectionMoved(int,int,int)));
-	connect(m_horizontalHeader, SIGNAL(sectionDoubleClicked(int)), this, \
                SLOT(handleHorizontalHeaderDoubleClicked(int)));
-	connect(m_horizontalHeader, SIGNAL(sectionResized(int,int,int)), this, \
SLOT(handleHorizontalSectionResized(int,int,int))); +    \
m_tableView->setHorizontalHeader(m_horizontalHeader); +    \
m_horizontalHeader->setResizeMode(QHeaderView::Interactive); +    \
m_horizontalHeader->setMovable(true); +    \
m_horizontalHeader->installEventFilter(this); +    connect(m_horizontalHeader, \
SIGNAL(sectionMoved(int,int,int)), this, \
SLOT(handleHorizontalSectionMoved(int,int,int))); +    connect(m_horizontalHeader, \
SIGNAL(sectionDoubleClicked(int)), this, \
SLOT(handleHorizontalHeaderDoubleClicked(int))); +    connect(m_horizontalHeader, \
SIGNAL(sectionResized(int,int,int)), this, \
SLOT(handleHorizontalSectionResized(int,int,int)));  
-	// vertical header
-	QHeaderView * v_header = m_tableView->verticalHeader();
-	v_header->setResizeMode(QHeaderView::Fixed);
-	v_header->setDefaultSectionSize(22);
-	v_header->setMovable(false);
-	v_header->installEventFilter(this);
+    // vertical header
+    QHeaderView * v_header = m_tableView->verticalHeader();
+    v_header->setResizeMode(QHeaderView::Fixed);
+    v_header->setDefaultSectionSize(22);
+    v_header->setMovable(false);
+    v_header->installEventFilter(this);
 
-	m_delegate = new SpreadsheetItemDelegate(this);
-	m_tableView->setItemDelegate(m_delegate);
+    m_delegate = new SpreadsheetItemDelegate(this);
+    m_tableView->setItemDelegate(m_delegate);
 
-	setFocusPolicy(Qt::StrongFocus);
-	setFocus();
-	m_tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
+    setFocusPolicy(Qt::StrongFocus);
+    setFocus();
+    m_tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
 
-	installEventFilter(this);
+    installEventFilter(this);
 
-	connect(m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this,
-		SLOT(updateHeaderGeometry(Qt::Orientation,int,int)) );
-	connect(m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this,
-		SLOT(handleHeaderDataChanged(Qt::Orientation,int,int)) );
+    connect(m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this,
+        SLOT(updateHeaderGeometry(Qt::Orientation,int,int)) );
+    connect(m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), this,
+        SLOT(handleHeaderDataChanged(Qt::Orientation,int,int)) );
 
-	int i=0;
-	foreach(Column * col, m_spreadsheet->children<Column>())
-		m_horizontalHeader->resizeSection(i++, col->width());
+    int i=0;
+    foreach(Column * col, m_spreadsheet->children<Column>())
+        m_horizontalHeader->resizeSection(i++, col->width());
 
 
-	connectActions();
-	showComments(false);
+    connectActions();
+    showComments(false);
 
-	connect(m_spreadsheet, SIGNAL(aspectAdded(const AbstractAspect*)),
-			this, SLOT(handleAspectAdded(const AbstractAspect*)));
-	connect(m_spreadsheet, SIGNAL(aspectAboutToBeRemoved(const AbstractAspect*)),
-			this, SLOT(handleAspectAboutToBeRemoved(const AbstractAspect*)));
-	connect(m_spreadsheet, SIGNAL(requestProjectContextMenu(QMenu*)), this, \
SLOT(createContextMenu(QMenu*))); +    connect(m_spreadsheet, \
SIGNAL(aspectAdded(const AbstractAspect*)), +            this, \
SLOT(handleAspectAdded(const AbstractAspect*))); +    connect(m_spreadsheet, \
SIGNAL(aspectAboutToBeRemoved(const AbstractAspect*)), +            this, \
SLOT(handleAspectAboutToBeRemoved(const AbstractAspect*))); +    \
connect(m_spreadsheet, SIGNAL(requestProjectContextMenu(QMenu*)), this, \
SLOT(createContextMenu(QMenu*)));  
 
-	//selection relevant connections
-	QItemSelectionModel * sel_model = m_tableView->selectionModel();
+    //selection relevant connections
+    QItemSelectionModel * sel_model = m_tableView->selectionModel();
 
-	connect(sel_model, SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)),
-		this, SLOT(currentColumnChanged(QModelIndex,QModelIndex)));
-	connect(sel_model, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-		this, SLOT(selectionChanged(QItemSelection,QItemSelection)));
-	connect(sel_model, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-			this, SLOT(selectionChanged(QItemSelection,QItemSelection)) );
+    connect(sel_model, SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)),
+        this, SLOT(currentColumnChanged(QModelIndex,QModelIndex)));
+    connect(sel_model, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
+        this, SLOT(selectionChanged(QItemSelection,QItemSelection)));
+    connect(sel_model, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
+            this, SLOT(selectionChanged(QItemSelection,QItemSelection)) );
 
-	connect(m_spreadsheet, SIGNAL(columnSelected(int)), this, SLOT(selectColumn(int)) \
                );
-	connect(m_spreadsheet, SIGNAL(columnDeselected(int)), this, \
                SLOT(deselectColumn(int)) );
-	connect(m_tableView->horizontalHeader(), SIGNAL(sectionClicked(int)), this, \
SLOT(columnClicked(int)) ); +    connect(m_spreadsheet, SIGNAL(columnSelected(int)), \
this, SLOT(selectColumn(int)) ); +    connect(m_spreadsheet, \
SIGNAL(columnDeselected(int)), this, SLOT(deselectColumn(int)) ); +    \
connect(m_tableView->horizontalHeader(), SIGNAL(sectionClicked(int)), this, \
SLOT(columnClicked(int)) );  }
 
 void SpreadsheetView::initActions(){
-	// selection related actions
-	action_cut_selection = new KAction(KIcon("edit-cut"), i18n("Cu&t"), this);
-	action_copy_selection = new KAction(KIcon("edit-copy"), i18n("&Copy"), this);
-	action_paste_into_selection = new KAction(KIcon("edit-paste"), i18n("Past&e"), \
                this);
-	action_mask_selection = new KAction(KIcon("edit-node"), i18n("&Mask Selection"), \
                this);
-	action_unmask_selection = new KAction(KIcon("format-remove-node"), i18n("&Unmask \
                Selection"), this);
-
-	action_set_formula = new KAction(KIcon(""), i18n("Assign &Formula"), this);
-	action_clear_selection = new KAction(KIcon("edit-clear"), i18n("Clea&r Selection"), \
                this);
-	action_recalculate = new KAction(KIcon(""), i18n("Recalculate"), this);
-	action_fill_row_numbers = new KAction(KIcon(""), i18n("Row Numbers"), this);
-	action_fill_random = new KAction(KIcon(""), i18n("Uniform Random Values"), this);
-	action_fill_random_nonuniform = new KAction(KIcon(""), i18n("Random Values"), \
                this);
-	action_fill_equidistant = new KAction(KIcon(""), i18n("Equidistant Values"), this);
-	action_fill_function = new KAction(KIcon(""), i18n("Function Values"), this);
-	action_fill_const = new KAction(KIcon(""), i18n("Const Values"), this);
-
-	//spreadsheet related actions
-	action_toggle_comments = new KAction(KIcon("document-properties"), i18n("Show \
                Comments"), this);
-	action_select_all = new KAction(KIcon("edit-select-all"), i18n("Select All"), \
                this);
-	action_add_column = new KAction(KIcon("edit-table-insert-column-left"), i18n("&Add \
                Column"), this);
-	action_clear_spreadsheet = new KAction(KIcon("edit-clear"), i18n("Clear \
                Spreadsheet"), this);
-	action_clear_masks = new KAction(KIcon("format-remove-node"), i18n("Clear Masks"), \
                this);
-	action_sort_spreadsheet = new KAction(KIcon("view-sort-ascending"), i18n("&Sort \
                Spreadsheet"), this);
-	action_go_to_cell = new KAction(KIcon("go-jump"), i18n("&Go to Cell"), this);
-
-	// column related actions
-	action_insert_columns = new KAction(KIcon("edit-table-insert-column-left"), \
                i18n("&Insert Empty Columns"), this);
-	action_remove_columns = new KAction(KIcon("edit-table-delete-column"), \
                i18n("Remo&ve Columns"), this);
-	action_clear_columns = new KAction(KIcon("edit-clear"), i18n("Clea&r Columns"), \
                this);
-	action_add_columns = new KAction(KIcon("edit-table-insert-column-right"), \
                i18n("&Add Columns"), this);
-// 	action_set_as_x = new KAction(KIcon(""), i18n("X, Plot Designation"), this);
-// 	action_set_as_y = new KAction(KIcon(""), i18n("Y, Plot Designation"), this);
-// 	action_set_as_z = new KAction(KIcon(""), i18n("Z, Plot Designation"), this);
-// 	action_set_as_xerr = new KAction(KIcon(""), i18n("X Error, Plot Designation"), \
                this);
-// 	action_set_as_yerr = new KAction(KIcon(""), i18n("Y Error, Plot Designation"), \
                this);
-// 	action_set_as_none = new KAction(KIcon(""), i18n("None, Plot Designation"), \
                this);
-	action_normalize_columns = new KAction(KIcon(""), i18n("&Normalize Columns"), \
                this);
-	action_normalize_selection = new KAction(KIcon(""), i18n("&Normalize Selection"), \
                this);
-	action_sort_columns = new KAction(KIcon(""), i18n("&Selected Columns"), this);
-	action_sort_asc_column = new KAction(KIcon("view-sort-ascending"), \
                i18n("&Ascending"), this);
-	action_sort_desc_column = new KAction(KIcon("view-sort-descending"), \
                i18n("&Descending"), this);
-	action_statistics_columns = new KAction(KIcon("view-statistics"), i18n("Column \
                Statisti&cs"), this);
-
-	// row related actions
-	action_insert_rows = new KAction(KIcon("edit-table-insert-row-above") \
                ,i18n("&Insert Empty Rows"), this);
-	action_remove_rows = new KAction(KIcon("edit-table-delete-row"), i18n("Remo&ve \
                Rows"), this);
-	action_clear_rows = new KAction(KIcon("edit-clear"), i18n("Clea&r Rows"), this);
-	action_add_rows = new KAction(KIcon("edit-table-insert-row-above"), i18n("&Add \
                Rows"), this);
-	action_statistics_rows = new KAction(KIcon("view-statistics"), i18n("Row \
Statisti&cs"), this); +    // selection related actions
+    action_cut_selection = new QAction(QIcon("edit-cut"), i18n("Cu&t"), this);
+    action_copy_selection = new QAction(QIcon("edit-copy"), i18n("&Copy"), this);
+    action_paste_into_selection = new QAction(QIcon("edit-paste"), i18n("Past&e"), \
this); +    action_mask_selection = new QAction(QIcon("edit-node"), i18n("&Mask \
Selection"), this); +    action_unmask_selection = new \
QAction(QIcon("format-remove-node"), i18n("&Unmask Selection"), this); +
+    action_set_formula = new QAction(QIcon(""), i18n("Assign &Formula"), this);
+    action_clear_selection = new QAction(QIcon("edit-clear"), i18n("Clea&r \
Selection"), this); +    action_recalculate = new QAction(QIcon(""), \
i18n("Recalculate"), this); +    action_fill_row_numbers = new QAction(QIcon(""), \
i18n("Row Numbers"), this); +    action_fill_random = new QAction(QIcon(""), \
i18n("Uniform Random Values"), this); +    action_fill_random_nonuniform = new \
QAction(QIcon(""), i18n("Random Values"), this); +    action_fill_equidistant = new \
QAction(QIcon(""), i18n("Equidistant Values"), this); +    action_fill_function = new \
QAction(QIcon(""), i18n("Function Values"), this); +    action_fill_const = new \
QAction(QIcon(""), i18n("Const Values"), this); +
+    //spreadsheet related actions
+    action_toggle_comments = new QAction(QIcon("document-properties"), i18n("Show \
Comments"), this); +    action_select_all = new QAction(QIcon("edit-select-all"), \
i18n("Select All"), this); +    action_add_column = new \
QAction(QIcon("edit-table-insert-column-left"), i18n("&Add Column"), this); +    \
action_clear_spreadsheet = new QAction(QIcon("edit-clear"), i18n("Clear \
Spreadsheet"), this); +    action_clear_masks = new \
QAction(QIcon("format-remove-node"), i18n("Clear Masks"), this); +    \
action_sort_spreadsheet = new QAction(QIcon("view-sort-ascending"), i18n("&Sort \
Spreadsheet"), this); +    action_go_to_cell = new QAction(QIcon("go-jump"), \
i18n("&Go to Cell"), this); +
+    // column related actions
+    action_insert_columns = new QAction(QIcon("edit-table-insert-column-left"), \
i18n("&Insert Empty Columns"), this); +    action_remove_columns = new \
QAction(QIcon("edit-table-delete-column"), i18n("Remo&ve Columns"), this); +    \
action_clear_columns = new QAction(QIcon("edit-clear"), i18n("Clea&r Columns"), \
this); +    action_add_columns = new QAction(QIcon("edit-table-insert-column-right"), \
i18n("&Add Columns"), this); +// 	action_set_as_x = new QAction(QIcon(""), i18n("X, \
Plot Designation"), this); +// 	action_set_as_y = new QAction(QIcon(""), i18n("Y, \
Plot Designation"), this); +// 	action_set_as_z = new QAction(QIcon(""), i18n("Z, \
Plot Designation"), this); +// 	action_set_as_xerr = new QAction(QIcon(""), i18n("X \
Error, Plot Designation"), this); +// 	action_set_as_yerr = new QAction(QIcon(""), \
i18n("Y Error, Plot Designation"), this); +// 	action_set_as_none = new \
QAction(QIcon(""), i18n("None, Plot Designation"), this); +    \
action_normalize_columns = new QAction(QIcon(""), i18n("&Normalize Columns"), this); \
+    action_normalize_selection = new QAction(QIcon(""), i18n("&Normalize \
Selection"), this); +    action_sort_columns = new QAction(QIcon(""), i18n("&Selected \
Columns"), this); +    action_sort_asc_column = new \
QAction(QIcon("view-sort-ascending"), i18n("&Ascending"), this); +    \
action_sort_desc_column = new QAction(QIcon("view-sort-descending"), \
i18n("&Descending"), this); +    action_statistics_columns = new \
QAction(QIcon("view-statistics"), i18n("Column Statisti&cs"), this); +
+    // row related actions
+    action_insert_rows = new QAction(QIcon("edit-table-insert-row-above") \
,i18n("&Insert Empty Rows"), this); +    action_remove_rows = new \
QAction(QIcon("edit-table-delete-row"), i18n("Remo&ve Rows"), this); +    \
action_clear_rows = new QAction(QIcon("edit-clear"), i18n("Clea&r Rows"), this); +    \
action_add_rows = new QAction(QIcon("edit-table-insert-row-above"), i18n("&Add \
Rows"), this); +    action_statistics_rows = new QAction(QIcon("view-statistics"), \
i18n("Row Statisti&cs"), this);  }
 
 void SpreadsheetView::initMenus(){
-	//Selection menu
-	m_selectionMenu = new QMenu(i18n("Selection"));
+    //Selection menu
+    m_selectionMenu = new QMenu(i18n("Selection"));
 
-	QMenu * submenu = new QMenu(i18n("Fi&ll Selection with"));
-	submenu->addAction(action_fill_row_numbers);
-	submenu->addAction(action_fill_const);
+    QMenu * submenu = new QMenu(i18n("Fi&ll Selection with"));
+    submenu->addAction(action_fill_row_numbers);
+    submenu->addAction(action_fill_const);
 // 	submenu->addAction(action_fill_random);
-	m_selectionMenu ->addMenu(submenu);
-	m_selectionMenu ->addSeparator();
-
-	m_selectionMenu ->addAction(action_cut_selection);
-	m_selectionMenu ->addAction(action_copy_selection);
-	m_selectionMenu ->addAction(action_paste_into_selection);
-	m_selectionMenu ->addAction(action_clear_selection);
-	m_selectionMenu ->addSeparator();
-	m_selectionMenu ->addAction(action_mask_selection);
-	m_selectionMenu ->addAction(action_unmask_selection);
-	m_selectionMenu ->addSeparator();
-	m_selectionMenu ->addAction(action_normalize_selection);
-	//TODO
+    m_selectionMenu ->addMenu(submenu);
+    m_selectionMenu ->addSeparator();
+
+    m_selectionMenu ->addAction(action_cut_selection);
+    m_selectionMenu ->addAction(action_copy_selection);
+    m_selectionMenu ->addAction(action_paste_into_selection);
+    m_selectionMenu ->addAction(action_clear_selection);
+    m_selectionMenu ->addSeparator();
+    m_selectionMenu ->addAction(action_mask_selection);
+    m_selectionMenu ->addAction(action_unmask_selection);
+    m_selectionMenu ->addSeparator();
+    m_selectionMenu ->addAction(action_normalize_selection);
+    //TODO
 // 	m_selectionMenu ->addSeparator();
 // 	m_selectionMenu ->addAction(action_set_formula);
 // 	m_selectionMenu ->addAction(action_recalculate);
 
 
-	//TODO add plot menu to spreadsheet- and column-menu, like in scidavis, origin etc.
+    //TODO add plot menu to spreadsheet- and column-menu, like in scidavis, origin \
etc.  
-	// Column menu
-	m_columnMenu = new QMenu();
+    // Column menu
+    m_columnMenu = new QMenu();
 
 // 	submenu = new QMenu(i18n("S&et Column As"));
 // 	submenu->addAction(action_set_as_x);
@@ -252,138 +253,138 @@ void SpreadsheetView::initMenus(){
 // 	m_columnMenu->addMenu(submenu);
 // 	m_columnMenu->addSeparator();
 
-	submenu = new QMenu(i18n("Generate Data"));
-	submenu->addAction(action_fill_row_numbers);
-	submenu->addAction(action_fill_const);
+    submenu = new QMenu(i18n("Generate Data"));
+    submenu->addAction(action_fill_row_numbers);
+    submenu->addAction(action_fill_const);
 // 	submenu->addAction(action_fill_random);
-	submenu->addAction(action_fill_equidistant);
-	submenu->addAction(action_fill_random_nonuniform);
-	submenu->addAction(action_fill_function);
-	m_columnMenu->addMenu(submenu);
-	m_columnMenu->addSeparator();
-
-	m_columnMenu->addAction(action_insert_columns);
-	m_columnMenu->addAction(action_remove_columns);
-	m_columnMenu->addAction(action_clear_columns);
-	m_columnMenu->addAction(action_add_columns);
-	m_columnMenu->addSeparator();
-
-	m_columnMenu->addAction(action_normalize_columns);
-
-	submenu = new QMenu(i18n("Sort"));
-	submenu->setIcon(KIcon("view-sort-ascending"));
-	submenu->addAction(action_sort_asc_column);
-	submenu->addAction(action_sort_desc_column);
-	submenu->addAction(action_sort_columns);
-	m_columnMenu->addMenu(submenu);
-	m_columnMenu->addSeparator();
-
-	m_columnMenu->addAction(action_toggle_comments);
-	m_columnMenu->addSeparator();
-
-	//TODO
+    submenu->addAction(action_fill_equidistant);
+    submenu->addAction(action_fill_random_nonuniform);
+    submenu->addAction(action_fill_function);
+    m_columnMenu->addMenu(submenu);
+    m_columnMenu->addSeparator();
+
+    m_columnMenu->addAction(action_insert_columns);
+    m_columnMenu->addAction(action_remove_columns);
+    m_columnMenu->addAction(action_clear_columns);
+    m_columnMenu->addAction(action_add_columns);
+    m_columnMenu->addSeparator();
+
+    m_columnMenu->addAction(action_normalize_columns);
+
+    submenu = new QMenu(i18n("Sort"));
+    submenu->setIcon(QIcon("view-sort-ascending"));
+    submenu->addAction(action_sort_asc_column);
+    submenu->addAction(action_sort_desc_column);
+    submenu->addAction(action_sort_columns);
+    m_columnMenu->addMenu(submenu);
+    m_columnMenu->addSeparator();
+
+    m_columnMenu->addAction(action_toggle_comments);
+    m_columnMenu->addSeparator();
+
+    //TODO
 // 	m_columnMenu->addAction(action_statistics_columns);
 
 
-	//Spreadsheet menu
-	m_spreadsheetMenu = new QMenu();
+    //Spreadsheet menu
+    m_spreadsheetMenu = new QMenu();
 // 	m_selectionMenu->setTitle(i18n("Fi&ll Selection with"));
-	m_spreadsheetMenu->addMenu(m_selectionMenu);
-	m_spreadsheetMenu->addAction(action_toggle_comments);
-	m_spreadsheetMenu->addSeparator();
-	m_spreadsheetMenu->addAction(action_select_all);
-	m_spreadsheetMenu->addAction(action_clear_spreadsheet);
-	m_spreadsheetMenu->addAction(action_clear_masks);
-	m_spreadsheetMenu->addAction(action_sort_spreadsheet);
-	m_spreadsheetMenu->addSeparator();
-	m_spreadsheetMenu->addAction(action_add_column);
-	m_spreadsheetMenu->addSeparator();
-	m_spreadsheetMenu->addAction(action_go_to_cell);
-
-
-	//Row menu
-	m_rowMenu = new QMenu();
-
-	m_rowMenu->addAction(action_insert_rows);
-	m_rowMenu->addAction(action_remove_rows);
-	m_rowMenu->addAction(action_clear_rows);
-	m_rowMenu->addAction(action_add_rows);
-	m_rowMenu->addSeparator();
-
-	submenu = new QMenu(i18n("Fi&ll Selection with"));
-	submenu->addAction(action_fill_row_numbers);
+    m_spreadsheetMenu->addMenu(m_selectionMenu);
+    m_spreadsheetMenu->addAction(action_toggle_comments);
+    m_spreadsheetMenu->addSeparator();
+    m_spreadsheetMenu->addAction(action_select_all);
+    m_spreadsheetMenu->addAction(action_clear_spreadsheet);
+    m_spreadsheetMenu->addAction(action_clear_masks);
+    m_spreadsheetMenu->addAction(action_sort_spreadsheet);
+    m_spreadsheetMenu->addSeparator();
+    m_spreadsheetMenu->addAction(action_add_column);
+    m_spreadsheetMenu->addSeparator();
+    m_spreadsheetMenu->addAction(action_go_to_cell);
+
+
+    //Row menu
+    m_rowMenu = new QMenu();
+
+    m_rowMenu->addAction(action_insert_rows);
+    m_rowMenu->addAction(action_remove_rows);
+    m_rowMenu->addAction(action_clear_rows);
+    m_rowMenu->addAction(action_add_rows);
+    m_rowMenu->addSeparator();
+
+    submenu = new QMenu(i18n("Fi&ll Selection with"));
+    submenu->addAction(action_fill_row_numbers);
 // 	submenu->addAction(action_fill_random);
-	submenu->addAction(action_fill_const);
-	m_rowMenu->addMenu(submenu);
+    submenu->addAction(action_fill_const);
+    m_rowMenu->addMenu(submenu);
 
-	//TODO
+    //TODO
 // 	m_rowMenu->addSeparator();
 // 	m_rowMenu->addAction(action_statistics_rows);
 }
 
 void SpreadsheetView::connectActions(){
-	connect(action_cut_selection, SIGNAL(triggered()), this, SLOT(cutSelection()));
-	connect(action_copy_selection, SIGNAL(triggered()), this, SLOT(copySelection()));
-	connect(action_paste_into_selection, SIGNAL(triggered()), this, \
                SLOT(pasteIntoSelection()));
-	connect(action_mask_selection, SIGNAL(triggered()), this, SLOT(maskSelection()));
-	connect(action_unmask_selection, SIGNAL(triggered()), this, \
                SLOT(unmaskSelection()));
-
-	connect(action_clear_selection, SIGNAL(triggered()), this, \
                SLOT(clearSelectedCells()));
-	connect(action_recalculate, SIGNAL(triggered()), this, \
                SLOT(recalculateSelectedCells()));
-	connect(action_fill_row_numbers, SIGNAL(triggered()), this, \
SLOT(fillSelectedCellsWithRowNumbers())); +    connect(action_cut_selection, \
SIGNAL(triggered()), this, SLOT(cutSelection())); +    connect(action_copy_selection, \
SIGNAL(triggered()), this, SLOT(copySelection())); +    \
connect(action_paste_into_selection, SIGNAL(triggered()), this, \
SLOT(pasteIntoSelection())); +    connect(action_mask_selection, SIGNAL(triggered()), \
this, SLOT(maskSelection())); +    connect(action_unmask_selection, \
SIGNAL(triggered()), this, SLOT(unmaskSelection())); +
+    connect(action_clear_selection, SIGNAL(triggered()), this, \
SLOT(clearSelectedCells())); +    connect(action_recalculate, SIGNAL(triggered()), \
this, SLOT(recalculateSelectedCells())); +    connect(action_fill_row_numbers, \
SIGNAL(triggered()), this, SLOT(fillSelectedCellsWithRowNumbers()));  // \
connect(action_fill_random, SIGNAL(triggered()), this, \
                SLOT(fillSelectedCellsWithRandomNumbers()));
-	connect(action_fill_random_nonuniform, SIGNAL(triggered()), this, \
                SLOT(fillWithRandomValues()));
-	connect(action_fill_equidistant, SIGNAL(triggered()), this, \
                SLOT(fillWithEquidistantValues()));
-	connect(action_fill_function, SIGNAL(triggered()), this, \
                SLOT(fillWithFunctionValues()));
-	connect(action_fill_const, SIGNAL(triggered()), this, \
                SLOT(fillSelectedCellsWithConstValues()));
-	connect(action_select_all, SIGNAL(triggered()), m_tableView, SLOT(selectAll()));
-	connect(action_add_column, SIGNAL(triggered()), m_spreadsheet, \
                SLOT(appendColumn()));
-	connect(action_clear_spreadsheet, SIGNAL(triggered()), m_spreadsheet, \
                SLOT(clear()));
-	connect(action_clear_masks, SIGNAL(triggered()), m_spreadsheet, \
                SLOT(clearMasks()));
-	connect(action_sort_spreadsheet, SIGNAL(triggered()), this, \
                SLOT(sortSpreadsheet()));
-	connect(action_go_to_cell, SIGNAL(triggered()), this, SLOT(goToCell()));
-
-	connect(action_insert_columns, SIGNAL(triggered()), this, \
                SLOT(insertEmptyColumns()));
-	connect(action_remove_columns, SIGNAL(triggered()), this, \
                SLOT(removeSelectedColumns()));
-	connect(action_clear_columns, SIGNAL(triggered()), this, \
                SLOT(clearSelectedColumns()));
-	connect(action_add_columns, SIGNAL(triggered()), this, SLOT(addColumns()));
+    connect(action_fill_random_nonuniform, SIGNAL(triggered()), this, \
SLOT(fillWithRandomValues())); +    connect(action_fill_equidistant, \
SIGNAL(triggered()), this, SLOT(fillWithEquidistantValues())); +    \
connect(action_fill_function, SIGNAL(triggered()), this, \
SLOT(fillWithFunctionValues())); +    connect(action_fill_const, SIGNAL(triggered()), \
this, SLOT(fillSelectedCellsWithConstValues())); +    connect(action_select_all, \
SIGNAL(triggered()), m_tableView, SLOT(selectAll())); +    connect(action_add_column, \
SIGNAL(triggered()), m_spreadsheet, SLOT(appendColumn())); +    \
connect(action_clear_spreadsheet, SIGNAL(triggered()), m_spreadsheet, SLOT(clear())); \
+    connect(action_clear_masks, SIGNAL(triggered()), m_spreadsheet, \
SLOT(clearMasks())); +    connect(action_sort_spreadsheet, SIGNAL(triggered()), this, \
SLOT(sortSpreadsheet())); +    connect(action_go_to_cell, SIGNAL(triggered()), this, \
SLOT(goToCell())); +
+    connect(action_insert_columns, SIGNAL(triggered()), this, \
SLOT(insertEmptyColumns())); +    connect(action_remove_columns, SIGNAL(triggered()), \
this, SLOT(removeSelectedColumns())); +    connect(action_clear_columns, \
SIGNAL(triggered()), this, SLOT(clearSelectedColumns())); +    \
connect(action_add_columns, SIGNAL(triggered()), this, SLOT(addColumns()));  // \
connect(action_set_as_x, SIGNAL(triggered()), this, SLOT(setSelectedColumnsAsX()));  \
// 	connect(action_set_as_y, SIGNAL(triggered()), this, \
SLOT(setSelectedColumnsAsY()));  // 	connect(action_set_as_z, SIGNAL(triggered()), \
this, SLOT(setSelectedColumnsAsZ()));  // 	connect(action_set_as_xerr, \
SIGNAL(triggered()), this, SLOT(setSelectedColumnsAsXError()));  // \
connect(action_set_as_yerr, SIGNAL(triggered()), this, \
SLOT(setSelectedColumnsAsYError()));  // 	connect(action_set_as_none, \
                SIGNAL(triggered()), this, SLOT(setSelectedColumnsAsNone()));
-	connect(action_normalize_columns, SIGNAL(triggered()), this, \
                SLOT(normalizeSelectedColumns()));
-	connect(action_normalize_selection, SIGNAL(triggered()), this, \
                SLOT(normalizeSelection()));
-	connect(action_sort_columns, SIGNAL(triggered()), this, \
                SLOT(sortSelectedColumns()));
-	connect(action_sort_asc_column, SIGNAL(triggered()), this, \
                SLOT(sortColumnAscending()));
-	connect(action_sort_desc_column, SIGNAL(triggered()), this, \
                SLOT(sortColumnDescending()));
-	connect(action_statistics_columns, SIGNAL(triggered()), this, \
SLOT(statisticsOnSelectedColumns())); +    connect(action_normalize_columns, \
SIGNAL(triggered()), this, SLOT(normalizeSelectedColumns())); +    \
connect(action_normalize_selection, SIGNAL(triggered()), this, \
SLOT(normalizeSelection())); +    connect(action_sort_columns, SIGNAL(triggered()), \
this, SLOT(sortSelectedColumns())); +    connect(action_sort_asc_column, \
SIGNAL(triggered()), this, SLOT(sortColumnAscending())); +    \
connect(action_sort_desc_column, SIGNAL(triggered()), this, \
SLOT(sortColumnDescending())); +    connect(action_statistics_columns, \
SIGNAL(triggered()), this, SLOT(statisticsOnSelectedColumns()));  
-	connect(action_insert_rows, SIGNAL(triggered()), this, SLOT(insertEmptyRows()));
-	connect(action_remove_rows, SIGNAL(triggered()), this, SLOT(removeSelectedRows()));
-	connect(action_clear_rows, SIGNAL(triggered()), this, SLOT(clearSelectedRows()));
-	connect(action_add_rows, SIGNAL(triggered()), this, SLOT(addRows()));
-	connect(action_statistics_rows, SIGNAL(triggered()), this, \
                SLOT(statisticsOnSelectedRows()));
-	connect(action_toggle_comments, SIGNAL(triggered()), this, SLOT(toggleComments()));
+    connect(action_insert_rows, SIGNAL(triggered()), this, SLOT(insertEmptyRows()));
+    connect(action_remove_rows, SIGNAL(triggered()), this, \
SLOT(removeSelectedRows())); +    connect(action_clear_rows, SIGNAL(triggered()), \
this, SLOT(clearSelectedRows())); +    connect(action_add_rows, SIGNAL(triggered()), \
this, SLOT(addRows())); +    connect(action_statistics_rows, SIGNAL(triggered()), \
this, SLOT(statisticsOnSelectedRows())); +    connect(action_toggle_comments, \
SIGNAL(triggered()), this, SLOT(toggleComments()));  }
 
 void SpreadsheetView::fillToolBar(QToolBar* toolBar){
-	toolBar->addAction(action_insert_rows);
-	toolBar->addAction(action_add_rows);
-	toolBar->addAction(action_remove_rows);
+    toolBar->addAction(action_insert_rows);
+    toolBar->addAction(action_add_rows);
+    toolBar->addAction(action_remove_rows);
 // 	toolBar->addAction(action_statistics_rows);
 
-	toolBar->addSeparator();
-	toolBar->addAction(action_insert_columns);
-	toolBar->addAction(action_add_column);
-	toolBar->addAction(action_remove_columns);
-	//TODO
+    toolBar->addSeparator();
+    toolBar->addAction(action_insert_columns);
+    toolBar->addAction(action_add_column);
+    toolBar->addAction(action_remove_columns);
+    //TODO
 // 	toolBar->addAction(action_statistics_columns);
 
-	toolBar->addSeparator();
-	toolBar->addAction(action_sort_asc_column);
-	toolBar->addAction(action_sort_desc_column);
+    toolBar->addSeparator();
+    toolBar->addAction(action_sort_asc_column);
+    toolBar->addAction(action_sort_desc_column);
 }
 
 /*!
@@ -394,150 +395,150 @@ void SpreadsheetView::fillToolBar(QToolBar* toolBar){
  *   - as a part of the spreadsheet context menu in project explorer
  */
 void SpreadsheetView::createContextMenu(QMenu * menu) const {
-	Q_ASSERT(menu);
+    Q_ASSERT(menu);
 
 #ifdef ACTIVATE_SCIDAVIS_SPECIFIC_CODE
-	QAction* firstAction = menu->actions().first();
+    QAction* firstAction = menu->actions().first();
 #else
-	QAction* firstAction = 0;
-	// if we're populating the context menu for the project explorer, then
-	//there're already actions available there. Skip the first title-action
-	//and insert the action at the beginning of the menu.
-	if (menu->actions().size()>1)
-		firstAction = menu->actions().at(1);
+    QAction* firstAction = 0;
+    // if we're populating the context menu for the project explorer, then
+    //there're already actions available there. Skip the first title-action
+    //and insert the action at the beginning of the menu.
+    if (menu->actions().size()>1)
+        firstAction = menu->actions().at(1);
 #endif
 
-	menu->insertMenu(firstAction, m_selectionMenu);
-	menu->insertAction(firstAction, action_toggle_comments);
-	menu->insertSeparator(firstAction);
-	menu->insertAction(firstAction, action_select_all);
-	menu->insertAction(firstAction, action_clear_spreadsheet);
-	menu->insertAction(firstAction, action_clear_masks);
-	menu->insertAction(firstAction, action_sort_spreadsheet);
-	menu->insertSeparator(firstAction);
-	menu->insertAction(firstAction, action_add_column);
-	menu->insertSeparator(firstAction);
-	menu->insertAction(firstAction, action_go_to_cell);
-	menu->insertSeparator(firstAction);
+    menu->insertMenu(firstAction, m_selectionMenu);
+    menu->insertAction(firstAction, action_toggle_comments);
+    menu->insertSeparator(firstAction);
+    menu->insertAction(firstAction, action_select_all);
+    menu->insertAction(firstAction, action_clear_spreadsheet);
+    menu->insertAction(firstAction, action_clear_masks);
+    menu->insertAction(firstAction, action_sort_spreadsheet);
+    menu->insertSeparator(firstAction);
+    menu->insertAction(firstAction, action_add_column);
+    menu->insertSeparator(firstAction);
+    menu->insertAction(firstAction, action_go_to_cell);
+    menu->insertSeparator(firstAction);
 
-	// TODO
-	// Export to ASCII
-	//Export to latex
+    // TODO
+    // Export to ASCII
+    //Export to latex
 }
 
 //SLOTS
 void SpreadsheetView::handleAspectAdded(const AbstractAspect * aspect){
-	const Column * col = qobject_cast<const Column*>(aspect);
-	if (!col || col->parentAspect() != static_cast<AbstractAspect*>(m_spreadsheet))
-		return;
-	connect(col, SIGNAL(widthChanged(const Column*)), this, \
SLOT(updateSectionSize(const Column*))); +    const Column * col = qobject_cast<const \
Column*>(aspect); +    if (!col || col->parentAspect() != \
static_cast<AbstractAspect*>(m_spreadsheet)) +        return;
+    connect(col, SIGNAL(widthChanged(const Column*)), this, \
SLOT(updateSectionSize(const Column*)));  }
 
 void SpreadsheetView::handleAspectAboutToBeRemoved(const AbstractAspect * aspect){
-	const Column * col = qobject_cast<const Column*>(aspect);
-	if (!col || col->parentAspect() != static_cast<AbstractAspect*>(m_spreadsheet))
-		return;
-	disconnect(col, 0, this, 0);
+    const Column * col = qobject_cast<const Column*>(aspect);
+    if (!col || col->parentAspect() != static_cast<AbstractAspect*>(m_spreadsheet))
+        return;
+    disconnect(col, 0, this, 0);
 }
 
 void SpreadsheetView::updateSectionSize(const Column* col){
-	disconnect(m_horizontalHeader, SIGNAL(sectionResized(int,int,int)), this, \
                SLOT(handleHorizontalSectionResized(int,int,int)));
-	m_horizontalHeader->resizeSection(m_spreadsheet->indexOfChild<Column>(col), \
                col->width());
-	connect(m_horizontalHeader, SIGNAL(sectionResized(int,int,int)), this, \
SLOT(handleHorizontalSectionResized(int,int,int))); +    \
disconnect(m_horizontalHeader, SIGNAL(sectionResized(int,int,int)), this, \
SLOT(handleHorizontalSectionResized(int,int,int))); +    \
m_horizontalHeader->resizeSection(m_spreadsheet->indexOfChild<Column>(col), \
col->width()); +    connect(m_horizontalHeader, SIGNAL(sectionResized(int,int,int)), \
this, SLOT(handleHorizontalSectionResized(int,int,int)));  }
 
 //TODO what for?!?
 void SpreadsheetView::handleHorizontalSectionResized(int logicalIndex, int oldSize, \
                int newSize){
-	Q_UNUSED(logicalIndex);
-	Q_UNUSED(oldSize);
-	static bool inside = false;
-	if (inside) return;
-	inside = true;
+    Q_UNUSED(logicalIndex);
+    Q_UNUSED(oldSize);
+    static bool inside = false;
+    if (inside) return;
+    inside = true;
 
-	int cols = m_spreadsheet->columnCount();
-	for (int i=0; i<cols; i++)
-		if (isColumnSelected(i, true))
-			m_horizontalHeader->resizeSection(i, newSize);
+    int cols = m_spreadsheet->columnCount();
+    for (int i=0; i<cols; i++)
+        if (isColumnSelected(i, true))
+            m_horizontalHeader->resizeSection(i, newSize);
 
-	inside = false;
+    inside = false;
 }
 
 /*!
   Advance current cell after [Return] or [Enter] was pressed.
  */
 void SpreadsheetView::advanceCell(){
-	QModelIndex idx = m_tableView->currentIndex();
+    QModelIndex idx = m_tableView->currentIndex();
     if (idx.row()+1 >= m_spreadsheet->rowCount()) {
-		int new_size = m_spreadsheet->rowCount()+1;
-		m_spreadsheet->setRowCount(new_size);
-	}
-	m_tableView->setCurrentIndex(idx.sibling(idx.row()+1, idx.column()));
+        int new_size = m_spreadsheet->rowCount()+1;
+        m_spreadsheet->setRowCount(new_size);
+    }
+    m_tableView->setCurrentIndex(idx.sibling(idx.row()+1, idx.column()));
 }
 
 void SpreadsheetView::goToCell(int row, int col){
-	QModelIndex index = m_model->index(row, col);
-	m_tableView->scrollTo(index);
-	m_tableView->setCurrentIndex(index);
+    QModelIndex index = m_model->index(row, col);
+    m_tableView->scrollTo(index);
+    m_tableView->setCurrentIndex(index);
 }
 
 void SpreadsheetView::handleHorizontalSectionMoved(int index, int from, int to){
-	Q_UNUSED(index);
+    Q_UNUSED(index);
 
-	static bool inside = false;
-	if (inside) return;
+    static bool inside = false;
+    if (inside) return;
 
-	Q_ASSERT(index == from);
+    Q_ASSERT(index == from);
 
-	inside = true;
-	m_tableView->horizontalHeader()->moveSection(to, from);
-	inside = false;
-	m_spreadsheet->moveColumn(from, to);
+    inside = true;
+    m_tableView->horizontalHeader()->moveSection(to, from);
+    inside = false;
+    m_spreadsheet->moveColumn(from, to);
 }
 
 //TODO Implement the "change of the column name"-mode  upon a double click
 void SpreadsheetView::handleHorizontalHeaderDoubleClicked(int index){
-	Q_UNUSED(index);
+    Q_UNUSED(index);
 }
 
 /*!
   Returns whether comments are show currently or not.
 */
 bool SpreadsheetView::areCommentsShown() const{
-	return m_horizontalHeader->areCommentsShown();
+    return m_horizontalHeader->areCommentsShown();
 }
 
 /*!
   toggles the column comment in the horizontal header
 */
 void SpreadsheetView::toggleComments(){
-	showComments(!areCommentsShown());
-	//TODO
-	if(areCommentsShown())
-		action_toggle_comments->setText(i18n("Hide Comments"));
-	else
-		action_toggle_comments->setText(i18n("Show Comments"));
+    showComments(!areCommentsShown());
+    //TODO
+    if(areCommentsShown())
+        action_toggle_comments->setText(i18n("Hide Comments"));
+    else
+        action_toggle_comments->setText(i18n("Show Comments"));
 }
 
 //! Shows (\c on=true) or hides (\c on=false) the column comments in the horizontal \
header  void SpreadsheetView::showComments(bool on){
-	m_horizontalHeader->showComments(on);
+    m_horizontalHeader->showComments(on);
 }
 
 void SpreadsheetView::currentColumnChanged(const QModelIndex & current, const \
                QModelIndex & previous){
-	Q_UNUSED(previous);
-	int col = current.column();
-	if (col < 0 || col >= m_spreadsheet->columnCount())
-	  return;
+    Q_UNUSED(previous);
+    int col = current.column();
+    if (col < 0 || col >= m_spreadsheet->columnCount())
+      return;
 }
 
 //TODO
 void SpreadsheetView::handleHeaderDataChanged(Qt::Orientation orientation, int \
                first, int last){
-	if (orientation != Qt::Horizontal) return;
+    if (orientation != Qt::Horizontal) return;
 
-	QItemSelectionModel * sel_model = m_tableView->selectionModel();
+    QItemSelectionModel * sel_model = m_tableView->selectionModel();
 
-	int col = sel_model->currentIndex().column();
-	if (col < first || col > last) return;
+    int col = sel_model->currentIndex().column();
+    if (col < first || col > last) return;
 }
 
 /*!
@@ -545,23 +546,23 @@ void SpreadsheetView::handleHeaderDataChanged(Qt::Orientation \
orientation, int f  If \c full is \c true, this function only returns the number of \
                fully selected columns.
 */
 int SpreadsheetView::selectedColumnCount(bool full){
-	int count = 0;
-	int cols = m_spreadsheet->columnCount();
-	for (int i=0; i<cols; i++)
-		if (isColumnSelected(i, full)) count++;
-	return count;
+    int count = 0;
+    int cols = m_spreadsheet->columnCount();
+    for (int i=0; i<cols; i++)
+        if (isColumnSelected(i, full)) count++;
+    return count;
 }
 
 /*!
   Returns the number of (at least partly) selected columns with the plot designation \
                \param pd.
  */
 int SpreadsheetView::selectedColumnCount(AbstractColumn::PlotDesignation pd){
-	int count = 0;
-	int cols = m_spreadsheet->columnCount();
-	for (int i=0; i<cols; i++)
-		if ( isColumnSelected(i, false) && (m_spreadsheet->column(i)->plotDesignation() == \
pd) ) count++; +    int count = 0;
+    int cols = m_spreadsheet->columnCount();
+    for (int i=0; i<cols; i++)
+        if ( isColumnSelected(i, false) && \
(m_spreadsheet->column(i)->plotDesignation() == pd) ) count++;  
-	return count;
+    return count;
 }
 
 /*!
@@ -569,10 +570,10 @@ int \
SpreadsheetView::selectedColumnCount(AbstractColumn::PlotDesignation pd){  If \param \
                full is \c true, this function only returns true if the whole column \
                is selected.
 */
 bool SpreadsheetView::isColumnSelected(int col, bool full){
-	if (full)
-		return m_tableView->selectionModel()->isColumnSelected(col, QModelIndex());
-	else
-		return m_tableView->selectionModel()->columnIntersectsSelection(col, \
QModelIndex()); +    if (full)
+        return m_tableView->selectionModel()->isColumnSelected(col, QModelIndex());
+    else
+        return m_tableView->selectionModel()->columnIntersectsSelection(col, \
QModelIndex());  }
 
 /*!
@@ -580,12 +581,12 @@ bool SpreadsheetView::isColumnSelected(int col, bool full){
   If \param full is true, this function only returns a column if the whole column is \
                selected.
   */
 QList<Column*> SpreadsheetView::selectedColumns(bool full){
-	QList<Column*> list;
-	int cols = m_spreadsheet->columnCount();
-	for (int i=0; i<cols; i++)
-		if (isColumnSelected(i, full)) list << m_spreadsheet->column(i);
+    QList<Column*> list;
+    int cols = m_spreadsheet->columnCount();
+    for (int i=0; i<cols; i++)
+        if (isColumnSelected(i, full)) list << m_spreadsheet->column(i);
 
-	return list;
+    return list;
 }
 
 /*!
@@ -593,11 +594,11 @@ QList<Column*> SpreadsheetView::selectedColumns(bool full){
   If \param full is \c true, this function only returns the number of fully selected \
                rows.
 */
 int SpreadsheetView::selectedRowCount(bool full){
-	int count = 0;
-	int rows = m_spreadsheet->rowCount();
-	for (int i=0; i<rows; i++)
-		if (isRowSelected(i, full)) count++;
-	return count;
+    int count = 0;
+    int rows = m_spreadsheet->rowCount();
+    for (int i=0; i<rows; i++)
+        if (isRowSelected(i, full)) count++;
+    return count;
 }
 
 /*!
@@ -605,10 +606,10 @@ int SpreadsheetView::selectedRowCount(bool full){
   If \param full is \c true, this function only returns \c true if the whole row is \
                selected.
 */
 bool SpreadsheetView::isRowSelected(int row, bool full){
-	if (full)
-		return m_tableView->selectionModel()->isRowSelected(row, QModelIndex());
-	else
-		return m_tableView->selectionModel()->rowIntersectsSelection(row, QModelIndex());
+    if (full)
+        return m_tableView->selectionModel()->isRowSelected(row, QModelIndex());
+    else
+        return m_tableView->selectionModel()->rowIntersectsSelection(row, \
QModelIndex());  }
 
 /*!
@@ -616,13 +617,13 @@ bool SpreadsheetView::isRowSelected(int row, bool full){
   If \param full is \c true, this function only looks for fully selected columns.
 */
 int SpreadsheetView::firstSelectedColumn(bool full){
-	int cols = m_spreadsheet->columnCount();
-	for (int i=0; i<cols; i++)
-	{
-		if (isColumnSelected(i, full))
-			return i;
-	}
-	return -1;
+    int cols = m_spreadsheet->columnCount();
+    for (int i=0; i<cols; i++)
+    {
+        if (isColumnSelected(i, full))
+            return i;
+    }
+    return -1;
 }
 
 /*!
@@ -630,11 +631,11 @@ int SpreadsheetView::firstSelectedColumn(bool full){
   If \param full is \c true, this function only looks for fully selected columns.
   */
 int SpreadsheetView::lastSelectedColumn(bool full){
-	int cols = m_spreadsheet->columnCount();
-	for (int i=cols-1; i>=0; i--)
-		if (isColumnSelected(i, full)) return i;
+    int cols = m_spreadsheet->columnCount();
+    for (int i=cols-1; i>=0; i--)
+        if (isColumnSelected(i, full)) return i;
 
-	return -2;
+    return -2;
 }
 
 /*!
@@ -642,13 +643,13 @@ int SpreadsheetView::lastSelectedColumn(bool full){
   If \param full is \c true, this function only looks for fully selected rows.
   */
 int SpreadsheetView::firstSelectedRow(bool full){
-	int rows = m_spreadsheet->rowCount();
-	for (int i=0; i<rows; i++)
-	{
-		if (isRowSelected(i, full))
-			return i;
-	}
-	return -1;
+    int rows = m_spreadsheet->rowCount();
+    for (int i=0; i<rows; i++)
+    {
+        if (isRowSelected(i, full))
+            return i;
+    }
+    return -1;
 }
 
 /*!
@@ -656,894 +657,894 @@ int SpreadsheetView::firstSelectedRow(bool full){
   If \param full is \c true, this function only looks for fully selected rows.
   */
 int SpreadsheetView::lastSelectedRow(bool full){
-	int rows = m_spreadsheet->rowCount();
-	for (int i=rows-1; i>=0; i--)
-		if (isRowSelected(i, full)) return i;
+    int rows = m_spreadsheet->rowCount();
+    for (int i=rows-1; i>=0; i--)
+        if (isRowSelected(i, full)) return i;
 
-	return -2;
+    return -2;
 }
 
 /*!
   Return whether a cell is selected
  */
 bool SpreadsheetView::isCellSelected(int row, int col){
-	if (row < 0 || col < 0 || row >= m_spreadsheet->rowCount() || col >= \
m_spreadsheet->columnCount()) return false; +    if (row < 0 || col < 0 || row >= \
m_spreadsheet->rowCount() || col >= m_spreadsheet->columnCount()) return false;  
-	return m_tableView->selectionModel()->isSelected(m_model->index(row, col));
+    return m_tableView->selectionModel()->isSelected(m_model->index(row, col));
 }
 
 /*!
   Get the complete set of selected rows.
  */
 IntervalAttribute<bool> SpreadsheetView::selectedRows(bool full){
-	IntervalAttribute<bool> result;
-	int rows = m_spreadsheet->rowCount();
-	for (int i=0; i<rows; i++)
-		if (isRowSelected(i, full))
-			result.setValue(i, true);
-	return result;
+    IntervalAttribute<bool> result;
+    int rows = m_spreadsheet->rowCount();
+    for (int i=0; i<rows; i++)
+        if (isRowSelected(i, full))
+            result.setValue(i, true);
+    return result;
 }
 
 /*!
   Select/Deselect a cell.
  */
 void SpreadsheetView::setCellSelected(int row, int col, bool select){
-	m_tableView->selectionModel()->select(m_model->index(row, col),
-			 select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect);
+    m_tableView->selectionModel()->select(m_model->index(row, col),
+             select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect);
 }
 
 /*!
   Select/Deselect a range of cells.
  */
 void SpreadsheetView::setCellsSelected(int first_row, int first_col, int last_row, \
                int last_col, bool select){
-	QModelIndex top_left = m_model->index(first_row, first_col);
-	QModelIndex bottom_right = m_model->index(last_row, last_col);
-	m_tableView->selectionModel()->select(QItemSelection(top_left, bottom_right),
-			select ? QItemSelectionModel::SelectCurrent : QItemSelectionModel::Deselect);
+    QModelIndex top_left = m_model->index(first_row, first_col);
+    QModelIndex bottom_right = m_model->index(last_row, last_col);
+    m_tableView->selectionModel()->select(QItemSelection(top_left, bottom_right),
+            select ? QItemSelectionModel::SelectCurrent : \
QItemSelectionModel::Deselect);  }
 
 /*!
   Determine the current cell (-1 if no cell is designated as the current).
  */
 void SpreadsheetView::getCurrentCell(int * row, int * col){
-	QModelIndex index = m_tableView->selectionModel()->currentIndex();
-	if (index.isValid())	{
-		*row = index.row();
-		*col = index.column();
-	}else{
-		*row = -1;
-		*col = -1;
-	}
+    QModelIndex index = m_tableView->selectionModel()->currentIndex();
+    if (index.isValid())	{
+        *row = index.row();
+        *col = index.column();
+    }else{
+        *row = -1;
+        *col = -1;
+    }
 }
 
 bool SpreadsheetView::eventFilter(QObject* watched, QEvent* event) {
-	if (event->type() == QEvent::ContextMenu){
-		QContextMenuEvent *cm_event = static_cast<QContextMenuEvent*>(event);
-		QPoint global_pos = cm_event->globalPos();
-		if (watched == m_tableView->verticalHeader()){
-			m_rowMenu->exec(global_pos);
-		}else if (watched == m_horizontalHeader) {
-			int col = m_horizontalHeader->logicalIndexAt(cm_event->pos());
-			if (!isColumnSelected(col, true)) {
-				QItemSelectionModel *sel_model = m_tableView->selectionModel();
-				sel_model->clearSelection();
-				sel_model->select(QItemSelection(m_model->index(0, col, QModelIndex()),
-							m_model->index(m_model->rowCount()-1, col, QModelIndex())),
-						QItemSelectionModel::Select);
-			}
-
-			if (selectedColumns().size()==1){
-				action_sort_columns->setVisible(false);
-				action_sort_asc_column->setVisible(true);
-				action_sort_desc_column->setVisible(true);
-			}else{
-				action_sort_columns->setVisible(true);
-				action_sort_asc_column->setVisible(false);
-				action_sort_desc_column->setVisible(false);
-			}
-
-			//check whether we have non-numeric columns selected and deactivate actions for \
                numeric columns
-			bool numeric = true;
-			foreach(Column* col, selectedColumns()) {
-				if (col->columnMode() != AbstractColumn::Numeric) {
-					numeric = false;
-					break;
-				}
-			}
-			action_fill_equidistant->setEnabled(numeric);
-			action_fill_random_nonuniform->setEnabled(numeric);
-			action_fill_function->setEnabled(numeric);
-
-			m_columnMenu->exec(global_pos);
-		}else if (watched == this){
-			m_spreadsheetMenu->exec(global_pos);
-		}else{
-			return QWidget::eventFilter(watched, event);
-		}
-		return true;
-	}
-	else
-		return QWidget::eventFilter(watched, event);
+    if (event->type() == QEvent::ContextMenu){
+        QContextMenuEvent *cm_event = static_cast<QContextMenuEvent*>(event);
+        QPoint global_pos = cm_event->globalPos();
+        if (watched == m_tableView->verticalHeader()){
+            m_rowMenu->exec(global_pos);
+        }else if (watched == m_horizontalHeader) {
+            int col = m_horizontalHeader->logicalIndexAt(cm_event->pos());
+            if (!isColumnSelected(col, true)) {
+                QItemSelectionModel *sel_model = m_tableView->selectionModel();
+                sel_model->clearSelection();
+                sel_model->select(QItemSelection(m_model->index(0, col, \
QModelIndex()), +                            m_model->index(m_model->rowCount()-1, \
col, QModelIndex())), +                        QItemSelectionModel::Select);
+            }
+
+            if (selectedColumns().size()==1){
+                action_sort_columns->setVisible(false);
+                action_sort_asc_column->setVisible(true);
+                action_sort_desc_column->setVisible(true);
+            }else{
+                action_sort_columns->setVisible(true);
+                action_sort_asc_column->setVisible(false);
+                action_sort_desc_column->setVisible(false);
+            }
+
+            //check whether we have non-numeric columns selected and deactivate \
actions for numeric columns +            bool numeric = true;
+            foreach(Column* col, selectedColumns()) {
+                if (col->columnMode() != AbstractColumn::Numeric) {
+                    numeric = false;
+                    break;
+                }
+            }
+            action_fill_equidistant->setEnabled(numeric);
+            action_fill_random_nonuniform->setEnabled(numeric);
+            action_fill_function->setEnabled(numeric);
+
+            m_columnMenu->exec(global_pos);
+        }else if (watched == this){
+            m_spreadsheetMenu->exec(global_pos);
+        }else{
+            return QWidget::eventFilter(watched, event);
+        }
+        return true;
+    }
+    else
+        return QWidget::eventFilter(watched, event);
 }
 
 bool SpreadsheetView::formulaModeActive() const{
-	return m_model->formulaModeActive();
+    return m_model->formulaModeActive();
 }
 
 void SpreadsheetView::activateFormulaMode(bool on){
-	m_model->activateFormulaMode(on);
+    m_model->activateFormulaMode(on);
 }
 
 void SpreadsheetView::goToNextColumn(){
-	if (m_spreadsheet->columnCount() == 0) return;
+    if (m_spreadsheet->columnCount() == 0) return;
 
-	QModelIndex idx = m_tableView->currentIndex();
-	int col = idx.column()+1;
+    QModelIndex idx = m_tableView->currentIndex();
+    int col = idx.column()+1;
     if (col >= m_spreadsheet->columnCount())
-		col = 0;
+        col = 0;
 
-	m_tableView->setCurrentIndex(idx.sibling(idx.row(), col));
+    m_tableView->setCurrentIndex(idx.sibling(idx.row(), col));
 }
 
 void SpreadsheetView::goToPreviousColumn(){
-	if (m_spreadsheet->columnCount() == 0)
-	  return;
+    if (m_spreadsheet->columnCount() == 0)
+      return;
 
-	QModelIndex idx = m_tableView->currentIndex();
-	int col = idx.column()-1;
+    QModelIndex idx = m_tableView->currentIndex();
+    int col = idx.column()-1;
     if (col < 0)
-		col = m_spreadsheet->columnCount()-1;
+        col = m_spreadsheet->columnCount()-1;
 
-	m_tableView->setCurrentIndex(idx.sibling(idx.row(), col));
+    m_tableView->setCurrentIndex(idx.sibling(idx.row(), col));
 }
 
 void SpreadsheetView::cutSelection(){
-	int first = firstSelectedRow();
-	if ( first < 0 )
-	  return;
+    int first = firstSelectedRow();
+    if ( first < 0 )
+      return;
 
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: cut selected cells", m_spreadsheet->name()));
-	copySelection();
-	clearSelectedCells();
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: cut selected cells", \
m_spreadsheet->name())); +    copySelection();
+    clearSelectedCells();
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::copySelection(){
-	int first_col = firstSelectedColumn(false);
-	if (first_col == -1) return;
-	int last_col = lastSelectedColumn(false);
-	if (last_col == -2) return;
-	int first_row = firstSelectedRow(false);
-	if (first_row == -1)	return;
-	int last_row = lastSelectedRow(false);
-	if (last_row == -2) return;
-	int cols = last_col - first_col +1;
-	int rows = last_row - first_row +1;
-
-	WAIT_CURSOR;
-	QString output_str;
-
-	for (int r=0; r<rows; r++)
-	{
-		for (int c=0; c<cols; c++)
-		{
-			Column *col_ptr = m_spreadsheet->column(first_col + c);
-			if (isCellSelected(first_row + r, first_col + c))
-			{
-				if (formulaModeActive())
-				{
-					output_str += col_ptr->formula(first_row + r);
-				}
-				else if (col_ptr->columnMode() == AbstractColumn::Numeric)
-				{
-					Double2StringFilter * out_fltr = static_cast<Double2StringFilter \
                *>(col_ptr->outputFilter());
-					output_str += QLocale().toString(col_ptr->valueAt(first_row + r),
-							out_fltr->numericFormat(), 16); // copy with max. precision
-				}
-				else
-				{
-					output_str += m_spreadsheet->column(first_col+c)->asStringColumn()->textAt(first_row \
                + r);
-				}
-			}
-			if (c < cols-1)
-				output_str += '\t';
-		}
-		if (r < rows-1)
-			output_str += '\n';
-	}
-	QApplication::clipboard()->setText(output_str);
-	RESET_CURSOR;
+    int first_col = firstSelectedColumn(false);
+    if (first_col == -1) return;
+    int last_col = lastSelectedColumn(false);
+    if (last_col == -2) return;
+    int first_row = firstSelectedRow(false);
+    if (first_row == -1)	return;
+    int last_row = lastSelectedRow(false);
+    if (last_row == -2) return;
+    int cols = last_col - first_col +1;
+    int rows = last_row - first_row +1;
+
+    WAIT_CURSOR;
+    QString output_str;
+
+    for (int r=0; r<rows; r++)
+    {
+        for (int c=0; c<cols; c++)
+        {
+            Column *col_ptr = m_spreadsheet->column(first_col + c);
+            if (isCellSelected(first_row + r, first_col + c))
+            {
+                if (formulaModeActive())
+                {
+                    output_str += col_ptr->formula(first_row + r);
+                }
+                else if (col_ptr->columnMode() == AbstractColumn::Numeric)
+                {
+                    Double2StringFilter * out_fltr = static_cast<Double2StringFilter \
*>(col_ptr->outputFilter()); +                    output_str += \
QLocale().toString(col_ptr->valueAt(first_row + r), +                            \
out_fltr->numericFormat(), 16); // copy with max. precision +                }
+                else
+                {
+                    output_str += \
m_spreadsheet->column(first_col+c)->asStringColumn()->textAt(first_row + r); +        \
} +            }
+            if (c < cols-1)
+                output_str += '\t';
+        }
+        if (r < rows-1)
+            output_str += '\n';
+    }
+    QApplication::clipboard()->setText(output_str);
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::pasteIntoSelection(){
-	if (m_spreadsheet->columnCount() < 1 || m_spreadsheet->rowCount() < 1)
-	  return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: paste from clipboard", m_spreadsheet->name()));
-	const QMimeData * mime_data = QApplication::clipboard()->mimeData();
-
-	if (mime_data->hasFormat("text/plain")){
-		int first_col = firstSelectedColumn(false);
-		int last_col = lastSelectedColumn(false);
-		int first_row = firstSelectedRow(false);
-		int last_row = lastSelectedRow(false);
-		int input_row_count = 0;
-		int input_col_count = 0;
-		int rows, cols;
-
-		QString input_str = QString(mime_data->data("text/plain")).trimmed();
-		QList< QStringList > cellTexts;
-		QStringList input_rows(input_str.split('\n'));
-		input_row_count = input_rows.count();
-		input_col_count = 0;
-		for (int i=0; i<input_row_count; i++)
-		{
-			cellTexts.append(input_rows.at(i).trimmed().split(QRegExp("\\s+")));
-			if (cellTexts.at(i).count() > input_col_count) input_col_count = \
                cellTexts.at(i).count();
-		}
-
-		if ( (first_col == -1 || first_row == -1) ||
-			(last_row == first_row && last_col == first_col) )
-		// if the is no selection or only one cell selected, the
-		// selection will be expanded to the needed size from the current cell
-		{
-			int current_row, current_col;
-			getCurrentCell(&current_row, &current_col);
-			if (current_row == -1) current_row = 0;
-			if (current_col == -1) current_col = 0;
-			setCellSelected(current_row, current_col);
-			first_col = current_col;
-			first_row = current_row;
-			last_row = first_row + input_row_count -1;
-			last_col = first_col + input_col_count -1;
-			// resize the spreadsheet if necessary
-			if (last_col >= m_spreadsheet->columnCount())
-			{
-				for (int i=0; i<last_col+1-m_spreadsheet->columnCount(); i++)
-				{
-					Column * new_col = new Column(QString::number(i+1), AbstractColumn::Text);
-					new_col->setPlotDesignation(AbstractColumn::Y);
-					new_col->insertRows(0, m_spreadsheet->rowCount());
-					m_spreadsheet->addChild(new_col);
-				}
-			}
-			if (last_row >= m_spreadsheet->rowCount())
-				m_spreadsheet->appendRows(last_row+1-m_spreadsheet->rowCount());
-			// select the rectangle to be pasted in
-			setCellsSelected(first_row, first_col, last_row, last_col);
-		}
-
-		rows = last_row - first_row + 1;
-		cols = last_col - first_col + 1;
-		for (int r=0; r<rows && r<input_row_count; r++)
-		{
-			for (int c=0; c<cols && c<input_col_count; c++)
-			{
-				//TODO c->setSuppressDataChangedSignal(true);
-				if (isCellSelected(first_row + r, first_col + c) && (c < \
                cellTexts.at(r).count()) )
-				{
-					Column * col_ptr = m_spreadsheet->column(first_col + c);
-					if (formulaModeActive())
-					{
-						col_ptr->setFormula(first_row + r, cellTexts.at(r).at(c));
-					}
-					else
-						col_ptr->asStringColumn()->setTextAt(first_row+r, cellTexts.at(r).at(c));
-				}
-			}
-		}
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    if (m_spreadsheet->columnCount() < 1 || m_spreadsheet->rowCount() < 1)
+      return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: paste from clipboard", \
m_spreadsheet->name())); +    const QMimeData * mime_data = \
QApplication::clipboard()->mimeData(); +
+    if (mime_data->hasFormat("text/plain")){
+        int first_col = firstSelectedColumn(false);
+        int last_col = lastSelectedColumn(false);
+        int first_row = firstSelectedRow(false);
+        int last_row = lastSelectedRow(false);
+        int input_row_count = 0;
+        int input_col_count = 0;
+        int rows, cols;
+
+        QString input_str = QString(mime_data->data("text/plain")).trimmed();
+        QList< QStringList > cellTexts;
+        QStringList input_rows(input_str.split('\n'));
+        input_row_count = input_rows.count();
+        input_col_count = 0;
+        for (int i=0; i<input_row_count; i++)
+        {
+            cellTexts.append(input_rows.at(i).trimmed().split(QRegExp("\\s+")));
+            if (cellTexts.at(i).count() > input_col_count) input_col_count = \
cellTexts.at(i).count(); +        }
+
+        if ( (first_col == -1 || first_row == -1) ||
+            (last_row == first_row && last_col == first_col) )
+        // if the is no selection or only one cell selected, the
+        // selection will be expanded to the needed size from the current cell
+        {
+            int current_row, current_col;
+            getCurrentCell(&current_row, &current_col);
+            if (current_row == -1) current_row = 0;
+            if (current_col == -1) current_col = 0;
+            setCellSelected(current_row, current_col);
+            first_col = current_col;
+            first_row = current_row;
+            last_row = first_row + input_row_count -1;
+            last_col = first_col + input_col_count -1;
+            // resize the spreadsheet if necessary
+            if (last_col >= m_spreadsheet->columnCount())
+            {
+                for (int i=0; i<last_col+1-m_spreadsheet->columnCount(); i++)
+                {
+                    Column * new_col = new Column(QString::number(i+1), \
AbstractColumn::Text); +                    \
new_col->setPlotDesignation(AbstractColumn::Y); +                    \
new_col->insertRows(0, m_spreadsheet->rowCount()); +                    \
m_spreadsheet->addChild(new_col); +                }
+            }
+            if (last_row >= m_spreadsheet->rowCount())
+                m_spreadsheet->appendRows(last_row+1-m_spreadsheet->rowCount());
+            // select the rectangle to be pasted in
+            setCellsSelected(first_row, first_col, last_row, last_col);
+        }
+
+        rows = last_row - first_row + 1;
+        cols = last_col - first_col + 1;
+        for (int r=0; r<rows && r<input_row_count; r++)
+        {
+            for (int c=0; c<cols && c<input_col_count; c++)
+            {
+                //TODO c->setSuppressDataChangedSignal(true);
+                if (isCellSelected(first_row + r, first_col + c) && (c < \
cellTexts.at(r).count()) ) +                {
+                    Column * col_ptr = m_spreadsheet->column(first_col + c);
+                    if (formulaModeActive())
+                    {
+                        col_ptr->setFormula(first_row + r, cellTexts.at(r).at(c));
+                    }
+                    else
+                        col_ptr->asStringColumn()->setTextAt(first_row+r, \
cellTexts.at(r).at(c)); +                }
+            }
+        }
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::maskSelection(){
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: mask selected cells", m_spreadsheet->name()));
-	QList<Column*> list = selectedColumns();
-	foreach(Column * col_ptr, list)
-	{
-		int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-		for (int row=first; row<=last; row++)
-			if (isCellSelected(row, col)) col_ptr->setMasked(row);
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: mask selected cells", \
m_spreadsheet->name())); +    QList<Column*> list = selectedColumns();
+    foreach(Column * col_ptr, list)
+    {
+        int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+        for (int row=first; row<=last; row++)
+            if (isCellSelected(row, col)) col_ptr->setMasked(row);
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::unmaskSelection(){
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: unmask selected cells", \
                m_spreadsheet->name()));
-	QList<Column*> list = selectedColumns();
-	foreach(Column * col_ptr, list)	{
-		int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-		for (int row=first; row<=last; row++)
-			if (isCellSelected(row, col)) col_ptr->setMasked(row, false);
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: unmask selected cells", \
m_spreadsheet->name())); +    QList<Column*> list = selectedColumns();
+    foreach(Column * col_ptr, list)	{
+        int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+        for (int row=first; row<=last; row++)
+            if (isCellSelected(row, col)) col_ptr->setMasked(row, false);
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 // TODO
 void SpreadsheetView::recalculateSelectedCells(){
-	QMessageBox::information(0, "info", "not yet implemented");
+    QMessageBox::information(0, "info", "not yet implemented");
 }
 
 void SpreadsheetView::fillSelectedCellsWithRowNumbers(){
-	if (selectedColumnCount() < 1) return;
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: fill cells with row numbers", \
                m_spreadsheet->name()));
-	foreach(Column* col_ptr, selectedColumns()) {
-		int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-		col_ptr->setSuppressDataChangedSignal(true);
-		switch (col_ptr->columnMode()) {
-			case AbstractColumn::Numeric:
-				{
-					QVector<double> results(last-first+1);
-					for (int row=first; row<=last; row++)
-						if(isCellSelected(row, col))
-							results[row-first] = row+1;
-						else
-							results[row-first] = col_ptr->valueAt(row);
-					col_ptr->replaceValues(first, results);
-					break;
-				}
-			case AbstractColumn::Text:
-				{
-					QStringList results;
-					for (int row=first; row<=last; row++)
-						if (isCellSelected(row, col))
-							results << QString::number(row+1);
-						else
-							results << col_ptr->textAt(row);
-					col_ptr->replaceTexts(first, results);
-					break;
-				}
-			//TODO: handle other modes
-			default: break;
-		}
-
-		col_ptr->setSuppressDataChangedSignal(false);
-		col_ptr->setChanged();
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    if (selectedColumnCount() < 1) return;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: fill cells with row numbers", \
m_spreadsheet->name())); +    foreach(Column* col_ptr, selectedColumns()) {
+        int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+        col_ptr->setSuppressDataChangedSignal(true);
+        switch (col_ptr->columnMode()) {
+            case AbstractColumn::Numeric:
+                {
+                    QVector<double> results(last-first+1);
+                    for (int row=first; row<=last; row++)
+                        if(isCellSelected(row, col))
+                            results[row-first] = row+1;
+                        else
+                            results[row-first] = col_ptr->valueAt(row);
+                    col_ptr->replaceValues(first, results);
+                    break;
+                }
+            case AbstractColumn::Text:
+                {
+                    QStringList results;
+                    for (int row=first; row<=last; row++)
+                        if (isCellSelected(row, col))
+                            results << QString::number(row+1);
+                        else
+                            results << col_ptr->textAt(row);
+                    col_ptr->replaceTexts(first, results);
+                    break;
+                }
+            //TODO: handle other modes
+            default: break;
+        }
+
+        col_ptr->setSuppressDataChangedSignal(false);
+        col_ptr->setChanged();
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::fillSelectedCellsWithRandomNumbers(){
-	if (selectedColumnCount() < 1) return;
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: fill cells with random values", \
                m_spreadsheet->name()));
-	qsrand(QTime::currentTime().msec());
-	foreach(Column* col_ptr, selectedColumns()) {
-		int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-		col_ptr->setSuppressDataChangedSignal(true);
-		switch (col_ptr->columnMode()) {
-			case AbstractColumn::Numeric:
-				{
-					QVector<double> results(last-first+1);
-					for (int row=first; row<=last; row++)
-						if (isCellSelected(row, col))
-							results[row-first] = double(qrand())/double(RAND_MAX);
-						else
-							results[row-first] = col_ptr->valueAt(row);
-					col_ptr->replaceValues(first, results);
-					break;
-				}
-			case AbstractColumn::Text:
-				{
-					QStringList results;
-					for (int row=first; row<=last; row++)
-						if (isCellSelected(row, col))
-							results << QString::number(double(qrand())/double(RAND_MAX));
-						else
-							results << col_ptr->textAt(row);
-					col_ptr->replaceTexts(first, results);
-					break;
-				}
-			case AbstractColumn::DateTime:
-			case AbstractColumn::Month:
-			case AbstractColumn::Day:
-				{
-					QList<QDateTime> results;
-					QDate earliestDate(1,1,1);
-					QDate latestDate(2999,12,31);
-					QTime midnight(0,0,0,0);
-					for (int row=first; row<=last; row++)
-						if (isCellSelected(row, col))
-							results << QDateTime(
-									earliestDate.addDays(((double)qrand())*((double)earliestDate.daysTo(latestDate))/((double)RAND_MAX)),
                
-									midnight.addMSecs(((qint64)qrand())*1000*60*60*24/RAND_MAX));
-						else
-							results << col_ptr->dateTimeAt(row);
-					col_ptr->replaceDateTimes(first, results);
-					break;
-				}
-		}
-
-		col_ptr->setSuppressDataChangedSignal(false);
-		col_ptr->setChanged();
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    if (selectedColumnCount() < 1) return;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: fill cells with random values", \
m_spreadsheet->name())); +    qsrand(QTime::currentTime().msec());
+    foreach(Column* col_ptr, selectedColumns()) {
+        int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+        col_ptr->setSuppressDataChangedSignal(true);
+        switch (col_ptr->columnMode()) {
+            case AbstractColumn::Numeric:
+                {
+                    QVector<double> results(last-first+1);
+                    for (int row=first; row<=last; row++)
+                        if (isCellSelected(row, col))
+                            results[row-first] = double(qrand())/double(RAND_MAX);
+                        else
+                            results[row-first] = col_ptr->valueAt(row);
+                    col_ptr->replaceValues(first, results);
+                    break;
+                }
+            case AbstractColumn::Text:
+                {
+                    QStringList results;
+                    for (int row=first; row<=last; row++)
+                        if (isCellSelected(row, col))
+                            results << \
QString::number(double(qrand())/double(RAND_MAX)); +                        else
+                            results << col_ptr->textAt(row);
+                    col_ptr->replaceTexts(first, results);
+                    break;
+                }
+            case AbstractColumn::DateTime:
+            case AbstractColumn::Month:
+            case AbstractColumn::Day:
+                {
+                    QList<QDateTime> results;
+                    QDate earliestDate(1,1,1);
+                    QDate latestDate(2999,12,31);
+                    QTime midnight(0,0,0,0);
+                    for (int row=first; row<=last; row++)
+                        if (isCellSelected(row, col))
+                            results << QDateTime(
+                                    \
earliestDate.addDays(((double)qrand())*((double)earliestDate.daysTo(latestDate))/((double)RAND_MAX)),
 +                                    \
midnight.addMSecs(((qint64)qrand())*1000*60*60*24/RAND_MAX)); +                       \
else +                            results << col_ptr->dateTimeAt(row);
+                    col_ptr->replaceDateTimes(first, results);
+                    break;
+                }
+        }
+
+        col_ptr->setSuppressDataChangedSignal(false);
+        col_ptr->setChanged();
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::fillWithRandomValues() {
-	if (selectedColumnCount() < 1) return;
-	RandomValuesDialog* dlg = new RandomValuesDialog(m_spreadsheet);
-	dlg->setAttribute(Qt::WA_DeleteOnClose);
-	dlg->setColumns(selectedColumns());
-	dlg->exec();
+    if (selectedColumnCount() < 1) return;
+    RandomValuesDialog* dlg = new RandomValuesDialog(m_spreadsheet);
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->setColumns(selectedColumns());
+    dlg->exec();
 }
 
 void SpreadsheetView::fillWithEquidistantValues() {
-	if (selectedColumnCount() < 1) return;
-	EquidistantValuesDialog* dlg = new EquidistantValuesDialog(m_spreadsheet);
-	dlg->setAttribute(Qt::WA_DeleteOnClose);
-	dlg->setColumns(selectedColumns());
-	dlg->exec();
+    if (selectedColumnCount() < 1) return;
+    EquidistantValuesDialog* dlg = new EquidistantValuesDialog(m_spreadsheet);
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->setColumns(selectedColumns());
+    dlg->exec();
 }
 
 void SpreadsheetView::fillWithFunctionValues() {
-	if (selectedColumnCount() < 1) return;
-	FunctionValuesDialog* dlg = new FunctionValuesDialog(m_spreadsheet);
-	dlg->setAttribute(Qt::WA_DeleteOnClose);
-	dlg->setColumns(selectedColumns());
-	dlg->exec();
+    if (selectedColumnCount() < 1) return;
+    FunctionValuesDialog* dlg = new FunctionValuesDialog(m_spreadsheet);
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->setColumns(selectedColumns());
+    dlg->exec();
 }
 
 void SpreadsheetView::fillSelectedCellsWithConstValues(){
-	if (selectedColumnCount() < 1) return;
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 )
-		return;
-
-	bool doubleOk = false;
-	bool stringOk = false;
-	double doubleValue = 0;
-	QString stringValue;
-
-	m_spreadsheet->beginMacro(i18n("%1: fill cells with const values", \
                m_spreadsheet->name()));
-	foreach(Column* col_ptr, selectedColumns()) {
-		int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-		col_ptr->setSuppressDataChangedSignal(true);
-		switch (col_ptr->columnMode()) {
-			case AbstractColumn::Numeric: {
-				if (!doubleOk)
-					doubleValue = QInputDialog::getDouble(this, i18n("Fill the selection with \
                constant value"),
-															i18n("Value"), 0, -2147483647, 2147483647, 6, &doubleOk);
-				if (doubleOk) {
-					WAIT_CURSOR;
-					QVector<double> results(last-first+1);
-					for (int row=first; row<=last; row++) {
-						if(isCellSelected(row, col))
-							results[row-first] = doubleValue;
-						else
-							results[row-first] = col_ptr->valueAt(row);
-					}
-					col_ptr->replaceValues(first, results);
-					RESET_CURSOR;
-				}
-				break;
-			}
-			case AbstractColumn::Text: {
-				if (!stringOk)
-					stringValue = QInputDialog::getText(this, i18n("Fill the selection with \
                constant value"),
-															i18n("Value"), QLineEdit::Normal, 0, &stringOk);
-				if (stringOk && !stringValue.isEmpty()) {
-					WAIT_CURSOR;
-					QStringList results;
-					for (int row=first; row<=last; row++) {
-						if (isCellSelected(row, col))
-							results << stringValue;
-						else
-							results << col_ptr->textAt(row);
-					}
-					col_ptr->replaceTexts(first, results);
-					RESET_CURSOR;
-				}
-				break;
-				}
-			//TODO: handle other modes
-			default:
-				break;
-		}
-
-		col_ptr->setSuppressDataChangedSignal(false);
-		col_ptr->setChanged();
-	}
-	m_spreadsheet->endMacro();
+    if (selectedColumnCount() < 1) return;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 )
+        return;
+
+    bool doubleOk = false;
+    bool stringOk = false;
+    double doubleValue = 0;
+    QString stringValue;
+
+    m_spreadsheet->beginMacro(i18n("%1: fill cells with const values", \
m_spreadsheet->name())); +    foreach(Column* col_ptr, selectedColumns()) {
+        int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+        col_ptr->setSuppressDataChangedSignal(true);
+        switch (col_ptr->columnMode()) {
+            case AbstractColumn::Numeric: {
+                if (!doubleOk)
+                    doubleValue = QInputDialog::getDouble(this, i18n("Fill the \
selection with constant value"), +                                                    \
i18n("Value"), 0, -2147483647, 2147483647, 6, &doubleOk); +                if \
(doubleOk) { +                    WAIT_CURSOR;
+                    QVector<double> results(last-first+1);
+                    for (int row=first; row<=last; row++) {
+                        if(isCellSelected(row, col))
+                            results[row-first] = doubleValue;
+                        else
+                            results[row-first] = col_ptr->valueAt(row);
+                    }
+                    col_ptr->replaceValues(first, results);
+                    RESET_CURSOR;
+                }
+                break;
+            }
+            case AbstractColumn::Text: {
+                if (!stringOk)
+                    stringValue = QInputDialog::getText(this, i18n("Fill the \
selection with constant value"), +                                                    \
i18n("Value"), QLineEdit::Normal, 0, &stringOk); +                if (stringOk && \
!stringValue.isEmpty()) { +                    WAIT_CURSOR;
+                    QStringList results;
+                    for (int row=first; row<=last; row++) {
+                        if (isCellSelected(row, col))
+                            results << stringValue;
+                        else
+                            results << col_ptr->textAt(row);
+                    }
+                    col_ptr->replaceTexts(first, results);
+                    RESET_CURSOR;
+                }
+                break;
+                }
+            //TODO: handle other modes
+            default:
+                break;
+        }
+
+        col_ptr->setSuppressDataChangedSignal(false);
+        col_ptr->setChanged();
+    }
+    m_spreadsheet->endMacro();
 }
 
 /*!
-	Open the sort dialog for all columns.
+    Open the sort dialog for all columns.
 */
 void SpreadsheetView::sortSpreadsheet(){
-	sortDialog(m_spreadsheet->children<Column>());
+    sortDialog(m_spreadsheet->children<Column>());
 }
 
 /*!
   Insert columns depending on the selection.
  */
 void SpreadsheetView::insertEmptyColumns(){
-	int first = firstSelectedColumn();
-	if ( first < 0 ) return;
-	int last = lastSelectedColumn();
-	int count, current = first;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: insert empty columns", m_spreadsheet->name()));
-	int rows = m_spreadsheet->rowCount();
-	while( current <= last )
-	{
-		current = first+1;
-		while( current <= last && isColumnSelected(current) ) current++;
-		count = current-first;
-		Column *first_col = m_spreadsheet->child<Column>(first);
-		for (int i=0; i<count; i++)
-		{
-			Column * new_col = new Column(QString::number(i+1), AbstractColumn::Numeric);
-			new_col->setPlotDesignation(AbstractColumn::Y);
-			new_col->insertRows(0, rows);
-			m_spreadsheet->insertChildBefore(new_col, first_col);
-		}
-		current += count;
-		last += count;
-		while( current <= last && !isColumnSelected(current) ) current++;
-		first = current;
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    int first = firstSelectedColumn();
+    if ( first < 0 ) return;
+    int last = lastSelectedColumn();
+    int count, current = first;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: insert empty columns", \
m_spreadsheet->name())); +    int rows = m_spreadsheet->rowCount();
+    while( current <= last )
+    {
+        current = first+1;
+        while( current <= last && isColumnSelected(current) ) current++;
+        count = current-first;
+        Column *first_col = m_spreadsheet->child<Column>(first);
+        for (int i=0; i<count; i++)
+        {
+            Column * new_col = new Column(QString::number(i+1), \
AbstractColumn::Numeric); +            \
new_col->setPlotDesignation(AbstractColumn::Y); +            new_col->insertRows(0, \
rows); +            m_spreadsheet->insertChildBefore(new_col, first_col);
+        }
+        current += count;
+        last += count;
+        while( current <= last && !isColumnSelected(current) ) current++;
+        first = current;
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::removeSelectedColumns(){
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: remove selected columns", \
m_spreadsheet->name())); +    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: remove selected columns", \
m_spreadsheet->name()));  
-	QList< Column* > list = selectedColumns();
-	foreach(Column* ptr, list)
-		m_spreadsheet->removeChild(ptr);
+    QList< Column* > list = selectedColumns();
+    foreach(Column* ptr, list)
+        m_spreadsheet->removeChild(ptr);
 
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::clearSelectedColumns(){
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: clear selected columns", \
                m_spreadsheet->name()));
-
-	QList< Column* > list = selectedColumns();
-	if (formulaModeActive())	{
-		foreach(Column* ptr, list) {
-			ptr->setSuppressDataChangedSignal(true);
-			ptr->clearFormulas();
-			ptr->setSuppressDataChangedSignal(false);
-			ptr->setChanged();
-		}
-	}else{
-		foreach(Column* ptr, list) {
-			ptr->setSuppressDataChangedSignal(true);
-			ptr->clear();
-			ptr->setSuppressDataChangedSignal(false);
-			ptr->setChanged();
-		}
-	}
-
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: clear selected columns", \
m_spreadsheet->name())); +
+    QList< Column* > list = selectedColumns();
+    if (formulaModeActive())	{
+        foreach(Column* ptr, list) {
+            ptr->setSuppressDataChangedSignal(true);
+            ptr->clearFormulas();
+            ptr->setSuppressDataChangedSignal(false);
+            ptr->setChanged();
+        }
+    }else{
+        foreach(Column* ptr, list) {
+            ptr->setSuppressDataChangedSignal(true);
+            ptr->clear();
+            ptr->setSuppressDataChangedSignal(false);
+            ptr->setChanged();
+        }
+    }
+
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::setSelectionAs(AbstractColumn::PlotDesignation pd){
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: set plot designation", m_spreadsheet->name()));
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: set plot designation", \
m_spreadsheet->name()));  
-	QList< Column* > list = selectedColumns();
-	foreach(Column* ptr, list)
-		ptr->setPlotDesignation(pd);
+    QList< Column* > list = selectedColumns();
+    foreach(Column* ptr, list)
+        ptr->setPlotDesignation(pd);
 
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::setSelectedColumnsAsX(){
-	setSelectionAs(AbstractColumn::X);
+    setSelectionAs(AbstractColumn::X);
 }
 
 void SpreadsheetView::setSelectedColumnsAsY(){
-	setSelectionAs(AbstractColumn::Y);
+    setSelectionAs(AbstractColumn::Y);
 }
 
 void SpreadsheetView::setSelectedColumnsAsZ(){
-	setSelectionAs(AbstractColumn::Z);
+    setSelectionAs(AbstractColumn::Z);
 }
 
 void SpreadsheetView::setSelectedColumnsAsYError(){
-	setSelectionAs(AbstractColumn::yErr);
+    setSelectionAs(AbstractColumn::yErr);
 }
 
 void SpreadsheetView::setSelectedColumnsAsXError(){
-	setSelectionAs(AbstractColumn::xErr);
+    setSelectionAs(AbstractColumn::xErr);
 }
 
 void SpreadsheetView::setSelectedColumnsAsNone(){
-	setSelectionAs(AbstractColumn::noDesignation);
+    setSelectionAs(AbstractColumn::noDesignation);
 }
 
 void SpreadsheetView::normalizeSelectedColumns(){
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: normalize columns", m_spreadsheet->name()));
-	QList< Column* > cols = selectedColumns();
-	foreach(Column* col, cols)	{
-		if (col->columnMode() == AbstractColumn::Numeric) {
-			col->setSuppressDataChangedSignal(true);
-			double max = col->maximum();
-			if (max != 0.0) {// avoid division by zero
-				for (int row=0; row<col->rowCount(); row++)
-					col->setValueAt(row, col->valueAt(row) / max);
-			}
-			col->setSuppressDataChangedSignal(false);
-			col->setChanged();
-		}
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: normalize columns", m_spreadsheet->name()));
+    QList< Column* > cols = selectedColumns();
+    foreach(Column* col, cols)	{
+        if (col->columnMode() == AbstractColumn::Numeric) {
+            col->setSuppressDataChangedSignal(true);
+            double max = col->maximum();
+            if (max != 0.0) {// avoid division by zero
+                for (int row=0; row<col->rowCount(); row++)
+                    col->setValueAt(row, col->valueAt(row) / max);
+            }
+            col->setSuppressDataChangedSignal(false);
+            col->setChanged();
+        }
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::normalizeSelection(){
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: normalize selection", m_spreadsheet->name()));
-	double max = 0.0;
-	for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
-		if (m_spreadsheet->column(col)->columnMode() == AbstractColumn::Numeric)
-			for (int row=0; row<m_spreadsheet->rowCount(); row++)
-			{
-				if (isCellSelected(row, col) && m_spreadsheet->column(col)->valueAt(row) > max)
-					max = m_spreadsheet->column(col)->valueAt(row);
-			}
-
-	if (max != 0.0) // avoid division by zero
-	{
-		//TODO setSuppressDataChangedSignal
-		for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
-			if (m_spreadsheet->column(col)->columnMode() == AbstractColumn::Numeric)
-				for (int row=0; row<m_spreadsheet->rowCount(); row++)
-				{
-					if (isCellSelected(row, col))
-						m_spreadsheet->column(col)->setValueAt(row, \
                m_spreadsheet->column(col)->valueAt(row) / max);
-				}
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: normalize selection", \
m_spreadsheet->name())); +    double max = 0.0;
+    for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
+        if (m_spreadsheet->column(col)->columnMode() == AbstractColumn::Numeric)
+            for (int row=0; row<m_spreadsheet->rowCount(); row++)
+            {
+                if (isCellSelected(row, col) && \
m_spreadsheet->column(col)->valueAt(row) > max) +                    max = \
m_spreadsheet->column(col)->valueAt(row); +            }
+
+    if (max != 0.0) // avoid division by zero
+    {
+        //TODO setSuppressDataChangedSignal
+        for (int col=firstSelectedColumn(); col<=lastSelectedColumn(); col++)
+            if (m_spreadsheet->column(col)->columnMode() == AbstractColumn::Numeric)
+                for (int row=0; row<m_spreadsheet->rowCount(); row++)
+                {
+                    if (isCellSelected(row, col))
+                        m_spreadsheet->column(col)->setValueAt(row, \
m_spreadsheet->column(col)->valueAt(row) / max); +                }
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::sortSelectedColumns(){
-	QList< Column* > cols = selectedColumns();
-	sortDialog(cols);
+    QList< Column* > cols = selectedColumns();
+    sortDialog(cols);
 }
 
 
 // TODO
 void SpreadsheetView::statisticsOnSelectedColumns(){
-	QMessageBox::information(0, "info", "not yet implemented");
+    QMessageBox::information(0, "info", "not yet implemented");
 }
 
 // TODO
 void SpreadsheetView::statisticsOnSelectedRows(){
-	QMessageBox::information(0, "info", "not yet implemented");
+    QMessageBox::information(0, "info", "not yet implemented");
 }
 
 /*!
   Insert rows depending on the selection.
 */
 void SpreadsheetView::insertEmptyRows(){
-	int first = firstSelectedRow();
-	if ( first < 0 ) return;
-	int last = lastSelectedRow();
-	int count, current = first;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: insert empty rows", m_spreadsheet->name()));
-	while( current <= last ){
-		current = first+1;
-		while( current <= last && isRowSelected(current) ) current++;
-		count = current-first;
-		m_spreadsheet->insertRows(first, count);
-		current += count;
-		last += count;
-		while( current <= last && !isRowSelected(current) ) current++;
-		first = current;
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    int first = firstSelectedRow();
+    if ( first < 0 ) return;
+    int last = lastSelectedRow();
+    int count, current = first;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: insert empty rows", m_spreadsheet->name()));
+    while( current <= last ){
+        current = first+1;
+        while( current <= last && isRowSelected(current) ) current++;
+        count = current-first;
+        m_spreadsheet->insertRows(first, count);
+        current += count;
+        last += count;
+        while( current <= last && !isRowSelected(current) ) current++;
+        first = current;
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::removeSelectedRows(){
-	if ( firstSelectedRow() < 0 ) return;
+    if ( firstSelectedRow() < 0 ) return;
 
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: remove selected rows", m_spreadsheet->name()));
-	//TODO setSuppressDataChangedSignal
-	foreach(const Interval<int>& i, selectedRows().intervals())
-		m_spreadsheet->removeRows(i.start(), i.size());
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: remove selected rows", \
m_spreadsheet->name())); +    //TODO setSuppressDataChangedSignal
+    foreach(const Interval<int>& i, selectedRows().intervals())
+        m_spreadsheet->removeRows(i.start(), i.size());
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::clearSelectedRows(){
-	if ( firstSelectedRow() < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: clear selected rows", m_spreadsheet->name()));
-	QList<Column*> list = selectedColumns();
-	foreach(Column* col_ptr, list) {
-		col_ptr->setSuppressDataChangedSignal(true);
-		if (formulaModeActive()) {
-			foreach(const Interval<int>& i, selectedRows().intervals())
-				col_ptr->setFormula(i, "");
-		} else {
-			foreach(const Interval<int>& i, selectedRows().intervals()) {
-				if (i.end() == col_ptr->rowCount()-1)
-					col_ptr->removeRows(i.start(), i.size());
-				else {
-					QStringList empties;
-					for (int j=0; j<i.size(); j++)
-						empties << QString();
-					col_ptr->asStringColumn()->replaceTexts(i.start(), empties);
-				}
-			}
-		}
-
-		col_ptr->setSuppressDataChangedSignal(false);
-		col_ptr->setChanged();
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    if ( firstSelectedRow() < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: clear selected rows", \
m_spreadsheet->name())); +    QList<Column*> list = selectedColumns();
+    foreach(Column* col_ptr, list) {
+        col_ptr->setSuppressDataChangedSignal(true);
+        if (formulaModeActive()) {
+            foreach(const Interval<int>& i, selectedRows().intervals())
+                col_ptr->setFormula(i, "");
+        } else {
+            foreach(const Interval<int>& i, selectedRows().intervals()) {
+                if (i.end() == col_ptr->rowCount()-1)
+                    col_ptr->removeRows(i.start(), i.size());
+                else {
+                    QStringList empties;
+                    for (int j=0; j<i.size(); j++)
+                        empties << QString();
+                    col_ptr->asStringColumn()->replaceTexts(i.start(), empties);
+                }
+            }
+        }
+
+        col_ptr->setSuppressDataChangedSignal(false);
+        col_ptr->setChanged();
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::clearSelectedCells(){
-	int first = firstSelectedRow();
-	int last = lastSelectedRow();
-	if ( first < 0 ) return;
-
-	WAIT_CURSOR;
-	m_spreadsheet->beginMacro(i18n("%1: clear selected cells", m_spreadsheet->name()));
-	QList<Column*> list = selectedColumns();
-	foreach(Column* col_ptr, list) {
-		col_ptr->setSuppressDataChangedSignal(true);
-		if (formulaModeActive())
-		{
-			int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-			for (int row=last; row>=first; row--)
-				if (isCellSelected(row, col))
-				{
-					col_ptr->setFormula(row, "");
-				}
-		}
-		else
-		{
-			int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
-			for (int row=last; row>=first; row--)
-				if (isCellSelected(row, col))
-				{
-					if (row < col_ptr->rowCount())
-						col_ptr->asStringColumn()->setTextAt(row, QString());
-				}
-		}
-		col_ptr->setSuppressDataChangedSignal(false);
-		col_ptr->setChanged();
-	}
-	m_spreadsheet->endMacro();
-	RESET_CURSOR;
+    int first = firstSelectedRow();
+    int last = lastSelectedRow();
+    if ( first < 0 ) return;
+
+    WAIT_CURSOR;
+    m_spreadsheet->beginMacro(i18n("%1: clear selected cells", \
m_spreadsheet->name())); +    QList<Column*> list = selectedColumns();
+    foreach(Column* col_ptr, list) {
+        col_ptr->setSuppressDataChangedSignal(true);
+        if (formulaModeActive())
+        {
+            int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+            for (int row=last; row>=first; row--)
+                if (isCellSelected(row, col))
+                {
+                    col_ptr->setFormula(row, "");
+                }
+        }
+        else
+        {
+            int col = m_spreadsheet->indexOfChild<Column>(col_ptr);
+            for (int row=last; row>=first; row--)
+                if (isCellSelected(row, col))
+                {
+                    if (row < col_ptr->rowCount())
+                        col_ptr->asStringColumn()->setTextAt(row, QString());
+                }
+        }
+        col_ptr->setSuppressDataChangedSignal(false);
+        col_ptr->setChanged();
+    }
+    m_spreadsheet->endMacro();
+    RESET_CURSOR;
 }
 
 void SpreadsheetView::goToCell(){
-	bool ok;
+    bool ok;
 
-	int col = QInputDialog::getInteger(0, i18n("Go to Cell"), i18n("Enter column"),
-			1, 1, m_spreadsheet->columnCount(), 1, &ok);
-	if ( !ok ) return;
+    int col = QInputDialog::getInteger(0, i18n("Go to Cell"), i18n("Enter column"),
+            1, 1, m_spreadsheet->columnCount(), 1, &ok);
+    if ( !ok ) return;
 
-	int row = QInputDialog::getInteger(0, i18n("Go to Cell"), i18n("Enter row"),
-			1, 1, m_spreadsheet->rowCount(), 1, &ok);
-	if ( !ok ) return;
+    int row = QInputDialog::getInteger(0, i18n("Go to Cell"), i18n("Enter row"),
+            1, 1, m_spreadsheet->rowCount(), 1, &ok);
+    if ( !ok ) return;
 
-	goToCell(row-1, col-1);
+    goToCell(row-1, col-1);
 }
 
 //! Open the sort dialog for the given columns
 void SpreadsheetView::sortDialog(QList<Column*> cols){
-	if (cols.isEmpty()) return;
+    if (cols.isEmpty()) return;
 
-	foreach(Column* col, cols)
-		col->setSuppressDataChangedSignal(true);
+    foreach(Column* col, cols)
+        col->setSuppressDataChangedSignal(true);
 
-	SortDialog* dlg = new SortDialog();
-	dlg->setAttribute(Qt::WA_DeleteOnClose);
-	connect(dlg, SIGNAL(sort(Column*,QList<Column*>,bool)), m_spreadsheet, \
                SLOT(sortColumns(Column*,QList<Column*>,bool)));
-	dlg->setColumnsList(cols);
-	int rc = dlg->exec();
+    SortDialog* dlg = new SortDialog();
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    connect(dlg, SIGNAL(sort(Column*,QList<Column*>,bool)), m_spreadsheet, \
SLOT(sortColumns(Column*,QList<Column*>,bool))); +    dlg->setColumnsList(cols);
+    int rc = dlg->exec();
 
-	foreach(Column* col, cols) {
-		col->setSuppressDataChangedSignal(false);
-		if (rc==QDialog::Accepted)
-			col->setChanged();
-	}
+    foreach(Column* col, cols) {
+        col->setSuppressDataChangedSignal(false);
+        if (rc==QDialog::Accepted)
+            col->setChanged();
+    }
 }
 
 void SpreadsheetView::sortColumnAscending(){
-	QList< Column* > cols = selectedColumns();
-	foreach(Column* col, cols) {
-		col->setSuppressDataChangedSignal(true);
-	}
-	m_spreadsheet->sortColumns(cols.first(), cols, true);
-	foreach(Column* col, cols) {
-		col->setSuppressDataChangedSignal(false);
-		col->setChanged();
-	}
+    QList< Column* > cols = selectedColumns();
+    foreach(Column* col, cols) {
+        col->setSuppressDataChangedSignal(true);
+    }
+    m_spreadsheet->sortColumns(cols.first(), cols, true);
+    foreach(Column* col, cols) {
+        col->setSuppressDataChangedSignal(false);
+        col->setChanged();
+    }
 }
 
 void SpreadsheetView::sortColumnDescending(){
-	QList< Column* > cols = selectedColumns();
-	foreach(Column* col, cols) {
-		col->setSuppressDataChangedSignal(true);
-	}
-	m_spreadsheet->sortColumns(cols.first(), cols, false);
-	foreach(Column* col, cols) {
-		col->setSuppressDataChangedSignal(false);
-		col->setChanged();
-	}
+    QList< Column* > cols = selectedColumns();
+    foreach(Column* col, cols) {
+        col->setSuppressDataChangedSignal(true);
+    }
+    m_spreadsheet->sortColumns(cols.first(), cols, false);
+    foreach(Column* col, cols) {
+        col->setSuppressDataChangedSignal(false);
+        col->setChanged();
+    }
 }
 
 /*!
   Append as many columns as are selected.
 */
 void SpreadsheetView::addColumns(){
-	m_spreadsheet->appendColumns(selectedColumnCount(false));
+    m_spreadsheet->appendColumns(selectedColumnCount(false));
 }
 
 /*!
   Append as many rows as are selected.
 */
 void SpreadsheetView::addRows(){
-	m_spreadsheet->appendRows(selectedRowCount(false));
+    m_spreadsheet->appendRows(selectedRowCount(false));
 }
 
 /*!
   Cause a repaint of the header.
 */
 void SpreadsheetView::updateHeaderGeometry(Qt::Orientation o, int first, int last){
-	Q_UNUSED(first)
-	Q_UNUSED(last)
-	//TODO
-	if (o != Qt::Horizontal) return;
-	m_tableView->horizontalHeader()->setStretchLastSection(true);  // ugly hack (flaw \
                in Qt? Does anyone know a better way?)
-	m_tableView->horizontalHeader()->updateGeometry();
-	m_tableView->horizontalHeader()->setStretchLastSection(false); // ugly hack part 2
+    Q_UNUSED(first)
+    Q_UNUSED(last)
+    //TODO
+    if (o != Qt::Horizontal) return;
+    m_tableView->horizontalHeader()->setStretchLastSection(true);  // ugly hack \
(flaw in Qt? Does anyone know a better way?) +    \
m_tableView->horizontalHeader()->updateGeometry(); +    \
m_tableView->horizontalHeader()->setStretchLastSection(false); // ugly hack part 2  }
 
 void SpreadsheetView::keyPressEvent(QKeyEvent * event){
     if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
-	  advanceCell();
+      advanceCell();
 }
 
 /*!
@@ -1583,11 +1584,11 @@ void SpreadsheetView::columnClicked(int column){
   Q_UNUSED(deselected);
 
   if (m_suppressSelectionChangedEvent)
-	  return;
+      return;
 
   QItemSelectionModel* selModel = m_tableView->selectionModel();
   for (int i=0; i<m_spreadsheet->columnCount(); i++){
-	m_spreadsheet->setColumnSelectedInView(i, selModel->isColumnSelected(i, \
QModelIndex())); +    m_spreadsheet->setColumnSelectedInView(i, \
selModel->isColumnSelected(i, QModelIndex()));  }
 }
 
@@ -1595,118 +1596,118 @@ void SpreadsheetView::columnClicked(int column){
   prints the complete spreadsheet to \c printer.
  */
 void SpreadsheetView::print(QPrinter* printer) const{
-	QPainter painter (printer);
-
-	int dpiy = printer->logicalDpiY();
-	const int margin = (int) ( (1/2.54)*dpiy ); // 1 cm margins
-
-	QHeaderView *hHeader = m_tableView->horizontalHeader();
-	QHeaderView *vHeader = m_tableView->verticalHeader();
-
-	int rows = m_spreadsheet->rowCount();
-	int cols = m_spreadsheet->columnCount();
-	int height = margin;
-	int i;
-	int vertHeaderWidth = vHeader->width();
-	int right = margin + vertHeaderWidth;
-
-	//Paint the horizontal header first
-	painter.setFont(hHeader->font());
-	QString headerString = m_tableView->model()->headerData(0, \
                Qt::Horizontal).toString();
-	QRect br = painter.boundingRect(br, Qt::AlignCenter, headerString);
-	painter.drawLine(right, height, right, height+br.height());
-	QRect tr(br);
-
-	int w;
-	for (i=0; i<cols; ++i) {
-		headerString = m_tableView->model()->headerData(i, Qt::Horizontal).toString();
-		w = m_tableView->columnWidth(i);
-		tr.setTopLeft(QPoint(right,height));
-		tr.setWidth(w);
-		tr.setHeight(br.height());
-
- 		painter.drawText(tr, Qt::AlignCenter, headerString);
-		right += w;
-		painter.drawLine(right, height, right, height+tr.height());
-
-		if (right >= printer->pageRect().width()-2*margin )
-			break;
-	}
-
-	painter.drawLine(margin + vertHeaderWidth, height, right-1, height);//first \
                horizontal line
-	height += tr.height();
-	painter.drawLine(margin, height, right-1, height);
-
-
-	// print table values
-	QString cellText;
-	for (i=0; i<rows; ++i) {
-		right = margin;
-		cellText = m_tableView->model()->headerData(i, Qt::Vertical).toString()+'\t';
-		tr = painter.boundingRect(tr, Qt::AlignCenter, cellText);
-		painter.drawLine(right, height, right, height+tr.height());
-
-		br.setTopLeft(QPoint(right,height));
-		br.setWidth(vertHeaderWidth);
-		br.setHeight(tr.height());
-		painter.drawText(br, Qt::AlignCenter, cellText);
-		right += vertHeaderWidth;
-		painter.drawLine(right, height, right, height+tr.height());
-
-		for(int j=0;j<cols;j++){
-			int w = m_tableView->columnWidth(j);
-			cellText = m_spreadsheet->text(i,j)+'\t';
-			tr = painter.boundingRect(tr,Qt::AlignCenter,cellText);
-			br.setTopLeft(QPoint(right,height));
-			br.setWidth(w);
-			br.setHeight(tr.height());
-			painter.drawText(br, Qt::AlignCenter, cellText);
-			right += w;
-			painter.drawLine(right, height, right, height+tr.height());
-
-			if (right >= printer->width()-2*margin )
-				break;
-		}
-		height += br.height();
-		painter.drawLine(margin, height, right-1, height);
-
-		if (height >= printer->height()-margin ){
-			printer->newPage();
-			height = margin;
-			painter.drawLine(margin, height, right, height);
-		}
-	}
+    QPainter painter (printer);
+
+    int dpiy = printer->logicalDpiY();
+    const int margin = (int) ( (1/2.54)*dpiy ); // 1 cm margins
+
+    QHeaderView *hHeader = m_tableView->horizontalHeader();
+    QHeaderView *vHeader = m_tableView->verticalHeader();
+
+    int rows = m_spreadsheet->rowCount();
+    int cols = m_spreadsheet->columnCount();
+    int height = margin;
+    int i;
+    int vertHeaderWidth = vHeader->width();
+    int right = margin + vertHeaderWidth;
+
+    //Paint the horizontal header first
+    painter.setFont(hHeader->font());
+    QString headerString = m_tableView->model()->headerData(0, \
Qt::Horizontal).toString(); +    QRect br = painter.boundingRect(br, Qt::AlignCenter, \
headerString); +    painter.drawLine(right, height, right, height+br.height());
+    QRect tr(br);
+
+    int w;
+    for (i=0; i<cols; ++i) {
+        headerString = m_tableView->model()->headerData(i, \
Qt::Horizontal).toString(); +        w = m_tableView->columnWidth(i);
+        tr.setTopLeft(QPoint(right,height));
+        tr.setWidth(w);
+        tr.setHeight(br.height());
+
+        painter.drawText(tr, Qt::AlignCenter, headerString);
+        right += w;
+        painter.drawLine(right, height, right, height+tr.height());
+
+        if (right >= printer->pageRect().width()-2*margin )
+            break;
+    }
+
+    painter.drawLine(margin + vertHeaderWidth, height, right-1, height);//first \
horizontal line +    height += tr.height();
+    painter.drawLine(margin, height, right-1, height);
+
+
+    // print table values
+    QString cellText;
+    for (i=0; i<rows; ++i) {
+        right = margin;
+        cellText = m_tableView->model()->headerData(i, \
Qt::Vertical).toString()+'\t'; +        tr = painter.boundingRect(tr, \
Qt::AlignCenter, cellText); +        painter.drawLine(right, height, right, \
height+tr.height()); +
+        br.setTopLeft(QPoint(right,height));
+        br.setWidth(vertHeaderWidth);
+        br.setHeight(tr.height());
+        painter.drawText(br, Qt::AlignCenter, cellText);
+        right += vertHeaderWidth;
+        painter.drawLine(right, height, right, height+tr.height());
+
+        for(int j=0;j<cols;j++){
+            int w = m_tableView->columnWidth(j);
+            cellText = m_spreadsheet->text(i,j)+'\t';
+            tr = painter.boundingRect(tr,Qt::AlignCenter,cellText);
+            br.setTopLeft(QPoint(right,height));
+            br.setWidth(w);
+            br.setHeight(tr.height());
+            painter.drawText(br, Qt::AlignCenter, cellText);
+            right += w;
+            painter.drawLine(right, height, right, height+tr.height());
+
+            if (right >= printer->width()-2*margin )
+                break;
+        }
+        height += br.height();
+        painter.drawLine(margin, height, right-1, height);
+
+        if (height >= printer->height()-margin ){
+            printer->newPage();
+            height = margin;
+            painter.drawLine(margin, height, right, height);
+        }
+    }
 }
 
 void SpreadsheetView::exportToFile(const QString& path, const bool exportHeader, \
                const QString& separator) const {
-	QFile file(path);
-	if (!file.open(QFile::WriteOnly | QFile::Truncate))
-		return;
-
-	QTextStream out(&file);
-	const int cols = m_spreadsheet->columnCount();
-
-	QString sep = separator;
-	sep = sep.replace(QString("TAB"), QString("\t"), Qt::CaseInsensitive);
-	sep = sep.replace(QString("SPACE"), QString(" "), Qt::CaseInsensitive);
-
-	//export header (column names)
-	if (exportHeader) {
-		for (int j=0; j<cols; ++j) {
-			out << m_spreadsheet->column(j)->name();
-			if (j!=cols-1)
-				out<<sep;
-		}
-		out << '\n';
-	}
-
-	//export values
-	for (int i=0; i<m_spreadsheet->rowCount(); ++i) {
-		for (int j=0; j<cols; ++j) {
-			out << m_spreadsheet->column(j)->asStringColumn()->textAt(i);
-			if (j!=cols-1)
-				out<<sep;
-		}
-		out << '\n';
-	}
+    QFile file(path);
+    if (!file.open(QFile::WriteOnly | QFile::Truncate))
+        return;
+
+    QTextStream out(&file);
+    const int cols = m_spreadsheet->columnCount();
+
+    QString sep = separator;
+    sep = sep.replace(QString("TAB"), QString("\t"), Qt::CaseInsensitive);
+    sep = sep.replace(QString("SPACE"), QString(" "), Qt::CaseInsensitive);
+
+    //export header (column names)
+    if (exportHeader) {
+        for (int j=0; j<cols; ++j) {
+            out << m_spreadsheet->column(j)->name();
+            if (j!=cols-1)
+                out<<sep;
+        }
+        out << '\n';
+    }
+
+    //export values
+    for (int i=0; i<m_spreadsheet->rowCount(); ++i) {
+        for (int j=0; j<cols; ++j) {
+            out << m_spreadsheet->column(j)->asStringColumn()->textAt(i);
+            if (j!=cols-1)
+                out<<sep;
+        }
+        out << '\n';
+    }
 }
diff --git a/src/commonfrontend/worksheet/WorksheetView.cpp \
b/src/commonfrontend/worksheet/WorksheetView.cpp index 55d3f17..6682bd2 100644
--- a/src/commonfrontend/worksheet/WorksheetView.cpp
+++ b/src/commonfrontend/worksheet/WorksheetView.cpp
@@ -50,7 +50,7 @@
 #include <QGraphicsOpacityEffect>
 #include <QTimeLine>
 
-#include <KAction>
+#include <QAction>
 #include <KLocale>
 #include <KMessageBox>
 
@@ -64,345 +64,345 @@
   Creates a view for the Worksheet \c worksheet and initializes the internal model.
 */
 WorksheetView::WorksheetView(Worksheet* worksheet) : QGraphicsView(),
-	m_worksheet(worksheet),
-	m_mouseMode(SelectionMode),
-	m_cartesianPlotActionMode(ApplyActionToSelection),
-	m_cartesianPlotMouseMode(CartesianPlot::SelectionMode),
-	m_selectionBandIsShown(false),
-	m_suppressSelectionChangedEvent(false),
-	lastAddedWorksheetElement(0),
-	m_fadeInTimeLine(0),
-	m_fadeOutTimeLine(0),
-	tbNewCartesianPlot(0),
-	tbZoom(0) {
-
-	setScene(m_worksheet->scene());
-
-	setRenderHint(QPainter::Antialiasing);
-	setRubberBandSelectionMode(Qt::ContainsItemBoundingRect);
-	setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
-	setResizeAnchor(QGraphicsView::AnchorViewCenter);
-	setMinimumSize(16, 16);
-	setFocusPolicy(Qt::StrongFocus);
-
-	if (m_worksheet->useViewSize()) {
-		setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-		setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-	}
-
-	viewport()->setAttribute( Qt::WA_OpaquePaintEvent );
-	viewport()->setAttribute( Qt::WA_NoSystemBackground );
+    m_worksheet(worksheet),
+    m_mouseMode(SelectionMode),
+    m_cartesianPlotActionMode(ApplyActionToSelection),
+    m_cartesianPlotMouseMode(CartesianPlot::SelectionMode),
+    m_selectionBandIsShown(false),
+    m_suppressSelectionChangedEvent(false),
+    lastAddedWorksheetElement(0),
+    m_fadeInTimeLine(0),
+    m_fadeOutTimeLine(0),
+    tbNewCartesianPlot(0),
+    tbZoom(0) {
+
+    setScene(m_worksheet->scene());
+
+    setRenderHint(QPainter::Antialiasing);
+    setRubberBandSelectionMode(Qt::ContainsItemBoundingRect);
+    setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
+    setResizeAnchor(QGraphicsView::AnchorViewCenter);
+    setMinimumSize(16, 16);
+    setFocusPolicy(Qt::StrongFocus);
+
+    if (m_worksheet->useViewSize()) {
+        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    }
+
+    viewport()->setAttribute( Qt::WA_OpaquePaintEvent );
+    viewport()->setAttribute( Qt::WA_NoSystemBackground );
 // 	setAcceptDrops( true );
-	setCacheMode(QGraphicsView::CacheBackground);
-
-	m_gridSettings.style = WorksheetView::NoGrid;
-
-	initActions();
-	initMenus();
-	selectionModeAction->setChecked(true);
-	handleCartesianPlotActions();
-
-	changeZoom(zoomOriginAction);
-	currentZoomAction=zoomInViewAction;
-
-	//signal/slot connections
-	connect(m_worksheet, SIGNAL(requestProjectContextMenu(QMenu*)), this, \
                SLOT(createContextMenu(QMenu*)));
-	connect(m_worksheet, SIGNAL(itemSelected(QGraphicsItem*)), this, \
                SLOT(selectItem(QGraphicsItem*)) );
-	connect(m_worksheet, SIGNAL(itemDeselected(QGraphicsItem*)), this, \
                SLOT(deselectItem(QGraphicsItem*)) );
-	connect(m_worksheet, SIGNAL(itemSelected(QGraphicsItem*)), this, \
                SLOT(selectItem(QGraphicsItem*)) );
-	connect(m_worksheet, SIGNAL(itemDeselected(QGraphicsItem*)), this, \
                SLOT(deselectItem(QGraphicsItem*)) );
-	connect(m_worksheet, SIGNAL(requestUpdate()), this, SLOT(updateBackground()) );
-	connect(m_worksheet, SIGNAL(aspectAboutToBeRemoved(const AbstractAspect*)), this, \
                SLOT(aspectAboutToBeRemoved(const AbstractAspect*)));
-	connect(m_worksheet, SIGNAL(useViewSizeRequested()), this, \
                SLOT(useViewSizeRequested()) );
-	connect(m_worksheet, SIGNAL(layoutChanged(Worksheet::Layout)), this, \
                SLOT(layoutChanged(Worksheet::Layout)) );
-	connect(scene(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged()) );
+    setCacheMode(QGraphicsView::CacheBackground);
+
+    m_gridSettings.style = WorksheetView::NoGrid;
+
+    initActions();
+    initMenus();
+    selectionModeAction->setChecked(true);
+    handleCartesianPlotActions();
+
+    changeZoom(zoomOriginAction);
+    currentZoomAction=zoomInViewAction;
+
+    //signal/slot connections
+    connect(m_worksheet, SIGNAL(requestProjectContextMenu(QMenu*)), this, \
SLOT(createContextMenu(QMenu*))); +    connect(m_worksheet, \
SIGNAL(itemSelected(QGraphicsItem*)), this, SLOT(selectItem(QGraphicsItem*)) ); +    \
connect(m_worksheet, SIGNAL(itemDeselected(QGraphicsItem*)), this, \
SLOT(deselectItem(QGraphicsItem*)) ); +    connect(m_worksheet, \
SIGNAL(itemSelected(QGraphicsItem*)), this, SLOT(selectItem(QGraphicsItem*)) ); +    \
connect(m_worksheet, SIGNAL(itemDeselected(QGraphicsItem*)), this, \
SLOT(deselectItem(QGraphicsItem*)) ); +    connect(m_worksheet, \
SIGNAL(requestUpdate()), this, SLOT(updateBackground()) ); +    connect(m_worksheet, \
SIGNAL(aspectAboutToBeRemoved(const AbstractAspect*)), this, \
SLOT(aspectAboutToBeRemoved(const AbstractAspect*))); +    connect(m_worksheet, \
SIGNAL(useViewSizeRequested()), this, SLOT(useViewSizeRequested()) ); +    \
connect(m_worksheet, SIGNAL(layoutChanged(Worksheet::Layout)), this, \
SLOT(layoutChanged(Worksheet::Layout)) ); +    connect(scene(), \
SIGNAL(selectionChanged()), this, SLOT(selectionChanged()) );  }
 
 void WorksheetView::initActions(){
-	QActionGroup* addNewActionGroup = new QActionGroup(this);
-	QActionGroup* zoomActionGroup = new QActionGroup(this);
-	QActionGroup* mouseModeActionGroup = new QActionGroup(this);
-	QActionGroup* layoutActionGroup = new QActionGroup(this);
-	QActionGroup* gridActionGroup = new QActionGroup(this);
-	gridActionGroup->setExclusive(true);
-
-	selectAllAction = new KAction(KIcon("edit-select-all"), i18n("Select all"), this);
-	selectAllAction->setShortcut(Qt::CTRL+Qt::Key_A);
-	this->addAction(selectAllAction);
-	connect(selectAllAction, SIGNAL(triggered()), SLOT(selectAllElements()));
-
-	deleteAction = new KAction(KIcon("edit-delete"), i18n("Delete"), this);
-	deleteAction->setShortcut(Qt::Key_Delete);
-	this->addAction(deleteAction);
-	connect(deleteAction, SIGNAL(triggered()), SLOT(deleteElement()));
-
-	backspaceAction = new KAction(this);
-	backspaceAction->setShortcut(Qt::Key_Backspace);
-	this->addAction(backspaceAction);
-	connect(backspaceAction, SIGNAL(triggered()), SLOT(deleteElement()));
-
-	//Zoom actions
-	zoomInViewAction = new KAction(KIcon("zoom-in"), i18n("Zoom in"), zoomActionGroup);
-	zoomInViewAction->setShortcut(Qt::CTRL+Qt::Key_Plus);
-
-	zoomOutViewAction = new KAction(KIcon("zoom-out"), i18n("Zoom out"), \
                zoomActionGroup);
-	zoomOutViewAction->setShortcut(Qt::CTRL+Qt::Key_Minus);
-
-	zoomOriginAction = new KAction(KIcon("zoom-original"), i18n("Original size"), \
                zoomActionGroup);
-	zoomOriginAction->setShortcut(Qt::CTRL+Qt::Key_1);
-
-	zoomFitPageHeightAction = new KAction(KIcon("zoom-fit-height"), i18n("Fit to \
                height"), zoomActionGroup);
-	zoomFitPageWidthAction = new KAction(KIcon("zoom-fit-width"), i18n("Fit to width"), \
                zoomActionGroup);
-	zoomFitSelectionAction = new KAction(i18n("Fit to selection"), zoomActionGroup);
-
-	// Mouse mode actions
-	selectionModeAction = new KAction(KIcon("cursor-arrow"), i18n("Select and Edit"), \
                mouseModeActionGroup);
-	selectionModeAction->setCheckable(true);
-
-	navigationModeAction = new KAction(KIcon("input-mouse"), i18n("Navigate"), \
                mouseModeActionGroup);
-	navigationModeAction->setCheckable(true);
-
-	zoomSelectionModeAction = new KAction(KIcon("page-zoom"), i18n("Select and Zoom"), \
                mouseModeActionGroup);
-	zoomSelectionModeAction->setCheckable(true);
-
-	//TODO implement later "group selection action" where multiple objects can be \
                selected by drawing a rectangular
-// 	selectionModeAction = new KAction(KIcon("select-rectangular"), \
i18n("Selection"), mouseModeActionGroup); +    QActionGroup* addNewActionGroup = new \
QActionGroup(this); +    QActionGroup* zoomActionGroup = new QActionGroup(this);
+    QActionGroup* mouseModeActionGroup = new QActionGroup(this);
+    QActionGroup* layoutActionGroup = new QActionGroup(this);
+    QActionGroup* gridActionGroup = new QActionGroup(this);
+    gridActionGroup->setExclusive(true);
+
+    selectAllAction = new QAction(QIcon("edit-select-all"), i18n("Select all"), \
this); +    selectAllAction->setShortcut(Qt::CTRL+Qt::Key_A);
+    this->addAction(selectAllAction);
+    connect(selectAllAction, SIGNAL(triggered()), SLOT(selectAllElements()));
+
+    deleteAction = new QAction(QIcon("edit-delete"), i18n("Delete"), this);
+    deleteAction->setShortcut(Qt::Key_Delete);
+    this->addAction(deleteAction);
+    connect(deleteAction, SIGNAL(triggered()), SLOT(deleteElement()));
+
+    backspaceAction = new QAction(this);
+    backspaceAction->setShortcut(Qt::Key_Backspace);
+    this->addAction(backspaceAction);
+    connect(backspaceAction, SIGNAL(triggered()), SLOT(deleteElement()));
+
+    //Zoom actions
+    zoomInViewAction = new QAction(QIcon("zoom-in"), i18n("Zoom in"), \
zoomActionGroup); +    zoomInViewAction->setShortcut(Qt::CTRL+Qt::Key_Plus);
+
+    zoomOutViewAction = new QAction(QIcon("zoom-out"), i18n("Zoom out"), \
zoomActionGroup); +    zoomOutViewAction->setShortcut(Qt::CTRL+Qt::Key_Minus);
+
+    zoomOriginAction = new QAction(QIcon("zoom-original"), i18n("Original size"), \
zoomActionGroup); +    zoomOriginAction->setShortcut(Qt::CTRL+Qt::Key_1);
+
+    zoomFitPageHeightAction = new QAction(QIcon("zoom-fit-height"), i18n("Fit to \
height"), zoomActionGroup); +    zoomFitPageWidthAction = new \
QAction(QIcon("zoom-fit-width"), i18n("Fit to width"), zoomActionGroup); +    \
zoomFitSelectionAction = new QAction(i18n("Fit to selection"), zoomActionGroup); +
+    // Mouse mode actions
+    selectionModeAction = new QAction(QIcon("cursor-arrow"), i18n("Select and \
Edit"), mouseModeActionGroup); +    selectionModeAction->setCheckable(true);
+
+    navigationModeAction = new QAction(QIcon("input-mouse"), i18n("Navigate"), \
mouseModeActionGroup); +    navigationModeAction->setCheckable(true);
+
+    zoomSelectionModeAction = new QAction(QIcon("page-zoom"), i18n("Select and \
Zoom"), mouseModeActionGroup); +    zoomSelectionModeAction->setCheckable(true);
+
+    //TODO implement later "group selection action" where multiple objects can be \
selected by drawing a rectangular +// 	selectionModeAction = new \
QAction(QIcon("select-rectangular"), i18n("Selection"), mouseModeActionGroup);  // \
selectionModeAction->setCheckable(true);  
-	//"Add new" related actions
-	addCartesianPlot1Action = new KAction(KIcon("cartesian-plot-four-axes"), i18n("box \
                plot, four axes"), addNewActionGroup);
-	addCartesianPlot2Action = new KAction(KIcon("cartesian-plot-two-axes"), i18n("box \
                plot, two axes"), addNewActionGroup);
-	addCartesianPlot3Action = new KAction(KIcon("cartesian-plot-two-axes-centered"), \
                i18n("two axes, centered"), addNewActionGroup);
-	addCartesianPlot4Action = new \
KAction(KIcon("cartesian-plot-two-axes-centered-origin"), i18n("two axes, crossing at \
                origin"), addNewActionGroup);
-	addTextLabelAction = new KAction(KIcon("draw-text"), i18n("text label"), \
addNewActionGroup); +    //"Add new" related actions
+    addCartesianPlot1Action = new QAction(QIcon("cartesian-plot-four-axes"), \
i18n("box plot, four axes"), addNewActionGroup); +    addCartesianPlot2Action = new \
QAction(QIcon("cartesian-plot-two-axes"), i18n("box plot, two axes"), \
addNewActionGroup); +    addCartesianPlot3Action = new \
QAction(QIcon("cartesian-plot-two-axes-centered"), i18n("two axes, centered"), \
addNewActionGroup); +    addCartesianPlot4Action = new \
QAction(QIcon("cartesian-plot-two-axes-centered-origin"), i18n("two axes, crossing at \
origin"), addNewActionGroup); +    addTextLabelAction = new \
QAction(QIcon("draw-text"), i18n("text label"), addNewActionGroup);  
-	//Layout actions
-	verticalLayoutAction = new KAction(KIcon("editvlayout"), i18n("Vertical layout"), \
                layoutActionGroup);
-	verticalLayoutAction->setObjectName("verticalLayoutAction");
-	verticalLayoutAction->setCheckable(true);
+    //Layout actions
+    verticalLayoutAction = new QAction(QIcon("editvlayout"), i18n("Vertical \
layout"), layoutActionGroup); +    \
verticalLayoutAction->setObjectName("verticalLayoutAction"); +    \
verticalLayoutAction->setCheckable(true);  
-	horizontalLayoutAction = new KAction(KIcon("edithlayout"), i18n("Horizontal \
                layout"), layoutActionGroup);
-	horizontalLayoutAction->setObjectName("horizontalLayoutAction");
-	horizontalLayoutAction->setCheckable(true);
+    horizontalLayoutAction = new QAction(QIcon("edithlayout"), i18n("Horizontal \
layout"), layoutActionGroup); +    \
horizontalLayoutAction->setObjectName("horizontalLayoutAction"); +    \
horizontalLayoutAction->setCheckable(true);  
-	gridLayoutAction = new KAction(KIcon("editgrid"), i18n("Grid layout"), \
                layoutActionGroup);
-	gridLayoutAction->setObjectName("gridLayoutAction");
-	gridLayoutAction->setCheckable(true);
+    gridLayoutAction = new QAction(QIcon("editgrid"), i18n("Grid layout"), \
layoutActionGroup); +    gridLayoutAction->setObjectName("gridLayoutAction");
+    gridLayoutAction->setCheckable(true);
 
-	breakLayoutAction = new KAction(KIcon("editbreaklayout"), i18n("Break layout"), \
                layoutActionGroup);
-	breakLayoutAction->setObjectName("breakLayoutAction");
-	breakLayoutAction->setEnabled(false);
+    breakLayoutAction = new QAction(QIcon("editbreaklayout"), i18n("Break layout"), \
layoutActionGroup); +    breakLayoutAction->setObjectName("breakLayoutAction");
+    breakLayoutAction->setEnabled(false);
 
    //Grid actions
-	noGridAction = new KAction(i18n("no grid"), gridActionGroup);
-	noGridAction->setObjectName("noGridAction");
-	noGridAction->setCheckable(true);
-	noGridAction->setChecked(true);
-	noGridAction->setData(WorksheetView::NoGrid);
-
-	denseLineGridAction = new KAction(i18n("dense line grid"), gridActionGroup);
-	denseLineGridAction->setObjectName("denseLineGridAction");
-	denseLineGridAction->setCheckable(true);
-
-	sparseLineGridAction = new KAction(i18n("sparse line grid"), gridActionGroup);
-	sparseLineGridAction->setObjectName("sparseLineGridAction");
-	sparseLineGridAction->setCheckable(true);
-
-	denseDotGridAction = new KAction(i18n("dense dot grid"), gridActionGroup);
-	denseDotGridAction->setObjectName("denseDotGridAction");
-	denseDotGridAction->setCheckable(true);
-
-	sparseDotGridAction = new KAction(i18n("sparse dot grid"), gridActionGroup);
-	sparseDotGridAction->setObjectName("sparseDotGridAction");
-	sparseDotGridAction->setCheckable(true);
-
-	customGridAction = new KAction(i18n("custom grid"), gridActionGroup);
-	customGridAction->setObjectName("customGridAction");
-	customGridAction->setCheckable(true);
-
-	snapToGridAction = new KAction(i18n("snap to grid"), this);
-	snapToGridAction->setCheckable(true);
-
-	//check the action corresponding to the currently active layout in worksheet
-	this->layoutChanged(m_worksheet->layout());
-
-	connect(addNewActionGroup, SIGNAL(triggered(QAction*)), this, \
                SLOT(addNew(QAction*)));
-	connect(mouseModeActionGroup, SIGNAL(triggered(QAction*)), this, \
                SLOT(mouseModeChanged(QAction*)));
-	connect(zoomActionGroup, SIGNAL(triggered(QAction*)), this, \
                SLOT(changeZoom(QAction*)));
-	connect(layoutActionGroup, SIGNAL(triggered(QAction*)), this, \
                SLOT(changeLayout(QAction*)));
-	connect(gridActionGroup, SIGNAL(triggered(QAction*)), this, \
                SLOT(changeGrid(QAction*)));
-	connect(snapToGridAction, SIGNAL(triggered()), this, SLOT(changeSnapToGrid()));
-
-
-	//action for cartesian plots
-	QActionGroup* cartesianPlotActionModeActionGroup = new QActionGroup(this);
-	cartesianPlotActionModeActionGroup->setExclusive(true);
-	cartesianPlotApplyToSelectionAction = new KAction(i18n("selected plots"), \
                cartesianPlotActionModeActionGroup);
-	cartesianPlotApplyToSelectionAction->setCheckable(true);
-	cartesianPlotApplyToSelectionAction->setChecked(true);
-	cartesianPlotApplyToAllAction = new KAction(i18n("all plots"), \
                cartesianPlotActionModeActionGroup);
-	cartesianPlotApplyToAllAction->setCheckable(true);
-	connect(cartesianPlotActionModeActionGroup, SIGNAL(triggered(QAction*)), \
                SLOT(cartesianPlotActionModeChanged(QAction*)));
-
-	QActionGroup* cartesianPlotMouseModeActionGroup = new QActionGroup(this);
-	cartesianPlotMouseModeActionGroup->setExclusive(true);
-	cartesianPlotSelectionModeAction = new KAction(KIcon("cursor-arrow"), i18n("Select \
                and edit"), cartesianPlotMouseModeActionGroup);
-	cartesianPlotSelectionModeAction->setCheckable(true);
-	cartesianPlotSelectionModeAction->setChecked(true);
-
-	cartesianPlotZoomSelectionModeAction = new KAction(KIcon("zoom-select"), \
                i18n("Select region and zoom in"), \
                cartesianPlotMouseModeActionGroup);
-	cartesianPlotZoomSelectionModeAction->setCheckable(true);
-
-	cartesianPlotZoomXSelectionModeAction = new KAction(KIcon("zoom-select-x"), \
                i18n("Select x-region and zoom in"), \
                cartesianPlotMouseModeActionGroup);
-	cartesianPlotZoomXSelectionModeAction->setCheckable(true);
-
-	cartesianPlotZoomYSelectionModeAction = new KAction(KIcon("zoom-select-y"), \
                i18n("Select y-region and zoom in"), \
                cartesianPlotMouseModeActionGroup);
-	cartesianPlotZoomYSelectionModeAction->setCheckable(true);
-
-	connect(cartesianPlotMouseModeActionGroup, SIGNAL(triggered(QAction*)), \
                SLOT(cartesianPlotMouseModeChanged(QAction*)));
-
-	addCurveAction = new KAction(KIcon("xy-curve"), i18n("xy-curve"), this);
-	addEquationCurveAction = new KAction(KIcon("xy-equation-curve"), i18n("xy-curve \
                from a mathematical equation"), this);
-	addFitCurveAction = new KAction(KIcon("xy-fit-curve"), i18n("xy-curve from a fit to \
                data"), this);
-	addLegendAction = new KAction(KIcon("text-field"), i18n("legend"), this);
-	addHorizontalAxisAction = new KAction(KIcon("axis-horizontal"), i18n("horizontal \
                axis"), this);
-	addVerticalAxisAction = new KAction(KIcon("axis-vertical"), i18n("vertical axis"), \
                this);
-
-	scaleAutoAction = new KAction(KIcon("auto-scale-all"), i18n("auto scale"), this);
-	scaleAutoXAction = new KAction(KIcon("auto-scale-x"), i18n("auto scale X"), this);
-	scaleAutoYAction = new KAction(KIcon("auto-scale-y"), i18n("auto scale Y"), this);
-	zoomInAction = new KAction(KIcon("zoom-in"), i18n("zoom in"), this);
-	zoomOutAction = new KAction(KIcon("zoom-out"), i18n("zoom out"), this);
-	zoomInXAction = new KAction(KIcon("zoom-in-x"), i18n("zoom in X"), this);
-	zoomOutXAction = new KAction(KIcon("zoom-out-x"), i18n("zoom out X"), this);
-	zoomInYAction = new KAction(KIcon("zoom-in-y"), i18n("zoom in Y"), this);
-	zoomOutYAction = new KAction(KIcon("zoom-out-y"), i18n("zoom out Y"), this);
-    shiftLeftXAction = new KAction(KIcon("shift-left-x"), i18n("shift left X"), \
                this);
-	shiftRightXAction = new KAction(KIcon("shift-right-x"), i18n("shift right X"), \
                this);
-	shiftUpYAction = new KAction(KIcon("shift-up-y"), i18n("shift up Y"), this);
-	shiftDownYAction = new KAction(KIcon("shift-down-y"), i18n("shift down Y"), this);
-
-	connect(addCurveAction, SIGNAL(triggered()), SLOT(addCurve()));
-	connect(addEquationCurveAction, SIGNAL(triggered()), SLOT(addEquationCurve()));
-	connect(addFitCurveAction, SIGNAL(triggered()), SLOT(addFitCurve()));
-	connect(addLegendAction, SIGNAL(triggered()), SLOT(addLegend()));
-	connect(addHorizontalAxisAction, SIGNAL(triggered()), SLOT(addHorizontalAxis()));
-	connect(addVerticalAxisAction, SIGNAL(triggered()), SLOT(addVerticalAxis()));
-
-	//zoom actions
-	connect(scaleAutoAction, SIGNAL(triggered()), SLOT(scaleAuto()));
-	connect(scaleAutoXAction, SIGNAL(triggered()), SLOT(scaleAutoX()));
-	connect(scaleAutoYAction, SIGNAL(triggered()), SLOT(scaleAutoY()));
-	connect(zoomInAction, SIGNAL(triggered()), SLOT(zoomIn()));
-	connect(zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut()));
-	connect(zoomInXAction, SIGNAL(triggered()), SLOT(zoomInX()));
-	connect(zoomOutXAction, SIGNAL(triggered()), SLOT(zoomOutX()));
-	connect(zoomInYAction, SIGNAL(triggered()), SLOT(zoomInY()));
-	connect(zoomOutYAction, SIGNAL(triggered()), SLOT(zoomOutY()));
-	connect(shiftLeftXAction, SIGNAL(triggered()), SLOT(shiftLeftX()));
-	connect(shiftRightXAction, SIGNAL(triggered()), SLOT(shiftRightX()));
-	connect(shiftUpYAction, SIGNAL(triggered()), SLOT(shiftUpY()));
-	connect(shiftDownYAction, SIGNAL(triggered()), SLOT(shiftDownY()));
+    noGridAction = new QAction(i18n("no grid"), gridActionGroup);
+    noGridAction->setObjectName("noGridAction");
+    noGridAction->setCheckable(true);
+    noGridAction->setChecked(true);
+    noGridAction->setData(WorksheetView::NoGrid);
+
+    denseLineGridAction = new QAction(i18n("dense line grid"), gridActionGroup);
+    denseLineGridAction->setObjectName("denseLineGridAction");
+    denseLineGridAction->setCheckable(true);
+
+    sparseLineGridAction = new QAction(i18n("sparse line grid"), gridActionGroup);
+    sparseLineGridAction->setObjectName("sparseLineGridAction");
+    sparseLineGridAction->setCheckable(true);
+
+    denseDotGridAction = new QAction(i18n("dense dot grid"), gridActionGroup);
+    denseDotGridAction->setObjectName("denseDotGridAction");
+    denseDotGridAction->setCheckable(true);
+
+    sparseDotGridAction = new QAction(i18n("sparse dot grid"), gridActionGroup);
+    sparseDotGridAction->setObjectName("sparseDotGridAction");
+    sparseDotGridAction->setCheckable(true);
+
+    customGridAction = new QAction(i18n("custom grid"), gridActionGroup);
+    customGridAction->setObjectName("customGridAction");
+    customGridAction->setCheckable(true);
+
+    snapToGridAction = new QAction(i18n("snap to grid"), this);
+    snapToGridAction->setCheckable(true);
+
+    //check the action corresponding to the currently active layout in worksheet
+    this->layoutChanged(m_worksheet->layout());
+
+    connect(addNewActionGroup, SIGNAL(triggered(QAction*)), this, \
SLOT(addNew(QAction*))); +    connect(mouseModeActionGroup, \
SIGNAL(triggered(QAction*)), this, SLOT(mouseModeChanged(QAction*))); +    \
connect(zoomActionGroup, SIGNAL(triggered(QAction*)), this, \
SLOT(changeZoom(QAction*))); +    connect(layoutActionGroup, \
SIGNAL(triggered(QAction*)), this, SLOT(changeLayout(QAction*))); +    \
connect(gridActionGroup, SIGNAL(triggered(QAction*)), this, \
SLOT(changeGrid(QAction*))); +    connect(snapToGridAction, SIGNAL(triggered()), \
this, SLOT(changeSnapToGrid())); +
+
+    //action for cartesian plots
+    QActionGroup* cartesianPlotActionModeActionGroup = new QActionGroup(this);
+    cartesianPlotActionModeActionGroup->setExclusive(true);
+    cartesianPlotApplyToSelectionAction = new QAction(i18n("selected plots"), \
cartesianPlotActionModeActionGroup); +    \
cartesianPlotApplyToSelectionAction->setCheckable(true); +    \
cartesianPlotApplyToSelectionAction->setChecked(true); +    \
cartesianPlotApplyToAllAction = new QAction(i18n("all plots"), \
cartesianPlotActionModeActionGroup); +    \
cartesianPlotApplyToAllAction->setCheckable(true); +    \
connect(cartesianPlotActionModeActionGroup, SIGNAL(triggered(QAction*)), \
SLOT(cartesianPlotActionModeChanged(QAction*))); +
+    QActionGroup* cartesianPlotMouseModeActionGroup = new QActionGroup(this);
+    cartesianPlotMouseModeActionGroup->setExclusive(true);
+    cartesianPlotSelectionModeAction = new QAction(QIcon("cursor-arrow"), \
i18n("Select and edit"), cartesianPlotMouseModeActionGroup); +    \
cartesianPlotSelectionModeAction->setCheckable(true); +    \
cartesianPlotSelectionModeAction->setChecked(true); +
+    cartesianPlotZoomSelectionModeAction = new QAction(QIcon("zoom-select"), \
i18n("Select region and zoom in"), cartesianPlotMouseModeActionGroup); +    \
cartesianPlotZoomSelectionModeAction->setCheckable(true); +
+    cartesianPlotZoomXSelectionModeAction = new QAction(QIcon("zoom-select-x"), \
i18n("Select x-region and zoom in"), cartesianPlotMouseModeActionGroup); +    \
cartesianPlotZoomXSelectionModeAction->setCheckable(true); +
+    cartesianPlotZoomYSelectionModeAction = new QAction(QIcon("zoom-select-y"), \
i18n("Select y-region and zoom in"), cartesianPlotMouseModeActionGroup); +    \
cartesianPlotZoomYSelectionModeAction->setCheckable(true); +
+    connect(cartesianPlotMouseModeActionGroup, SIGNAL(triggered(QAction*)), \
SLOT(cartesianPlotMouseModeChanged(QAction*))); +
+    addCurveAction = new QAction(QIcon("xy-curve"), i18n("xy-curve"), this);
+    addEquationCurveAction = new QAction(QIcon("xy-equation-curve"), i18n("xy-curve \
from a mathematical equation"), this); +    addFitCurveAction = new \
QAction(QIcon("xy-fit-curve"), i18n("xy-curve from a fit to data"), this); +    \
addLegendAction = new QAction(QIcon("text-field"), i18n("legend"), this); +    \
addHorizontalAxisAction = new QAction(QIcon("axis-horizontal"), i18n("horizontal \
axis"), this); +    addVerticalAxisAction = new QAction(QIcon("axis-vertical"), \
i18n("vertical axis"), this); +
+    scaleAutoAction = new QAction(QIcon("auto-scale-all"), i18n("auto scale"), \
this); +    scaleAutoXAction = new QAction(QIcon("auto-scale-x"), i18n("auto scale \
X"), this); +    scaleAutoYAction = new QAction(QIcon("auto-scale-y"), i18n("auto \
scale Y"), this); +    zoomInAction = new QAction(QIcon("zoom-in"), i18n("zoom in"), \
this); +    zoomOutAction = new QAction(QIcon("zoom-out"), i18n("zoom out"), this);
+    zoomInXAction = new QAction(QIcon("zoom-in-x"), i18n("zoom in X"), this);
+    zoomOutXAction = new QAction(QIcon("zoom-out-x"), i18n("zoom out X"), this);
+    zoomInYAction = new QAction(QIcon("zoom-in-y"), i18n("zoom in Y"), this);
+    zoomOutYAction = new QAction(QIcon("zoom-out-y"), i18n("zoom out Y"), this);
+    shiftLeftXAction = new QAction(QIcon("shift-left-x"), i18n("shift left X"), \
this); +    shiftRightXAction = new QAction(QIcon("shift-right-x"), i18n("shift right \
X"), this); +    shiftUpYAction = new QAction(QIcon("shift-up-y"), i18n("shift up \
Y"), this); +    shiftDownYAction = new QAction(QIcon("shift-down-y"), i18n("shift \
down Y"), this); +
+    connect(addCurveAction, SIGNAL(triggered()), SLOT(addCurve()));
+    connect(addEquationCurveAction, SIGNAL(triggered()), SLOT(addEquationCurve()));
+    connect(addFitCurveAction, SIGNAL(triggered()), SLOT(addFitCurve()));
+    connect(addLegendAction, SIGNAL(triggered()), SLOT(addLegend()));
+    connect(addHorizontalAxisAction, SIGNAL(triggered()), \
SLOT(addHorizontalAxis())); +    connect(addVerticalAxisAction, SIGNAL(triggered()), \
SLOT(addVerticalAxis())); +
+    //zoom actions
+    connect(scaleAutoAction, SIGNAL(triggered()), SLOT(scaleAuto()));
+    connect(scaleAutoXAction, SIGNAL(triggered()), SLOT(scaleAutoX()));
+    connect(scaleAutoYAction, SIGNAL(triggered()), SLOT(scaleAutoY()));
+    connect(zoomInAction, SIGNAL(triggered()), SLOT(zoomIn()));
+    connect(zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut()));
+    connect(zoomInXAction, SIGNAL(triggered()), SLOT(zoomInX()));
+    connect(zoomOutXAction, SIGNAL(triggered()), SLOT(zoomOutX()));
+    connect(zoomInYAction, SIGNAL(triggered()), SLOT(zoomInY()));
+    connect(zoomOutYAction, SIGNAL(triggered()), SLOT(zoomOutY()));
+    connect(shiftLeftXAction, SIGNAL(triggered()), SLOT(shiftLeftX()));
+    connect(shiftRightXAction, SIGNAL(triggered()), SLOT(shiftRightX()));
+    connect(shiftUpYAction, SIGNAL(triggered()), SLOT(shiftUpY()));
+    connect(shiftDownYAction, SIGNAL(triggered()), SLOT(shiftDownY()));
 }
 
 void WorksheetView::initMenus(){
-	m_addNewCartesianPlotMenu = new QMenu(i18n("xy-plot"));
-	m_addNewCartesianPlotMenu->addAction(addCartesianPlot1Action);
-	m_addNewCartesianPlotMenu->addAction(addCartesianPlot2Action);
-	m_addNewCartesianPlotMenu->addAction(addCartesianPlot3Action);
-	m_addNewCartesianPlotMenu->addAction(addCartesianPlot4Action);
-
-	m_addNewMenu = new QMenu(i18n("Add new"));
-	m_addNewMenu->addMenu(m_addNewCartesianPlotMenu)->setIcon(KIcon("office-chart-line"));
                
-	m_addNewMenu->addSeparator();
-	m_addNewMenu->addAction(addTextLabelAction);
-
-	m_viewMouseModeMenu = new QMenu(i18n("Mouse Mode"));
-	m_viewMouseModeMenu->setIcon(KIcon("input-mouse"));
-	m_viewMouseModeMenu->addAction(selectionModeAction);
-	m_viewMouseModeMenu->addAction(navigationModeAction);
-	m_viewMouseModeMenu->addAction(zoomSelectionModeAction);
-
-	m_zoomMenu = new QMenu(i18n("Zoom"));
-	m_zoomMenu->setIcon(KIcon("zoom-draw"));
-	m_zoomMenu->addAction(zoomInViewAction);
-	m_zoomMenu->addAction(zoomOutViewAction);
-	m_zoomMenu->addAction(zoomOriginAction);
-	m_zoomMenu->addAction(zoomFitPageHeightAction);
-	m_zoomMenu->addAction(zoomFitPageWidthAction);
-	m_zoomMenu->addAction(zoomFitSelectionAction);
-
-	m_layoutMenu = new QMenu(i18n("Layout"));
-	m_layoutMenu->addAction(verticalLayoutAction);
-	m_layoutMenu->addAction(horizontalLayoutAction);
-	m_layoutMenu->addAction(gridLayoutAction);
-	m_layoutMenu->addSeparator();
-	m_layoutMenu->addAction(breakLayoutAction);
-
-	m_gridMenu = new QMenu(i18n("Grid"));
-	m_gridMenu->setIcon(KIcon("view-grid"));
-	m_gridMenu->addAction(noGridAction);
-	m_gridMenu->addSeparator();
-	m_gridMenu->addAction(sparseLineGridAction);
-	m_gridMenu->addAction(denseLineGridAction);
-	m_gridMenu->addSeparator();
-	m_gridMenu->addAction(sparseDotGridAction);
-	m_gridMenu->addAction(denseDotGridAction);
-	m_gridMenu->addSeparator();
-	m_gridMenu->addAction(customGridAction);
-	//TODO: implement "snap to grid" and activate this action
+    m_addNewCartesianPlotMenu = new QMenu(i18n("xy-plot"));
+    m_addNewCartesianPlotMenu->addAction(addCartesianPlot1Action);
+    m_addNewCartesianPlotMenu->addAction(addCartesianPlot2Action);
+    m_addNewCartesianPlotMenu->addAction(addCartesianPlot3Action);
+    m_addNewCartesianPlotMenu->addAction(addCartesianPlot4Action);
+
+    m_addNewMenu = new QMenu(i18n("Add new"));
+    m_addNewMenu->addMenu(m_addNewCartesianPlotMenu)->setIcon(QIcon("office-chart-line"));
 +    m_addNewMenu->addSeparator();
+    m_addNewMenu->addAction(addTextLabelAction);
+
+    m_viewMouseModeMenu = new QMenu(i18n("Mouse Mode"));
+    m_viewMouseModeMenu->setIcon(QIcon("input-mouse"));
+    m_viewMouseModeMenu->addAction(selectionModeAction);
+    m_viewMouseModeMenu->addAction(navigationModeAction);
+    m_viewMouseModeMenu->addAction(zoomSelectionModeAction);
+
+    m_zoomMenu = new QMenu(i18n("Zoom"));
+    m_zoomMenu->setIcon(QIcon("zoom-draw"));
+    m_zoomMenu->addAction(zoomInViewAction);
+    m_zoomMenu->addAction(zoomOutViewAction);
+    m_zoomMenu->addAction(zoomOriginAction);
+    m_zoomMenu->addAction(zoomFitPageHeightAction);
+    m_zoomMenu->addAction(zoomFitPageWidthAction);
+    m_zoomMenu->addAction(zoomFitSelectionAction);
+
+    m_layoutMenu = new QMenu(i18n("Layout"));
+    m_layoutMenu->addAction(verticalLayoutAction);
+    m_layoutMenu->addAction(horizontalLayoutAction);
+    m_layoutMenu->addAction(gridLayoutAction);
+    m_layoutMenu->addSeparator();
+    m_layoutMenu->addAction(breakLayoutAction);
+
+    m_gridMenu = new QMenu(i18n("Grid"));
+    m_gridMenu->setIcon(QIcon("view-grid"));
+    m_gridMenu->addAction(noGridAction);
+    m_gridMenu->addSeparator();
+    m_gridMenu->addAction(sparseLineGridAction);
+    m_gridMenu->addAction(denseLineGridAction);
+    m_gridMenu->addSeparator();
+    m_gridMenu->addAction(sparseDotGridAction);
+    m_gridMenu->addAction(denseDotGridAction);
+    m_gridMenu->addSeparator();
+    m_gridMenu->addAction(customGridAction);
+    //TODO: implement "snap to grid" and activate this action
 // 	m_gridMenu->addSeparator();
 // 	m_gridMenu->addAction(snapToGridAction);
 
-	m_cartesianPlotMenu = new QMenu(i18n("Cartesian Plot"));
-
-	m_cartesianPlotMouseModeMenu = new QMenu(i18n("Mouse Mode"));
-	m_cartesianPlotMouseModeMenu->setIcon(KIcon("input-mouse"));
-	m_cartesianPlotMouseModeMenu->addAction(cartesianPlotSelectionModeAction);
-	m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomSelectionModeAction);
-	m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomXSelectionModeAction);
-	m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomYSelectionModeAction);
-	m_cartesianPlotMouseModeMenu->addSeparator();
-
-	m_cartesianPlotAddNewMenu = new QMenu(i18n("Add new"));
-	m_cartesianPlotAddNewMenu->addAction(addCurveAction);
-	m_cartesianPlotAddNewMenu->addAction(addEquationCurveAction);
-	m_cartesianPlotAddNewMenu->addAction(addFitCurveAction);
-	m_cartesianPlotAddNewMenu->addAction(addLegendAction);
-	m_cartesianPlotAddNewMenu->addSeparator();
-	m_cartesianPlotAddNewMenu->addAction(addHorizontalAxisAction);
-	m_cartesianPlotAddNewMenu->addAction(addVerticalAxisAction);
-
-	m_cartesianPlotZoomMenu = new QMenu(i18n("Zoom/Navigate"));
-	m_cartesianPlotZoomMenu->setIcon(KIcon("zoom-draw"));
-	m_cartesianPlotZoomMenu->addAction(scaleAutoAction);
-	m_cartesianPlotZoomMenu->addAction(scaleAutoXAction);
-	m_cartesianPlotZoomMenu->addAction(scaleAutoYAction);
-	m_cartesianPlotZoomMenu->addSeparator();
-	m_cartesianPlotZoomMenu->addAction(zoomInAction);
-	m_cartesianPlotZoomMenu->addAction(zoomOutAction);
-	m_cartesianPlotZoomMenu->addSeparator();
-	m_cartesianPlotZoomMenu->addAction(zoomInXAction);
-	m_cartesianPlotZoomMenu->addAction(zoomOutXAction);
-	m_cartesianPlotZoomMenu->addSeparator();
-	m_cartesianPlotZoomMenu->addAction(zoomInYAction);
-	m_cartesianPlotZoomMenu->addAction(zoomOutYAction);
-	m_cartesianPlotZoomMenu->addSeparator();
-	m_cartesianPlotZoomMenu->addAction(shiftLeftXAction);
-	m_cartesianPlotZoomMenu->addAction(shiftRightXAction);
-	m_cartesianPlotZoomMenu->addSeparator();
-	m_cartesianPlotZoomMenu->addAction(shiftUpYAction);
-	m_cartesianPlotZoomMenu->addAction(shiftDownYAction);
-
-	m_cartesianPlotActionModeMenu = new QMenu(i18n("Apply actions to"));
-	m_cartesianPlotActionModeMenu->addAction(cartesianPlotApplyToSelectionAction);
-	m_cartesianPlotActionModeMenu->addAction(cartesianPlotApplyToAllAction);
-
-	m_cartesianPlotMenu->addMenu(m_cartesianPlotMouseModeMenu);
-	m_cartesianPlotMenu->addMenu(m_cartesianPlotAddNewMenu);
-	m_cartesianPlotMenu->addMenu(m_cartesianPlotZoomMenu);
-	m_cartesianPlotMenu->addSeparator();
-	m_cartesianPlotMenu->addMenu(m_cartesianPlotActionModeMenu);
+    m_cartesianPlotMenu = new QMenu(i18n("Cartesian Plot"));
+
+    m_cartesianPlotMouseModeMenu = new QMenu(i18n("Mouse Mode"));
+    m_cartesianPlotMouseModeMenu->setIcon(QIcon("input-mouse"));
+    m_cartesianPlotMouseModeMenu->addAction(cartesianPlotSelectionModeAction);
+    m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomSelectionModeAction);
+    m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomXSelectionModeAction);
+    m_cartesianPlotMouseModeMenu->addAction(cartesianPlotZoomYSelectionModeAction);
+    m_cartesianPlotMouseModeMenu->addSeparator();
+
+    m_cartesianPlotAddNewMenu = new QMenu(i18n("Add new"));
+    m_cartesianPlotAddNewMenu->addAction(addCurveAction);
+    m_cartesianPlotAddNewMenu->addAction(addEquationCurveAction);
+    m_cartesianPlotAddNewMenu->addAction(addFitCurveAction);
+    m_cartesianPlotAddNewMenu->addAction(addLegendAction);
+    m_cartesianPlotAddNewMenu->addSeparator();
+    m_cartesianPlotAddNewMenu->addAction(addHorizontalAxisAction);
+    m_cartesianPlotAddNewMenu->addAction(addVerticalAxisAction);
+
+    m_cartesianPlotZoomMenu = new QMenu(i18n("Zoom/Navigate"));
+    m_cartesianPlotZoomMenu->setIcon(QIcon("zoom-draw"));
+    m_cartesianPlotZoomMenu->addAction(scaleAutoAction);
+    m_cartesianPlotZoomMenu->addAction(scaleAutoXAction);
+    m_cartesianPlotZoomMenu->addAction(scaleAutoYAction);
+    m_cartesianPlotZoomMenu->addSeparator();
+    m_cartesianPlotZoomMenu->addAction(zoomInAction);
+    m_cartesianPlotZoomMenu->addAction(zoomOutAction);
+    m_cartesianPlotZoomMenu->addSeparator();
+    m_cartesianPlotZoomMenu->addAction(zoomInXAction);
+    m_cartesianPlotZoomMenu->addAction(zoomOutXAction);
+    m_cartesianPlotZoomMenu->addSeparator();
+    m_cartesianPlotZoomMenu->addAction(zoomInYAction);
+    m_cartesianPlotZoomMenu->addAction(zoomOutYAction);
+    m_cartesianPlotZoomMenu->addSeparator();
+    m_cartesianPlotZoomMenu->addAction(shiftLeftXAction);
+    m_cartesianPlotZoomMenu->addAction(shiftRightXAction);
+    m_cartesianPlotZoomMenu->addSeparator();
+    m_cartesianPlotZoomMenu->addAction(shiftUpYAction);
+    m_cartesianPlotZoomMenu->addAction(shiftDownYAction);
+
+    m_cartesianPlotActionModeMenu = new QMenu(i18n("Apply actions to"));
+    m_cartesianPlotActionModeMenu->addAction(cartesianPlotApplyToSelectionAction);
+    m_cartesianPlotActionModeMenu->addAction(cartesianPlotApplyToAllAction);
+
+    m_cartesianPlotMenu->addMenu(m_cartesianPlotMouseModeMenu);
+    m_cartesianPlotMenu->addMenu(m_cartesianPlotAddNewMenu);
+    m_cartesianPlotMenu->addMenu(m_cartesianPlotZoomMenu);
+    m_cartesianPlotMenu->addSeparator();
+    m_cartesianPlotMenu->addMenu(m_cartesianPlotActionModeMenu);
 }
 
 /*!
@@ -413,83 +413,83 @@ void WorksheetView::initMenus(){
  *   - as a part of the worksheet context menu in project explorer
  */
 void WorksheetView::createContextMenu(QMenu* menu) const {
-	Q_ASSERT(menu);
+    Q_ASSERT(menu);
 
 #ifdef ACTIVATE_SCIDAVIS_SPECIFIC_CODE
-	QAction* firstAction = menu->actions().first();
+    QAction* firstAction = menu->actions().first();
 #else
-	QAction* firstAction = 0;
-	// if we're populating the context menu for the project explorer, then
-	//there're already actions available there. Skip the first title-action
-	//and insert the action at the beginning of the menu.
-	if (menu->actions().size()>1)
-		firstAction = menu->actions().at(1);
+    QAction* firstAction = 0;
+    // if we're populating the context menu for the project explorer, then
+    //there're already actions available there. Skip the first title-action
+    //and insert the action at the beginning of the menu.
+    if (menu->actions().size()>1)
+        firstAction = menu->actions().at(1);
 #endif
 
-	menu->insertMenu(firstAction, m_addNewMenu);
-	menu->insertSeparator(firstAction);
-	menu->insertMenu(firstAction, m_viewMouseModeMenu);
-	menu->insertMenu(firstAction, m_zoomMenu);
-	menu->insertMenu(firstAction, m_layoutMenu);
-	menu->insertMenu(firstAction, m_gridMenu);
-	menu->insertSeparator(firstAction);
-	menu->insertMenu(firstAction, m_cartesianPlotMenu);
-	menu->insertSeparator(firstAction);
+    menu->insertMenu(firstAction, m_addNewMenu);
+    menu->insertSeparator(firstAction);
+    menu->insertMenu(firstAction, m_viewMouseModeMenu);
+    menu->insertMenu(firstAction, m_zoomMenu);
+    menu->insertMenu(firstAction, m_layoutMenu);
+    menu->insertMenu(firstAction, m_gridMenu);
+    menu->insertSeparator(firstAction);
+    menu->insertMenu(firstAction, m_cartesianPlotMenu);
+    menu->insertSeparator(firstAction);
 }
 
 void WorksheetView::fillToolBar(QToolBar* toolBar){
-	toolBar->addSeparator();
-	tbNewCartesianPlot = new QToolButton(toolBar);
-	tbNewCartesianPlot->setPopupMode(QToolButton::MenuButtonPopup);
-	tbNewCartesianPlot->setMenu(m_addNewCartesianPlotMenu);
-	tbNewCartesianPlot->setDefaultAction(addCartesianPlot1Action);
-	toolBar->addWidget(tbNewCartesianPlot);
-	toolBar->addAction(addTextLabelAction);
-
-	toolBar->addSeparator();
-	toolBar->addAction(verticalLayoutAction);
-	toolBar->addAction(horizontalLayoutAction);
-	toolBar->addAction(gridLayoutAction);
-	toolBar->addAction(breakLayoutAction);
-
-	toolBar->addSeparator();
-	toolBar->addAction(selectionModeAction);
-	toolBar->addAction(navigationModeAction);
-	toolBar->addAction(zoomSelectionModeAction);
-	tbZoom = new QToolButton(toolBar);
-	tbZoom->setPopupMode(QToolButton::MenuButtonPopup);
-	tbZoom->setMenu(m_zoomMenu);
-	tbZoom->setDefaultAction(currentZoomAction);
-	toolBar->addWidget(tbZoom);
+    toolBar->addSeparator();
+    tbNewCartesianPlot = new QToolButton(toolBar);
+    tbNewCartesianPlot->setPopupMode(QToolButton::MenuButtonPopup);
+    tbNewCartesianPlot->setMenu(m_addNewCartesianPlotMenu);
+    tbNewCartesianPlot->setDefaultAction(addCartesianPlot1Action);
+    toolBar->addWidget(tbNewCartesianPlot);
+    toolBar->addAction(addTextLabelAction);
+
+    toolBar->addSeparator();
+    toolBar->addAction(verticalLayoutAction);
+    toolBar->addAction(horizontalLayoutAction);
+    toolBar->addAction(gridLayoutAction);
+    toolBar->addAction(breakLayoutAction);
+
+    toolBar->addSeparator();
+    toolBar->addAction(selectionModeAction);
+    toolBar->addAction(navigationModeAction);
+    toolBar->addAction(zoomSelectionModeAction);
+    tbZoom = new QToolButton(toolBar);
+    tbZoom->setPopupMode(QToolButton::MenuButtonPopup);
+    tbZoom->setMenu(m_zoomMenu);
+    tbZoom->setDefaultAction(currentZoomAction);
+    toolBar->addWidget(tbZoom);
 }
 
 void WorksheetView::fillCartesianPlotToolBar(QToolBar* toolBar) {
-	toolBar->addAction(cartesianPlotSelectionModeAction);
-	toolBar->addAction(cartesianPlotZoomSelectionModeAction);
-	toolBar->addAction(cartesianPlotZoomXSelectionModeAction);
-	toolBar->addAction(cartesianPlotZoomYSelectionModeAction);
-	toolBar->addSeparator();
-	toolBar->addAction(addCurveAction);
-	toolBar->addAction(addEquationCurveAction);
-	toolBar->addAction(addFitCurveAction);
-	toolBar->addAction(addLegendAction);
-	toolBar->addSeparator();
-	toolBar->addAction(addHorizontalAxisAction);
-	toolBar->addAction(addVerticalAxisAction);
-	toolBar->addSeparator();
-	toolBar->addAction(scaleAutoAction);
-	toolBar->addAction(scaleAutoXAction);
-	toolBar->addAction(scaleAutoYAction);
-	toolBar->addAction(zoomInAction);
-	toolBar->addAction(zoomOutAction);
-	toolBar->addAction(zoomInXAction);
-	toolBar->addAction(zoomOutXAction);
-	toolBar->addAction(zoomInYAction);
-	toolBar->addAction(zoomOutYAction);
-	toolBar->addAction(shiftLeftXAction);
-	toolBar->addAction(shiftRightXAction);
-	toolBar->addAction(shiftUpYAction);
-	toolBar->addAction(shiftDownYAction);
+    toolBar->addAction(cartesianPlotSelectionModeAction);
+    toolBar->addAction(cartesianPlotZoomSelectionModeAction);
+    toolBar->addAction(cartesianPlotZoomXSelectionModeAction);
+    toolBar->addAction(cartesianPlotZoomYSelectionModeAction);
+    toolBar->addSeparator();
+    toolBar->addAction(addCurveAction);
+    toolBar->addAction(addEquationCurveAction);
+    toolBar->addAction(addFitCurveAction);
+    toolBar->addAction(addLegendAction);
+    toolBar->addSeparator();
+    toolBar->addAction(addHorizontalAxisAction);
+    toolBar->addAction(addVerticalAxisAction);
+    toolBar->addSeparator();
+    toolBar->addAction(scaleAutoAction);
+    toolBar->addAction(scaleAutoXAction);
+    toolBar->addAction(scaleAutoYAction);
+    toolBar->addAction(zoomInAction);
+    toolBar->addAction(zoomOutAction);
+    toolBar->addAction(zoomInXAction);
+    toolBar->addAction(zoomOutXAction);
+    toolBar->addAction(zoomInYAction);
+    toolBar->addAction(zoomOutYAction);
+    toolBar->addAction(shiftLeftXAction);
+    toolBar->addAction(shiftRightXAction);
+    toolBar->addAction(shiftUpYAction);
+    toolBar->addAction(shiftDownYAction);
 }
 
 void WorksheetView::setScene(QGraphicsScene* scene) {
@@ -498,487 +498,487 @@ void WorksheetView::setScene(QGraphicsScene* scene) {
 }
 
 void WorksheetView::drawForeground(QPainter* painter, const QRectF& rect) {
-	if (m_mouseMode==ZoomSelectionMode && m_selectionBandIsShown) {
-		painter->save();
-		const QRectF& selRect = mapToScene(QRect(m_selectionStart, \
                m_selectionEnd).normalized()).boundingRect();
-		painter->setPen(QPen(Qt::black, 5));
-		painter->drawRect(selRect);
-		painter->setBrush(Qt::blue);
-		painter->setOpacity(0.2);
-		painter->drawRect(selRect);
-		painter->restore();
-	}
-	QGraphicsView::drawForeground(painter, rect);
+    if (m_mouseMode==ZoomSelectionMode && m_selectionBandIsShown) {
+        painter->save();
+        const QRectF& selRect = mapToScene(QRect(m_selectionStart, \
m_selectionEnd).normalized()).boundingRect(); +        \
painter->setPen(QPen(Qt::black, 5)); +        painter->drawRect(selRect);
+        painter->setBrush(Qt::blue);
+        painter->setOpacity(0.2);
+        painter->drawRect(selRect);
+        painter->restore();
+    }
+    QGraphicsView::drawForeground(painter, rect);
 }
 
 void WorksheetView::drawBackground(QPainter* painter, const QRectF& rect) {
-	painter->save();
-
-	//painter->setRenderHint(QPainter::Antialiasing);
-	QRectF scene_rect = sceneRect();
-
-	if (!m_worksheet->useViewSize()) {
-		// background
-		if (!scene_rect.contains(rect))
-			painter->fillRect(rect, Qt::lightGray);
-
-		//shadow
-		int shadowSize = scene_rect.width()*0.02;
-		QRectF rightShadowRect(scene_rect.right(), scene_rect.top() + shadowSize,
-											shadowSize, scene_rect.height());
-		QRectF bottomShadowRect(scene_rect.left() + shadowSize, scene_rect.bottom(),
-											scene_rect.width(), shadowSize);
-
-		painter->fillRect(rightShadowRect.intersected(rect), Qt::darkGray);
-		painter->fillRect(bottomShadowRect.intersected(rect), Qt::darkGray);
-	}
-
-	// canvas
-	painter->setOpacity(m_worksheet->backgroundOpacity());
-	if (m_worksheet->backgroundType() == PlotArea::Color){
-		switch (m_worksheet->backgroundColorStyle()){
-			case PlotArea::SingleColor:{
-				painter->setBrush(QBrush(m_worksheet->backgroundFirstColor()));
-				break;
-			}
-			case PlotArea::HorizontalLinearGradient:{
-				QLinearGradient linearGrad(scene_rect.topLeft(), scene_rect.topRight());
-				linearGrad.setColorAt(0, m_worksheet->backgroundFirstColor());
-				linearGrad.setColorAt(1, m_worksheet->backgroundSecondColor());
-				painter->setBrush(QBrush(linearGrad));
-				break;
-			}
-			case PlotArea::VerticalLinearGradient:{
-				QLinearGradient linearGrad(scene_rect.topLeft(), scene_rect.bottomLeft());
-				linearGrad.setColorAt(0, m_worksheet->backgroundFirstColor());
-				linearGrad.setColorAt(1, m_worksheet->backgroundSecondColor());
-				painter->setBrush(QBrush(linearGrad));
-				break;
-			}
-			case PlotArea::TopLeftDiagonalLinearGradient:{
-				QLinearGradient linearGrad(scene_rect.topLeft(), scene_rect.bottomRight());
-				linearGrad.setColorAt(0, m_worksheet->backgroundFirstColor());
-				linearGrad.setColorAt(1, m_worksheet->backgroundSecondColor());
-				painter->setBrush(QBrush(linearGrad));
-				break;
-			}
-			case PlotArea::BottomLeftDiagonalLinearGradient:{
-				QLinearGradient linearGrad(scene_rect.bottomLeft(), scene_rect.topRight());
-				linearGrad.setColorAt(0, m_worksheet->backgroundFirstColor());
-				linearGrad.setColorAt(1, m_worksheet->backgroundSecondColor());
-				painter->setBrush(QBrush(linearGrad));
-				break;
-			}
-			case PlotArea::RadialGradient:{
-				QRadialGradient radialGrad(scene_rect.center(), scene_rect.width()/2);
-				radialGrad.setColorAt(0, m_worksheet->backgroundFirstColor());
-				radialGrad.setColorAt(1, m_worksheet->backgroundSecondColor());
-				painter->setBrush(QBrush(radialGrad));
-				break;
-			}
-			default:
-				painter->setBrush(QBrush(m_worksheet->backgroundFirstColor()));
-		}
-		painter->drawRect(scene_rect);
-	}else if (m_worksheet->backgroundType() == PlotArea::Image){
-		const QString& backgroundFileName = m_worksheet->backgroundFileName().trimmed();
-		if ( !backgroundFileName.isEmpty() ) {
-			QPixmap pix(backgroundFileName);
-			switch (m_worksheet->backgroundImageStyle()){
-				case PlotArea::ScaledCropped:
-					pix = pix.scaled(scene_rect.size().toSize(),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation);
                
-					painter->drawPixmap(scene_rect.topLeft(),pix);
-					break;
-				case PlotArea::Scaled:
-					pix = pix.scaled(scene_rect.size().toSize(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
                
-					painter->drawPixmap(scene_rect.topLeft(),pix);
-					break;
-				case PlotArea::ScaledAspectRatio:
-					pix = pix.scaled(scene_rect.size().toSize(),Qt::KeepAspectRatio,Qt::SmoothTransformation);
                
-					painter->drawPixmap(scene_rect.topLeft(),pix);
-					break;
-				case PlotArea::Centered:
-					painter->drawPixmap(QPointF(scene_rect.center().x()-pix.size().width()/2,scene_rect.center().y()-pix.size().height()/2),pix);
                
-					break;
-				case PlotArea::Tiled:
-					painter->drawTiledPixmap(scene_rect,pix);
-					break;
-				case PlotArea::CenterTiled:
-					painter->drawTiledPixmap(scene_rect,pix,QPoint(scene_rect.size().width()/2,scene_rect.size().height()/2));
                
-					break;
-				default:
-					painter->drawPixmap(scene_rect.topLeft(),pix);
-			}
-		}
-	}else if (m_worksheet->backgroundType() == PlotArea::Pattern){
-		painter->setBrush(QBrush(m_worksheet->backgroundFirstColor(),m_worksheet->backgroundBrushStyle()));
                
-		painter->drawRect(scene_rect);
-	}
+    painter->save();
+
+    //painter->setRenderHint(QPainter::Antialiasing);
+    QRectF scene_rect = sceneRect();
+
+    if (!m_worksheet->useViewSize()) {
+        // background
+        if (!scene_rect.contains(rect))
+            painter->fillRect(rect, Qt::lightGray);
+
+        //shadow
+        int shadowSize = scene_rect.width()*0.02;
+        QRectF rightShadowRect(scene_rect.right(), scene_rect.top() + shadowSize,
+                                            shadowSize, scene_rect.height());
+        QRectF bottomShadowRect(scene_rect.left() + shadowSize, scene_rect.bottom(),
+                                            scene_rect.width(), shadowSize);
+
+        painter->fillRect(rightShadowRect.intersected(rect), Qt::darkGray);
+        painter->fillRect(bottomShadowRect.intersected(rect), Qt::darkGray);
+    }
+
+    // canvas
+    painter->setOpacity(m_worksheet->backgroundOpacity());
+    if (m_worksheet->backgroundType() == PlotArea::Color){
+        switch (m_worksheet->backgroundColorStyle()){
+            case PlotArea::SingleColor:{
+                painter->setBrush(QBrush(m_worksheet->backgroundFirstColor()));
+                break;
+            }
+            case PlotArea::HorizontalLinearGradient:{
+                QLinearGradient linearGrad(scene_rect.topLeft(), \
scene_rect.topRight()); +                linearGrad.setColorAt(0, \
m_worksheet->backgroundFirstColor()); +                linearGrad.setColorAt(1, \
m_worksheet->backgroundSecondColor()); +                \
painter->setBrush(QBrush(linearGrad)); +                break;
+            }
+            case PlotArea::VerticalLinearGradient:{
+                QLinearGradient linearGrad(scene_rect.topLeft(), \
scene_rect.bottomLeft()); +                linearGrad.setColorAt(0, \
m_worksheet->backgroundFirstColor()); +                linearGrad.setColorAt(1, \
m_worksheet->backgroundSecondColor()); +                \
painter->setBrush(QBrush(linearGrad)); +                break;
+            }
+            case PlotArea::TopLeftDiagonalLinearGradient:{
+                QLinearGradient linearGrad(scene_rect.topLeft(), \
scene_rect.bottomRight()); +                linearGrad.setColorAt(0, \
m_worksheet->backgroundFirstColor()); +                linearGrad.setColorAt(1, \
m_worksheet->backgroundSecondColor()); +                \
painter->setBrush(QBrush(linearGrad)); +                break;
+            }
+            case PlotArea::BottomLeftDiagonalLinearGradient:{
+                QLinearGradient linearGrad(scene_rect.bottomLeft(), \
scene_rect.topRight()); +                linearGrad.setColorAt(0, \
m_worksheet->backgroundFirstColor()); +                linearGrad.setColorAt(1, \
m_worksheet->backgroundSecondColor()); +                \
painter->setBrush(QBrush(linearGrad)); +                break;
+            }
+            case PlotArea::RadialGradient:{
+                QRadialGradient radialGrad(scene_rect.center(), \
scene_rect.width()/2); +                radialGrad.setColorAt(0, \
m_worksheet->backgroundFirstColor()); +                radialGrad.setColorAt(1, \
m_worksheet->backgroundSecondColor()); +                \
painter->setBrush(QBrush(radialGrad)); +                break;
+            }
+            default:
+                painter->setBrush(QBrush(m_worksheet->backgroundFirstColor()));
+        }
+        painter->drawRect(scene_rect);
+    }else if (m_worksheet->backgroundType() == PlotArea::Image){
+        const QString& backgroundFileName = \
m_worksheet->backgroundFileName().trimmed(); +        if ( \
!backgroundFileName.isEmpty() ) { +            QPixmap pix(backgroundFileName);
+            switch (m_worksheet->backgroundImageStyle()){
+                case PlotArea::ScaledCropped:
+                    pix = \
pix.scaled(scene_rect.size().toSize(),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation);
 +                    painter->drawPixmap(scene_rect.topLeft(),pix);
+                    break;
+                case PlotArea::Scaled:
+                    pix = \
pix.scaled(scene_rect.size().toSize(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
 +                    painter->drawPixmap(scene_rect.topLeft(),pix);
+                    break;
+                case PlotArea::ScaledAspectRatio:
+                    pix = \
pix.scaled(scene_rect.size().toSize(),Qt::KeepAspectRatio,Qt::SmoothTransformation); \
+                    painter->drawPixmap(scene_rect.topLeft(),pix); +                 \
break; +                case PlotArea::Centered:
+                    \
painter->drawPixmap(QPointF(scene_rect.center().x()-pix.size().width()/2,scene_rect.center().y()-pix.size().height()/2),pix);
 +                    break;
+                case PlotArea::Tiled:
+                    painter->drawTiledPixmap(scene_rect,pix);
+                    break;
+                case PlotArea::CenterTiled:
+                    \
painter->drawTiledPixmap(scene_rect,pix,QPoint(scene_rect.size().width()/2,scene_rect.size().height()/2));
 +                    break;
+                default:
+                    painter->drawPixmap(scene_rect.topLeft(),pix);
+            }
+        }
+    }else if (m_worksheet->backgroundType() == PlotArea::Pattern){
+        painter->setBrush(QBrush(m_worksheet->backgroundFirstColor(),m_worksheet->backgroundBrushStyle()));
 +        painter->drawRect(scene_rect);
+    }
 
   //grid
-	if (m_gridSettings.style != WorksheetView::NoGrid){
-		QColor c=m_gridSettings.color;
- 		c.setAlphaF(m_gridSettings.opacity);
-		painter->setPen(c);
-
-		qreal x, y;
-		qreal left = scene_rect.left();
-		qreal right = scene_rect.right();
-		qreal top = scene_rect.top();
-		qreal bottom = scene_rect.bottom();
-
-		if (m_gridSettings.style==WorksheetView::LineGrid){
-			QLineF line;
-
-			//horizontal lines
-			y = top + m_gridSettings.verticalSpacing;
-			while (y < bottom) {
-				line.setLine( left, y,  right, y );
-				painter->drawLine(line);
-				y += m_gridSettings.verticalSpacing;
-			}
-
-			//vertical lines
-			x = left + m_gridSettings.horizontalSpacing;
-			while (x < right) {
-				line.setLine( x, top,  x, bottom );
-				painter->drawLine(line);
-				x += m_gridSettings.horizontalSpacing;
-			}
-		}else{ //DotGrid
-			y = top + m_gridSettings.verticalSpacing;
-			while (y < bottom){
-				x = left;// + m_gridSettings.horizontalSpacing;
-				while (x < right){
-					x += m_gridSettings.horizontalSpacing;
-					painter->drawPoint(x, y);
-				}
-				y += m_gridSettings.verticalSpacing;
-			}
-		}
-	}
-
-	invalidateScene(rect, QGraphicsScene::BackgroundLayer);
-	painter->restore();
+    if (m_gridSettings.style != WorksheetView::NoGrid){
+        QColor c=m_gridSettings.color;
+        c.setAlphaF(m_gridSettings.opacity);
+        painter->setPen(c);
+
+        qreal x, y;
+        qreal left = scene_rect.left();
+        qreal right = scene_rect.right();
+        qreal top = scene_rect.top();
+        qreal bottom = scene_rect.bottom();
+
+        if (m_gridSettings.style==WorksheetView::LineGrid){
+            QLineF line;
+
+            //horizontal lines
+            y = top + m_gridSettings.verticalSpacing;
+            while (y < bottom) {
+                line.setLine( left, y,  right, y );
+                painter->drawLine(line);
+                y += m_gridSettings.verticalSpacing;
+            }
+
+            //vertical lines
+            x = left + m_gridSettings.horizontalSpacing;
+            while (x < right) {
+                line.setLine( x, top,  x, bottom );
+                painter->drawLine(line);
+                x += m_gridSettings.horizontalSpacing;
+            }
+        }else{ //DotGrid
+            y = top + m_gridSettings.verticalSpacing;
+            while (y < bottom){
+                x = left;// + m_gridSettings.horizontalSpacing;
+                while (x < right){
+                    x += m_gridSettings.horizontalSpacing;
+                    painter->drawPoint(x, y);
+                }
+                y += m_gridSettings.verticalSpacing;
+            }
+        }
+    }
+
+    invalidateScene(rect, QGraphicsScene::BackgroundLayer);
+    painter->restore();
 }
 
 //##############################################################################
 //####################################  Events   ###############################
 //##############################################################################
 void WorksheetView::resizeEvent(QResizeEvent *event) {
-	if (m_worksheet->useViewSize())
-		this->processResize();
+    if (m_worksheet->useViewSize())
+        this->processResize();
 
-	QGraphicsView::resizeEvent(event);
+    QGraphicsView::resizeEvent(event);
 }
 
 void WorksheetView::wheelEvent(QWheelEvent *event) {
   if (m_mouseMode == ZoomSelectionMode){
-	if (event->delta() > 0)
-		scale(1.2, 1.2);
-	else if (event->delta() < 0)
-		scale(1.0/1.2, 1.0/1.2);
+    if (event->delta() > 0)
+        scale(1.2, 1.2);
+    else if (event->delta() < 0)
+        scale(1.0/1.2, 1.0/1.2);
   }else{
-	QGraphicsView::wheelEvent(event);
+    QGraphicsView::wheelEvent(event);
   }
 }
 
 void WorksheetView::mousePressEvent(QMouseEvent* event) {
-	if (m_mouseMode == ZoomSelectionMode) {
-		m_selectionStart = event->pos();
-		m_selectionBandIsShown = true;
-	}
-
-	//prevent the deselection of items when context menu event
-	//was triggered (right button click)
-	if (event->button() != Qt::LeftButton) {
+    if (m_mouseMode == ZoomSelectionMode) {
+        m_selectionStart = event->pos();
+        m_selectionBandIsShown = true;
+    }
+
+    //prevent the deselection of items when context menu event
+    //was triggered (right button click)
+    if (event->button() != Qt::LeftButton) {
         event->accept();
         return;
     }
 
-	// select the worksheet in the project explorer if the view was clicked
-	// and there is no selection currently. We need this for the case when
-	// there is a single worksheet in the project and we change from the project-node
-	// in the project explorer to the worksheet-node by clicking the view.
-	if ( scene()->selectedItems().empty() )
-		m_worksheet->setSelectedInView(true);
+    // select the worksheet in the project explorer if the view was clicked
+    // and there is no selection currently. We need this for the case when
+    // there is a single worksheet in the project and we change from the \
project-node +    // in the project explorer to the worksheet-node by clicking the \
view. +    if ( scene()->selectedItems().empty() )
+        m_worksheet->setSelectedInView(true);
 
-	QGraphicsView::mousePressEvent(event);
+    QGraphicsView::mousePressEvent(event);
 }
 
 void WorksheetView::mouseReleaseEvent(QMouseEvent* event) {
-	if (m_mouseMode == ZoomSelectionMode) {
-		m_selectionBandIsShown = false;
-		viewport()->repaint(QRect(m_selectionStart, m_selectionEnd).normalized());
-
-		//don't zoom if very small region was selected, avoid occasional/unwanted zooming
-		m_selectionEnd = event->pos();
-		if ( abs(m_selectionEnd.x()-m_selectionStart.x())>20 && \
                abs(m_selectionEnd.y()-m_selectionStart.y())>20 )
-			fitInView(mapToScene(QRect(m_selectionStart, \
                m_selectionEnd).normalized()).boundingRect(), Qt::KeepAspectRatio);
-	}
-	QGraphicsView::mouseReleaseEvent(event);
+    if (m_mouseMode == ZoomSelectionMode) {
+        m_selectionBandIsShown = false;
+        viewport()->repaint(QRect(m_selectionStart, m_selectionEnd).normalized());
+
+        //don't zoom if very small region was selected, avoid occasional/unwanted \
zooming +        m_selectionEnd = event->pos();
+        if ( abs(m_selectionEnd.x()-m_selectionStart.x())>20 && \
abs(m_selectionEnd.y()-m_selectionStart.y())>20 ) +            \
fitInView(mapToScene(QRect(m_selectionStart, \
m_selectionEnd).normalized()).boundingRect(), Qt::KeepAspectRatio); +    }
+    QGraphicsView::mouseReleaseEvent(event);
 }
 
 void WorksheetView::mouseMoveEvent(QMouseEvent* event) {
-	if (m_mouseMode == SelectionMode && m_cartesianPlotMouseMode != \
                CartesianPlot::SelectionMode ) {
-		//check whether there is a cartesian plot under the cursor
-		bool plot = false;
-		QGraphicsItem* item = itemAt(event->pos());
-		if (item) {
-			plot = item->data(0).toInt() == WorksheetElement::NameCartesianPlot;
-			if (!plot && item->parentItem())
-				plot = item->parentItem()->data(0).toInt() == \
                WorksheetElement::NameCartesianPlot;
-		}
-
-		//set the cursor appearance according to the current mouse mode for the cartesian \
                plots
-		if (plot) {
-			if (m_cartesianPlotMouseMode == CartesianPlot::ZoomSelectionMode) {
-				setCursor(Qt::CrossCursor);
-			} else if (m_cartesianPlotMouseMode == CartesianPlot::ZoomXSelectionMode) {
-				setCursor(Qt::SizeHorCursor);
-			} else if (m_cartesianPlotMouseMode == CartesianPlot::ZoomYSelectionMode) {
-				setCursor(Qt::SizeVerCursor);
-			}
-		} else {
-			setCursor(Qt::ArrowCursor);
-		}
-	} else if (m_mouseMode == SelectionMode && m_cartesianPlotMouseMode == \
                CartesianPlot::SelectionMode ) {
-		setCursor(Qt::ArrowCursor);
-	} else if (m_selectionBandIsShown) {
-		m_selectionEnd = event->pos();
-		viewport()->repaint(QRect(m_selectionStart, m_selectionEnd).normalized());
-	}
-
-	QGraphicsView::mouseMoveEvent(event);
+    if (m_mouseMode == SelectionMode && m_cartesianPlotMouseMode != \
CartesianPlot::SelectionMode ) { +        //check whether there is a cartesian plot \
under the cursor +        bool plot = false;
+        QGraphicsItem* item = itemAt(event->pos());
+        if (item) {
+            plot = item->data(0).toInt() == WorksheetElement::NameCartesianPlot;
+            if (!plot && item->parentItem())
+                plot = item->parentItem()->data(0).toInt() == \
WorksheetElement::NameCartesianPlot; +        }
+
+        //set the cursor appearance according to the current mouse mode for the \
cartesian plots +        if (plot) {
+            if (m_cartesianPlotMouseMode == CartesianPlot::ZoomSelectionMode) {
+                setCursor(Qt::CrossCursor);
+            } else if (m_cartesianPlotMouseMode == \
CartesianPlot::ZoomXSelectionMode) { +                setCursor(Qt::SizeHorCursor);
+            } else if (m_cartesianPlotMouseMode == \
CartesianPlot::ZoomYSelectionMode) { +                setCursor(Qt::SizeVerCursor);
+            }
+        } else {
+            setCursor(Qt::ArrowCursor);
+        }
+    } else if (m_mouseMode == SelectionMode && m_cartesianPlotMouseMode == \
CartesianPlot::SelectionMode ) { +        setCursor(Qt::ArrowCursor);
+    } else if (m_selectionBandIsShown) {
+        m_selectionEnd = event->pos();
+        viewport()->repaint(QRect(m_selectionStart, m_selectionEnd).normalized());
+    }
+
+    QGraphicsView::mouseMoveEvent(event);
 }
 
 void WorksheetView::contextMenuEvent(QContextMenuEvent* e) {
-	if ( !itemAt(e->pos()) ){
-		//no item under the cursor -> show the context menu for the worksheet
-		QMenu *menu = new QMenu(this);
-		this->createContextMenu(menu);
-		menu->exec(QCursor::pos());
-	}else{
-		//propagate the event to the scene and graphics items
-		QGraphicsView::contextMenuEvent(e);
-	}
+    if ( !itemAt(e->pos()) ){
+        //no item under the cursor -> show the context menu for the worksheet
+        QMenu *menu = new QMenu(this);
+        this->createContextMenu(menu);
+        menu->exec(QCursor::pos());
+    }else{
+        //propagate the event to the scene and graphics items
+        QGraphicsView::contextMenuEvent(e);
+    }
 }
 
 //##############################################################################
 //####################################  SLOTs   ################################
 //##############################################################################
 void WorksheetView::useViewSizeRequested() {
-	if (m_worksheet->useViewSize()) {
-		setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-		setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-		zoomFitPageHeightAction->setVisible(false);
-		zoomFitPageWidthAction->setVisible(false);
-		currentZoomAction = zoomInViewAction;
-		if (tbZoom)
-			tbZoom->setDefaultAction(zoomInViewAction);
-
-		//determine and set the current view size
-		this->processResize();
-	} else {
-		setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-		setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-		zoomFitPageHeightAction->setVisible(true);
-		zoomFitPageWidthAction->setVisible(true);
-	}
+    if (m_worksheet->useViewSize()) {
+        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        zoomFitPageHeightAction->setVisible(false);
+        zoomFitPageWidthAction->setVisible(false);
+        currentZoomAction = zoomInViewAction;
+        if (tbZoom)
+            tbZoom->setDefaultAction(zoomInViewAction);
+
+        //determine and set the current view size
+        this->processResize();
+    } else {
+        setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+        setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+        zoomFitPageHeightAction->setVisible(true);
+        zoomFitPageWidthAction->setVisible(true);
+    }
 }
 
 void WorksheetView::processResize() {
-	if (size() != sceneRect().size()) {
-		static const float hscale = \
QApplication::desktop()->physicalDpiX()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
                
-		static const float vscale = \
QApplication::desktop()->physicalDpiY()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
                
-		m_worksheet->setUndoAware(false);
-		m_worksheet->setPageRect(QRectF(0.0, 0.0, width()/hscale, height()/vscale));
-		m_worksheet->setUndoAware(true);
-	}
+    if (size() != sceneRect().size()) {
+        static const float hscale = \
QApplication::desktop()->physicalDpiX()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
 +        static const float vscale = \
QApplication::desktop()->physicalDpiY()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
 +        m_worksheet->setUndoAware(false);
+        m_worksheet->setPageRect(QRectF(0.0, 0.0, width()/hscale, height()/vscale));
+        m_worksheet->setUndoAware(true);
+    }
 }
 
 void WorksheetView::changeZoom(QAction* action){
-	if (action==zoomInViewAction){
-		scale(1.2, 1.2);
-	}else if (action==zoomOutViewAction){
-		scale(1.0/1.2, 1.0/1.2);
-	}else if (action==zoomOriginAction){
-		static const float hscale = \
QApplication::desktop()->physicalDpiX()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
                
-		static const float vscale = \
QApplication::desktop()->physicalDpiY()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
                
-		setTransform(QTransform::fromScale(hscale, vscale));
-	}else if (action==zoomFitPageWidthAction){
-		float scaleFactor = viewport()->width()/scene()->sceneRect().width();
-		setTransform(QTransform::fromScale(scaleFactor, scaleFactor));
-	}else if (action==zoomFitPageHeightAction){
-		float scaleFactor = viewport()->height()/scene()->sceneRect().height();
-		setTransform(QTransform::fromScale(scaleFactor, scaleFactor));
-	}else if (action==zoomFitSelectionAction){
-		fitInView(scene()->selectionArea().boundingRect(),Qt::KeepAspectRatio);
-	}
-	currentZoomAction=action;
-	if (tbZoom)
-		tbZoom->setDefaultAction(action);
+    if (action==zoomInViewAction){
+        scale(1.2, 1.2);
+    }else if (action==zoomOutViewAction){
+        scale(1.0/1.2, 1.0/1.2);
+    }else if (action==zoomOriginAction){
+        static const float hscale = \
QApplication::desktop()->physicalDpiX()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
 +        static const float vscale = \
QApplication::desktop()->physicalDpiY()/(25.4*Worksheet::convertToSceneUnits(1,Worksheet::Millimeter));
 +        setTransform(QTransform::fromScale(hscale, vscale));
+    }else if (action==zoomFitPageWidthAction){
+        float scaleFactor = viewport()->width()/scene()->sceneRect().width();
+        setTransform(QTransform::fromScale(scaleFactor, scaleFactor));
+    }else if (action==zoomFitPageHeightAction){
+        float scaleFactor = viewport()->height()/scene()->sceneRect().height();
+        setTransform(QTransform::fromScale(scaleFactor, scaleFactor));
+    }else if (action==zoomFitSelectionAction){
+        fitInView(scene()->selectionArea().boundingRect(),Qt::KeepAspectRatio);
+    }
+    currentZoomAction=action;
+    if (tbZoom)
+        tbZoom->setDefaultAction(action);
 }
 
 void WorksheetView::mouseModeChanged(QAction* action) {
-	if (action==selectionModeAction) {
-		m_mouseMode = SelectionMode;
-		setInteractive(true);
-		setDragMode(QGraphicsView::NoDrag);
-	} else if (action==navigationModeAction) {
-		m_mouseMode = NavigationMode;
-		setInteractive(false);
-		setDragMode(QGraphicsView::ScrollHandDrag);
-	} else {
-		m_mouseMode = ZoomSelectionMode;
-		setInteractive(false);
-		setDragMode(QGraphicsView::NoDrag);
-	}
+    if (action==selectionModeAction) {
+        m_mouseMode = SelectionMode;
+        setInteractive(true);
+        setDragMode(QGraphicsView::NoDrag);
+    } else if (action==navigationModeAction) {
+        m_mouseMode = NavigationMode;
+        setInteractive(false);
+        setDragMode(QGraphicsView::ScrollHandDrag);
+    } else {
+        m_mouseMode = ZoomSelectionMode;
+        setInteractive(false);
+        setDragMode(QGraphicsView::NoDrag);
+    }
 }
 
 //"Add new" related slots
 void WorksheetView::addNew(QAction* action){
-	WorksheetElement* aspect = 0;
-	if ( action == addCartesianPlot1Action ){
-		CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
-		plot->initDefault(CartesianPlot::FourAxes);
-		plot->setMouseMode(m_cartesianPlotMouseMode);
-		aspect = plot;
-		if (tbNewCartesianPlot)
-			tbNewCartesianPlot->setDefaultAction(addCartesianPlot1Action);
-	}else if ( action == addCartesianPlot2Action ){
-		CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
-		plot->initDefault(CartesianPlot::TwoAxes);
-		plot->setMouseMode(m_cartesianPlotMouseMode);
-		aspect = plot;
-		if (tbNewCartesianPlot)
-			tbNewCartesianPlot->setDefaultAction(addCartesianPlot2Action);
-	}else if ( action == addCartesianPlot3Action ){
-		CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
-		plot->initDefault(CartesianPlot::TwoAxesCentered);
-		plot->setMouseMode(m_cartesianPlotMouseMode);
-		aspect = plot;
-		if (tbNewCartesianPlot)
-			tbNewCartesianPlot->setDefaultAction(addCartesianPlot3Action);
-	}else if ( action == addCartesianPlot4Action ){
-		CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
-		plot->initDefault(CartesianPlot::TwoAxesCenteredZero);
-		plot->setMouseMode(m_cartesianPlotMouseMode);
-		aspect = plot;
-		if (tbNewCartesianPlot)
-			tbNewCartesianPlot->setDefaultAction(addCartesianPlot4Action);
-	}else if ( action == addTextLabelAction ){
-		TextLabel* l = new TextLabel(i18n("text label"));
-		l->setText(i18n("text label"));
-		aspect = l;
-	}
-
-	if (!aspect)
-		return;
-
-	m_worksheet->addChild(aspect);
-	handleCartesianPlotActions();
-
-	if (!m_fadeInTimeLine) {
-		m_fadeInTimeLine = new QTimeLine(1000, this);
-		m_fadeInTimeLine->setFrameRange(0, 100);
-		connect(m_fadeInTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(fadeIn(qreal)));
-	}
-
-	//if there is already an element fading in, stop the time line and show the element \
                with the full opacity.
-	if (m_fadeInTimeLine->state() == QTimeLine::Running) {
-		m_fadeInTimeLine->stop();
-		QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
-		effect->setOpacity(1);
-		lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
-	}
-
-	//fade-in the newly added element
-	lastAddedWorksheetElement = aspect;
-	QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
-	effect->setOpacity(0);
-	lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
-	m_fadeInTimeLine->start();
+    WorksheetElement* aspect = 0;
+    if ( action == addCartesianPlot1Action ){
+        CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
+        plot->initDefault(CartesianPlot::FourAxes);
+        plot->setMouseMode(m_cartesianPlotMouseMode);
+        aspect = plot;
+        if (tbNewCartesianPlot)
+            tbNewCartesianPlot->setDefaultAction(addCartesianPlot1Action);
+    }else if ( action == addCartesianPlot2Action ){
+        CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
+        plot->initDefault(CartesianPlot::TwoAxes);
+        plot->setMouseMode(m_cartesianPlotMouseMode);
+        aspect = plot;
+        if (tbNewCartesianPlot)
+            tbNewCartesianPlot->setDefaultAction(addCartesianPlot2Action);
+    }else if ( action == addCartesianPlot3Action ){
+        CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
+        plot->initDefault(CartesianPlot::TwoAxesCentered);
+        plot->setMouseMode(m_cartesianPlotMouseMode);
+        aspect = plot;
+        if (tbNewCartesianPlot)
+            tbNewCartesianPlot->setDefaultAction(addCartesianPlot3Action);
+    }else if ( action == addCartesianPlot4Action ){
+        CartesianPlot* plot = new CartesianPlot(i18n("xy-plot"));
+        plot->initDefault(CartesianPlot::TwoAxesCenteredZero);
+        plot->setMouseMode(m_cartesianPlotMouseMode);
+        aspect = plot;
+        if (tbNewCartesianPlot)
+            tbNewCartesianPlot->setDefaultAction(addCartesianPlot4Action);
+    }else if ( action == addTextLabelAction ){
+        TextLabel* l = new TextLabel(i18n("text label"));
+        l->setText(i18n("text label"));
+        aspect = l;
+    }
+
+    if (!aspect)
+        return;
+
+    m_worksheet->addChild(aspect);
+    handleCartesianPlotActions();
+
+    if (!m_fadeInTimeLine) {
+        m_fadeInTimeLine = new QTimeLine(1000, this);
+        m_fadeInTimeLine->setFrameRange(0, 100);
+        connect(m_fadeInTimeLine, SIGNAL(valueChanged(qreal)), this, \
SLOT(fadeIn(qreal))); +    }
+
+    //if there is already an element fading in, stop the time line and show the \
element with the full opacity. +    if (m_fadeInTimeLine->state() == \
QTimeLine::Running) { +        m_fadeInTimeLine->stop();
+        QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
+        effect->setOpacity(1);
+        lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
+    }
+
+    //fade-in the newly added element
+    lastAddedWorksheetElement = aspect;
+    QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
+    effect->setOpacity(0);
+    lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
+    m_fadeInTimeLine->start();
 }
 
 /*!
  * select all top-level items
  */
 void WorksheetView::selectAllElements() {
-	//deselect all previously selected items since there can be some non top-level \
                items belong them
-	m_suppressSelectionChangedEvent = true;
-	QList<QGraphicsItem*> items = scene()->selectedItems();
-	foreach ( QGraphicsItem* item , m_selectedItems ){
-		m_worksheet->setItemSelectedInView(item, false);
-	}
-
-	//select top-level items
-	items = scene()->items();
-	foreach(QGraphicsItem* item, items){
-		if (!item->parentItem())
-			item->setSelected(true);
-	}
-	m_suppressSelectionChangedEvent = false;
-	this->selectionChanged();
+    //deselect all previously selected items since there can be some non top-level \
items belong them +    m_suppressSelectionChangedEvent = true;
+    QList<QGraphicsItem*> items = scene()->selectedItems();
+    foreach ( QGraphicsItem* item , m_selectedItems ){
+        m_worksheet->setItemSelectedInView(item, false);
+    }
+
+    //select top-level items
+    items = scene()->items();
+    foreach(QGraphicsItem* item, items){
+        if (!item->parentItem())
+            item->setSelected(true);
+    }
+    m_suppressSelectionChangedEvent = false;
+    this->selectionChanged();
 }
 
 /*!
  * deletes selected worksheet elements
  */
 void WorksheetView::deleteElement() {
-	QList<QGraphicsItem*> items = scene()->selectedItems();
-	if (items.size()==0)
-		return;
-
-	int rc = KMessageBox::warningYesNo( this,
-			i18np("Do you really want to delete the selected object?", "Do you really want to \
                delete the selected %1 objects?", items.size()),
-			i18n("Delete selected objects"));
-
-	if (rc==KMessageBox::No)
-		return;
-
-	m_suppressSelectionChangedEvent = true;
-	m_worksheet->beginMacro(i18n("%1: Remove selected worksheet elements.", \
                m_worksheet->name()));
-	foreach ( QGraphicsItem* item , m_selectedItems ) {
-		m_worksheet->deleteAspectFromGraphicsItem(item);
-	}
-	m_worksheet->endMacro();
-	m_suppressSelectionChangedEvent = false;
+    QList<QGraphicsItem*> items = scene()->selectedItems();
+    if (items.size()==0)
+        return;
+
+    int rc = KMessageBox::warningYesNo( this,
+            i18np("Do you really want to delete the selected object?", "Do you \
really want to delete the selected %1 objects?", items.size()), +            \
i18n("Delete selected objects")); +
+    if (rc==KMessageBox::No)
+        return;
+
+    m_suppressSelectionChangedEvent = true;
+    m_worksheet->beginMacro(i18n("%1: Remove selected worksheet elements.", \
m_worksheet->name())); +    foreach ( QGraphicsItem* item , m_selectedItems ) {
+        m_worksheet->deleteAspectFromGraphicsItem(item);
+    }
+    m_worksheet->endMacro();
+    m_suppressSelectionChangedEvent = false;
 }
 
 void WorksheetView::aspectAboutToBeRemoved(const AbstractAspect* aspect){
-	lastAddedWorksheetElement = \
                dynamic_cast<WorksheetElement*>(const_cast<AbstractAspect*>(aspect));
-	if (!lastAddedWorksheetElement)
-		return;
+    lastAddedWorksheetElement = \
dynamic_cast<WorksheetElement*>(const_cast<AbstractAspect*>(aspect)); +    if \
(!lastAddedWorksheetElement) +        return;
 
-	//FIXME: fading-out doesn't work
-	//also, the following code collides with undo/redo of the deletion
-	//of a worksheet element (after redoing the element is not shown with the full \
opacity +    //FIXME: fading-out doesn't work
+    //also, the following code collides with undo/redo of the deletion
+    //of a worksheet element (after redoing the element is not shown with the full \
opacity  /*
-	if (!m_fadeOutTimeLine) {
-		m_fadeOutTimeLine = new QTimeLine(1000, this);
-		m_fadeOutTimeLine->setFrameRange(0, 100);
-		connect(m_fadeOutTimeLine, SIGNAL(valueChanged(qreal)), this, \
                SLOT(fadeOut(qreal)));
-	}
+    if (!m_fadeOutTimeLine) {
+        m_fadeOutTimeLine = new QTimeLine(1000, this);
+        m_fadeOutTimeLine->setFrameRange(0, 100);
+        connect(m_fadeOutTimeLine, SIGNAL(valueChanged(qreal)), this, \
SLOT(fadeOut(qreal))); +    }
 
-	//if there is already an element fading out, stop the time line
-	if (m_fadeOutTimeLine->state() == QTimeLine::Running)
-		m_fadeOutTimeLine->stop();
+    //if there is already an element fading out, stop the time line
+    if (m_fadeOutTimeLine->state() == QTimeLine::Running)
+        m_fadeOutTimeLine->stop();
 
-	m_fadeOutTimeLine->start();
+    m_fadeOutTimeLine->start();
 */
 }
 
 void WorksheetView::fadeIn(qreal value) {
-	QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
-	effect->setOpacity(value);
-	lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
+    QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
+    effect->setOpacity(value);
+    lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
 }
 
 void WorksheetView::fadeOut(qreal value) {
-	QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
-	effect->setOpacity(1-value);
-	lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
+    QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect();
+    effect->setOpacity(1-value);
+    lastAddedWorksheetElement->graphicsItem()->setGraphicsEffect(effect);
 }
 
 /*!
@@ -986,82 +986,82 @@ void WorksheetView::fadeOut(qreal value) {
  * sets the layout in Worksheet and enables/disables the layout actions.
  */
 void WorksheetView::changeLayout(QAction* action){
-	if (action==breakLayoutAction){
-		verticalLayoutAction->setEnabled(true);
-		verticalLayoutAction->setChecked(false);
-
-		horizontalLayoutAction->setEnabled(true);
-		horizontalLayoutAction->setChecked(false);
-
-		gridLayoutAction->setEnabled(true);
-		gridLayoutAction->setChecked(false);
-
-		breakLayoutAction->setEnabled(false);
-
-		m_worksheet->setLayout(Worksheet::NoLayout);
-	}else{
-		verticalLayoutAction->setEnabled(false);
-		horizontalLayoutAction->setEnabled(false);
-		gridLayoutAction->setEnabled(false);
-		breakLayoutAction->setEnabled(true);
-
-		if (action == verticalLayoutAction){
-			verticalLayoutAction->setChecked(true);
-			m_worksheet->setLayout(Worksheet::VerticalLayout);
-		}else if (action == horizontalLayoutAction){
-			horizontalLayoutAction->setChecked(true);
-			m_worksheet->setLayout(Worksheet::HorizontalLayout);
-		}else{
-			gridLayoutAction->setChecked(true);
-			m_worksheet->setLayout(Worksheet::GridLayout);
-		}
-	}
+    if (action==breakLayoutAction){
+        verticalLayoutAction->setEnabled(true);
+        verticalLayoutAction->setChecked(false);
+
+        horizontalLayoutAction->setEnabled(true);
+        horizontalLayoutAction->setChecked(false);
+
+        gridLayoutAction->setEnabled(true);
+        gridLayoutAction->setChecked(false);
+
+        breakLayoutAction->setEnabled(false);
+
+        m_worksheet->setLayout(Worksheet::NoLayout);
+    }else{
+        verticalLayoutAction->setEnabled(false);
+        horizontalLayoutAction->setEnabled(false);
+        gridLayoutAction->setEnabled(false);
+        breakLayoutAction->setEnabled(true);
+
+        if (action == verticalLayoutAction){
+            verticalLayoutAction->setChecked(true);
+            m_worksheet->setLayout(Worksheet::VerticalLayout);
+        }else if (action == horizontalLayoutAction){
+            horizontalLayoutAction->setChecked(true);
+            m_worksheet->setLayout(Worksheet::HorizontalLayout);
+        }else{
+            gridLayoutAction->setChecked(true);
+            m_worksheet->setLayout(Worksheet::GridLayout);
+        }
+    }
 }
 
 void WorksheetView::changeGrid(QAction* action){
-	QString name = action->objectName();
-
-	if (name == "noGridAction"){
-		m_gridSettings.style = WorksheetView::NoGrid;
-		snapToGridAction->setEnabled(false);
-	}else if (name == "sparseLineGridAction"){
-		m_gridSettings.style = WorksheetView::LineGrid;
-		m_gridSettings.color = Qt::gray;
-		m_gridSettings.opacity = 0.7;
-		m_gridSettings.horizontalSpacing = 15;
-		m_gridSettings.verticalSpacing = 15;
-	}else if (name == "denseLineGridAction"){
-		m_gridSettings.style = WorksheetView::LineGrid;
-		m_gridSettings.color = Qt::gray;
-		m_gridSettings.opacity = 0.7;
-		m_gridSettings.horizontalSpacing = 5;
-		m_gridSettings.verticalSpacing = 5;
-	}else if (name == "denseDotGridAction"){
-		m_gridSettings.style = WorksheetView::DotGrid;
-		m_gridSettings.color = Qt::black;
-		m_gridSettings.opacity = 0.7;
-		m_gridSettings.horizontalSpacing = 5;
-		m_gridSettings.verticalSpacing = 5;
-	}else if (name == "sparseDotGridAction"){
-		m_gridSettings.style = WorksheetView::DotGrid;
-		m_gridSettings.color = Qt::black;
-		m_gridSettings.opacity = 0.7;
-		m_gridSettings.horizontalSpacing = 15;
-		m_gridSettings.verticalSpacing = 15;
-	}else if (name == "customGridAction"){
-		GridDialog* dlg = new GridDialog(this);
-		if (dlg->exec() == QDialog::Accepted)
-			dlg->save(m_gridSettings);
-		else
-			return;
-	}
-
-	if (m_gridSettings.style == WorksheetView::NoGrid)
-		snapToGridAction->setEnabled(false);
-	else
-		snapToGridAction->setEnabled(true);
-
-	invalidateScene(sceneRect(), QGraphicsScene::BackgroundLayer);
+    QString name = action->objectName();
+
+    if (name == "noGridAction"){
+        m_gridSettings.style = WorksheetView::NoGrid;
+        snapToGridAction->setEnabled(false);
+    }else if (name == "sparseLineGridAction"){
+        m_gridSettings.style = WorksheetView::LineGrid;
+        m_gridSettings.color = Qt::gray;
+        m_gridSettings.opacity = 0.7;
+        m_gridSettings.horizontalSpacing = 15;
+        m_gridSettings.verticalSpacing = 15;
+    }else if (name == "denseLineGridAction"){
+        m_gridSettings.style = WorksheetView::LineGrid;
+        m_gridSettings.color = Qt::gray;
+        m_gridSettings.opacity = 0.7;
+        m_gridSettings.horizontalSpacing = 5;
+        m_gridSettings.verticalSpacing = 5;
+    }else if (name == "denseDotGridAction"){
+        m_gridSettings.style = WorksheetView::DotGrid;
+        m_gridSettings.color = Qt::black;
+        m_gridSettings.opacity = 0.7;
+        m_gridSettings.horizontalSpacing = 5;
+        m_gridSettings.verticalSpacing = 5;
+    }else if (name == "sparseDotGridAction"){
+        m_gridSettings.style = WorksheetView::DotGrid;
+        m_gridSettings.color = Qt::black;
+        m_gridSettings.opacity = 0.7;
+        m_gridSettings.horizontalSpacing = 15;
+        m_gridSettings.verticalSpacing = 15;
+    }else if (name == "customGridAction"){
+        GridDialog* dlg = new GridDialog(this);
+        if (dlg->exec() == QDialog::Accepted)
+            dlg->save(m_gridSettings);
+        else
+            return;
+    }
+
+    if (m_gridSettings.style == WorksheetView::NoGrid)
+        snapToGridAction->setEnabled(false);
+    else
+        snapToGridAction->setEnabled(true);
+
+    invalidateScene(sceneRect(), QGraphicsScene::BackgroundLayer);
 }
 
 //TODO
@@ -1075,11 +1075,11 @@ void WorksheetView::changeSnapToGrid(){
  *  and is finally handled here.
  */
 void WorksheetView::selectItem(QGraphicsItem* item){
-	m_suppressSelectionChangedEvent = true;
-	item->setSelected(true);
-	m_selectedItems<<item;
-	handleCartesianPlotActions();
-	m_suppressSelectionChangedEvent = false;
+    m_suppressSelectionChangedEvent = true;
+    item->setSelected(true);
+    m_selectedItems<<item;
+    handleCartesianPlotActions();
+    m_suppressSelectionChangedEvent = false;
 }
 
 /*!
@@ -1088,11 +1088,11 @@ void WorksheetView::selectItem(QGraphicsItem* item){
  *  and is finally handled here.
  */
 void WorksheetView::deselectItem(QGraphicsItem* item){
-	m_suppressSelectionChangedEvent = true;
-	item->setSelected(false);
-	m_selectedItems.removeOne(item);
-	handleCartesianPlotActions();
-	m_suppressSelectionChangedEvent = false;
+    m_suppressSelectionChangedEvent = true;
+    item->setSelected(false);
+    m_selectedItems.removeOne(item);
+    handleCartesianPlotActions();
+    m_suppressSelectionChangedEvent = false;
 }
 
 /*!
@@ -1101,187 +1101,187 @@ void WorksheetView::deselectItem(QGraphicsItem* item){
  *  and forwards these changes to \c Worksheet
  */
 void WorksheetView::selectionChanged(){
-	if (m_suppressSelectionChangedEvent)
-		return;
-
-	QList<QGraphicsItem*> items = scene()->selectedItems();
-
-	//When making a graphics item invisible, it gets deselected in the scene.
-	//In this case we don't want to deselect the item in the project explorer.
-	bool invisibleDeselected = false;
-
-	//check, whether the previously selected items were deselected now.
-	//Forward the deselection prior to the selection of new items
-	//in order to avoid the unwanted multiple selection in project explorer
-	foreach ( QGraphicsItem* item, m_selectedItems ){
-		if ( items.indexOf(item) == -1 ) {
-			if (item->isVisible())
-				m_worksheet->setItemSelectedInView(item, false);
-			else
-				invisibleDeselected = true;
-		}
-	}
-
-	//select new items
-	if (items.size() == 0 && invisibleDeselected == false){
-		//no items selected -> select the worksheet again.
-		m_worksheet->setSelectedInView(true);
-	}else{
-		foreach (const QGraphicsItem* item, items)
-			m_worksheet->setItemSelectedInView(item, true);
-
-		//items selected -> deselect the worksheet in the project explorer
-		//prevents unwanted multiple selection with worksheet (if it was selected before)
-		m_worksheet->setSelectedInView(false);
-	}
-
-	m_selectedItems = items;
-	handleCartesianPlotActions();
+    if (m_suppressSelectionChangedEvent)
+        return;
+
+    QList<QGraphicsItem*> items = scene()->selectedItems();
+
+    //When making a graphics item invisible, it gets deselected in the scene.
+    //In this case we don't want to deselect the item in the project explorer.
+    bool invisibleDeselected = false;
+
+    //check, whether the previously selected items were deselected now.
+    //Forward the deselection prior to the selection of new items
+    //in order to avoid the unwanted multiple selection in project explorer
+    foreach ( QGraphicsItem* item, m_selectedItems ){
+        if ( items.indexOf(item) == -1 ) {
+            if (item->isVisible())
+                m_worksheet->setItemSelectedInView(item, false);
+            else
+                invisibleDeselected = true;
+        }
+    }
+
+    //select new items
+    if (items.size() == 0 && invisibleDeselected == false){
+        //no items selected -> select the worksheet again.
+        m_worksheet->setSelectedInView(true);
+    }else{
+        foreach (const QGraphicsItem* item, items)
+            m_worksheet->setItemSelectedInView(item, true);
+
+        //items selected -> deselect the worksheet in the project explorer
+        //prevents unwanted multiple selection with worksheet (if it was selected \
before) +        m_worksheet->setSelectedInView(false);
+    }
+
+    m_selectedItems = items;
+    handleCartesianPlotActions();
 }
 
 //check whether we have cartesian plots selected and activate/deactivate
 void WorksheetView::handleCartesianPlotActions() {
-	bool plot = false;
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		//check whether we have cartesian plots selected
-		foreach (QGraphicsItem* item , m_selectedItems) {
-			if (item->data(0).toInt() == WorksheetElement::NameCartesianPlot) {
-				plot = true;
-				break;
-			}
-		}
-	} else {
-		//actions are applied to all available plots -> check whether we have plots
-		plot = (m_worksheet->children<CartesianPlot>().size() != 0);
-	}
-
-	cartesianPlotSelectionModeAction->setEnabled(plot);
-	cartesianPlotZoomSelectionModeAction->setEnabled(plot);
-	cartesianPlotZoomXSelectionModeAction->setEnabled(plot);
-	cartesianPlotZoomYSelectionModeAction->setEnabled(plot);
-
-	addCurveAction->setEnabled(plot);
-	addEquationCurveAction->setEnabled(plot);
-	addFitCurveAction->setEnabled(plot);
-	addHorizontalAxisAction->setEnabled(plot);
-	addVerticalAxisAction->setEnabled(plot);
-	addLegendAction->setEnabled(plot);
-
-	scaleAutoXAction->setEnabled(plot);
-	scaleAutoYAction->setEnabled(plot);
-	scaleAutoAction->setEnabled(plot);
-	zoomInAction->setEnabled(plot);
-	zoomOutAction->setEnabled(plot);
-	zoomInXAction->setEnabled(plot);
-	zoomOutXAction->setEnabled(plot);
-	zoomInYAction->setEnabled(plot);
-	zoomOutYAction->setEnabled(plot);
-	shiftLeftXAction->setEnabled(plot);
-	shiftRightXAction->setEnabled(plot);
-	shiftUpYAction->setEnabled(plot);
-	shiftDownYAction->setEnabled(plot);
+    bool plot = false;
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        //check whether we have cartesian plots selected
+        foreach (QGraphicsItem* item , m_selectedItems) {
+            if (item->data(0).toInt() == WorksheetElement::NameCartesianPlot) {
+                plot = true;
+                break;
+            }
+        }
+    } else {
+        //actions are applied to all available plots -> check whether we have plots
+        plot = (m_worksheet->children<CartesianPlot>().size() != 0);
+    }
+
+    cartesianPlotSelectionModeAction->setEnabled(plot);
+    cartesianPlotZoomSelectionModeAction->setEnabled(plot);
+    cartesianPlotZoomXSelectionModeAction->setEnabled(plot);
+    cartesianPlotZoomYSelectionModeAction->setEnabled(plot);
+
+    addCurveAction->setEnabled(plot);
+    addEquationCurveAction->setEnabled(plot);
+    addFitCurveAction->setEnabled(plot);
+    addHorizontalAxisAction->setEnabled(plot);
+    addVerticalAxisAction->setEnabled(plot);
+    addLegendAction->setEnabled(plot);
+
+    scaleAutoXAction->setEnabled(plot);
+    scaleAutoYAction->setEnabled(plot);
+    scaleAutoAction->setEnabled(plot);
+    zoomInAction->setEnabled(plot);
+    zoomOutAction->setEnabled(plot);
+    zoomInXAction->setEnabled(plot);
+    zoomOutXAction->setEnabled(plot);
+    zoomInYAction->setEnabled(plot);
+    zoomOutYAction->setEnabled(plot);
+    shiftLeftXAction->setEnabled(plot);
+    shiftRightXAction->setEnabled(plot);
+    shiftUpYAction->setEnabled(plot);
+    shiftDownYAction->setEnabled(plot);
 }
 
 void WorksheetView::exportToFile(const QString& path, const ExportFormat format,
-								 const ExportArea area, const bool background, const int resolution) {
-	QRectF sourceRect;
-
-	//determine the rectangular to print
-	if (area==WorksheetView::ExportBoundingBox){
-		sourceRect = scene()->itemsBoundingRect();
-	}else if (area==WorksheetView::ExportSelection){
-		//TODO doesn't work: rect = scene()->selectionArea().boundingRect();
-		foreach(QGraphicsItem* item, m_selectedItems) {
-			sourceRect = sourceRect.united( \
                item->mapToScene(item->boundingRect()).boundingRect() );
-		}
-	}else{
-		sourceRect = scene()->sceneRect();
-	}
-
-	//print
-	if (format==WorksheetView::Pdf || format==WorksheetView::Eps){
-		QPrinter printer(QPrinter::HighResolution);
-		if (format==WorksheetView::Pdf)
-			printer.setOutputFormat(QPrinter::PdfFormat);
-		else
-			printer.setOutputFormat(QPrinter::PostScriptFormat);
-
-		printer.setOutputFileName(path);
-		int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
                Worksheet::Millimeter);
-		int h = Worksheet::convertFromSceneUnits(sourceRect.height(), \
                Worksheet::Millimeter);
-		printer.setPaperSize( QSizeF(w, h), QPrinter::Millimeter);
-		printer.setPageMargins(0,0,0,0, QPrinter::Millimeter);
-		printer.setPrintRange(QPrinter::PageRange);
-		printer.setCreator( QString("LabPlot ") + LVERSION );
-
-		QPainter painter(&printer);
-		painter.setRenderHint(QPainter::Antialiasing);
-		QRectF targetRect(0, 0, painter.device()->width(),painter.device()->height());
-		painter.begin(&printer);
-		exportPaint(&painter, targetRect, sourceRect, background);
-		painter.end();
-	}else if (format==WorksheetView::Svg){
-		QSvgGenerator generator;
-		generator.setFileName(path);
-		int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
                Worksheet::Millimeter);
-		int h = Worksheet::convertFromSceneUnits(sourceRect.height(), \
                Worksheet::Millimeter);
-		w = w*QApplication::desktop()->physicalDpiX()/25.4;
-		h = h*QApplication::desktop()->physicalDpiY()/25.4;
-
-		generator.setSize(QSize(w, h));
-		QRectF targetRect(0, 0, w, h);
-		generator.setViewBox(targetRect);
-
-		QPainter painter;
-		painter.begin(&generator);
-		exportPaint(&painter, targetRect, sourceRect, background);
-		painter.end();
-	}else{
-		//PNG
-		//TODO add all formats supported by Qt in QImage
-		int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
                Worksheet::Millimeter);
-		int h = Worksheet::convertFromSceneUnits(sourceRect.height(), \
                Worksheet::Millimeter);
-		w = w*resolution/25.4;
-		h = h*resolution/25.4;
-		QImage image(QSize(w, h), QImage::Format_ARGB32_Premultiplied);
-		image.fill(Qt::transparent);
-		QRectF targetRect(0, 0, w, h);
-
-		QPainter painter;
-		painter.begin(&image);
-		painter.setRenderHint(QPainter::Antialiasing);
-		exportPaint(&painter, targetRect, sourceRect, background);
-		painter.end();
-
-		image.save(path, "png");
-	}
+                                 const ExportArea area, const bool background, const \
int resolution) { +    QRectF sourceRect;
+
+    //determine the rectangular to print
+    if (area==WorksheetView::ExportBoundingBox){
+        sourceRect = scene()->itemsBoundingRect();
+    }else if (area==WorksheetView::ExportSelection){
+        //TODO doesn't work: rect = scene()->selectionArea().boundingRect();
+        foreach(QGraphicsItem* item, m_selectedItems) {
+            sourceRect = sourceRect.united( \
item->mapToScene(item->boundingRect()).boundingRect() ); +        }
+    }else{
+        sourceRect = scene()->sceneRect();
+    }
+
+    //print
+    if (format==WorksheetView::Pdf || format==WorksheetView::Eps){
+        QPrinter printer(QPrinter::HighResolution);
+        if (format==WorksheetView::Pdf)
+            printer.setOutputFormat(QPrinter::PdfFormat);
+        else
+//            printer.setOutputFormat(QPrinter::PostScriptFormat);
+
+        printer.setOutputFileName(path);
+        int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
Worksheet::Millimeter); +        int h = \
Worksheet::convertFromSceneUnits(sourceRect.height(), Worksheet::Millimeter); +       \
printer.setPaperSize( QSizeF(w, h), QPrinter::Millimeter); +        \
printer.setPageMargins(0,0,0,0, QPrinter::Millimeter); +        \
printer.setPrintRange(QPrinter::PageRange); +        printer.setCreator( \
QString("LabPlot ") + LVERSION ); +
+        QPainter painter(&printer);
+        painter.setRenderHint(QPainter::Antialiasing);
+        QRectF targetRect(0, 0, \
painter.device()->width(),painter.device()->height()); +        \
painter.begin(&printer); +        exportPaint(&painter, targetRect, sourceRect, \
background); +        painter.end();
+    }else if (format==WorksheetView::Svg){
+        QSvgGenerator generator;
+        generator.setFileName(path);
+        int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
Worksheet::Millimeter); +        int h = \
Worksheet::convertFromSceneUnits(sourceRect.height(), Worksheet::Millimeter); +       \
w = w*QApplication::desktop()->physicalDpiX()/25.4; +        h = \
h*QApplication::desktop()->physicalDpiY()/25.4; +
+        generator.setSize(QSize(w, h));
+        QRectF targetRect(0, 0, w, h);
+        generator.setViewBox(targetRect);
+
+        QPainter painter;
+        painter.begin(&generator);
+        exportPaint(&painter, targetRect, sourceRect, background);
+        painter.end();
+    }else{
+        //PNG
+        //TODO add all formats supported by Qt in QImage
+        int w = Worksheet::convertFromSceneUnits(sourceRect.width(), \
Worksheet::Millimeter); +        int h = \
Worksheet::convertFromSceneUnits(sourceRect.height(), Worksheet::Millimeter); +       \
w = w*resolution/25.4; +        h = h*resolution/25.4;
+        QImage image(QSize(w, h), QImage::Format_ARGB32_Premultiplied);
+        image.fill(Qt::transparent);
+        QRectF targetRect(0, 0, w, h);
+
+        QPainter painter;
+        painter.begin(&image);
+        painter.setRenderHint(QPainter::Antialiasing);
+        exportPaint(&painter, targetRect, sourceRect, background);
+        painter.end();
+
+        image.save(path, "png");
+    }
 }
 
 void WorksheetView::exportPaint(QPainter* painter, const QRectF& targetRect, const \
                QRectF& sourceRect, const bool background) {
-	//draw the background
-	if (background) {
-		painter->save();
-		painter->scale(targetRect.width()/sourceRect.width(), \
                targetRect.height()/sourceRect.height());
-		drawBackground(painter, sourceRect);
-		painter->restore();
-	}
-
-	//draw the scene items
-	m_worksheet->setPrinting(true);
-	scene()->render(painter, QRectF(), sourceRect);
-	m_worksheet->setPrinting(false);
+    //draw the background
+    if (background) {
+        painter->save();
+        painter->scale(targetRect.width()/sourceRect.width(), \
targetRect.height()/sourceRect.height()); +        drawBackground(painter, \
sourceRect); +        painter->restore();
+    }
+
+    //draw the scene items
+    m_worksheet->setPrinting(true);
+    scene()->render(painter, QRectF(), sourceRect);
+    m_worksheet->setPrinting(false);
 }
 
 void WorksheetView::print(QPrinter* printer) const{
-	m_worksheet->setPrinting(true);
-	QPainter painter(printer);
-	painter.setRenderHint(QPainter::Antialiasing);
-	scene()->render(&painter);
-	m_worksheet->setPrinting(false);
+    m_worksheet->setPrinting(true);
+    QPainter painter(printer);
+    painter.setRenderHint(QPainter::Antialiasing);
+    scene()->render(&painter);
+    m_worksheet->setPrinting(false);
 }
 
 void WorksheetView::updateBackground(){
-	invalidateScene(sceneRect(), QGraphicsScene::BackgroundLayer);
+    invalidateScene(sceneRect(), QGraphicsScene::BackgroundLayer);
 }
 
 /*!
@@ -1289,30 +1289,30 @@ void WorksheetView::updateBackground(){
  * enables the corresponding action
  */
 void WorksheetView::layoutChanged(Worksheet::Layout layout) {
-	if (layout==Worksheet::NoLayout){
-		verticalLayoutAction->setEnabled(true);
-		verticalLayoutAction->setChecked(false);
-
-		horizontalLayoutAction->setEnabled(true);
-		horizontalLayoutAction->setChecked(false);
-
-		gridLayoutAction->setEnabled(true);
-		gridLayoutAction->setChecked(false);
-
-		breakLayoutAction->setEnabled(false);
-	}else{
-		verticalLayoutAction->setEnabled(false);
-		horizontalLayoutAction->setEnabled(false);
-		gridLayoutAction->setEnabled(false);
-		breakLayoutAction->setEnabled(true);
-
-		if (layout==Worksheet::VerticalLayout)
-			verticalLayoutAction->setChecked(true);
-		else if (layout==Worksheet::HorizontalLayout)
-			horizontalLayoutAction->setChecked(true);
-		else
-			gridLayoutAction->setChecked(true);
-	}
+    if (layout==Worksheet::NoLayout){
+        verticalLayoutAction->setEnabled(true);
+        verticalLayoutAction->setChecked(false);
+
+        horizontalLayoutAction->setEnabled(true);
+        horizontalLayoutAction->setChecked(false);
+
+        gridLayoutAction->setEnabled(true);
+        gridLayoutAction->setChecked(false);
+
+        breakLayoutAction->setEnabled(false);
+    }else{
+        verticalLayoutAction->setEnabled(false);
+        horizontalLayoutAction->setEnabled(false);
+        gridLayoutAction->setEnabled(false);
+        breakLayoutAction->setEnabled(true);
+
+        if (layout==Worksheet::VerticalLayout)
+            verticalLayoutAction->setChecked(true);
+        else if (layout==Worksheet::HorizontalLayout)
+            horizontalLayoutAction->setChecked(true);
+        else
+            gridLayoutAction->setChecked(true);
+    }
 }
 
 
@@ -1320,273 +1320,273 @@ void WorksheetView::layoutChanged(Worksheet::Layout layout) \
{  //########################  SLOTs for cartesian plots   ########################
 //##############################################################################
 void WorksheetView::cartesianPlotActionModeChanged(QAction* action) {
-	if (action == cartesianPlotApplyToSelectionAction)
-		m_cartesianPlotActionMode = ApplyActionToSelection;
-	else
-		m_cartesianPlotActionMode = ApplyActionToAll;
+    if (action == cartesianPlotApplyToSelectionAction)
+        m_cartesianPlotActionMode = ApplyActionToSelection;
+    else
+        m_cartesianPlotActionMode = ApplyActionToAll;
 
-	handleCartesianPlotActions();
+    handleCartesianPlotActions();
 }
 
 void WorksheetView::cartesianPlotMouseModeChanged(QAction* action) {
-	if (action==cartesianPlotSelectionModeAction) {
-		m_cartesianPlotMouseMode = CartesianPlot::SelectionMode;
-	} else if (action==cartesianPlotZoomSelectionModeAction) {
-		m_cartesianPlotMouseMode = CartesianPlot::ZoomSelectionMode;
-	} else if (action==cartesianPlotZoomXSelectionModeAction) {
-		m_cartesianPlotMouseMode = CartesianPlot::ZoomXSelectionMode;
-	} else if (action==cartesianPlotZoomYSelectionModeAction) {
-		m_cartesianPlotMouseMode = CartesianPlot::ZoomYSelectionMode;
-	}
-
-	foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-		plot->setMouseMode(m_cartesianPlotMouseMode);
-	}
+    if (action==cartesianPlotSelectionModeAction) {
+        m_cartesianPlotMouseMode = CartesianPlot::SelectionMode;
+    } else if (action==cartesianPlotZoomSelectionModeAction) {
+        m_cartesianPlotMouseMode = CartesianPlot::ZoomSelectionMode;
+    } else if (action==cartesianPlotZoomXSelectionModeAction) {
+        m_cartesianPlotMouseMode = CartesianPlot::ZoomXSelectionMode;
+    } else if (action==cartesianPlotZoomYSelectionModeAction) {
+        m_cartesianPlotMouseMode = CartesianPlot::ZoomYSelectionMode;
+    }
+
+    foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+        plot->setMouseMode(m_cartesianPlotMouseMode);
+    }
 }
 
 void WorksheetView::addCurve() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addCurve();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addCurve();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addCurve();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addCurve();
+        }
+    }
 }
 
 void WorksheetView::addEquationCurve() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addEquationCurve();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addEquationCurve();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addEquationCurve();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addEquationCurve();
+        }
+    }
 }
 
 void WorksheetView::addFitCurve() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addFitCurve();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addFitCurve();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addFitCurve();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addFitCurve();
+        }
+    }
 }
 
 void WorksheetView::addLegend() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addLegend();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addLegend();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addLegend();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addLegend();
+        }
+    }
 }
 
 void WorksheetView::addHorizontalAxis() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addHorizontalAxis();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addHorizontalAxis();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addHorizontalAxis();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addHorizontalAxis();
+        }
+    }
 }
 
 void WorksheetView::addVerticalAxis() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->addVerticalAxis();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->addVerticalAxis();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->addVerticalAxis();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->addVerticalAxis();
+        }
+    }
 }
 
 void WorksheetView::scaleAuto() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->scaleAuto();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->scaleAuto();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->scaleAuto();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->scaleAuto();
+        }
+    }
 }
 
 void WorksheetView::scaleAutoX() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->scaleAutoX();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->scaleAutoX();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->scaleAutoX();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->scaleAutoX();
+        }
+    }
 }
 
 void WorksheetView::scaleAutoY() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->scaleAutoY();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->scaleAutoY();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->scaleAutoY();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->scaleAutoY();
+        }
+    }
 }
 
 void WorksheetView::zoomIn() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomIn();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomIn();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomIn();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomIn();
+        }
+    }
 }
 
 void WorksheetView::zoomOut() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomOut();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomOut();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomOut();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomOut();
+        }
+    }
 }
 
 void WorksheetView::zoomInX() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomInX();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomInX();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomInX();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomInX();
+        }
+    }
 }
 
 void WorksheetView::zoomOutX() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomOutX();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomOutX();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomOutX();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomOutX();
+        }
+    }
 }
 
 void WorksheetView::zoomInY() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomInY();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomInY();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomInY();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomInY();
+        }
+    }
 }
 
 void WorksheetView::zoomOutY() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->zoomOutY();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->zoomOutY();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->zoomOutY();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->zoomOutY();
+        }
+    }
 }
 
 void WorksheetView::shiftLeftX() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->shiftLeftX();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->shiftLeftX();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->shiftLeftX();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->shiftLeftX();
+        }
+    }
 }
 
 void WorksheetView::shiftRightX() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->shiftRightX();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->shiftRightX();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->shiftRightX();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->shiftRightX();
+        }
+    }
 }
 
 void WorksheetView::shiftUpY() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->shiftUpY();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->shiftUpY();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->shiftUpY();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->shiftUpY();
+        }
+    }
 }
 
 void WorksheetView::shiftDownY() {
-	if (m_cartesianPlotActionMode == ApplyActionToSelection) {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
-				plot->shiftDownY();
-		}
-	} else {
-		foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
-			plot->shiftDownY();
-		}
-	}
+    if (m_cartesianPlotActionMode == ApplyActionToSelection) {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            if (m_selectedItems.indexOf(plot->graphicsItem())!=-1)
+                plot->shiftDownY();
+        }
+    } else {
+        foreach(CartesianPlot* plot, m_worksheet->children<CartesianPlot>() ){
+            plot->shiftDownY();
+        }
+    }
 }
diff --git a/src/kdefrontend/GuiObserver.cpp b/src/kdefrontend/GuiObserver.cpp
index 8457e71..f0572e8 100644
--- a/src/kdefrontend/GuiObserver.cpp
+++ b/src/kdefrontend/GuiObserver.cpp
@@ -58,7 +58,7 @@ Email (use @ for *)  	: alexander.semke*web.de
 #include <QDockWidget>
 #include <QStackedWidget>
 #include <QToolBar>
-#include <KDebug>
+#include <QDebug>
 #include <KLocalizedString>
 
 /*!
diff --git a/src/kdefrontend/MainWin.cpp b/src/kdefrontend/MainWin.cpp
index 0acb89b..38ba9d0 100644
--- a/src/kdefrontend/MainWin.cpp
+++ b/src/kdefrontend/MainWin.cpp
@@ -58,9 +58,10 @@
 #include <QPrintDialog>
 #include <QPrintPreviewDialog>
 #include <QCloseEvent>
+#include <QFileDialog>
 #include <QElapsedTimer>
+#include <QDebug>
 
-#include <KApplication>
 #include <KActionCollection>
 #include <KFileDialog>
 #include <KStandardAction>
@@ -68,8 +69,7 @@
 #include <KMessageBox>
 #include <KToolBar>
 #include <KStatusBar>
-#include <KLocale>
-#include <KDebug>
+#include <KLocalizedString>
 #include <KFilterDev>
 
  /*!
@@ -111,7 +111,7 @@ MainWin::MainWin(QWidget *parent, const QString& filename)
 }
 
 MainWin::~MainWin() {
-    kDebug()<<"write settings"<<endl;
+    qDebug()<<"write settings"<<endl;
 
     //write settings
     m_recentProjectsAction->saveEntries( KSharedConfig::openConfig()->group("Recent \
Files") ); @@ -701,7 +701,7 @@ bool MainWin::openXML(QIODevice *file) {
     XmlStreamReader reader(file);
     if (m_project->load(&reader) == false) {
         RESET_CURSOR;
-        kDebug()<<"ERROR: reading file content"<<endl;
+        qDebug()<<"ERROR: reading file content"<<endl;
         QString msg_text = reader.errorString();
         KMessageBox::error(this, msg_text, i18n("Error opening project"));
         statusBar()->showMessage(msg_text);
@@ -1337,7 +1337,7 @@ void MainWin::newFileDataSourceActionTriggered(){
       FileDataSource* dataSource = new FileDataSource(0,  i18n("File data source%1", \
1));  dlg->importToFileDataSource(dataSource, statusBar());
       this->addAspectToProject(dataSource);
-      kDebug()<<"new file data source created"<<endl;
+      qDebug()<<"new file data source created"<<endl;
   }
   delete dlg;
 }
diff --git a/src/kdefrontend/SettingsDialog.cpp b/src/kdefrontend/SettingsDialog.cpp
index 7b461ff..5e73cd2 100644
--- a/src/kdefrontend/SettingsDialog.cpp
+++ b/src/kdefrontend/SettingsDialog.cpp
@@ -32,12 +32,12 @@
 #include "SettingsGeneralPage.h"
 // #include "SettingsPrintingPage.h"
 
-#include <KLocale>
 #include <KPushButton>
 #include <kmessagebox.h>
-#include <KIcon>
 #include <KConfigGroup>
+#include <KSharedConfig>
 #include <KWindowConfig>
+#include <KLocalizedString>
 
 /**
  * \brief Settings dialog for Labplot.
diff --git a/src/kdefrontend/SettingsGeneralPage.cpp \
b/src/kdefrontend/SettingsGeneralPage.cpp index e3ce1ea..18267f5 100644
--- a/src/kdefrontend/SettingsGeneralPage.cpp
+++ b/src/kdefrontend/SettingsGeneralPage.cpp
@@ -29,8 +29,9 @@
 #include "SettingsGeneralPage.h"
 #include "MainWin.h"
 
-#include <KDialog>
-#include <KLocale>
+#include <KLocalizedString>
+#include <KConfigGroup>
+#include <KSharedConfig>
 #include <kfiledialog.h>
 
 /**
diff --git a/src/kdefrontend/TemplateHandler.cpp \
b/src/kdefrontend/TemplateHandler.cpp index 1aae237..45db522 100644
--- a/src/kdefrontend/TemplateHandler.cpp
+++ b/src/kdefrontend/TemplateHandler.cpp
@@ -34,10 +34,9 @@
 #include <QLabel>
 #include <QFileInfo>
 #include <QWidgetAction>
-#include <KLocale>
-#include <KStandardDirs>
+
+#include <KLocalizedString>
 #include <KLineEdit>
-#include <KIcon>
 #include <KMenu>
 #include <KConfig>
  /*!
diff --git a/src/tools/TeXRenderer.cpp b/src/tools/TeXRenderer.cpp
index c909ca0..c00f2a8 100644
--- a/src/tools/TeXRenderer.cpp
+++ b/src/tools/TeXRenderer.cpp
@@ -37,7 +37,7 @@
 #include <QTemporaryFile>
 #include <QTextStream>
 #include <QProcess>
-#include <QtConcurrentRun>
+#include <QtConcurrent/QtConcurrentRun>
 
 // use (pdf)latex to render LaTeX text (see tex2im, etc.)
 // TODO: test convert to svg and render to qimage, test dvipng


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic