r20424 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Sep 26 13:06:35 UTC 2015


Author: jghali
Date: Sat Sep 26 13:06:35 2015
New Revision: 20424

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20424
Log:
#13371: indentation fixes <FirasH>

Modified:
    trunk/Scribus/scribus/guidesdelegate.cpp
    trunk/Scribus/scribus/pdflib.cpp
    trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
    trunk/Scribus/scribus/plugins/gettext/textfilter/textfilter.cpp
    trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/ps/importps.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
    trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
    trunk/Scribus/scribus/plugins/scripter/utils.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
    trunk/Scribus/scribus/plugins/tools/spellcheck/suggest.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/third_party/wpg/WPGXParser.cpp
    trunk/Scribus/scribus/ui/arrowchooser.cpp
    trunk/Scribus/scribus/ui/checkDocument.cpp
    trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
    trunk/Scribus/scribus/ui/propertywidget_flop.cpp
    trunk/Scribus/scribus/ui/shadebutton.cpp
    trunk/Scribus/scribus/ui/smlinestyle.cpp
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/guidesdelegate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/guidesdelegate.cpp
==============================================================================
--- trunk/Scribus/scribus/guidesdelegate.cpp	(original)
+++ trunk/Scribus/scribus/guidesdelegate.cpp	Sat Sep 26 13:06:35 2015
@@ -1,110 +1,110 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#include <QModelIndex>
-
-#include "ui/scrspinbox.h"
-#include "scribusdoc.h"
-#include "guidesdelegate.h"
-#include "units.h"
-
-
-GuidesDelegate::GuidesDelegate(QObject *parent)
-	: QItemDelegate(parent),
-		m_doc(0)
-{
-}
-
-// QWidget * GuidesDelegate::createEditor(QWidget *parent,
-// 									   const QStyleOptionViewItem &/* option */,
-// 									   const QModelIndex &/* index */) const
-// {
-// 	Q_ASSERT_X(m_doc != 0, "GuidesDelegate::createEditor",
-// 			   "No reference to the doc");
-// 	ScrSpinBox *editor = new ScrSpinBox(0, m_doc->currentPage()->height(),
-// 										parent, m_doc->unitIndex());
-// 	return editor;
-// }
-
-void GuidesDelegate::setEditorData(QWidget *editor,
-								   const QModelIndex &index) const
-{
-	double value = index.model()->data(index, Qt::EditRole).toDouble();
-	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
-	w->setValue(value);
-}
-
-void GuidesDelegate::setModelData(QWidget *editor,
-								  QAbstractItemModel *model,
-								  const QModelIndex &index) const
-{
-	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
-	// When user exit widget, editor value may not be commited at this point
-	// so we have to get value from widget text
-	double value = w->valueFromText(w->text());
-	model->setData(index, value, Qt::EditRole);
-}
-
-void GuidesDelegate::updateEditorGeometry(QWidget *editor,
-										  const QStyleOptionViewItem &option,
-									      const QModelIndex &/* index */) const
-{
-	editor->setGeometry(option.rect);
-}
-
-void GuidesDelegate::setDoc(ScribusDoc * doc)
-{
-	m_doc = doc;
-}
-
-
-// horizontals
-
-GuidesHDelegate::GuidesHDelegate(QObject *parent)
-	: GuidesDelegate(parent)
-{
-}
-
-QWidget * GuidesHDelegate::createEditor(QWidget *parent,
-									   const QStyleOptionViewItem &/* option */,
-									   const QModelIndex &/* index */) const
-{
-	Q_ASSERT_X(m_doc != 0, "GuidesHDelegate::createEditor",
-			   "No reference to the doc");
-	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
-	double min = 0.0 - (m_doc->bleeds()->top() * uix);
-	double max = (m_doc->currentPage()->height() * uix)
-				 + (m_doc->bleeds()->bottom() * uix);
-	ScrSpinBox *editor =
-			new ScrSpinBox(min,
-						   max,
-						   parent, m_doc->unitIndex());
-	return editor;
-}
-
-// verticals
-
-GuidesVDelegate::GuidesVDelegate(QObject *parent)
-	: GuidesDelegate(parent)
-{
-}
-
-QWidget * GuidesVDelegate::createEditor(QWidget *parent,
-									   const QStyleOptionViewItem &/* option */,
-									   const QModelIndex &/* index */) const
-{
-	Q_ASSERT_X(m_doc != 0, "GuidesVDelegate::createEditor",
-			   "No reference to the doc");
-	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
-	double min = 0.0 - (m_doc->bleeds()->left() * uix);
-	double max = (m_doc->currentPage()->width() * uix)
-				 + (m_doc->bleeds()->right() * uix);
-	ScrSpinBox *editor =
-			new ScrSpinBox(min,
-						   max,
-						   parent, m_doc->unitIndex());
-	return editor;
-}
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include <QModelIndex>
+
+#include "ui/scrspinbox.h"
+#include "scribusdoc.h"
+#include "guidesdelegate.h"
+#include "units.h"
+
+
+GuidesDelegate::GuidesDelegate(QObject *parent)
+	: QItemDelegate(parent),
+		m_doc(0)
+{
+}
+
+// QWidget * GuidesDelegate::createEditor(QWidget *parent,
+// 									   const QStyleOptionViewItem &/* option */,
+// 									   const QModelIndex &/* index */) const
+// {
+// 	Q_ASSERT_X(m_doc != 0, "GuidesDelegate::createEditor",
+// 			   "No reference to the doc");
+// 	ScrSpinBox *editor = new ScrSpinBox(0, m_doc->currentPage()->height(),
+// 										parent, m_doc->unitIndex());
+// 	return editor;
+// }
+
+void GuidesDelegate::setEditorData(QWidget *editor,
+								   const QModelIndex &index) const
+{
+	double value = index.model()->data(index, Qt::EditRole).toDouble();
+	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
+	w->setValue(value);
+}
+
+void GuidesDelegate::setModelData(QWidget *editor,
+								  QAbstractItemModel *model,
+								  const QModelIndex &index) const
+{
+	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
+	// When user exit widget, editor value may not be commited at this point
+	// so we have to get value from widget text
+	double value = w->valueFromText(w->text());
+	model->setData(index, value, Qt::EditRole);
+}
+
+void GuidesDelegate::updateEditorGeometry(QWidget *editor,
+										  const QStyleOptionViewItem &option,
+										  const QModelIndex &/* index */) const
+{
+	editor->setGeometry(option.rect);
+}
+
+void GuidesDelegate::setDoc(ScribusDoc * doc)
+{
+	m_doc = doc;
+}
+
+
+// horizontals
+
+GuidesHDelegate::GuidesHDelegate(QObject *parent)
+	: GuidesDelegate(parent)
+{
+}
+
+QWidget * GuidesHDelegate::createEditor(QWidget *parent,
+									   const QStyleOptionViewItem &/* option */,
+									   const QModelIndex &/* index */) const
+{
+	Q_ASSERT_X(m_doc != 0, "GuidesHDelegate::createEditor",
+			   "No reference to the doc");
+	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
+	double min = 0.0 - (m_doc->bleeds()->top() * uix);
+	double max = (m_doc->currentPage()->height() * uix)
+				 + (m_doc->bleeds()->bottom() * uix);
+	ScrSpinBox *editor =
+			new ScrSpinBox(min,
+						   max,
+						   parent, m_doc->unitIndex());
+	return editor;
+}
+
+// verticals
+
+GuidesVDelegate::GuidesVDelegate(QObject *parent)
+	: GuidesDelegate(parent)
+{
+}
+
+QWidget * GuidesVDelegate::createEditor(QWidget *parent,
+									   const QStyleOptionViewItem &/* option */,
+									   const QModelIndex &/* index */) const
+{
+	Q_ASSERT_X(m_doc != 0, "GuidesVDelegate::createEditor",
+			   "No reference to the doc");
+	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
+	double min = 0.0 - (m_doc->bleeds()->left() * uix);
+	double max = (m_doc->currentPage()->width() * uix)
+				 + (m_doc->bleeds()->right() * uix);
+	ScrSpinBox *editor =
+			new ScrSpinBox(min,
+						   max,
+						   parent, m_doc->unitIndex());
+	return editor;
+}

Modified: trunk/Scribus/scribus/pdflib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/pdflib.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib.cpp	(original)
+++ trunk/Scribus/scribus/pdflib.cpp	Sat Sep 26 13:06:35 2015
@@ -1,30 +1,30 @@
-#include "pdflib.h"
-
-#include "pdflib_core.h"
-
-PDFlib::PDFlib(ScribusDoc & docu)
-    : impl( new PDFLibCore(docu) )
-{
-    Q_ASSERT(impl);
-}
-
-PDFlib::~PDFlib()
-{
-    delete static_cast<PDFLibCore*>(impl);
-}
-
-bool PDFlib::doExport(const QString& fn, const QString& nam, int Components,
-			  const std::vector<int> & pageNs, const QMap<int,QPixmap> & thumbs)
-{
-    return static_cast<PDFLibCore*>(impl)->doExport(fn, nam, Components, pageNs, thumbs);
-}
-
-const QString& PDFlib::errorMessage(void)
-{
-	return static_cast<PDFLibCore*>(impl)->errorMessage();
-}
-
-bool PDFlib::exportAborted(void)
-{
-	return static_cast<PDFLibCore*>(impl)->exportAborted();
-}
+#include "pdflib.h"
+
+#include "pdflib_core.h"
+
+PDFlib::PDFlib(ScribusDoc & docu)
+    : impl( new PDFLibCore(docu) )
+{
+	Q_ASSERT(impl);
+}
+
+PDFlib::~PDFlib()
+{
+	delete static_cast<PDFLibCore*>(impl);
+}
+
+bool PDFlib::doExport(const QString& fn, const QString& nam, int Components,
+			  const std::vector<int> & pageNs, const QMap<int,QPixmap> & thumbs)
+{
+	return static_cast<PDFLibCore*>(impl)->doExport(fn, nam, Components, pageNs, thumbs);
+}
+
+const QString& PDFlib::errorMessage(void)
+{
+	return static_cast<PDFLibCore*>(impl)->errorMessage();
+}
+
+bool PDFlib::exportAborted(void)
+{
+	return static_cast<PDFLibCore*>(impl)->exportAborted();
+}

Modified: trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp	Sat Sep 26 13:06:35 2015
@@ -38,7 +38,7 @@
 
 QStringList FileExtensions()
 {
-    return QStringList("pdb");
+	return QStringList("pdb");
 }
 
 void GetText(QString filename, QString encoding, bool /* textOnly */, gtWriter *writer)

Modified: trunk/Scribus/scribus/plugins/gettext/textfilter/textfilter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/gettext/textfilter/textfilter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/textfilter/textfilter.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/textfilter/textfilter.cpp	Sat Sep 26 13:06:35 2015
@@ -23,7 +23,7 @@
 
 QString FileFormatName()
 {
-    return QObject::tr("Text Filters");
+	return QObject::tr("Text Filters");
 }
 
 QStringList FileExtensions()

Modified: trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp	Sat Sep 26 13:06:35 2015
@@ -18,12 +18,12 @@
 
 QString FileFormatName()
 {
-    return QObject::tr("Text Files");
+	return QObject::tr("Text Files");
 }
 
 QStringList FileExtensions()
 {
-    return QStringList("txt");
+	return QStringList("txt");
 }
 
 void GetText(QString filename, QString encoding, bool textOnly, gtWriter *writer)

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	Sat Sep 26 13:06:35 2015
@@ -1515,7 +1515,7 @@
 			composite->addPoint(point);
 			composite->addPoint(point);
 		}
-    }
+	}
 	if (closePath)
 	{
 		composite->addPoint(firstP);

Modified: trunk/Scribus/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importps.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/ps/importps.cpp	Sat Sep 26 13:06:35 2015
@@ -792,13 +792,13 @@
 	if (device.startsWith("psd")) {
 		filename = filename.mid(0, filename.length()-3) + "psd";
 	}
-		
+
 	qDebug("%s", QString("import %7 image %1: %2x%3 @ (%4,%5) °%6").arg(filename).arg(w).arg(h).arg(x).arg(y).arg(angle).arg(device).toLocal8Bit().data());
 	QString rawfile = filename.mid(0, filename.length()-3) + "dat";
 	QStringList args;
 	args.append( "-q" );
 	args.append( "-dNOPAUSE" );
-	args.append( QString("-sDEVICE=%1").arg(device) );    
+	args.append( QString("-sDEVICE=%1").arg(device) );
 	args.append( "-dBATCH" );
 	args.append( QString("-g%1x%2").arg(horpix).arg(verpix) );
 	args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(filename)) );

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp	Sat Sep 26 13:06:35 2015
@@ -1775,7 +1775,7 @@
 	SvgStyle *gc   = m_gc.top();
 	QFont textFont = getFontFromStyle(*gc);
 	QFontMetrics fm(textFont);
-    double width   = fm.width(textString);
+	double width   = fm.width(textString);
 
 	if( gc->textAnchor == "middle" )
 		StartX -= chunkW / 2.0;

Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp	Sat Sep 26 13:06:35 2015
@@ -1451,7 +1451,7 @@
 	{
 		switch (font)
 		{
-    		case 1: // Roman
+			case 1: // Roman
 				TFont = "Times";
 				weight = QFont::Normal;
 				break;

Modified: trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp	Sat Sep 26 13:06:35 2015
@@ -1,549 +1,549 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.'
-*/
-#include "api_textitem.h"
-#include "units.h"
-#include "scribusdoc.h"
-#include "selection.h"
-#include "scribusview.h"
-#include "appmodes.h"
-#include "utils.h"
-#include "hyphenator.h"
-#include "scripterimpl.h"
-
-template<typename T>
-class ApplyCharstyleHelper {
-	PageItem* item;
-	T value;
-public:
-	ApplyCharstyleHelper(PageItem* i, T v) : item(i), value(v) {}
-
-	void apply(void (CharStyle::*f)(T), int p, int len)
-	{
-		CharStyle cs;
-		(cs.*f)(value);
-		if (item->HasSel)
-		{
-			int max = qMax(p+len, item->itemText.length());
-			for (int b = p; b < max; b++)
-			{
-				if (item->itemText.selected(b))
-					item->itemText.applyCharStyle(b, 1, cs);
-			}
-		}
-		else
-		{
-			item->itemText.applyCharStyle(p, len, cs);
-		}
-	}
-
-};
-
-TextAPI::TextAPI(PageItem_TextFrame* inner) : ItemAPI(inner)
-{
-	qDebug() << "TextItemWrapper loaded";
-	setObjectName("textItem");
-	item = inner;
-}
-
-QString TextAPI::font()
-{
-	if (item->HasSel)
-	{
-		for (int b = 0; b < item->itemText.length(); b++)
-			if (item->itemText.selected(b))
-				return item->itemText.charStyle(b).font().scName();
-		return NULL;
-	}
-	else
-		return item->currentCharStyle().font().scName();
-}
-
-void TextAPI::setFont(QString name)
-{
-	if (PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts.contains(name))
-	{
-		int Apm = ScCore->primaryMainWindow()->doc->appMode;
-		ScCore->primaryMainWindow()->doc->m_Selection->clear();
-		ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-		if (item->HasSel)
-			ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-		ScCore->primaryMainWindow()->SetNewFont(name);
-		ScCore->primaryMainWindow()->doc->appMode = Apm;
-		ScCore->primaryMainWindow()->view->Deselect();
-	}
-	else
-	{
-		RAISE("Font not found");
-	}
-
-}
-
-double TextAPI::fontSize()
-{
-	if (item->HasSel)
-	{
-		for (int b = 0; b < item->itemText.length(); b++)
-			if (item->itemText.selected(b))
-				return item->itemText.charStyle(b).fontSize() / 10.0;
-		return NULL;
-	}
-	else
-	{
-		return item->currentCharStyle().fontSize() / 10.0;
-	}
-}
-
-void TextAPI::setFontSize(double size)
-{
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->doc->itemSelection_SetFontSize(qRound(size * 10.0));
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-}
-
-void TextAPI::setText(QString text)
-{
-	text.replace("\r\n", SpecialChars::PARSEP);
-	text.replace(QChar('\n') , SpecialChars::PARSEP);
-	item->itemText.clear();
-//	for (int a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
-//	{
-//		ScCore->primaryMainWindow()->doc->FrameItems[a]->ItemNr = a;
-//	} TODO fix this :FrameItems has been changed to QHash from QList
-	qDebug()<<"text : "<<text;
-	item->itemText.insertChars(0, text);
-	item->invalidateLayout();
-	item->Dirty = false;
-	ScCore->primaryMainWindow()->view->DrawNew();
-}
-
-QString TextAPI::text()
-{
-	QString text = "";
-	for (int a = 0; a < item->itemText.length(); a++)
-	{
-		if (item->HasSel)
-		{
-			if (item->itemText.selected(a))
-				text += item->itemText.text(a);
-		}
-		else
-		{
-			text += item->itemText.text(a);
-		}
-	} // for
-	return text;
-}
-
-int TextAPI::textLines()
-{
-	return item->textLayout.lines();
-}
-
-int TextAPI::textLength()
-{
-	return item->itemText.length();
-}
-
-double TextAPI::lineSpacing()
-{
-	return item->currentStyle().lineSpacing();
-}
-
-void TextAPI::setLineSpacing(double value)
-{
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->doc->itemSelection_SetLineSpacing(value);
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-}
-
-QList<QVariant> TextAPI::distances()
-{
-	QList<QVariant> l;
-	l.append(pts2value(item->textToFrameDistLeft(), ScCore->primaryMainWindow()->doc->unitIndex()));
-	l.append(pts2value(item->textToFrameDistRight(), ScCore->primaryMainWindow()->doc->unitIndex()));
-	l.append(pts2value(item->textToFrameDistTop(), ScCore->primaryMainWindow()->doc->unitIndex()));
-	l.append(pts2value(item->textToFrameDistBottom(), ScCore->primaryMainWindow()->doc->unitIndex()));
-	return l;
-}
-
-void TextAPI::insertText(QString text, int position)
-{
-	text.replace("\r\n", SpecialChars::PARSEP);
-	text.replace(QChar('\n') , SpecialChars::PARSEP);
-	if ((position < -1) || (position > static_cast<int>(item->itemText.length())))
-	{
-		RAISE("Value of position out of bound.");
-		return;
-	}
-	if (position == -1)
-		position = item->itemText.length();
-	item->itemText.insertChars(position, text);
-	item->Dirty = true;
-	if (ScCore->primaryMainWindow()->doc->DoDrawing)
-	{
-		// FIXME adapt to Qt-4 painting style
-		item->Dirty = false;
-	}
-	ScCore->primaryMainWindow()->view->DrawNew();
-}
-
-void TextAPI::setLineSpacingMode(int mode)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (mode < 0 || mode > 3) // Use constants?
-	{
-		RAISE("Line space mode invalid, must be 0, 1 or 2");
-	}
-
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->doc->itemSelection_SetLineSpacingMode(mode);
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-}
-
-void TextAPI::setDistances(double left, double right, double top, double bottom)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (left < 0.0 || right < 0.0 || top < 0.0 || bottom < 0.0)
-	{
-		RAISE("Text distances out of bounds, must be positive.");
-	}
-
-	item->setTextToFrameDist(ValueToPoint(left), ValueToPoint(right), ValueToPoint(top), ValueToPoint(bottom));
-}
-
-void TextAPI::setTextAlignment(int alignment)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if ((alignment > 4) || (alignment < 0))
-	{
-		RAISE("Alignment out of range. Should be between 0 and 4");
-	}
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->setNewAlignment(alignment);
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-}
-
-void TextAPI::setTextColor(QString color)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-
-	ApplyCharstyleHelper<QString>(item, color).apply(&CharStyle::setFillColor, 0, item->itemText.length());
-
-//	for (int b = 0; b < item->itemText.length(); b++)
-//	{
-//		//FIXME: doc method
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setFillColor(color);
-//		}
-//		else
-//			item->itemText.item(b)->setFillColor(color);
-//	}
-}
-
-void TextAPI::setTextStroke(QString color)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-
-	ApplyCharstyleHelper<QString>(item, color).apply(&CharStyle::setStrokeColor, 0, item->itemText.length());
-
-//	for (int b = 0; b < item->itemText.length(); b++)
-//	{
-//		//FIXME:NLS use document method for item
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setStrokeColor(color);
-//		}
-//		else
-//			item->itemText.item(b)->setStrokeColor(color);
-//	}
-}
-
-void TextAPI::setTextScalingV(double value)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (value < 10)
-	{
-		RAISE("Character scaling out of bounds, must be >= 10");
-	}
-
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->doc->itemSelection_SetScaleV(qRound(value * 10));
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-
-}
-
-void TextAPI::setTextScalingH(double value)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (value < 10)
-	{
-		RAISE("Character scaling out of bounds, must be >= 10");
-	}
-
-	int Apm = ScCore->primaryMainWindow()->doc->appMode;
-	ScCore->primaryMainWindow()->doc->m_Selection->clear();
-	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-	if (item->HasSel)
-		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-	ScCore->primaryMainWindow()->doc->itemSelection_SetScaleH(qRound(value * 10));
-	ScCore->primaryMainWindow()->doc->appMode = Apm;
-	ScCore->primaryMainWindow()->view->Deselect();
-
-}
-
-void TextAPI::setTextShade(int w)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if ((w < 0) || (w > 100))
-	{
-		RAISE("value out of bound. Should be between 0 and 100");
-	}
-	//FIXME:NLS use document method for that
-
-	ApplyCharstyleHelper<double>(item, w).apply(&CharStyle::setFillShade, 0, item->itemText.length());
-
-//	for (int b = 0; b < item->itemText.length(); ++b)
-//	{
-//		if (item->HasSel)
-//		{
-//			if (item->itemText.selected(b))
-//				item->itemText.item(b)->setFillShade(w);
-//		}
-//		else
-//			item->itemText.item(b)->setFillShade(w);
-//	}
-}
-
-void TextAPI::selectText(int start, int selcount)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	
-	if (selcount == -1)
-	{
-		// user wants to select all after the start point
-		selcount = item->itemText.length() - start;
-		if (selcount < 0)
-			// user passed start that's > text in the frame
-			selcount = 0;
-	}
-	if ((start < 0) || ((start + selcount) > static_cast<int>(item->itemText.length())))
-	{
-		RAISE("Selection index out of bounds");
-	}
-
-	item->itemText.deselectAll();
-	if (selcount == 0)
-	{
-		item->HasSel = false;
-		return;
-	}
-	item->itemText.select(start, selcount, true);
-	item->HasSel = true;
-}
-
-void TextAPI::linkToTextFrame(QString name2)
-{
-	if(name2.isEmpty())
-	{
-		RAISE("Destination text frame name is empty.");
-	}
-	if (!checkHaveDocument())
-		RAISE("No document open");
-
-	PageItem *toitem = GetUniqueItem(name2);
-	if (toitem == NULL)
-		return;
-	if (!(toitem->asTextFrame()))
-	{
-		RAISE("Can only link text frames.");
-	}
-	if (toitem->itemText.length() > 0)
-	{
-		RAISE("Target frame must be empty.");
-	}
-	
-	if (toitem->nextInChain() != 0)
-	{
-		RAISE("Target frame links to another frame.");
-	}
-	if (toitem->prevInChain() != 0)
-	{
-		RAISE("Target frame is linked to by another frame.");
-	}
-	if (toitem->itemName() == item->itemName())
-	{
-		RAISE("Source and target are the same object.");
-	}
-	// references to the others boxes
-	item->link(toitem);
-	ScCore->primaryMainWindow()->view->DrawNew();
-	ScCore->primaryMainWindow()->slotDocCh();
-}
-
-void TextAPI::unLinkTextFrames()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	// only linked
-	if (item->prevInChain() == 0)
-	{
-		RAISE("Object is not a linked text frame, can't unlink.");
-	}
-	item->prevInChain()->unlink();
-	// enable 'save icon' stuff
-	ScCore->primaryMainWindow()->slotDocCh();
-	ScCore->primaryMainWindow()->view->DrawNew();
-}
-
-bool TextAPI::deleteText()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (item->HasSel){}
-//		item->deleteSelectedTextFromFrame();
-	else
-	{
-		item->itemText.clear();
-		//for (int a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
-		//{
-		//	ScCore->primaryMainWindow()->doc->FrameItems.at(a)->ItemNr = a;
-		//}TODO fix this,
-	}
-}
-
-bool TextAPI::traceText()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (item->invalid)
-		item->layout();
-	ScCore->primaryMainWindow()->view->Deselect(true);
-	ScCore->primaryMainWindow()->view->SelectItem(item);
-	ScCore->primaryMainWindow()->view->TextToPath();
-    return true;
-}
-
-int TextAPI::textOverFlows(bool checkLinks)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	/* original solution
-	if (item->itemText.count() > item->MaxChars)
-	return PyBool_FromLong(static_cast<long>(true));
-	return PyBool_FromLong(static_cast<long>(false)); */
-	/*
-	 uint firstFrame = 0;
-	if (nolinks)
-		firstFrame = item->itemText.count();
-	uint chars = item->itemText.count();
-	uint maxchars = item->MaxChars;
-	while (item->NextBox != 0) {
-		item = item->NextBox;
-		chars += item->itemText.count();
-		maxchars += item->MaxChars;
-	}
-	// no overrun
-	if (nolinks)
-		return PyInt_FromLong(maxchars - firstFrame);
-
-	if (maxchars > chars)
-		return PyInt_FromLong(0);
-	// number of overrunning letters
-	return PyInt_FromLong(static_cast<long>(chars - maxchars));
-	 */
-	// refresh overflow information
-	item->invalidateLayout();
-	item->layout();
-	return item->frameOverflows();
-}
-
-bool TextAPI::hyphenate()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	ScCore->primaryMainWindow()->doc->docHyphenator->slotHyphenate(item);
-	return true;
-}
-
-bool TextAPI::dehyphenate()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	ScCore->primaryMainWindow()->doc->docHyphenator->slotDeHyphenate(item);
-	return false;
-}
-
-bool TextAPI::PDFBookMark()
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (item->isBookmark)
-		return true;
-	return false;
-}
-
-void TextAPI::setPDFBookMark(bool toggle)
-{
-	if (!checkHaveDocument())
-		RAISE("No document open");
-	if (item->isBookmark == toggle)
-	{
-		return;
-	}
-	if (toggle)
-	{
-		item->setIsAnnotation(false);
-		ScCore->primaryMainWindow()->AddBookMark(item);
-	}
-	else
-		ScCore->primaryMainWindow()->DelBookMark(item);
-	item->isBookmark = toggle;
-}
-
-TextAPI::~TextAPI()
-{
-	qDebug() << "TextItemWrapper deleted";
-}
-
-
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.'
+*/
+#include "api_textitem.h"
+#include "units.h"
+#include "scribusdoc.h"
+#include "selection.h"
+#include "scribusview.h"
+#include "appmodes.h"
+#include "utils.h"
+#include "hyphenator.h"
+#include "scripterimpl.h"
+
+template<typename T>
+class ApplyCharstyleHelper {
+	PageItem* item;
+	T value;
+public:
+	ApplyCharstyleHelper(PageItem* i, T v) : item(i), value(v) {}
+
+	void apply(void (CharStyle::*f)(T), int p, int len)
+	{
+		CharStyle cs;
+		(cs.*f)(value);
+		if (item->HasSel)
+		{
+			int max = qMax(p+len, item->itemText.length());
+			for (int b = p; b < max; b++)
+			{
+				if (item->itemText.selected(b))
+					item->itemText.applyCharStyle(b, 1, cs);
+			}
+		}
+		else
+		{
+			item->itemText.applyCharStyle(p, len, cs);
+		}
+	}
+
+};
+
+TextAPI::TextAPI(PageItem_TextFrame* inner) : ItemAPI(inner)
+{
+	qDebug() << "TextItemWrapper loaded";
+	setObjectName("textItem");
+	item = inner;
+}
+
+QString TextAPI::font()
+{
+	if (item->HasSel)
+	{
+		for (int b = 0; b < item->itemText.length(); b++)
+			if (item->itemText.selected(b))
+				return item->itemText.charStyle(b).font().scName();
+		return NULL;
+	}
+	else
+		return item->currentCharStyle().font().scName();
+}
+
+void TextAPI::setFont(QString name)
+{
+	if (PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts.contains(name))
+	{
+		int Apm = ScCore->primaryMainWindow()->doc->appMode;
+		ScCore->primaryMainWindow()->doc->m_Selection->clear();
+		ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+		if (item->HasSel)
+			ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+		ScCore->primaryMainWindow()->SetNewFont(name);
+		ScCore->primaryMainWindow()->doc->appMode = Apm;
+		ScCore->primaryMainWindow()->view->Deselect();
+	}
+	else
+	{
+		RAISE("Font not found");
+	}
+
+}
+
+double TextAPI::fontSize()
+{
+	if (item->HasSel)
+	{
+		for (int b = 0; b < item->itemText.length(); b++)
+			if (item->itemText.selected(b))
+				return item->itemText.charStyle(b).fontSize() / 10.0;
+		return NULL;
+	}
+	else
+	{
+		return item->currentCharStyle().fontSize() / 10.0;
+	}
+}
+
+void TextAPI::setFontSize(double size)
+{
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetFontSize(qRound(size * 10.0));
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+}
+
+void TextAPI::setText(QString text)
+{
+	text.replace("\r\n", SpecialChars::PARSEP);
+	text.replace(QChar('\n') , SpecialChars::PARSEP);
+	item->itemText.clear();
+//	for (int a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
+//	{
+//		ScCore->primaryMainWindow()->doc->FrameItems[a]->ItemNr = a;
+//	} TODO fix this :FrameItems has been changed to QHash from QList
+	qDebug()<<"text : "<<text;
+	item->itemText.insertChars(0, text);
+	item->invalidateLayout();
+	item->Dirty = false;
+	ScCore->primaryMainWindow()->view->DrawNew();
+}
+
+QString TextAPI::text()
+{
+	QString text = "";
+	for (int a = 0; a < item->itemText.length(); a++)
+	{
+		if (item->HasSel)
+		{
+			if (item->itemText.selected(a))
+				text += item->itemText.text(a);
+		}
+		else
+		{
+			text += item->itemText.text(a);
+		}
+	} // for
+	return text;
+}
+
+int TextAPI::textLines()
+{
+	return item->textLayout.lines();
+}
+
+int TextAPI::textLength()
+{
+	return item->itemText.length();
+}
+
+double TextAPI::lineSpacing()
+{
+	return item->currentStyle().lineSpacing();
+}
+
+void TextAPI::setLineSpacing(double value)
+{
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetLineSpacing(value);
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+}
+
+QList<QVariant> TextAPI::distances()
+{
+	QList<QVariant> l;
+	l.append(pts2value(item->textToFrameDistLeft(), ScCore->primaryMainWindow()->doc->unitIndex()));
+	l.append(pts2value(item->textToFrameDistRight(), ScCore->primaryMainWindow()->doc->unitIndex()));
+	l.append(pts2value(item->textToFrameDistTop(), ScCore->primaryMainWindow()->doc->unitIndex()));
+	l.append(pts2value(item->textToFrameDistBottom(), ScCore->primaryMainWindow()->doc->unitIndex()));
+	return l;
+}
+
+void TextAPI::insertText(QString text, int position)
+{
+	text.replace("\r\n", SpecialChars::PARSEP);
+	text.replace(QChar('\n') , SpecialChars::PARSEP);
+	if ((position < -1) || (position > static_cast<int>(item->itemText.length())))
+	{
+		RAISE("Value of position out of bound.");
+		return;
+	}
+	if (position == -1)
+		position = item->itemText.length();
+	item->itemText.insertChars(position, text);
+	item->Dirty = true;
+	if (ScCore->primaryMainWindow()->doc->DoDrawing)
+	{
+		// FIXME adapt to Qt-4 painting style
+		item->Dirty = false;
+	}
+	ScCore->primaryMainWindow()->view->DrawNew();
+}
+
+void TextAPI::setLineSpacingMode(int mode)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (mode < 0 || mode > 3) // Use constants?
+	{
+		RAISE("Line space mode invalid, must be 0, 1 or 2");
+	}
+
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetLineSpacingMode(mode);
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+}
+
+void TextAPI::setDistances(double left, double right, double top, double bottom)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (left < 0.0 || right < 0.0 || top < 0.0 || bottom < 0.0)
+	{
+		RAISE("Text distances out of bounds, must be positive.");
+	}
+
+	item->setTextToFrameDist(ValueToPoint(left), ValueToPoint(right), ValueToPoint(top), ValueToPoint(bottom));
+}
+
+void TextAPI::setTextAlignment(int alignment)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if ((alignment > 4) || (alignment < 0))
+	{
+		RAISE("Alignment out of range. Should be between 0 and 4");
+	}
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->setNewAlignment(alignment);
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+}
+
+void TextAPI::setTextColor(QString color)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+
+	ApplyCharstyleHelper<QString>(item, color).apply(&CharStyle::setFillColor, 0, item->itemText.length());
+
+//	for (int b = 0; b < item->itemText.length(); b++)
+//	{
+//		//FIXME: doc method
+//		if (item->HasSel)
+//		{
+//			if (item->itemText.selected(b))
+//				item->itemText.item(b)->setFillColor(color);
+//		}
+//		else
+//			item->itemText.item(b)->setFillColor(color);
+//	}
+}
+
+void TextAPI::setTextStroke(QString color)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+
+	ApplyCharstyleHelper<QString>(item, color).apply(&CharStyle::setStrokeColor, 0, item->itemText.length());
+
+//	for (int b = 0; b < item->itemText.length(); b++)
+//	{
+//		//FIXME:NLS use document method for item
+//		if (item->HasSel)
+//		{
+//			if (item->itemText.selected(b))
+//				item->itemText.item(b)->setStrokeColor(color);
+//		}
+//		else
+//			item->itemText.item(b)->setStrokeColor(color);
+//	}
+}
+
+void TextAPI::setTextScalingV(double value)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (value < 10)
+	{
+		RAISE("Character scaling out of bounds, must be >= 10");
+	}
+
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetScaleV(qRound(value * 10));
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+
+}
+
+void TextAPI::setTextScalingH(double value)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (value < 10)
+	{
+		RAISE("Character scaling out of bounds, must be >= 10");
+	}
+
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetScaleH(qRound(value * 10));
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
+
+}
+
+void TextAPI::setTextShade(int w)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if ((w < 0) || (w > 100))
+	{
+		RAISE("value out of bound. Should be between 0 and 100");
+	}
+	//FIXME:NLS use document method for that
+
+	ApplyCharstyleHelper<double>(item, w).apply(&CharStyle::setFillShade, 0, item->itemText.length());
+
+//	for (int b = 0; b < item->itemText.length(); ++b)
+//	{
+//		if (item->HasSel)
+//		{
+//			if (item->itemText.selected(b))
+//				item->itemText.item(b)->setFillShade(w);
+//		}
+//		else
+//			item->itemText.item(b)->setFillShade(w);
+//	}
+}
+
+void TextAPI::selectText(int start, int selcount)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	
+	if (selcount == -1)
+	{
+		// user wants to select all after the start point
+		selcount = item->itemText.length() - start;
+		if (selcount < 0)
+			// user passed start that's > text in the frame
+			selcount = 0;
+	}
+	if ((start < 0) || ((start + selcount) > static_cast<int>(item->itemText.length())))
+	{
+		RAISE("Selection index out of bounds");
+	}
+
+	item->itemText.deselectAll();
+	if (selcount == 0)
+	{
+		item->HasSel = false;
+		return;
+	}
+	item->itemText.select(start, selcount, true);
+	item->HasSel = true;
+}
+
+void TextAPI::linkToTextFrame(QString name2)
+{
+	if(name2.isEmpty())
+	{
+		RAISE("Destination text frame name is empty.");
+	}
+	if (!checkHaveDocument())
+		RAISE("No document open");
+
+	PageItem *toitem = GetUniqueItem(name2);
+	if (toitem == NULL)
+		return;
+	if (!(toitem->asTextFrame()))
+	{
+		RAISE("Can only link text frames.");
+	}
+	if (toitem->itemText.length() > 0)
+	{
+		RAISE("Target frame must be empty.");
+	}
+	
+	if (toitem->nextInChain() != 0)
+	{
+		RAISE("Target frame links to another frame.");
+	}
+	if (toitem->prevInChain() != 0)
+	{
+		RAISE("Target frame is linked to by another frame.");
+	}
+	if (toitem->itemName() == item->itemName())
+	{
+		RAISE("Source and target are the same object.");
+	}
+	// references to the others boxes
+	item->link(toitem);
+	ScCore->primaryMainWindow()->view->DrawNew();
+	ScCore->primaryMainWindow()->slotDocCh();
+}
+
+void TextAPI::unLinkTextFrames()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	// only linked
+	if (item->prevInChain() == 0)
+	{
+		RAISE("Object is not a linked text frame, can't unlink.");
+	}
+	item->prevInChain()->unlink();
+	// enable 'save icon' stuff
+	ScCore->primaryMainWindow()->slotDocCh();
+	ScCore->primaryMainWindow()->view->DrawNew();
+}
+
+bool TextAPI::deleteText()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (item->HasSel){}
+//		item->deleteSelectedTextFromFrame();
+	else
+	{
+		item->itemText.clear();
+		//for (int a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
+		//{
+		//	ScCore->primaryMainWindow()->doc->FrameItems.at(a)->ItemNr = a;
+		//}TODO fix this,
+	}
+}
+
+bool TextAPI::traceText()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (item->invalid)
+		item->layout();
+	ScCore->primaryMainWindow()->view->Deselect(true);
+	ScCore->primaryMainWindow()->view->SelectItem(item);
+	ScCore->primaryMainWindow()->view->TextToPath();
+	return true;
+}
+
+int TextAPI::textOverFlows(bool checkLinks)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	/* original solution
+	if (item->itemText.count() > item->MaxChars)
+	return PyBool_FromLong(static_cast<long>(true));
+	return PyBool_FromLong(static_cast<long>(false)); */
+	/*
+	 uint firstFrame = 0;
+	if (nolinks)
+		firstFrame = item->itemText.count();
+	uint chars = item->itemText.count();
+	uint maxchars = item->MaxChars;
+	while (item->NextBox != 0) {
+		item = item->NextBox;
+		chars += item->itemText.count();
+		maxchars += item->MaxChars;
+	}
+	// no overrun
+	if (nolinks)
+		return PyInt_FromLong(maxchars - firstFrame);
+
+	if (maxchars > chars)
+		return PyInt_FromLong(0);
+	// number of overrunning letters
+	return PyInt_FromLong(static_cast<long>(chars - maxchars));
+	 */
+	// refresh overflow information
+	item->invalidateLayout();
+	item->layout();
+	return item->frameOverflows();
+}
+
+bool TextAPI::hyphenate()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	ScCore->primaryMainWindow()->doc->docHyphenator->slotHyphenate(item);
+	return true;
+}
+
+bool TextAPI::dehyphenate()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	ScCore->primaryMainWindow()->doc->docHyphenator->slotDeHyphenate(item);
+	return false;
+}
+
+bool TextAPI::PDFBookMark()
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (item->isBookmark)
+		return true;
+	return false;
+}
+
+void TextAPI::setPDFBookMark(bool toggle)
+{
+	if (!checkHaveDocument())
+		RAISE("No document open");
+	if (item->isBookmark == toggle)
+	{
+		return;
+	}
+	if (toggle)
+	{
+		item->setIsAnnotation(false);
+		ScCore->primaryMainWindow()->AddBookMark(item);
+	}
+	else
+		ScCore->primaryMainWindow()->DelBookMark(item);
+	item->isBookmark = toggle;
+}
+
+TextAPI::~TextAPI()
+{
+	qDebug() << "TextItemWrapper deleted";
+}
+
+

Modified: trunk/Scribus/scribus/plugins/scripter/utils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scripter/utils.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/utils.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scripter/utils.cpp	Sat Sep 26 13:06:35 2015
@@ -1,239 +1,239 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#include "utils.h"
-#include "units.h"
-#include "scpage.h"
-#include "scribuscore.h"
-#include "scribusdoc.h"
-#include "selection.h"
-#include "scribusview.h"
-
-ScribusMainWindow* Carrier;
-ScribusDoc* doc;
-
-/// Convert a value in points to a value in the current document units
-double PointToValue(double Val)
-{
-	return pts2value(Val, ScCore->primaryMainWindow()->doc->unitIndex());
-}
-
-/// Convert a value in the current document units to a value in points
-double ValueToPoint(double Val)
-{
-	return value2pts(Val, ScCore->primaryMainWindow()->doc->unitIndex());
-}
-
-/// Convert an X co-ordinate part in page units to a document co-ordinate
-/// in system units.
-double pageUnitXToDocX(double pageUnitX)
-{
-	return ValueToPoint(pageUnitX) + ScCore->primaryMainWindow()->doc->currentPage()->xOffset();
-}
-
-// Convert doc units to page units
-double docUnitXToPageX(double pageUnitX)
-{
-	return PointToValue(pageUnitX - ScCore->primaryMainWindow()->doc->currentPage()->xOffset());
-}
-
-/// Convert a Y co-ordinate part in page units to a document co-ordinate
-/// in system units. The document co-ordinates have their origin somewere
-/// up and left of the first page, where page co-ordinates have their
-/// origin on the top left of the current page.
-double pageUnitYToDocY(double pageUnitY)
-{
-	return ValueToPoint(pageUnitY) + ScCore->primaryMainWindow()->doc->currentPage()->yOffset();
-}
-
-double docUnitYToPageY(double pageUnitY)
-{
-	return PointToValue(pageUnitY - ScCore->primaryMainWindow()->doc->currentPage()->yOffset());
-}
-
-int GetItem(QString Name)
-{
-	if (!Name.isEmpty())
-	{
-		for (int a = 0; a < ScCore->primaryMainWindow()->doc->Items->count(); a++)
-		{
-			if (ScCore->primaryMainWindow()->doc->Items->at(a)->itemName() == Name)
-				return static_cast<int>(a);
-		}
-	}
-	return -1;
-}
-
-namespace {
-	void replaceColors(StoryText& itemText, int pos, QString col, QString rep)
-	{
-		QString fill = itemText.charStyle(pos).fillColor();
-		QString stroke = itemText.charStyle(pos).strokeColor();
-		if (col == fill || col == stroke)
-		{
-			CharStyle cstyle;
-			if (col == fill)
-				cstyle.setFillColor(rep);
-			if (col == stroke)
-				cstyle.setStrokeColor(rep);
-			itemText.applyCharStyle(pos, 1, cstyle);
-		}
-	}
-}
-
-void ReplaceColor(QString col, QString rep)
-{
-	QColor tmpc;
-	for (int c = 0; c < ScCore->primaryMainWindow()->doc->Items->count(); c++)
-	{
-		PageItem *ite = ScCore->primaryMainWindow()->doc->Items->at(c);
-		if (ite->itemType() == PageItem::TextFrame)
-		{
-			for (int d = 0; d < ite->itemText.length(); d++)
-			{
-				//FIXME:NLS  that should work on runs
-				replaceColors(ite->itemText, d, col, rep);
-			}
-		}
-		if (col == ite->fillColor())
-			ite->setFillColor(rep);
-		if (col == ite->lineColor())
-			ite->setLineColor(rep);
-		QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
-		for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
-		{
-			if (col == cstops.at(cst)->name)
-			{
-				ite->SetQColor(&tmpc, rep, cstops.at(cst)->shade);
-				cstops.at(cst)->color = tmpc;
-				cstops.at(cst)->name = rep;
-			}
-		}
-	}
-	for (int c = 0; c < ScCore->primaryMainWindow()->doc->MasterItems.count(); c++)
-	{
-		PageItem *ite = ScCore->primaryMainWindow()->doc->MasterItems.at(c);
-		if (ite->itemType() == PageItem::TextFrame)
-		{
-			for (int d = 0; d < ite->itemText.length(); d++)
-			{
-				//FIXME: NLS this should work on runs
-				replaceColors(ite->itemText, d, col, rep);
-			}
-		}
-		if (col == ite->fillColor())
-			ite->setFillColor(rep);
-		if (col == ite->lineColor())
-			ite->setLineColor(rep);
-		QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
-		for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
-		{
-			if (col == cstops.at(cst)->name)
-			{
-				ite->SetQColor(&tmpc, rep, cstops.at(cst)->shade);
-				cstops.at(cst)->color = tmpc;
-				cstops.at(cst)->name = rep;
-			}
-		}
-	}
-}
-
-/* 04/07/10 returns selection if is not name specified  pv  */
-PageItem* GetUniqueItem(QString name)
-{
-	if (name.length()==0)
-		if (ScCore->primaryMainWindow()->doc->m_Selection->count() != 0)
-			return ScCore->primaryMainWindow()->doc->m_Selection->itemAt(0);
-		else
-		{
-			RAISE("Cannot use empty string for object name when there is no selection");
-			return NULL;
-		}
-	else
-		return getPageItemByName(name);
-}
-
-PageItem* getPageItemByName(QString name)
-{
-	if (name.length() == 0)
-	{
-		RAISE("Cannot accept empty name for pageitem");
-		return NULL;
-	}
-	for (int j = 0; j<ScCore->primaryMainWindow()->doc->Items->count(); j++)
-	{
-		if (name==ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
-			return ScCore->primaryMainWindow()->doc->Items->at(j);
-	} // for items
-	RAISE("Object not found");
-	return NULL;
-}
-
-
-/*!
- * Checks to see if a pageItem named 'name' exists and return true
- * if it does exist. Returns false if there is no such object, or
- * if the empty string ("") is passed.
- */
-bool ItemExists(QString name)
-{
-	if (name.length() == 0)
-		return false;
-	for (int j = 0; j<ScCore->primaryMainWindow()->doc->Items->count(); j++)
-	{
-		if (name==ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
-			return true;
-	} // for items
-	return false;
-}
-
-/*!
- * Checks to see if there is a document open.
- * If there is an open document, returns true.
- * If there is no open document, sets a Python
- * exception and returns false.
- * 2004-10-27 Craig Ringer
- */
-bool checkHaveDocument()
-{
-    if (ScCore->primaryMainWindow()->HaveDoc)
-        return true;
-    // Caller is required to check for false return from this function
-    // and return NULL.
-    RAISE("Command does not make sense without an open document");
-    return false;
-}
-
-QStringList getSelectedItemsByName()
-{
-	/*
-	QStringList names;
-	QPtrListIterator<PageItem> it(ScCore->primaryMainWindow()->view->SelItem);
-	for ( ; it.current() != 0 ; ++it)
-		names.append(it.current()->itemName());
-	return names;
-	*/
-	return ScCore->primaryMainWindow()->doc->m_Selection->getSelectedItemsByName();
-}
-
-bool setSelectedItemsByName(QStringList& itemNames)
-{
-	ScCore->primaryMainWindow()->view->Deselect();
-	// For each named item
-	for (QStringList::Iterator it = itemNames.begin() ; it != itemNames.end() ; it++)
-	{
-		// Search for the named item
-		PageItem* item = 0;
-		for (int j = 0; j < ScCore->primaryMainWindow()->doc->Items->count(); j++)
-			if (*it == ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
-				item = ScCore->primaryMainWindow()->doc->Items->at(j);
-		if (!item)
-			return false;
-		// and select it
-		ScCore->primaryMainWindow()->view->SelectItem(item);
-	}
-	return true;
-}
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include "utils.h"
+#include "units.h"
+#include "scpage.h"
+#include "scribuscore.h"
+#include "scribusdoc.h"
+#include "selection.h"
+#include "scribusview.h"
+
+ScribusMainWindow* Carrier;
+ScribusDoc* doc;
+
+/// Convert a value in points to a value in the current document units
+double PointToValue(double Val)
+{
+	return pts2value(Val, ScCore->primaryMainWindow()->doc->unitIndex());
+}
+
+/// Convert a value in the current document units to a value in points
+double ValueToPoint(double Val)
+{
+	return value2pts(Val, ScCore->primaryMainWindow()->doc->unitIndex());
+}
+
+/// Convert an X co-ordinate part in page units to a document co-ordinate
+/// in system units.
+double pageUnitXToDocX(double pageUnitX)
+{
+	return ValueToPoint(pageUnitX) + ScCore->primaryMainWindow()->doc->currentPage()->xOffset();
+}
+
+// Convert doc units to page units
+double docUnitXToPageX(double pageUnitX)
+{
+	return PointToValue(pageUnitX - ScCore->primaryMainWindow()->doc->currentPage()->xOffset());
+}
+
+/// Convert a Y co-ordinate part in page units to a document co-ordinate
+/// in system units. The document co-ordinates have their origin somewere
+/// up and left of the first page, where page co-ordinates have their
+/// origin on the top left of the current page.
+double pageUnitYToDocY(double pageUnitY)
+{
+	return ValueToPoint(pageUnitY) + ScCore->primaryMainWindow()->doc->currentPage()->yOffset();
+}
+
+double docUnitYToPageY(double pageUnitY)
+{
+	return PointToValue(pageUnitY - ScCore->primaryMainWindow()->doc->currentPage()->yOffset());
+}
+
+int GetItem(QString Name)
+{
+	if (!Name.isEmpty())
+	{
+		for (int a = 0; a < ScCore->primaryMainWindow()->doc->Items->count(); a++)
+		{
+			if (ScCore->primaryMainWindow()->doc->Items->at(a)->itemName() == Name)
+				return static_cast<int>(a);
+		}
+	}
+	return -1;
+}
+
+namespace {
+	void replaceColors(StoryText& itemText, int pos, QString col, QString rep)
+	{
+		QString fill = itemText.charStyle(pos).fillColor();
+		QString stroke = itemText.charStyle(pos).strokeColor();
+		if (col == fill || col == stroke)
+		{
+			CharStyle cstyle;
+			if (col == fill)
+				cstyle.setFillColor(rep);
+			if (col == stroke)
+				cstyle.setStrokeColor(rep);
+			itemText.applyCharStyle(pos, 1, cstyle);
+		}
+	}
+}
+
+void ReplaceColor(QString col, QString rep)
+{
+	QColor tmpc;
+	for (int c = 0; c < ScCore->primaryMainWindow()->doc->Items->count(); c++)
+	{
+		PageItem *ite = ScCore->primaryMainWindow()->doc->Items->at(c);
+		if (ite->itemType() == PageItem::TextFrame)
+		{
+			for (int d = 0; d < ite->itemText.length(); d++)
+			{
+				//FIXME:NLS  that should work on runs
+				replaceColors(ite->itemText, d, col, rep);
+			}
+		}
+		if (col == ite->fillColor())
+			ite->setFillColor(rep);
+		if (col == ite->lineColor())
+			ite->setLineColor(rep);
+		QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
+		for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+		{
+			if (col == cstops.at(cst)->name)
+			{
+				ite->SetQColor(&tmpc, rep, cstops.at(cst)->shade);
+				cstops.at(cst)->color = tmpc;
+				cstops.at(cst)->name = rep;
+			}
+		}
+	}
+	for (int c = 0; c < ScCore->primaryMainWindow()->doc->MasterItems.count(); c++)
+	{
+		PageItem *ite = ScCore->primaryMainWindow()->doc->MasterItems.at(c);
+		if (ite->itemType() == PageItem::TextFrame)
+		{
+			for (int d = 0; d < ite->itemText.length(); d++)
+			{
+				//FIXME: NLS this should work on runs
+				replaceColors(ite->itemText, d, col, rep);
+			}
+		}
+		if (col == ite->fillColor())
+			ite->setFillColor(rep);
+		if (col == ite->lineColor())
+			ite->setLineColor(rep);
+		QList<VColorStop*> cstops = ite->fill_gradient.colorStops();
+		for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
+		{
+			if (col == cstops.at(cst)->name)
+			{
+				ite->SetQColor(&tmpc, rep, cstops.at(cst)->shade);
+				cstops.at(cst)->color = tmpc;
+				cstops.at(cst)->name = rep;
+			}
+		}
+	}
+}
+
+/* 04/07/10 returns selection if is not name specified  pv  */
+PageItem* GetUniqueItem(QString name)
+{
+	if (name.length()==0)
+		if (ScCore->primaryMainWindow()->doc->m_Selection->count() != 0)
+			return ScCore->primaryMainWindow()->doc->m_Selection->itemAt(0);
+		else
+		{
+			RAISE("Cannot use empty string for object name when there is no selection");
+			return NULL;
+		}
+	else
+		return getPageItemByName(name);
+}
+
+PageItem* getPageItemByName(QString name)
+{
+	if (name.length() == 0)
+	{
+		RAISE("Cannot accept empty name for pageitem");
+		return NULL;
+	}
+	for (int j = 0; j<ScCore->primaryMainWindow()->doc->Items->count(); j++)
+	{
+		if (name==ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
+			return ScCore->primaryMainWindow()->doc->Items->at(j);
+	} // for items
+	RAISE("Object not found");
+	return NULL;
+}
+
+
+/*!
+ * Checks to see if a pageItem named 'name' exists and return true
+ * if it does exist. Returns false if there is no such object, or
+ * if the empty string ("") is passed.
+ */
+bool ItemExists(QString name)
+{
+	if (name.length() == 0)
+		return false;
+	for (int j = 0; j<ScCore->primaryMainWindow()->doc->Items->count(); j++)
+	{
+		if (name==ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
+			return true;
+	} // for items
+	return false;
+}
+
+/*!
+ * Checks to see if there is a document open.
+ * If there is an open document, returns true.
+ * If there is no open document, sets a Python
+ * exception and returns false.
+ * 2004-10-27 Craig Ringer
+ */
+bool checkHaveDocument()
+{
+	if (ScCore->primaryMainWindow()->HaveDoc)
+		return true;
+	// Caller is required to check for false return from this function
+	// and return NULL.
+	RAISE("Command does not make sense without an open document");
+	return false;
+}
+
+QStringList getSelectedItemsByName()
+{
+	/*
+	QStringList names;
+	QPtrListIterator<PageItem> it(ScCore->primaryMainWindow()->view->SelItem);
+	for ( ; it.current() != 0 ; ++it)
+		names.append(it.current()->itemName());
+	return names;
+	*/
+	return ScCore->primaryMainWindow()->doc->m_Selection->getSelectedItemsByName();
+}
+
+bool setSelectedItemsByName(QStringList& itemNames)
+{
+	ScCore->primaryMainWindow()->view->Deselect();
+	// For each named item
+	for (QStringList::Iterator it = itemNames.begin() ; it != itemNames.end() ; it++)
+	{
+		// Search for the named item
+		PageItem* item = 0;
+		for (int j = 0; j < ScCore->primaryMainWindow()->doc->Items->count(); j++)
+			if (*it == ScCore->primaryMainWindow()->doc->Items->at(j)->itemName())
+				item = ScCore->primaryMainWindow()->doc->Items->at(j);
+		if (!item)
+			return false;
+		// and select it
+		ScCore->primaryMainWindow()->view->SelectItem(item);
+	}
+	return true;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp	Sat Sep 26 13:06:35 2015
@@ -361,9 +361,9 @@
 PV */
 void cmdcolordocswarnings()
 {
-    QStringList s;
-    s << scribus_colornames__doc__ << scribus_getcolor__doc__ << scribus_getcolorasrgb__doc__;
-    s << scribus_setcolor__doc__ << scribus_setcolorrgb__doc__ << scribus_setcolorcmyk__doc__; 
+	QStringList s;
+	s << scribus_colornames__doc__ << scribus_getcolor__doc__ << scribus_getcolorasrgb__doc__;
+	s << scribus_setcolor__doc__ << scribus_setcolorrgb__doc__ << scribus_setcolorcmyk__doc__;
 	s << scribus_newcolor__doc__ << scribus_newcolorrgb__doc__ << scribus_newcolorcmyk__doc__<< scribus_delcolor__doc__;
 	s << scribus_replcolor__doc__ << scribus_isspotcolor__doc__ << scribus_setspotcolor__doc__;
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmddialog.cpp	Sat Sep 26 13:06:35 2015
@@ -154,7 +154,7 @@
 PV */
 void cmddialogdocwarnings()
 {
-    QStringList s;
-    s << scribus_newdocdia__doc__ << scribus_filedia__doc__ << scribus_messdia__doc__;
-    s << scribus_valdialog__doc__ << scribus_newstyledialog__doc__;
+	QStringList s;
+	s << scribus_newdocdia__doc__ << scribus_filedia__doc__ << scribus_messdia__doc__;
+	s << scribus_valdialog__doc__ << scribus_newstyledialog__doc__;
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp	Sat Sep 26 13:06:35 2015
@@ -425,6 +425,6 @@
 PV */
 void cmddocdocwarnings()
 {
-    QStringList s;
-    s << scribus_newdocument__doc__ << scribus_newdoc__doc__ <<  scribus_closedoc__doc__ << scribus_havedoc__doc__ << scribus_opendoc__doc__ << scribus_savedoc__doc__ << scribus_getdocname__doc__ << scribus_savedocas__doc__ << scribus_setinfo__doc__ <<scribus_setmargins__doc__ <<scribus_setunit__doc__ <<scribus_getunit__doc__ <<scribus_loadstylesfromfile__doc__ <<scribus_setdoctype__doc__ <<scribus_closemasterpage__doc__ <<scribus_masterpagenames__doc__ <<scribus_editmasterpage__doc__ <<scribus_createmasterpage__doc__ <<scribus_deletemasterpage__doc__ << scribus_setbaseline__doc__;
-}
+	QStringList s;
+	s << scribus_newdocument__doc__ << scribus_newdoc__doc__ <<  scribus_closedoc__doc__ << scribus_havedoc__doc__ << scribus_opendoc__doc__ << scribus_savedoc__doc__ << scribus_getdocname__doc__ << scribus_savedocas__doc__ << scribus_setinfo__doc__ <<scribus_setmargins__doc__ <<scribus_setunit__doc__ <<scribus_getunit__doc__ <<scribus_loadstylesfromfile__doc__ <<scribus_setdoctype__doc__ <<scribus_closemasterpage__doc__ <<scribus_masterpagenames__doc__ <<scribus_editmasterpage__doc__ <<scribus_createmasterpage__doc__ <<scribus_deletemasterpage__doc__ << scribus_setbaseline__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp	Sat Sep 26 13:06:35 2015
@@ -332,8 +332,8 @@
 PV */
 void cmdgetpropdocwarnings()
 {
-    QStringList s;
-    s << scribus_getobjecttype__doc__ << scribus_getfillcolor__doc__ 
+	QStringList s;
+	s << scribus_getobjecttype__doc__ << scribus_getfillcolor__doc__
 	  << scribus_getfilltrans__doc__ << scribus_getfillblend__doc__ 
 	  << scribus_getlinecolor__doc__ << scribus_getlinetrans__doc__ 
 	  << scribus_getlineblend__doc__ << scribus_getlinewidth__doc__ 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp	Sat Sep 26 13:06:35 2015
@@ -493,7 +493,7 @@
 PV */
 void cmdgetsetpropdocwarnings()
 {
-    QStringList s;
-    s << scribus_propertyctype__doc__ << scribus_getpropertynames__doc__ << scribus_getproperty__doc__ << scribus_setproperty__doc__;
+	QStringList s;
+	s << scribus_propertyctype__doc__ << scribus_getpropertynames__doc__ << scribus_getproperty__doc__ << scribus_setproperty__doc__;
 	//Qt4 << scribus_getchildren__doc__ << scribus_getchild__doc__;
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp	Sat Sep 26 13:06:35 2015
@@ -619,7 +619,7 @@
 PV */
 void cmdmanidocwarnings()
 {
-    QStringList s;
+	QStringList s;
 	s << scribus_moveobjrel__doc__ << scribus_moveobjabs__doc__
 	  << scribus_rotobjrel__doc__ << scribus_rotobjabs__doc__
 	  << scribus_sizeobjabs__doc__ << scribus_getselobjnam__doc__

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp	Sat Sep 26 13:06:35 2015
@@ -817,7 +817,7 @@
 PV */
 void cmdmiscdocwarnings()
 {
-    QStringList s;
+	QStringList s;
 	s << scribus_setredraw__doc__ << scribus_fontnames__doc__ 
 	  << scribus_xfontnames__doc__ << scribus_renderfont__doc__ 
 	  << scribus_getlayers__doc__ << scribus_setactlayer__doc__ 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp	Sat Sep 26 13:06:35 2015
@@ -761,6 +761,6 @@
 PV */
 void cmdobjdocwarnings()
 {
-    QStringList s;
+	QStringList s;
 	s << scribus_newrect__doc__ <<scribus_newellipse__doc__ << scribus_newimage__doc__ << scribus_newtext__doc__ << scribus_newtable__doc__ << scribus_newline__doc__ <<scribus_polyline__doc__ << scribus_polygon__doc__ << scribus_bezierline__doc__ <<scribus_pathtext__doc__ <<scribus_deleteobj__doc__ <<scribus_textflow__doc__ <<scribus_objectexists__doc__ <<scribus_setstyle__doc__ <<scribus_getstylenames__doc__ <<scribus_getcharstylenames__doc__ <<scribus_duplicateobject__doc__ <<scribus_copyobject__doc__ <<scribus_pasteobject__doc__;
 }

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp	Sat Sep 26 13:06:35 2015
@@ -507,8 +507,8 @@
 PV */
 void cmdpagedocwarnings()
 {
-    QStringList s;
-    s << scribus_newpage__doc__        << scribus_pageposition__doc__
+	QStringList s;
+	s << scribus_newpage__doc__        << scribus_pageposition__doc__
 	  << scribus_actualpage__doc__     << scribus_redraw__doc__
 	  << scribus_savepageeps__doc__    << scribus_deletepage__doc__
 	  << scribus_gotopage__doc__       << scribus_pagecount__doc__

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	Sat Sep 26 13:06:35 2015
@@ -1,178 +1,178 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-02.01.2008: Joachim Neu - joachim_neu at web.de - http://www.joachim-neu.de
-*/
-#include "cmdstyle.h"
-#include "cmdutil.h"
-
-#include "qbuffer.h"
-#include "qpixmap.h"
-//Added by qt3to4:
-#include <QList>
-
-#include "scribuscore.h"
-#include "styles/paragraphstyle.h"
-#include "styles/charstyle.h"
-#include "ui/stylemanager.h"
-
-/*! 02.01.2007 - 05.01.2007 : Joachim Neu : Create a paragraph style.
-			Special thanks go to avox for helping me! */
-PyObject *scribus_createparagraphstyle(PyObject* /* self */, PyObject* args, PyObject* keywords)
-{
-	//TODO - new paragraph properties for bullets and numbering
-	char* keywordargs[] = {
-			const_cast<char*>("name"),
-			const_cast<char*>("linespacingmode"),
-			const_cast<char*>("linespacing"),
-			const_cast<char*>("alignment"),
-			const_cast<char*>("leftmargin"),
-			const_cast<char*>("rightmargin"),
-			const_cast<char*>("gapbefore"),
-			const_cast<char*>("gapafter"),
-			const_cast<char*>("firstindent"),
-			const_cast<char*>("hasdropcap"),
-			const_cast<char*>("dropcaplines"),
-			const_cast<char*>("dropcapoffset"),
-			const_cast<char*>("charstyle"),
-			NULL};
-	char *Name = const_cast<char*>(""), *CharStyle = const_cast<char*>("");
-	int LineSpacingMode = 0, Alignment = 0, DropCapLines = 2, HasDropCap = 0;
-	double LineSpacing = 15.0, LeftMargin = 0.0, RightMargin = 0.0;
-	double GapBefore = 0.0, GapAfter = 0.0, FirstIndent = 0.0, PEOffset = 0;
-	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|ididddddiides",
-		 keywordargs, "utf-8", &Name, &LineSpacingMode, &LineSpacing, &Alignment,
-		&LeftMargin, &RightMargin, &GapBefore, &GapAfter, &FirstIndent,
-		&HasDropCap, &DropCapLines, &PEOffset, "utf-8", &CharStyle))
-		return NULL;
-	if(!checkHaveDocument())
-		return NULL;
-	if (Name == EMPTY_STRING)
-	{
-		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty paragraph style name.","python error").toLocal8Bit().constData());
-		return NULL;
-	}
-
-	ParagraphStyle TmpParagraphStyle;
-	TmpParagraphStyle.setName(Name);
-	TmpParagraphStyle.setLineSpacingMode((ParagraphStyle::LineSpacingMode)LineSpacingMode);
-	TmpParagraphStyle.setLineSpacing(LineSpacing);
-	TmpParagraphStyle.setAlignment((ParagraphStyle::AlignmentType)Alignment);
-	TmpParagraphStyle.setLeftMargin(LeftMargin);
-	TmpParagraphStyle.setFirstIndent(FirstIndent);
-	TmpParagraphStyle.setRightMargin(RightMargin);
-	TmpParagraphStyle.setGapBefore(GapBefore);
-	TmpParagraphStyle.setGapAfter(GapAfter);
-	if(HasDropCap == 0)
-		TmpParagraphStyle.setHasDropCap(false);
-	else if(HasDropCap == 1)
-		TmpParagraphStyle.setHasDropCap(true);
-	else
-	{
-		PyErr_SetString(PyExc_ValueError, QObject::tr("hasdropcap has to be 0 or 1.","python error").toLocal8Bit().constData());
-		return NULL;
-	}
-	TmpParagraphStyle.setDropCapLines(DropCapLines);
-	TmpParagraphStyle.setParEffectOffset(PEOffset);
-	TmpParagraphStyle.charStyle().setParent(CharStyle);
-
-	StyleSet<ParagraphStyle> TmpStyleSet;
-	TmpStyleSet.create(TmpParagraphStyle);
-	ScCore->primaryMainWindow()->doc->redefineStyles(TmpStyleSet, false);
-	// PV - refresh the Style Manager window.
-	// I thought that this can work but it doesn't:
-	// ScCore->primaryMainWindow()->styleMgr()->reloadStyleView();
-	// So the brute force setDoc is called...
-	ScCore->primaryMainWindow()->styleMgr()->setDoc(ScCore->primaryMainWindow()->doc);
-
-	Py_RETURN_NONE;
-}
-
-/*! 03.01.2007 - 05.01.2007 : Joachim Neu : Create a char style.
-			Special thanks go to avox for helping me! */
-PyObject *scribus_createcharstyle(PyObject* /* self */, PyObject* args, PyObject* keywords)
-{
-	char* keywordargs[] = {
-					  							const_cast<char*>("name"),
-					  							const_cast<char*>("font"),
-					  							const_cast<char*>("fontsize"),
-					  							const_cast<char*>("features"),
-					  							const_cast<char*>("fillcolor"),
-					  							const_cast<char*>("fillshade"),
-					  							const_cast<char*>("strokecolor"),
-					  							const_cast<char*>("strokeshade"),
-					  							const_cast<char*>("baselineoffset"),
-					  							const_cast<char*>("shadowxoffset"),
-					  							const_cast<char*>("shadowyoffset"),
-					  							const_cast<char*>("outlinewidth"),
-					  							const_cast<char*>("underlineoffset"),
-					  							const_cast<char*>("underlinewidth"),
-					  							const_cast<char*>("strikethruoffset"),
-					  							const_cast<char*>("strikethruwidth"),
-					  							const_cast<char*>("scaleh"),
-					  							const_cast<char*>("scalev"),
-					  							const_cast<char*>("tracking"),
-					  							const_cast<char*>("language"),
-					  						NULL};
-	char *Name = const_cast<char*>(""), *Font = const_cast<char*>("Times"), *Features = const_cast<char*>("inherit"), *FillColor = const_cast<char*>("Black"), *StrokeColor = const_cast<char*>("Black"), *Language = const_cast<char*>("");
-	double FontSize = 200, FillShade = 1, StrokeShade = 1, ScaleH = 1, ScaleV = 1, BaselineOffset = 0, ShadowXOffset = 0, ShadowYOffset = 0, OutlineWidth = 0, UnderlineOffset = 0, UnderlineWidth = 0, StrikethruOffset = 0, StrikethruWidth = 0, Tracking = 0;
-	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|esdesesdesddddddddddddes", keywordargs,
-																									"utf-8", &Name, "utf-8", &Font, &FontSize, "utf-8", &Features,
-																									"utf-8", &FillColor, &FillShade, "utf-8", &StrokeColor, &StrokeShade, &BaselineOffset, &ShadowXOffset,
-																									&ShadowYOffset, &OutlineWidth, &UnderlineOffset, &UnderlineWidth, &StrikethruOffset, &StrikethruWidth,
-																									&ScaleH, &ScaleV, &Tracking, "utf-8", &Language))
-		return NULL;
-	if(!checkHaveDocument())
-		return NULL;
-	if(Name == EMPTY_STRING)
-	{
-		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty char style name.","python error").toLocal8Bit().constData());
-		return NULL;
-	}
-
-	QStringList FeaturesList = QString(Features).split(QString(","));
-
-	CharStyle TmpCharStyle;
-	TmpCharStyle.setName(Name);
-	TmpCharStyle.setFont((*ScCore->primaryMainWindow()->doc->AllFonts)[QString(Font)]);
-	TmpCharStyle.setFontSize(FontSize * 10);
-	TmpCharStyle.setFeatures(FeaturesList);
-	TmpCharStyle.setFillColor(QString(FillColor));
-	TmpCharStyle.setFillShade(FillShade * 100);
-	TmpCharStyle.setStrokeColor(QString(StrokeColor));
-	TmpCharStyle.setStrokeShade(StrokeShade * 100);
-	TmpCharStyle.setBaselineOffset(BaselineOffset);
-	TmpCharStyle.setShadowXOffset(ShadowXOffset);
-	TmpCharStyle.setShadowYOffset(ShadowYOffset);
-	TmpCharStyle.setOutlineWidth(OutlineWidth);
-	TmpCharStyle.setUnderlineOffset(UnderlineOffset);
-	TmpCharStyle.setUnderlineWidth(UnderlineWidth);
-	TmpCharStyle.setStrikethruOffset(StrikethruOffset);
-	TmpCharStyle.setStrikethruWidth(StrikethruWidth);
-	TmpCharStyle.setScaleH(ScaleH * 1000);
-	TmpCharStyle.setScaleV(ScaleV * 1000);
-	TmpCharStyle.setTracking(Tracking);
-	TmpCharStyle.setLanguage(QString(Language));
-
-	StyleSet<CharStyle> TmpStyleSet;
-	TmpStyleSet.create(TmpCharStyle);
-	ScCore->primaryMainWindow()->doc->redefineCharStyles(TmpStyleSet, false);
-	// PV - refresh the Style Manager window.
-	// I thought that this can work but it doesn't:
-	// ScCore->primaryMainWindow()->styleMgr()->reloadStyleView();
-	// So the brute force setDoc is called...
-	ScCore->primaryMainWindow()->styleMgr()->setDoc(ScCore->primaryMainWindow()->doc);
-
-	Py_RETURN_NONE;
-}
-
-/*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
-with header files structure untouched (docstrings are kept near declarations)
-PV */
-void cmdstyledocwarnings()
-{
-    QStringList s;
-    s << scribus_createparagraphstyle__doc__ << scribus_createcharstyle__doc__;
-}
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+02.01.2008: Joachim Neu - joachim_neu at web.de - http://www.joachim-neu.de
+*/
+#include "cmdstyle.h"
+#include "cmdutil.h"
+
+#include "qbuffer.h"
+#include "qpixmap.h"
+//Added by qt3to4:
+#include <QList>
+
+#include "scribuscore.h"
+#include "styles/paragraphstyle.h"
+#include "styles/charstyle.h"
+#include "ui/stylemanager.h"
+
+/*! 02.01.2007 - 05.01.2007 : Joachim Neu : Create a paragraph style.
+			Special thanks go to avox for helping me! */
+PyObject *scribus_createparagraphstyle(PyObject* /* self */, PyObject* args, PyObject* keywords)
+{
+	//TODO - new paragraph properties for bullets and numbering
+	char* keywordargs[] = {
+			const_cast<char*>("name"),
+			const_cast<char*>("linespacingmode"),
+			const_cast<char*>("linespacing"),
+			const_cast<char*>("alignment"),
+			const_cast<char*>("leftmargin"),
+			const_cast<char*>("rightmargin"),
+			const_cast<char*>("gapbefore"),
+			const_cast<char*>("gapafter"),
+			const_cast<char*>("firstindent"),
+			const_cast<char*>("hasdropcap"),
+			const_cast<char*>("dropcaplines"),
+			const_cast<char*>("dropcapoffset"),
+			const_cast<char*>("charstyle"),
+			NULL};
+	char *Name = const_cast<char*>(""), *CharStyle = const_cast<char*>("");
+	int LineSpacingMode = 0, Alignment = 0, DropCapLines = 2, HasDropCap = 0;
+	double LineSpacing = 15.0, LeftMargin = 0.0, RightMargin = 0.0;
+	double GapBefore = 0.0, GapAfter = 0.0, FirstIndent = 0.0, PEOffset = 0;
+	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|ididddddiides",
+		 keywordargs, "utf-8", &Name, &LineSpacingMode, &LineSpacing, &Alignment,
+		&LeftMargin, &RightMargin, &GapBefore, &GapAfter, &FirstIndent,
+		&HasDropCap, &DropCapLines, &PEOffset, "utf-8", &CharStyle))
+		return NULL;
+	if(!checkHaveDocument())
+		return NULL;
+	if (Name == EMPTY_STRING)
+	{
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty paragraph style name.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+
+	ParagraphStyle TmpParagraphStyle;
+	TmpParagraphStyle.setName(Name);
+	TmpParagraphStyle.setLineSpacingMode((ParagraphStyle::LineSpacingMode)LineSpacingMode);
+	TmpParagraphStyle.setLineSpacing(LineSpacing);
+	TmpParagraphStyle.setAlignment((ParagraphStyle::AlignmentType)Alignment);
+	TmpParagraphStyle.setLeftMargin(LeftMargin);
+	TmpParagraphStyle.setFirstIndent(FirstIndent);
+	TmpParagraphStyle.setRightMargin(RightMargin);
+	TmpParagraphStyle.setGapBefore(GapBefore);
+	TmpParagraphStyle.setGapAfter(GapAfter);
+	if(HasDropCap == 0)
+		TmpParagraphStyle.setHasDropCap(false);
+	else if(HasDropCap == 1)
+		TmpParagraphStyle.setHasDropCap(true);
+	else
+	{
+		PyErr_SetString(PyExc_ValueError, QObject::tr("hasdropcap has to be 0 or 1.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+	TmpParagraphStyle.setDropCapLines(DropCapLines);
+	TmpParagraphStyle.setParEffectOffset(PEOffset);
+	TmpParagraphStyle.charStyle().setParent(CharStyle);
+
+	StyleSet<ParagraphStyle> TmpStyleSet;
+	TmpStyleSet.create(TmpParagraphStyle);
+	ScCore->primaryMainWindow()->doc->redefineStyles(TmpStyleSet, false);
+	// PV - refresh the Style Manager window.
+	// I thought that this can work but it doesn't:
+	// ScCore->primaryMainWindow()->styleMgr()->reloadStyleView();
+	// So the brute force setDoc is called...
+	ScCore->primaryMainWindow()->styleMgr()->setDoc(ScCore->primaryMainWindow()->doc);
+
+	Py_RETURN_NONE;
+}
+
+/*! 03.01.2007 - 05.01.2007 : Joachim Neu : Create a char style.
+			Special thanks go to avox for helping me! */
+PyObject *scribus_createcharstyle(PyObject* /* self */, PyObject* args, PyObject* keywords)
+{
+	char* keywordargs[] = {
+					  							const_cast<char*>("name"),
+					  							const_cast<char*>("font"),
+					  							const_cast<char*>("fontsize"),
+					  							const_cast<char*>("features"),
+					  							const_cast<char*>("fillcolor"),
+					  							const_cast<char*>("fillshade"),
+					  							const_cast<char*>("strokecolor"),
+					  							const_cast<char*>("strokeshade"),
+					  							const_cast<char*>("baselineoffset"),
+					  							const_cast<char*>("shadowxoffset"),
+					  							const_cast<char*>("shadowyoffset"),
+					  							const_cast<char*>("outlinewidth"),
+					  							const_cast<char*>("underlineoffset"),
+					  							const_cast<char*>("underlinewidth"),
+					  							const_cast<char*>("strikethruoffset"),
+					  							const_cast<char*>("strikethruwidth"),
+					  							const_cast<char*>("scaleh"),
+					  							const_cast<char*>("scalev"),
+					  							const_cast<char*>("tracking"),
+					  							const_cast<char*>("language"),
+					  						NULL};
+	char *Name = const_cast<char*>(""), *Font = const_cast<char*>("Times"), *Features = const_cast<char*>("inherit"), *FillColor = const_cast<char*>("Black"), *StrokeColor = const_cast<char*>("Black"), *Language = const_cast<char*>("");
+	double FontSize = 200, FillShade = 1, StrokeShade = 1, ScaleH = 1, ScaleV = 1, BaselineOffset = 0, ShadowXOffset = 0, ShadowYOffset = 0, OutlineWidth = 0, UnderlineOffset = 0, UnderlineWidth = 0, StrikethruOffset = 0, StrikethruWidth = 0, Tracking = 0;
+	if (!PyArg_ParseTupleAndKeywords(args, keywords, "es|esdesesdesddddddddddddes", keywordargs,
+																									"utf-8", &Name, "utf-8", &Font, &FontSize, "utf-8", &Features,
+																									"utf-8", &FillColor, &FillShade, "utf-8", &StrokeColor, &StrokeShade, &BaselineOffset, &ShadowXOffset,
+																									&ShadowYOffset, &OutlineWidth, &UnderlineOffset, &UnderlineWidth, &StrikethruOffset, &StrikethruWidth,
+																									&ScaleH, &ScaleV, &Tracking, "utf-8", &Language))
+		return NULL;
+	if(!checkHaveDocument())
+		return NULL;
+	if(Name == EMPTY_STRING)
+	{
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty char style name.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+
+	QStringList FeaturesList = QString(Features).split(QString(","));
+
+	CharStyle TmpCharStyle;
+	TmpCharStyle.setName(Name);
+	TmpCharStyle.setFont((*ScCore->primaryMainWindow()->doc->AllFonts)[QString(Font)]);
+	TmpCharStyle.setFontSize(FontSize * 10);
+	TmpCharStyle.setFeatures(FeaturesList);
+	TmpCharStyle.setFillColor(QString(FillColor));
+	TmpCharStyle.setFillShade(FillShade * 100);
+	TmpCharStyle.setStrokeColor(QString(StrokeColor));
+	TmpCharStyle.setStrokeShade(StrokeShade * 100);
+	TmpCharStyle.setBaselineOffset(BaselineOffset);
+	TmpCharStyle.setShadowXOffset(ShadowXOffset);
+	TmpCharStyle.setShadowYOffset(ShadowYOffset);
+	TmpCharStyle.setOutlineWidth(OutlineWidth);
+	TmpCharStyle.setUnderlineOffset(UnderlineOffset);
+	TmpCharStyle.setUnderlineWidth(UnderlineWidth);
+	TmpCharStyle.setStrikethruOffset(StrikethruOffset);
+	TmpCharStyle.setStrikethruWidth(StrikethruWidth);
+	TmpCharStyle.setScaleH(ScaleH * 1000);
+	TmpCharStyle.setScaleV(ScaleV * 1000);
+	TmpCharStyle.setTracking(Tracking);
+	TmpCharStyle.setLanguage(QString(Language));
+
+	StyleSet<CharStyle> TmpStyleSet;
+	TmpStyleSet.create(TmpCharStyle);
+	ScCore->primaryMainWindow()->doc->redefineCharStyles(TmpStyleSet, false);
+	// PV - refresh the Style Manager window.
+	// I thought that this can work but it doesn't:
+	// ScCore->primaryMainWindow()->styleMgr()->reloadStyleView();
+	// So the brute force setDoc is called...
+	ScCore->primaryMainWindow()->styleMgr()->setDoc(ScCore->primaryMainWindow()->doc);
+
+	Py_RETURN_NONE;
+}
+
+/*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
+with header files structure untouched (docstrings are kept near declarations)
+PV */
+void cmdstyledocwarnings()
+{
+	QStringList s;
+	s << scribus_createparagraphstyle__doc__ << scribus_createcharstyle__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp	Sat Sep 26 13:06:35 2015
@@ -343,37 +343,37 @@
 
 PyObject *scribus_inserthtmltext(PyObject* /* self */, PyObject* args)
 {
-    char *name = const_cast<char*>("");
-    char *file;
-    QString data;
-
-    if (!PyArg_ParseTuple(args, "es|es", "utf-8", &file, "utf-8", &name)) {
-        return NULL;
-    }
-
-    if(!checkHaveDocument()) {
-        return NULL;
-    }
-
-    PageItem *it = GetUniqueItem(QString::fromUtf8(name));
-    if (it == NULL) {
-        return NULL;
-    }
-
-    if (!(it->asTextFrame()) && !(it->asPathText())) {
-        PyErr_SetString(WrongFrameTypeError,
-                QObject::tr("Cannot insert text into non-text frame.",
-                    "python error").toLocal8Bit().constData());
-        return NULL;
-    }
+	char *name = const_cast<char*>("");
+	char *file;
+	QString data;
+
+	if (!PyArg_ParseTuple(args, "es|es", "utf-8", &file, "utf-8", &name)) {
+		return NULL;
+	}
+
+	if(!checkHaveDocument()) {
+		return NULL;
+	}
+
+	PageItem *it = GetUniqueItem(QString::fromUtf8(name));
+	if (it == NULL) {
+		return NULL;
+	}
+
+	if (!(it->asTextFrame()) && !(it->asPathText())) {
+		PyErr_SetString(WrongFrameTypeError,
+				QObject::tr("Cannot insert text into non-text frame.",
+					"python error").toLocal8Bit().constData());
+		return NULL;
+	}
 
 	QString fileName = QString::fromUtf8(file);
 
-    gtGetText gt(ScCore->primaryMainWindow()->doc);
-    gt.launchImporter(-1, fileName, false, QString("utf-8"), false, it);
-
-    // FIXME: PyMem_Free() - are any needed??
-    Py_RETURN_NONE;
+	gtGetText gt(ScCore->primaryMainWindow()->doc);
+	gt.launchImporter(-1, fileName, false, QString("utf-8"), false, it);
+
+	// FIXME: PyMem_Free() - are any needed??
+	Py_RETURN_NONE;
 }
 
 PyObject *scribus_setalign(PyObject* /* self */, PyObject* args)
@@ -1182,8 +1182,8 @@
 PV */
 void cmdtextdocwarnings()
 {
-    QStringList s;
-    s << scribus_getfontsize__doc__    << scribus_getfont__doc__
+	QStringList s;
+	s << scribus_getfontsize__doc__    << scribus_getfont__doc__
 	  << scribus_gettextlines__doc__   << scribus_gettextsize__doc__
 	  << scribus_getframetext__doc__   << scribus_gettext__doc__
 	  << scribus_getlinespace__doc__   << scribus_getcolumngap__doc__

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp	Sat Sep 26 13:06:35 2015
@@ -223,12 +223,12 @@
  */
 bool checkHaveDocument()
 {
-    if (ScCore->primaryMainWindow()->HaveDoc)
-        return true;
-    // Caller is required to check for false return from this function
-    // and return NULL.
-    PyErr_SetString(NoDocOpenError, QString("Command does not make sense without an open document").toLocal8Bit().constData());
-    return false;
+	if (ScCore->primaryMainWindow()->HaveDoc)
+		return true;
+	// Caller is required to check for false return from this function
+	// and return NULL.
+	PyErr_SetString(NoDocOpenError, QString("Command does not make sense without an open document").toLocal8Bit().constData());
+	return false;
 }
 
 QStringList getSelectedItemsByName()

Modified: trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp	Sat Sep 26 13:06:35 2015
@@ -137,8 +137,8 @@
 PV */
 void guiappdocwarnings()
 {
-    QStringList s;
-    s << scribus_messagebartext__doc__ << scribus_progressreset__doc__
+	QStringList s;
+	s << scribus_messagebartext__doc__ << scribus_progressreset__doc__
 			<< scribus_progresssettotalsteps__doc__ << scribus_progresssetprogress__doc__
 			<< scribus_setcursor__doc__ << scribus_docchanged__doc__
 			<< scribus_zoomdocument__doc__ << scribus_scrolldocument__doc__;

Modified: trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp	Sat Sep 26 13:06:35 2015
@@ -208,6 +208,6 @@
 PV */
 void svgimportdocwarnings()
 {
-    QStringList s;
-    s << scribus_placevec__doc__ << scribus_placesvg__doc__ << scribus_placeeps__doc__ << scribus_placesxd__doc__ << scribus_placeodg__doc__;
-}
+	QStringList s;
+	s << scribus_placevec__doc__ << scribus_placesvg__doc__ << scribus_placeeps__doc__ << scribus_placesxd__doc__ << scribus_placeodg__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/tools/spellcheck/suggest.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/plugins/tools/spellcheck/suggest.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/spellcheck/suggest.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/spellcheck/suggest.cpp	Sat Sep 26 13:06:35 2015
@@ -1,579 +1,579 @@
-/*
-  For general Scribus (>=1.3.2) copyright and licensing information
-  please refer to the COPYING file provided with the
-  program. Following this notice may exist a copyright and/or license
-  notice that predates the release of Scribus 1.3.2 for which a new
-  license (GPL+exception) is in place.
-*/
-#include "suggest.h"
-#include "scpaths.h"
-#include <QDebug>
-#include <QFileInfo>
-/*!
-\brief Delimiter between different components of formatted strings for aspell dictionary entries.
- */
-const char* Speller::Aspell::Suggest::kDICT_DELIM = "/";
-const char* Speller::Aspell::Suggest::kEMPTY = "*";
-const char* Speller::Aspell::Suggest::kDEF_LANG = "en";
-const char* Speller::Aspell::Suggest::kDEF_JARGON = "";  // I.e., no jargon
-const char* Speller::Aspell::Suggest::kDEF_ENCODING = "utf-8";
-
-void Speller::Aspell::Suggest::checkError() throw( std::runtime_error )
-{
-	if( aspell_speller_error_number( fspeller ) != 0 )
-	{
-		std::string err_msg =
-			std::string( "(Aspell::Speller::Suggest::checkError): "
-				     "aspell speller error " ) +
-			aspell_speller_error_message( fspeller );
-		throw std::runtime_error( err_msg );
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::checkConfigError()
-	throw( std::runtime_error )
-{
-	if( aspell_config_error_number( fconfig ) != 0 )
-	{
-		std::string err_msg =
-			std::string( "(Aspell::Speller::Suggest::checkConfig"
-				     "Error): aspell speller error " ) +
-			aspell_config_error_message( fconfig );
-		throw std::runtime_error( err_msg );
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::init(const std::string& lang,
-				    const std::string& jargon,
-				    const std::string& encoding)
-	throw( std::invalid_argument, std::runtime_error )
-{
-	// Save aspell configuration values
-	flang = lang;
-	fjargon = jargon;
-	fencoding = encoding;
-	fconfig = new_aspell_config();
-	try
-	{
-		setConfig();
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "data-dir") ) );
-	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "dict-dir") ) );
-	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "local-data-dir") ) );
-
-
-
-	AspellCanHaveError* ret = new_aspell_speller( fconfig );
-	delete_aspell_config( fconfig );
-	if( aspell_error_number( ret ) != 0 )
-	{
-		//qDebug()<<aspell_error_number( ret )<<aspell_error_message(ret);
-		delete_aspell_can_have_error( ret );
-		throw std::runtime_error( "(Aspell::Speller::Suggest::init"
-					  "): Error in creating speller." );
-	}
-	else
-	{
-		fspeller = to_aspell_speller( ret );
-		fconfig = aspell_speller_config( fspeller );
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::listDicts(std::vector<AspellDictInfo>& vals)
-{
-	AspellDictInfoList* dlist = get_aspell_dict_info_list( fconfig );
-	AspellDictInfoEnumeration* dinfo_enum =
-		aspell_dict_info_list_elements( dlist );
-	const AspellDictInfo* entry;
-	while( (entry = aspell_dict_info_enumeration_next( dinfo_enum )) )
-	{
-		vals.push_back( *entry );
-	}
-	delete_aspell_dict_info_enumeration( dinfo_enum );
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::listDicts(std::vector<std::string>& vals)
-{
-	setConfig();
-
-	std::vector<AspellDictInfo> entries;
-	listDicts( entries );
-
-	for( std::vector<AspellDictInfo>::const_iterator i = entries.begin();
-             i != entries.end();
-             ++i )
-        {
-		std::string jargon( i->jargon );
-		std::ostringstream fmt_entry;
-		fmt_entry << i->name << kDICT_DELIM << i->code << kDICT_DELIM
-			  << (jargon == "" ? kEMPTY : jargon) << kDICT_DELIM
-			  << i->size;
-                vals.push_back( fmt_entry.str() );
-        }
-}
-//__________________________________________________________________________
-void
-Speller::Aspell::Suggest::printWordList(const AspellWordList* wlist,
-					char delim)
-	throw( std::invalid_argument )
-{
-	if( ! wlist )
-	{
-		throw std::invalid_argument( "(Aspell.Speller.Suggest.print"
-					     "WordList): word list pointer "
-					     "is null." );
-	}
-
-	AspellStringEnumeration* enum_list =
-		aspell_word_list_elements( wlist );
-	const char* next;
-	while( (next = aspell_string_enumeration_next( enum_list )) )
-	{
-		std::cout << next << delim;
-	}
-	delete_aspell_string_enumeration( enum_list );
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::setConfig() throw( std::invalid_argument )
-{
-	try
-	{
-		setConfigOpt( "lang", flang );
-		setConfigOpt( "jargon", fjargon );
-		setConfigOpt( "encoding", fencoding );
-#ifdef Q_WS_MAC && ASPELLRELATIVEDICTDIR
-		QString location(ScPaths::instance().bundleDir()+"/Contents/"+ASPELLRELATIVEDICTDIR);
-		//qDebug()<<"aspell location:"<<location;
-		QFileInfo fi(location);
-		if (fi.exists())
-		{
-			//qDebug()<<"setting dict-dir to:"<<location;
-			setConfigOpt( "dict-dir", location.toStdString());
-			setConfigOpt( "local-data-dir", location.toStdString());
-			//qDebug()<<"getting local-data-dir:"<<QString::fromStdString(getConfigOpt("local-data-dir"));
-			//qDebug()<<"getting dict-dir:"<<QString::fromStdString(getConfigOpt("dict-dir"));
-		}
-#endif
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void
-Speller::Aspell::Suggest::storeWordList(const AspellWordList* wlist,
-					std::vector<std::string>& replacement)
-	throw( std::invalid_argument )
-{
-	if( ! wlist )
-	{
-		throw std::invalid_argument( "(Aspell.Speller.Suggest.store"
-					     "WordList): word list pointer "
-					     "is null." );
-	}
-
-	AspellStringEnumeration* enum_list =
-		aspell_word_list_elements( wlist );
-	const char* next;
-	while( (next = aspell_string_enumeration_next( enum_list )) )
-	{
-		replacement.push_back( next );
-	}
-	delete_aspell_string_enumeration( enum_list );
-}
-//__________________________________________________________________________
-Speller::Aspell::Suggest::Suggest(const std::string& lang,
-				  const std::string& jargon,
-				  const std::string& encoding)
-	throw( std::invalid_argument, std::runtime_error )
-{
-	// Default constructor
-	try
-	{
-		init( lang, jargon, encoding );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-Speller::Aspell::Suggest::Suggest(const AspellDictInfo* dinfo,
-				  const std::string& encoding)
-	throw( std::invalid_argument, std::runtime_error )
-{
-	try
-	{
-		init( dinfo->code, dinfo->jargon, encoding );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::addPersonalList(const std::string& word)
-	throw( std::runtime_error )
-{
-	//  A std::runtime_error exception is thrown if
-	// an error occcurs.
-
-	// FIXME: Return value should be something meaningful from
-	// aspell_speller_add_to_personal.
-	aspell_speller_add_to_personal( fspeller, word.c_str(), -1 );
-	try
-	{
-		checkError();
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-bool Speller::Aspell::Suggest::checkWord(const std::string& word)
-{
-	bool status = true;
-
-	if( aspell_speller_check( fspeller, word.c_str(), -1 ) == 0 )
-	{
-		status = false;
-	}
-	return status;
-}
-//__________________________________________________________________________
-bool Speller::Aspell::Suggest::checkWord(const std::string& word,
-					 std::vector<std::string>& replacement,
-					 bool always)
-	throw( std::invalid_argument )
-{
-	// Checks 'word', and returns true if it is spelt correctly,
-	// else returns false. If 'always' is true, returns an
-	// array of suggestions in 'replacement', regardless of
-	// whether 'word' is spelt incorrectly or not. Else, if
-	// 'always' is false, the list of suggestions is stored only if
-	// 'word'is spelt incorrectly.
-	bool status = checkWord( word );
-
-	if( always )
-	{
-		const AspellWordList* wlist =
-			aspell_speller_suggest( fspeller, word.c_str(), -1 );
-		try
-		{
-			storeWordList( wlist, replacement );
-		}
-		catch( const std::invalid_argument& err )
-		{
-			throw err;
-		}
-	}
-	else
-	{
-		if( ! status )
-		{
-			const AspellWordList* wlist =
-				aspell_speller_suggest( fspeller, word.c_str(),
-							-1 );
-			try
-			{
-				storeWordList( wlist, replacement );
-			}
-			catch( const std::invalid_argument& err )
-			{
-				throw err;
-			}
-		}
-	}
-	return status;
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::clearSessionList() throw( std::runtime_error )
-{
-	aspell_speller_clear_session( fspeller );
-	try
-	{
-		checkError();
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}  
-}
-//__________________________________________________________________________
-std::string Speller::Aspell::Suggest::getConfigOpt(const std::string& opt)
-{
-	return std::string( aspell_config_retrieve( fconfig, opt.c_str() ) );
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::getConfigOpt(const std::string& opt,
-					    std::vector<std::string>& vals)
-{
-	// Stores current setting of configuration option, 'opt', which
-	// has a value of list type, in 'vals'.
-	AspellStringList* list = new_aspell_string_list();
-	AspellMutableContainer* lst0 =
-		aspell_string_list_to_mutable_container( list );
-	aspell_config_retrieve_list( fconfig, opt.c_str(), lst0 );
-	AspellStringEnumeration* enum_list =
-		aspell_string_list_elements( list );
-	const char* next;
-	while( (next = aspell_string_enumeration_next( enum_list )) )
-	{
-		vals.push_back( next );
-	}
-	delete_aspell_string_enumeration( enum_list );
-	delete_aspell_string_list( list );
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::ignoreWord(const std::string& word)
-	throw( std::runtime_error )
-{
-	// FIXME: Return value should be something meaningful from
-	// aspell_speller_add_to_session.
-	aspell_speller_add_to_session( fspeller, word.c_str(), -1 );
-	try
-	{
-		checkError();
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::printMainList() throw( std::invalid_argument )
-{
-	const AspellWordList* wlist =
-		aspell_speller_main_word_list( fspeller );
-	try
-	{
-		printWordList( wlist );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::printPersonalList()
-	throw( std::invalid_argument )
-{
-	const AspellWordList* wlist =
-		aspell_speller_personal_word_list( fspeller );
-	try
-	{
-		printWordList( wlist );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::printSessionList()
-	throw( std::invalid_argument )
-{
-	const AspellWordList* wlist =
-		aspell_speller_session_word_list( fspeller );
-	try
-	{
-		printWordList( wlist );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-bool Speller::Aspell::Suggest::printSuggestions(const std::string& word,
-						bool always)
-	throw( std::invalid_argument )
-{
-	// Checks 'word', and returns true if it is spelt correctly,
-	// else returns false. If 'always' is true, prints a list of
-	// suggestions to the console as UTF-8, regardless of whether
-	// 'word' is spelt correctly, or not. Else, if 'always' is
-	// false, only prints the list if 'word' is incorrect.
-	bool status = checkWord( word );
-
-	if( always )
-	{
-		const AspellWordList* wlist =
-			aspell_speller_suggest( fspeller, word.c_str(), -1 );
-		try
-		{
-			printWordList( wlist );
-		}
-		catch( const std::invalid_argument& err )
-		{
-			throw err;
-		}
-	}
-	else
-	{
-		if( ! status )
-		{
-			const AspellWordList* wlist =
-				aspell_speller_suggest( fspeller, word.c_str(),
-							-1 );
-			try
-			{
-				printWordList( wlist );
-			}
-			catch( const std::invalid_argument& err )
-			{
-				throw err;
-			}
-		}
-	}
-	return status;  
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::resetConfig()
-	throw( std::invalid_argument, std::runtime_error )
-{
-	delete_aspell_config( fconfig );
-	fconfig = new_aspell_config();
-	try
-	{
-		setConfig();
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-
-	AspellCanHaveError* ret = new_aspell_speller( fconfig );
-	if( aspell_error_number( ret ) != 0 )
-	{
-		delete_aspell_can_have_error( ret );
-		throw std::runtime_error( "(Aspell::Speller::Suggest::Reset"
-					  "Config): Error in creating "
-					  "speller." );
-	}
-	else
-	{
-		// Following statement causes a crash, hence commented out
-		//delete_aspell_speller( fspeller );
-		fspeller = to_aspell_speller( ret );
-		delete_aspell_config( fconfig );
-		fconfig = aspell_speller_config( fspeller );
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::resetConfig(const std::string& lang,
-					   const std::string& jargon,
-					   const std::string& encoding)
-	throw( std::invalid_argument, std::runtime_error )
-{
-	// Save new aspell configuration values
-	flang = lang;
-	fjargon = jargon;
-	fencoding = encoding;
-
-	try
-	{
-		resetConfig();  // Actually reset configuration
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::saveLists() throw( std::runtime_error )
-{
-	// Saves all word lists.
-	aspell_speller_save_all_word_lists( fspeller );
-	try
-	{
-		checkError();
-	}
-	catch( const std::runtime_error& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::setConfigOpt(const std::string& opt,
-					    const std::string& val)
-	throw( std::invalid_argument )
-{
-	aspell_config_replace( fconfig, opt.c_str(), val.c_str() );
-	try
-	{
-		checkConfigError();
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void
-Speller::Aspell::Suggest::StoreMainList(std::vector<std::string>& replacement)
-	throw( std::invalid_argument )
-{
-	const AspellWordList* wlist =
-		aspell_speller_main_word_list( fspeller );
-	try
-	{
-		storeWordList( wlist, replacement );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::StorePersonalList(std::vector<std::string>& replacement) throw( std::invalid_argument )
-{
-	// Stores personal word list. A std::invalid_argument
-	// exception is thrown in case of error.
-	const AspellWordList* wlist =
-		aspell_speller_personal_word_list( fspeller );
-	try
-	{
-		storeWordList( wlist, replacement );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-void Speller::Aspell::Suggest::StoreSessionList(std::vector<std::string>& replacement) throw( std::invalid_argument )
-{
-	// Stores session word list. A std::invalid_argument exception
-	// is thrown in case of error.
-	const AspellWordList* wlist =
-		aspell_speller_session_word_list( fspeller );
-	try
-	{
-		storeWordList( wlist, replacement );
-	}
-	catch( const std::invalid_argument& err )
-	{
-		throw err;
-	}
-}
-//__________________________________________________________________________
-//@@@@@@@@@@@@@@@@@@@@@@@@@ END OF FILE @@@@@@@@@@@@@@@@@@@@@@@@@
+/*
+  For general Scribus (>=1.3.2) copyright and licensing information
+  please refer to the COPYING file provided with the
+  program. Following this notice may exist a copyright and/or license
+  notice that predates the release of Scribus 1.3.2 for which a new
+  license (GPL+exception) is in place.
+*/
+#include "suggest.h"
+#include "scpaths.h"
+#include <QDebug>
+#include <QFileInfo>
+/*!
+\brief Delimiter between different components of formatted strings for aspell dictionary entries.
+ */
+const char* Speller::Aspell::Suggest::kDICT_DELIM = "/";
+const char* Speller::Aspell::Suggest::kEMPTY = "*";
+const char* Speller::Aspell::Suggest::kDEF_LANG = "en";
+const char* Speller::Aspell::Suggest::kDEF_JARGON = "";  // I.e., no jargon
+const char* Speller::Aspell::Suggest::kDEF_ENCODING = "utf-8";
+
+void Speller::Aspell::Suggest::checkError() throw( std::runtime_error )
+{
+	if( aspell_speller_error_number( fspeller ) != 0 )
+	{
+		std::string err_msg =
+			std::string( "(Aspell::Speller::Suggest::checkError): "
+				     "aspell speller error " ) +
+			aspell_speller_error_message( fspeller );
+		throw std::runtime_error( err_msg );
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::checkConfigError()
+	throw( std::runtime_error )
+{
+	if( aspell_config_error_number( fconfig ) != 0 )
+	{
+		std::string err_msg =
+			std::string( "(Aspell::Speller::Suggest::checkConfig"
+				     "Error): aspell speller error " ) +
+			aspell_config_error_message( fconfig );
+		throw std::runtime_error( err_msg );
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::init(const std::string& lang,
+				    const std::string& jargon,
+				    const std::string& encoding)
+	throw( std::invalid_argument, std::runtime_error )
+{
+	// Save aspell configuration values
+	flang = lang;
+	fjargon = jargon;
+	fencoding = encoding;
+	fconfig = new_aspell_config();
+	try
+	{
+		setConfig();
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "data-dir") ) );
+	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "dict-dir") ) );
+	//qDebug()<<QString::fromStdString(std::string( aspell_config_retrieve( fconfig, "local-data-dir") ) );
+
+
+
+	AspellCanHaveError* ret = new_aspell_speller( fconfig );
+	delete_aspell_config( fconfig );
+	if( aspell_error_number( ret ) != 0 )
+	{
+		//qDebug()<<aspell_error_number( ret )<<aspell_error_message(ret);
+		delete_aspell_can_have_error( ret );
+		throw std::runtime_error( "(Aspell::Speller::Suggest::init"
+					  "): Error in creating speller." );
+	}
+	else
+	{
+		fspeller = to_aspell_speller( ret );
+		fconfig = aspell_speller_config( fspeller );
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::listDicts(std::vector<AspellDictInfo>& vals)
+{
+	AspellDictInfoList* dlist = get_aspell_dict_info_list( fconfig );
+	AspellDictInfoEnumeration* dinfo_enum =
+		aspell_dict_info_list_elements( dlist );
+	const AspellDictInfo* entry;
+	while( (entry = aspell_dict_info_enumeration_next( dinfo_enum )) )
+	{
+		vals.push_back( *entry );
+	}
+	delete_aspell_dict_info_enumeration( dinfo_enum );
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::listDicts(std::vector<std::string>& vals)
+{
+	setConfig();
+
+	std::vector<AspellDictInfo> entries;
+	listDicts( entries );
+
+	for( std::vector<AspellDictInfo>::const_iterator i = entries.begin();
+             i != entries.end();
+             ++i )
+		{
+		std::string jargon( i->jargon );
+		std::ostringstream fmt_entry;
+		fmt_entry << i->name << kDICT_DELIM << i->code << kDICT_DELIM
+			  << (jargon == "" ? kEMPTY : jargon) << kDICT_DELIM
+			  << i->size;
+                vals.push_back( fmt_entry.str() );
+		}
+}
+//__________________________________________________________________________
+void
+Speller::Aspell::Suggest::printWordList(const AspellWordList* wlist,
+					char delim)
+	throw( std::invalid_argument )
+{
+	if( ! wlist )
+	{
+		throw std::invalid_argument( "(Aspell.Speller.Suggest.print"
+					     "WordList): word list pointer "
+					     "is null." );
+	}
+
+	AspellStringEnumeration* enum_list =
+		aspell_word_list_elements( wlist );
+	const char* next;
+	while( (next = aspell_string_enumeration_next( enum_list )) )
+	{
+		std::cout << next << delim;
+	}
+	delete_aspell_string_enumeration( enum_list );
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::setConfig() throw( std::invalid_argument )
+{
+	try
+	{
+		setConfigOpt( "lang", flang );
+		setConfigOpt( "jargon", fjargon );
+		setConfigOpt( "encoding", fencoding );
+#ifdef Q_WS_MAC && ASPELLRELATIVEDICTDIR
+		QString location(ScPaths::instance().bundleDir()+"/Contents/"+ASPELLRELATIVEDICTDIR);
+		//qDebug()<<"aspell location:"<<location;
+		QFileInfo fi(location);
+		if (fi.exists())
+		{
+			//qDebug()<<"setting dict-dir to:"<<location;
+			setConfigOpt( "dict-dir", location.toStdString());
+			setConfigOpt( "local-data-dir", location.toStdString());
+			//qDebug()<<"getting local-data-dir:"<<QString::fromStdString(getConfigOpt("local-data-dir"));
+			//qDebug()<<"getting dict-dir:"<<QString::fromStdString(getConfigOpt("dict-dir"));
+		}
+#endif
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void
+Speller::Aspell::Suggest::storeWordList(const AspellWordList* wlist,
+					std::vector<std::string>& replacement)
+	throw( std::invalid_argument )
+{
+	if( ! wlist )
+	{
+		throw std::invalid_argument( "(Aspell.Speller.Suggest.store"
+					     "WordList): word list pointer "
+					     "is null." );
+	}
+
+	AspellStringEnumeration* enum_list =
+		aspell_word_list_elements( wlist );
+	const char* next;
+	while( (next = aspell_string_enumeration_next( enum_list )) )
+	{
+		replacement.push_back( next );
+	}
+	delete_aspell_string_enumeration( enum_list );
+}
+//__________________________________________________________________________
+Speller::Aspell::Suggest::Suggest(const std::string& lang,
+				  const std::string& jargon,
+				  const std::string& encoding)
+	throw( std::invalid_argument, std::runtime_error )
+{
+	// Default constructor
+	try
+	{
+		init( lang, jargon, encoding );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+Speller::Aspell::Suggest::Suggest(const AspellDictInfo* dinfo,
+				  const std::string& encoding)
+	throw( std::invalid_argument, std::runtime_error )
+{
+	try
+	{
+		init( dinfo->code, dinfo->jargon, encoding );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::addPersonalList(const std::string& word)
+	throw( std::runtime_error )
+{
+	//  A std::runtime_error exception is thrown if
+	// an error occcurs.
+
+	// FIXME: Return value should be something meaningful from
+	// aspell_speller_add_to_personal.
+	aspell_speller_add_to_personal( fspeller, word.c_str(), -1 );
+	try
+	{
+		checkError();
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+bool Speller::Aspell::Suggest::checkWord(const std::string& word)
+{
+	bool status = true;
+
+	if( aspell_speller_check( fspeller, word.c_str(), -1 ) == 0 )
+	{
+		status = false;
+	}
+	return status;
+}
+//__________________________________________________________________________
+bool Speller::Aspell::Suggest::checkWord(const std::string& word,
+					 std::vector<std::string>& replacement,
+					 bool always)
+	throw( std::invalid_argument )
+{
+	// Checks 'word', and returns true if it is spelt correctly,
+	// else returns false. If 'always' is true, returns an
+	// array of suggestions in 'replacement', regardless of
+	// whether 'word' is spelt incorrectly or not. Else, if
+	// 'always' is false, the list of suggestions is stored only if
+	// 'word'is spelt incorrectly.
+	bool status = checkWord( word );
+
+	if( always )
+	{
+		const AspellWordList* wlist =
+			aspell_speller_suggest( fspeller, word.c_str(), -1 );
+		try
+		{
+			storeWordList( wlist, replacement );
+		}
+		catch( const std::invalid_argument& err )
+		{
+			throw err;
+		}
+	}
+	else
+	{
+		if( ! status )
+		{
+			const AspellWordList* wlist =
+				aspell_speller_suggest( fspeller, word.c_str(),
+							-1 );
+			try
+			{
+				storeWordList( wlist, replacement );
+			}
+			catch( const std::invalid_argument& err )
+			{
+				throw err;
+			}
+		}
+	}
+	return status;
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::clearSessionList() throw( std::runtime_error )
+{
+	aspell_speller_clear_session( fspeller );
+	try
+	{
+		checkError();
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}  
+}
+//__________________________________________________________________________
+std::string Speller::Aspell::Suggest::getConfigOpt(const std::string& opt)
+{
+	return std::string( aspell_config_retrieve( fconfig, opt.c_str() ) );
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::getConfigOpt(const std::string& opt,
+					    std::vector<std::string>& vals)
+{
+	// Stores current setting of configuration option, 'opt', which
+	// has a value of list type, in 'vals'.
+	AspellStringList* list = new_aspell_string_list();
+	AspellMutableContainer* lst0 =
+		aspell_string_list_to_mutable_container( list );
+	aspell_config_retrieve_list( fconfig, opt.c_str(), lst0 );
+	AspellStringEnumeration* enum_list =
+		aspell_string_list_elements( list );
+	const char* next;
+	while( (next = aspell_string_enumeration_next( enum_list )) )
+	{
+		vals.push_back( next );
+	}
+	delete_aspell_string_enumeration( enum_list );
+	delete_aspell_string_list( list );
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::ignoreWord(const std::string& word)
+	throw( std::runtime_error )
+{
+	// FIXME: Return value should be something meaningful from
+	// aspell_speller_add_to_session.
+	aspell_speller_add_to_session( fspeller, word.c_str(), -1 );
+	try
+	{
+		checkError();
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::printMainList() throw( std::invalid_argument )
+{
+	const AspellWordList* wlist =
+		aspell_speller_main_word_list( fspeller );
+	try
+	{
+		printWordList( wlist );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::printPersonalList()
+	throw( std::invalid_argument )
+{
+	const AspellWordList* wlist =
+		aspell_speller_personal_word_list( fspeller );
+	try
+	{
+		printWordList( wlist );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::printSessionList()
+	throw( std::invalid_argument )
+{
+	const AspellWordList* wlist =
+		aspell_speller_session_word_list( fspeller );
+	try
+	{
+		printWordList( wlist );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+bool Speller::Aspell::Suggest::printSuggestions(const std::string& word,
+						bool always)
+	throw( std::invalid_argument )
+{
+	// Checks 'word', and returns true if it is spelt correctly,
+	// else returns false. If 'always' is true, prints a list of
+	// suggestions to the console as UTF-8, regardless of whether
+	// 'word' is spelt correctly, or not. Else, if 'always' is
+	// false, only prints the list if 'word' is incorrect.
+	bool status = checkWord( word );
+
+	if( always )
+	{
+		const AspellWordList* wlist =
+			aspell_speller_suggest( fspeller, word.c_str(), -1 );
+		try
+		{
+			printWordList( wlist );
+		}
+		catch( const std::invalid_argument& err )
+		{
+			throw err;
+		}
+	}
+	else
+	{
+		if( ! status )
+		{
+			const AspellWordList* wlist =
+				aspell_speller_suggest( fspeller, word.c_str(),
+							-1 );
+			try
+			{
+				printWordList( wlist );
+			}
+			catch( const std::invalid_argument& err )
+			{
+				throw err;
+			}
+		}
+	}
+	return status;  
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::resetConfig()
+	throw( std::invalid_argument, std::runtime_error )
+{
+	delete_aspell_config( fconfig );
+	fconfig = new_aspell_config();
+	try
+	{
+		setConfig();
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+
+	AspellCanHaveError* ret = new_aspell_speller( fconfig );
+	if( aspell_error_number( ret ) != 0 )
+	{
+		delete_aspell_can_have_error( ret );
+		throw std::runtime_error( "(Aspell::Speller::Suggest::Reset"
+					  "Config): Error in creating "
+					  "speller." );
+	}
+	else
+	{
+		// Following statement causes a crash, hence commented out
+		//delete_aspell_speller( fspeller );
+		fspeller = to_aspell_speller( ret );
+		delete_aspell_config( fconfig );
+		fconfig = aspell_speller_config( fspeller );
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::resetConfig(const std::string& lang,
+					   const std::string& jargon,
+					   const std::string& encoding)
+	throw( std::invalid_argument, std::runtime_error )
+{
+	// Save new aspell configuration values
+	flang = lang;
+	fjargon = jargon;
+	fencoding = encoding;
+
+	try
+	{
+		resetConfig();  // Actually reset configuration
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::saveLists() throw( std::runtime_error )
+{
+	// Saves all word lists.
+	aspell_speller_save_all_word_lists( fspeller );
+	try
+	{
+		checkError();
+	}
+	catch( const std::runtime_error& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::setConfigOpt(const std::string& opt,
+					    const std::string& val)
+	throw( std::invalid_argument )
+{
+	aspell_config_replace( fconfig, opt.c_str(), val.c_str() );
+	try
+	{
+		checkConfigError();
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void
+Speller::Aspell::Suggest::StoreMainList(std::vector<std::string>& replacement)
+	throw( std::invalid_argument )
+{
+	const AspellWordList* wlist =
+		aspell_speller_main_word_list( fspeller );
+	try
+	{
+		storeWordList( wlist, replacement );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::StorePersonalList(std::vector<std::string>& replacement) throw( std::invalid_argument )
+{
+	// Stores personal word list. A std::invalid_argument
+	// exception is thrown in case of error.
+	const AspellWordList* wlist =
+		aspell_speller_personal_word_list( fspeller );
+	try
+	{
+		storeWordList( wlist, replacement );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+void Speller::Aspell::Suggest::StoreSessionList(std::vector<std::string>& replacement) throw( std::invalid_argument )
+{
+	// Stores session word list. A std::invalid_argument exception
+	// is thrown in case of error.
+	const AspellWordList* wlist =
+		aspell_speller_session_word_list( fspeller );
+	try
+	{
+		storeWordList( wlist, replacement );
+	}
+	catch( const std::invalid_argument& err )
+	{
+		throw err;
+	}
+}
+//__________________________________________________________________________
+//@@@@@@@@@@@@@@@@@@@@@@@@@ END OF FILE @@@@@@@@@@@@@@@@@@@@@@@@@

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Sat Sep 26 13:06:35 2015
@@ -1607,7 +1607,7 @@
 		dcVerifierProfile.setAttribute("CheckOverflow", static_cast<int>(itcp.value().checkOverflow));
 		dcVerifierProfile.setAttribute("CheckPictures", static_cast<int>(itcp.value().checkPictures));
 		dcVerifierProfile.setAttribute("CheckResolution", static_cast<int>(itcp.value().checkResolution));
-        dcVerifierProfile.setAttribute("CheckPartFilledImageFrames", static_cast<int>(itcp.value().checkPartFilledImageFrames));
+		dcVerifierProfile.setAttribute("CheckPartFilledImageFrames", static_cast<int>(itcp.value().checkPartFilledImageFrames));
 		dcVerifierProfile.setAttribute("CheckTransparency", static_cast<int>(itcp.value().checkTransparency));
 		dcVerifierProfile.setAttribute("CheckAnnotations", static_cast<int>(itcp.value().checkAnnotations));
 		dcVerifierProfile.setAttribute("CheckRasterPDF", static_cast<int>(itcp.value().checkRasterPDF));

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp	(original)
+++ trunk/Scribus/scribus/scpainter.cpp	Sat Sep 26 13:06:35 2015
@@ -1723,7 +1723,7 @@
 	cairo_surface_t *image3 = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_ARGB32, image->width(), image->height(), image->width()*4);
 	cairo_set_source_surface (m_cr, image2, 0, 0);
 	cairo_pattern_set_filter(cairo_get_source(m_cr), CAIRO_FILTER_GOOD);
-    cairo_mask_surface (m_cr, image3, 0, 0);
+	cairo_mask_surface (m_cr, image3, 0, 0);
 	cairo_surface_destroy (image2);
 	cairo_surface_destroy (image3);
 	cairo_pop_group_to_source (m_cr);

Modified: trunk/Scribus/scribus/third_party/wpg/WPGXParser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/third_party/wpg/WPGXParser.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPGXParser.cpp	(original)
+++ trunk/Scribus/scribus/third_party/wpg/WPGXParser.cpp	Sat Sep 26 13:06:35 2015
@@ -1,113 +1,113 @@
-/* libwpg
- * Copyright (C) 2006 Ariya Hidayat (ariya at kde.org)
- * Copyright (C) 2004 Marc Oude Kotte (marc at solcon.nl)
- * Copyright (C) 2005 Fridrich Strba (fridrich.strba at bluewin.ch)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the 
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
- * Boston, MA  02111-1301 USA
- *
- * For further information visit http://libwpg.sourceforge.net
- */
- 
-/* "This product is not manufactured, approved, or supported by
- * Corel Corporation or Corel Corporation Limited."
- */
-
-#include "WPGXParser.h"
-
-WPGXParser::WPGXParser(WPXInputStream *input, libwpg::WPGPaintInterface* painter):
-  m_input(input), m_painter(painter), m_colorPalette(std::map<int,libwpg::WPGColor>())
-{
-}
-
-WPGXParser::WPGXParser(const WPGXParser& parser):
-  m_input(parser.m_input), m_painter(parser.m_painter),
-  m_colorPalette(parser.m_colorPalette)
-{
-}
-
-unsigned char WPGXParser::readU8()
-{
-	if (!m_input || m_input->atEOS())
-		return (unsigned char)0;
-	size_t numBytesRead;
-	unsigned char const * p = m_input->read(sizeof(unsigned char), numBytesRead);
-	
-	if (p && numBytesRead == 1)
-		return *(unsigned char const *)(p);
-	return (unsigned char)0;
-}
-
-unsigned short WPGXParser::readU16()
-{
-	unsigned short p0 = (unsigned short)readU8();
-	unsigned short p1 = (unsigned short)readU8();
-	return (unsigned short)(p0|(p1<<8));
-}
-
-unsigned int WPGXParser::readU32()
-{
-	unsigned int p0 = (unsigned int)readU8();
-	unsigned int p1 = (unsigned int)readU8();
-	unsigned int p2 = (unsigned int)readU8();
-	unsigned int p3 = (unsigned int)readU8();
-	return (unsigned long)(p0|(p1<<8)|(p2<<16)|(p3<<24));
-}
-
-signed char WPGXParser::readS8()
-{
-	return (signed char)readU8();
-}
-
-short WPGXParser::readS16()
-{
-	return (short)readU16();
-}
-
-int WPGXParser::readS32()
-{
-	return (int)readU32();
-}
-
-unsigned int WPGXParser::readVariableLengthInteger()
-{
-	// read a byte
-	unsigned char value8 = readU8();
-	// if it's in the range 0-0xFE, then we have a 8-bit value
-	if (value8<=0xFE) {
-		return (unsigned int)value8;
-	} else {
-		// now read a 16 bit value
-		unsigned short value16 = readU16();
-		// if the MSB is 1, we have a 32 bit value
-		if (value16>>15) {
-			// read the next 16 bit value (LSB part, in value16 resides the MSB part)
-			unsigned long lvalue16 = readU16();
-			unsigned long value32 = value16 & 0x7fff;  // mask out the MSB
-			return (value32<<16)+lvalue16;
-		} else {
-			// we have a 16 bit value, return it
-			return (unsigned int)value16;
-		}
-	}
-}
-
-WPGXParser& WPGXParser::operator=(const WPGXParser& parser)
-{
-    m_input = parser.m_input;
-    m_painter = parser.m_painter;
-    m_colorPalette = parser.m_colorPalette;
-    return *this;
-}
+/* libwpg
+ * Copyright (C) 2006 Ariya Hidayat (ariya at kde.org)
+ * Copyright (C) 2004 Marc Oude Kotte (marc at solcon.nl)
+ * Copyright (C) 2005 Fridrich Strba (fridrich.strba at bluewin.ch)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the 
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02111-1301 USA
+ *
+ * For further information visit http://libwpg.sourceforge.net
+ */
+ 
+/* "This product is not manufactured, approved, or supported by
+ * Corel Corporation or Corel Corporation Limited."
+ */
+
+#include "WPGXParser.h"
+
+WPGXParser::WPGXParser(WPXInputStream *input, libwpg::WPGPaintInterface* painter):
+  m_input(input), m_painter(painter), m_colorPalette(std::map<int,libwpg::WPGColor>())
+{
+}
+
+WPGXParser::WPGXParser(const WPGXParser& parser):
+  m_input(parser.m_input), m_painter(parser.m_painter),
+  m_colorPalette(parser.m_colorPalette)
+{
+}
+
+unsigned char WPGXParser::readU8()
+{
+	if (!m_input || m_input->atEOS())
+		return (unsigned char)0;
+	size_t numBytesRead;
+	unsigned char const * p = m_input->read(sizeof(unsigned char), numBytesRead);
+	
+	if (p && numBytesRead == 1)
+		return *(unsigned char const *)(p);
+	return (unsigned char)0;
+}
+
+unsigned short WPGXParser::readU16()
+{
+	unsigned short p0 = (unsigned short)readU8();
+	unsigned short p1 = (unsigned short)readU8();
+	return (unsigned short)(p0|(p1<<8));
+}
+
+unsigned int WPGXParser::readU32()
+{
+	unsigned int p0 = (unsigned int)readU8();
+	unsigned int p1 = (unsigned int)readU8();
+	unsigned int p2 = (unsigned int)readU8();
+	unsigned int p3 = (unsigned int)readU8();
+	return (unsigned long)(p0|(p1<<8)|(p2<<16)|(p3<<24));
+}
+
+signed char WPGXParser::readS8()
+{
+	return (signed char)readU8();
+}
+
+short WPGXParser::readS16()
+{
+	return (short)readU16();
+}
+
+int WPGXParser::readS32()
+{
+	return (int)readU32();
+}
+
+unsigned int WPGXParser::readVariableLengthInteger()
+{
+	// read a byte
+	unsigned char value8 = readU8();
+	// if it's in the range 0-0xFE, then we have a 8-bit value
+	if (value8<=0xFE) {
+		return (unsigned int)value8;
+	} else {
+		// now read a 16 bit value
+		unsigned short value16 = readU16();
+		// if the MSB is 1, we have a 32 bit value
+		if (value16>>15) {
+			// read the next 16 bit value (LSB part, in value16 resides the MSB part)
+			unsigned long lvalue16 = readU16();
+			unsigned long value32 = value16 & 0x7fff;  // mask out the MSB
+			return (value32<<16)+lvalue16;
+		} else {
+			// we have a 16 bit value, return it
+			return (unsigned int)value16;
+		}
+	}
+}
+
+WPGXParser& WPGXParser::operator=(const WPGXParser& parser)
+{
+	m_input = parser.m_input;
+	m_painter = parser.m_painter;
+	m_colorPalette = parser.m_colorPalette;
+	return *this;
+}

Modified: trunk/Scribus/scribus/ui/arrowchooser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/arrowchooser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/arrowchooser.cpp	(original)
+++ trunk/Scribus/scribus/ui/arrowchooser.cpp	Sat Sep 26 13:06:35 2015
@@ -64,7 +64,7 @@
 		delete painter;
 /*		int wi = image.width();
 		int hi = image.height();
-    	for( int yi=0; yi < hi; ++yi )
+		for( int yi=0; yi < hi; ++yi )
 		{
 			QRgb *s = (QRgb*)(image.scanLine( yi ));
 			for(int xi=0; xi < wi; ++xi )
@@ -73,8 +73,8 @@
 					(*s) &= 0x00ffffff;
 				s++;
 			}
-    	} */
-    	QPixmap Ico;
+		} */
+		QPixmap Ico;
 		Ico=QPixmap::fromImage(image);
 		addItem(Ico, arrowStyles->at(a).name);
 	}

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp	(original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp	Sat Sep 26 13:06:35 2015
@@ -126,16 +126,16 @@
 	warnMap.insert(PV_ANNOTATION,				qMakePair(tr("Object is a PDF Annotation or Field"),					tr("Indicates that editorial changes have been made to a PDF are still present or your PDF contains unprintable annotation items. They may cause issues in professional printing. Also helpful reminder if you are wanting to publish a final draft without editorial relics.")));
 	warnMap.insert(PV_APPLIED_MASTER_DIFF_SIDE,	qMakePair(tr("Applied master page has different page destination (left, middle, right side)"),
 																														tr("Have you applied the correct Master Page?")));
-	warnMap.insert(PV_EMPTY_IMAGE_FRAME,		qMakePair(tr("Empty Image Frame"),										tr("If you have created an image frame, there is the presumption that you planned to put an image in it.")));
-	warnMap.insert(PV_EMPTY_TEXT_FRAME,			qMakePair(tr("Empty Text Frame"),										tr("If you have created a text frame, there is the presumption that you planned to put text in it.")));
-	warnMap.insert(PV_FONT_NOT_EMBEDDED,		qMakePair(tr("Imported document contains non-embedded fonts"),			tr("When some imported document uses non-embedded fonts, then their rendering will be wrong, unless by chance you have them installed on their system, but that cannot be guaranteed in case you want to share the resulting document.")));
-	warnMap.insert(PV_HIGH_DPI,					qMakePair(tr("Image resolution above %1 DPI,\ncurrently %2 x %3 DPI"),	tr("This is a user definable setting serving as a caution for high resolution images, which may lead to unnecessarily large files.")));
+	warnMap.insert(PV_EMPTY_IMAGE_FRAME,		qMakePair(tr("Empty Image Frame"),										tr("If you have created an image frame, there is the presumption that you planned to put an image in it")));
+	warnMap.insert(PV_EMPTY_TEXT_FRAME,			qMakePair(tr("Empty Text Frame"),										tr("If you have created a text frame, there is the presumption that you planned to put text in it")));
+	warnMap.insert(PV_FONT_NOT_EMBEDDED,		qMakePair(tr("Imported document contains non-embedded fonts"),			tr("When some imported document uses non-embedded fonts, then their rendering will be wrong, unless by chance you have them installed on their system, but that cannot be guaranteed in case you want to share the resulting document")));
+	warnMap.insert(PV_HIGH_DPI,					qMakePair(tr("Image resolution above %1 DPI,\ncurrently %2 x %3 DPI"),	tr("This is a user definable setting serving as a caution for high resolution images, which may lead to unnecessarily large files")));
 	warnMap.insert(PV_IMAGE_FRAME_PART_FILLED,	qMakePair(tr("Image dimension is smaller than its frame"),				tr("The image does not fit the whole space you reserved for it. Maybe this is intended, or maybe this is caused by bad inner placement or scale. The result will either be a cropped image or white space around the image.")));
 	warnMap.insert(PV_IS_GIF,					qMakePair(tr("Image is GIF"),											tr("This warning alerts you that you are using a bitmap based graphic format that is typically not used for high resolution images (.gif is one of those). This may result in poor viewing quality (for example: when commercially printed, viewed on a high-resolution screens, etc...). If your PDF will be printed commercially, there are some printing systems that will have difficulty printing these types of images.")));
-	warnMap.insert(PV_LOW_DPI,					qMakePair(tr("Image resolution below %1 DPI,\ncurrently %2 x %3 DPI"),	tr("This is a user definable setting serving as a caution for low resolution images, which may lead to poor quality output.")));
-	warnMap.insert(PV_MISSING_GLYPH,			qMakePair(tr("Glyphs missing"),											tr("You have one or more characters which do not have a corresponding glyph in your chosen font.")));
-	warnMap.insert(PV_MISSING_IMAGE,			qMakePair(tr("Missing Image"),											tr("The assigned image file cannot be found.")));
-	warnMap.insert(PV_NON_ON_PAGE,				qMakePair(tr("Object is not on a Page"),								tr("An object is placed somewhere outside of the page borders, it will not be printed and might be missing somewhere.")));
+	warnMap.insert(PV_LOW_DPI,					qMakePair(tr("Image resolution below %1 DPI,\ncurrently %2 x %3 DPI"),	tr("This is a user definable setting serving as a caution for low resolution images, which may lead to poor quality output")));
+	warnMap.insert(PV_MISSING_GLYPH,			qMakePair(tr("Glyphs missing"),											tr("You have one or more characters which do not have a corresponding glyph in your chosen font")));
+	warnMap.insert(PV_MISSING_IMAGE,			qMakePair(tr("Missing Image"),											tr("The assigned image file cannot be found")));
+	warnMap.insert(PV_NON_ON_PAGE,				qMakePair(tr("Object is not on a Page"),								tr("An object is placed somewhere outside of the page borders, it will not be printed and might be missing somewhere")));
 	warnMap.insert(PV_NOT_CMYK_SPOT,			qMakePair(tr("Object colorspace is not CMYK or spot"),					tr("PDF supports many different ways to represent the color of any object including RGB, CMYK and Spot (aka Separation) colors. Some of the PDF standards, such as PDF/X-1a, require the only CMYK and Spot colors be used.")));
 	warnMap.insert(PV_RASTER_PDF,				qMakePair(tr("Object is a placed PDF"),									tr("The warning is verifying for you that there is a PDF loaded into an Image Frame, where it will be rasterized or converted to a bitmap. Its resolution may be less than ideal. See PDF Export to learn how to minimize this problem.")));
 	warnMap.insert(PV_TEXT_OVERFLOW,			qMakePair(tr("Text overflow"),											tr("There is more text than can show in the frame as sized. Nonvisible excess characters like spaces and carriage returns may trigger this if nothing appears to be missing.")));

Modified: trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_widgets.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_widgets.cpp	Sat Sep 26 13:06:35 2015
@@ -54,7 +54,7 @@
 	{
 		QMenu *pmen = new QMenu();
 //		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-        QAction *px = pmen->addAction( tr("Show Page Previews"), this, SLOT(toggleThumbnail()));
+		QAction *px = pmen->addAction( tr("Show Page Previews"), this, SLOT(toggleThumbnail()));
 		px->setCheckable(true);
 		if (Thumb)
 			px->setChecked(true);
@@ -135,7 +135,7 @@
 {
 	setDragEnabled(true);
 	setAcceptDrops(true);
-    setDropIndicatorShown(true);
+	setDropIndicatorShown(true);
 //	viewport()->setAcceptDrops(true);
 	setShowGrid(false);
 	setWordWrap(true);
@@ -225,7 +225,7 @@
 	bool lastPage = false;
 	if (e->mimeData()->hasFormat("page/magic"))
 	{
-        e->setDropAction(Qt::MoveAction);
+		e->setDropAction(Qt::MoveAction);
 		e->accept();
 		// HACK to prevent strange Qt4 cursor behaviour after dropping. It's examined by Trolltech now - PV.
 		// It's the one and only reason why to include QApplication here.

Modified: trunk/Scribus/scribus/ui/propertywidget_flop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/propertywidget_flop.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_flop.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_flop.cpp	Sat Sep 26 13:06:35 2015
@@ -21,8 +21,8 @@
 	flopRealHeight->setChecked(true);
 
 	flopGroup->setId(flopRealHeight,  RealHeightID);
-    flopGroup->setId(flopFontAscent,  FontAscentID);
-    flopGroup->setId(flopLineSpacing, LineSpacingID);
+	flopGroup->setId(flopFontAscent,  FontAscentID);
+	flopGroup->setId(flopLineSpacing, LineSpacingID);
 	flopGroup->setId(flopBaselineGrid, BaselineGridID);
 
 	languageChange();

Modified: trunk/Scribus/scribus/ui/shadebutton.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/shadebutton.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/shadebutton.cpp	(original)
+++ trunk/Scribus/scribus/ui/shadebutton.cpp	Sat Sep 26 13:06:35 2015
@@ -48,7 +48,7 @@
 	{
 		Query dia(this, "New", 1, tr("&Shade:"), tr("Shade"));
 		if (dia.exec())
-    	{
+		{
 			c = dia.getEditText().toInt(&ok);
 			if (ok)
 				b = qMax(qMin(c, 100),0);

Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp	(original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp	Sat Sep 26 13:06:35 2015
@@ -693,7 +693,7 @@
 
 void SMLineStyle::updatePreview()
 {
-    if (m_selection.count() < 1)
+	if (m_selection.count() < 1)
 		return;
 	
 	QPixmap pm = QPixmap(200, 37);

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20424&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Sat Sep 26 13:06:35 2015
@@ -2966,7 +2966,7 @@
 	// #9180 : force relayout here, it appears that relayout is sometime disabled
 	// to speed up selection, but re layout() cannot be avoided here
 	if (nextItem->asTextFrame())
-        nextItem->asTextFrame()->invalidateLayout(true);
+		nextItem->asTextFrame()->invalidateLayout(true);
 	nextItem->layout();
 #if 0
 	QList<PageItem*> FrameItemsDel;




More information about the scribus-commit mailing list