r23002 by jghali - #15705: Text color combos show wrong value

scribus-commit scribus-commit at lists.scribus.net
Thu Jun 6 12:22:22 UTC 2019


Author: jghali
Date: Thu Jun  6 12:22:21 2019
New Revision: 23002

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23002
Log:
#15705: Text color combos show wrong value

Modified:
    trunk/Scribus/scribus/text/sctext_shared.cpp
    trunk/Scribus/scribus/text/sctext_shared.h
    trunk/Scribus/scribus/text/storytext.cpp
    trunk/Scribus/scribus/text/storytext.h

Modified: trunk/Scribus/scribus/text/sctext_shared.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23002&path=/trunk/Scribus/scribus/text/sctext_shared.cpp
==============================================================================
--- trunk/Scribus/scribus/text/sctext_shared.cpp	(original)
+++ trunk/Scribus/scribus/text/sctext_shared.cpp	Thu Jun  6 12:22:21 2019
@@ -23,6 +23,7 @@
 	pstyleContext.setDefaultStyle( & defaultStyle );
 	defaultStyle.setContext( pstyles );
 	trailingStyle.setContext( &pstyleContext );
+	orphanedCharStyle.setContext( defaultStyle.charStyle().context() );
 //		defaultStyle.charStyle().setContext( cstyles );
 //		qDebug() << QString("ScText_Shared() %1 %2 %3 %4").arg(reinterpret_cast<uint>(this)).arg(reinterpret_cast<uint>(&defaultStyle)).arg(reinterpret_cast<uint>(pstyles)).arg(reinterpret_cast<uint>(cstyles));
 }
@@ -36,6 +37,8 @@
 {
 	pstyleContext.setDefaultStyle( &defaultStyle );
 	trailingStyle.setContext( &pstyleContext );
+	orphanedCharStyle.setContext( defaultStyle.charStyle().context() );
+
 	QListIterator<ScText*> it( other );
 	ScText* elem;
 	while ( it.hasNext() ) {
@@ -71,6 +74,7 @@
 		pstyleContext.setDefaultStyle( &defaultStyle );
 		defaultStyle.setContext( other.defaultStyle.context() );
 		trailingStyle.setContext( &pstyleContext );
+		orphanedCharStyle.setContext( other.defaultStyle.charStyle().context() );
 		clear();
 		QListIterator<ScText*> it( other );
 		ScText* elem;

Modified: trunk/Scribus/scribus/text/sctext_shared.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23002&path=/trunk/Scribus/scribus/text/sctext_shared.h
==============================================================================
--- trunk/Scribus/scribus/text/sctext_shared.h	(original)
+++ trunk/Scribus/scribus/text/sctext_shared.h	Thu Jun  6 12:22:21 2019
@@ -17,19 +17,19 @@
 class SCRIBUS_API ScText_Shared : public QList<ScText*>
 {
 public:
+	ScText_Shared(const StyleContext* pstyles);	
+	ScText_Shared(const ScText_Shared& other);
+	~ScText_Shared();
+
+	ScText_Shared& operator= (const ScText_Shared& other);
+
 	ParagraphStyle defaultStyle;
 	StyleContextProxy pstyleContext;
 	uint refs;
 	uint len;
 	uint cursorPosition;
 	ParagraphStyle trailingStyle;
-	ScText_Shared(const StyleContext* pstyles);	
-
-	ScText_Shared(const ScText_Shared& other);
-
-	ScText_Shared& operator= (const ScText_Shared& other);
-
-	~ScText_Shared();
+	CharStyle orphanedCharStyle;
 
 	void clear();
 	

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23002&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp	(original)
+++ trunk/Scribus/scribus/text/storytext.cpp	Thu Jun  6 12:22:21 2019
@@ -58,7 +58,6 @@
 	m_shapedTextCache = new ShapedTextCache();
 	
 	d->len = 0;
-	orphanedCharStyle = defaultStyle().charStyle();
 	invalidateAll();
 }
 
@@ -561,7 +560,7 @@
 		int lastChar = length() - 1;
 		while (lastChar > 0 && text(lastChar) == SpecialChars::PARSEP)
 			--lastChar;
-		orphanedCharStyle = charStyle(lastChar);
+		d->orphanedCharStyle = charStyle(lastChar);
 	}
 	for (int i = pos + static_cast<int>(len) - 1; i >= pos; --i)
 	{
@@ -1160,7 +1159,7 @@
 	if (length() == 0)
 	{
 //		qDebug() << "storytext::charstyle: default";
-		return orphanedCharStyle;
+		return d->orphanedCharStyle;
 	}
 	if (pos == length())
 	{

Modified: trunk/Scribus/scribus/text/storytext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23002&path=/trunk/Scribus/scribus/text/storytext.h
==============================================================================
--- trunk/Scribus/scribus/text/storytext.h	(original)
+++ trunk/Scribus/scribus/text/storytext.h	Thu Jun  6 12:22:21 2019
@@ -284,7 +284,6 @@
 private:
 	ScribusDoc * m_doc; 
 	int m_selFirst, m_selLast;
-	CharStyle orphanedCharStyle;
 	ShapedTextCache* m_shapedTextCache;
 	static BreakIterator* m_graphemeIterator;
 	static BreakIterator* m_wordIterator;




More information about the scribus-commit mailing list