r14989 by jghali - #9031 : tabs can't be changed in edit mode using tab manager widget in PP The tab manager did not work consistently compared to other text settings and acted only story default style. Now when in edit mode it acts on current style/selection like other text settings do.

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 19 23:10:21 CEST 2010


Revision: 14989
Author: jghali
Date: 2010-04-19T21:05:42.437889Z
Commit message: #9031 : tabs can't be changed in edit mode using tab manager widget in PP
The tab manager did not work consistently compared to other text settings and acted only story default style. Now when in edit mode it acts on current style/selection like other text settings do.

Changeset: 
M  /branches/Version135/Scribus/scribus/propertiespalette.cpp

Diffs:
Index: scribus/propertiespalette.cpp
===================================================================
--- scribus/propertiespalette.cpp	(revision 14988)
+++ scribus/propertiespalette.cpp	(revision 14989)
@@ -5021,12 +5021,22 @@
 		PageItem_TextFrame *i2=CurItem->asTextFrame();
 		if (i2==0)
 			return;
-		TabManager *dia = new TabManager(this, doc->unitIndex(), i2->itemText.defaultStyle().tabValues(), i2->columnWidth());
+		const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
+		TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
 		if (dia->exec())
 		{
-			ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
-			newStyle.setTabValues(dia->tmpTab);
-			CurItem->itemText.setDefaultStyle(newStyle);
+			if (doc->appMode != modeEdit)
+			{
+				ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
+				newStyle.setTabValues(dia->tmpTab);
+				CurItem->itemText.setDefaultStyle(newStyle);
+			}
+			else
+			{
+				ParagraphStyle newStyle;
+				newStyle.setTabValues(dia->tmpTab);
+				doc->itemSelection_ApplyParagraphStyle(newStyle);
+			}
 			CurItem->update();
 			emit DocChanged();
 		}




More information about the scribus-commit mailing list