r18541 by jghali - #11780: [BUG/FIX] superscript is not applied to note marks

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 10 22:39:38 UTC 2013


Author: jghali
Date: Thu Oct 10 22:39:38 2013
New Revision: 18541

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18541
Log:
#11780: [BUG/FIX] superscript is not applied to note marks

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/text/storytext.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18541&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Thu Oct 10 22:39:38 2013
@@ -1543,35 +1543,38 @@
 					NotesStyle* nStyle = note->notesStyle();
 						Q_ASSERT(nStyle != NULL);
 					QString chsName = nStyle->marksChStyle();
-					CharStyle newStyle(itemText.charStyle(a));
+					CharStyle currStyle(itemText.charStyle(a));
 					if ((chsName != "") && (chsName != tr("No Style")))
 					{
 						CharStyle marksStyle(m_Doc->charStyle(chsName));
-						if (!newStyle.equiv(marksStyle))
+						if (!currStyle.equiv(marksStyle))
 						{
-							newStyle.setParent(chsName);
-							itemText.applyCharStyle(a, 1, marksStyle);
+							currStyle.setParent(chsName);
+							itemText.applyCharStyle(a, 1, currStyle);
 						}
 					}
+
+					StyleFlag s(itemText.charStyle(a).effects());
+					if (mark->isType(MARKNoteMasterType))
+					{
+						if (nStyle->isSuperscriptInMaster())
+							s |= ScStyle_Superscript;
+						else
+							s &= ~ScStyle_Superscript;
+					}
 					else
-						itemText.eraseCharStyle(a, 1, newStyle);
-
-					CharStyle haveSuperscript;
-					if (mark->isType(MARKNoteMasterType))
-					{
-						if (nStyle->isSuperscriptInMaster())
-							haveSuperscript.setEffects(haveSuperscript.effects() | ScStyle_Superscript);
+					{
+						if (nStyle->isSuperscriptInNote())
+							s |= ScStyle_Superscript;
 						else
-							haveSuperscript.setEffects(haveSuperscript.effects() & ~ScStyle_Superscript);
-					}
-					else
-					{
-						if (nStyle->isSuperscriptInNote())
-							haveSuperscript.setEffects(haveSuperscript.effects() | ScStyle_Superscript);
-						else
-							haveSuperscript.setEffects(haveSuperscript.effects() & ~ScStyle_Superscript);
-					}
-					itemText.applyCharStyle(a, 1, haveSuperscript);
+							s &= ~ScStyle_Superscript;
+					}
+					if (s != itemText.charStyle(a).effects())
+					{
+						CharStyle haveSuperscript;
+						haveSuperscript.setFeatures(s.featureList());
+						itemText.applyCharStyle(a, 1, haveSuperscript);
+					}
 				}
 			}
 			BulNumMode = false;

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18541&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Thu Oct 10 22:39:38 2013
@@ -914,9 +914,6 @@
 		qDebug() << "storytext::charstyle: access at end of text %i" << pos;
 		--pos;
 	}
-	//for notes frames - get style from note text, not from mark
-	if ((pos+1 < length()) && hasMark(pos) && mark(pos)->isNoteType())
-		++pos;
 	if (text(pos) == SpecialChars::PARSEP)
 		return paragraphStyle(pos).charStyle();
 	StoryText* that = const_cast<StoryText *>(this);




More information about the scribus-commit mailing list