r20465 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 14 18:42:18 UTC 2015


Author: fschmid
Date: Wed Oct 14 18:42:18 2015
New Revision: 20465

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20465
Log:
Follow up to #13406 Fix Style name with german umlauts.

Modified:
    trunk/Scribus/scribus/plugins/gettext/rtfim/rtfim.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
    trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.h
    trunk/Scribus/scribus/third_party/rtf-qt/controlword.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
    trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h

Modified: trunk/Scribus/scribus/plugins/gettext/rtfim/rtfim.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/plugins/gettext/rtfim/rtfim.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/rtfim/rtfim.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/rtfim/rtfim.cpp	Wed Oct 14 18:42:18 2015
@@ -43,6 +43,7 @@
 		RtfReader::Reader reader;
 		reader.parseFromDeviceTo(&buffer, output);
 		textItem->itemText.trim();
+		textItem->itemText.invalidateLayout();
 		delete output;
 	}
 }

Modified: trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h	Wed Oct 14 18:42:18 2015
@@ -307,6 +307,9 @@
 	virtual void setPageWidth( const int pageWidth ) = 0;
 	virtual void setSpaceBefore( const int value ) = 0;
 	virtual void setSpaceAfter( const int value ) = 0;
+	virtual void keepWithNext() = 0;
+	virtual void setDropCapsLines(const int value) = 0;
+	virtual void setDropCaps() = 0;
 	virtual void addTabStop( const int value, const int type ) = 0;
 	virtual void appendToColourTable( const QColor &colour ) = 0;
 	virtual void insertFontTableEntry( FontTableEntry fontTableEntry, quint32 fontTableIndex ) = 0;
@@ -315,6 +318,7 @@
 
 	virtual void startGroup();
 	virtual void endGroup();
+	virtual QTextCodec *getCurrentCodec() { return 0; }
 
       private:
 	// The author of the document (from document meta-data, if any)

Modified: trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/DocumentDestination.cpp	Wed Oct 14 18:42:18 2015
@@ -163,6 +163,12 @@
 			m_uc_Value = value;
 		else if ((controlWord == "s") && hasValue)
 			m_output->useStyleSheetTableEntry(value);
+	/*	else if ((controlWord == "dropcapli") && hasValue)
+			m_output->setDropCapsLines(value);
+		else if (controlWord == "dropcapt")
+			m_output->setDropCaps();
+		else if (controlWord == "keepn")
+			m_output->keepWithNext(); */
 		else if ((controlWord == "\'") && hasValue)
 		{
 	//	qDebug() << "special character value:" << value;

Modified: trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.cpp	Wed Oct 14 18:42:18 2015
@@ -17,6 +17,7 @@
 
 #include "StyleSheetDestination.h"
 
+#include <QTextCodec>
 #include "rtfreader.h"
 #include "controlword.h"
 #include "commonstrings.h"
@@ -34,6 +35,7 @@
 		QList<ParagraphStyle::TabRecord> tbs;
 		tbs.clear();
 		m_textStyle.setTabValues(tbs);
+		m_styleName = "";
 	}
 
 	StyleSheetDestination::~StyleSheetDestination()
@@ -183,9 +185,11 @@
 			if (delimiterPosition == (plainText.length() - 1))
 			{
 				// It is at the end, chop it off
-				QString styleName = plainText.left(delimiterPosition);
-				m_textStyle.setName(styleName);
+				QByteArray styleName = plainText.left(delimiterPosition);
+				m_styleName.append(styleName);
+				m_textStyle.setName(m_output->getCurrentCodec()->toUnicode(m_styleName));
 				m_output->insertStyleSheetTableEntry(m_currentStyleHandleNumber, m_textStyle);
+				m_styleName = "";
 			}
 			else
 			{
@@ -194,12 +198,11 @@
 			}
 		}
 		else
-			m_textStyle.setName(plainText);
+			m_styleName.append(plainText);
 	}
 
 	void StyleSheetDestination::aboutToEndDestination()
 	{
-	// TODO
 	}
 
 	double StyleSheetDestination::pixelsFromTwips(const int twips)

Modified: trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.h	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/StyleSheetDestination.h	Wed Oct 14 18:42:18 2015
@@ -41,6 +41,7 @@
 			double pixelsFromTwips(const int twips);
 			quint32 		m_currentStyleHandleNumber;
 			ParagraphStyle m_textStyle;
+			QByteArray m_styleName;
 	};
 }
 

Modified: trunk/Scribus/scribus/third_party/rtf-qt/controlword.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/controlword.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/controlword.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/controlword.cpp	Wed Oct 14 18:42:18 2015
@@ -1893,6 +1893,7 @@
 	    ( m_name == "hlinkbase" ) ||
 	    ( m_name == "userprops" ) ||
 	    ( m_name == "mmathPr" ) ||
+		 ( m_name == "listtext" ) ||
 	    ( m_name == "author" ) ) {
 	    return true;
 	}

Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp	Wed Oct 14 18:42:18 2015
@@ -50,6 +50,7 @@
 			m_codec = QTextCodec::codecForName("cp1252");		// Default ANSI codec
 		else
 			m_codec = QTextCodec::codecForLocale();
+		m_keepn = false;
 	}
 
 	SlaDocumentRtfOutput::~SlaDocumentRtfOutput()
@@ -468,6 +469,21 @@
 	void SlaDocumentRtfOutput::setSpaceAfter(const int twips)
 	{
 		m_textStyle.top().setGapAfter(pixelsFromTwips(twips));
+	}
+
+	void SlaDocumentRtfOutput::keepWithNext()
+	{
+		m_keepn = true;
+	}
+
+	void SlaDocumentRtfOutput::setDropCapsLines(const int value)
+	{
+		m_textStyle.top().setDropCapLines(value);
+	}
+
+	void SlaDocumentRtfOutput::setDropCaps()
+	{
+		m_textStyle.top().setHasDropCap(true);
 	}
 
 	void SlaDocumentRtfOutput::addTabStop(const int value, const int type)

Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20465&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h	(original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h	Wed Oct 14 18:42:18 2015
@@ -93,9 +93,13 @@
 		virtual void setPageWidth(const int pageWidth);
 		virtual void setSpaceBefore(const int twips);
 		virtual void setSpaceAfter(const int twips);
+		virtual void keepWithNext();
+		virtual void setDropCapsLines(const int value);
+		virtual void setDropCaps();
 		virtual void addTabStop(const int value, const int type);
 		QString getFontName(QString name);
 		double pixelsFromTwips(const int twips);
+		virtual QTextCodec *getCurrentCodec() { return m_codec; }
 	private:
 		PageItem* m_item;
 		ScribusDoc* m_Doc;
@@ -107,6 +111,7 @@
 		QHash<int, FontTableEntry> m_fontTableReal;
 		QHash<int, ParagraphStyle> m_stylesTable;
 		QList<QByteArray> m_codecList;
+		bool m_keepn;
 	};
 }
 #endif // SLADOCUMENTRTFOUTPUT_H




More information about the scribus-commit mailing list