r23650 by jghali - Initial fix for several style related issues introduced by the "No Style" => "Default Style" behavior change which was made on PP:

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 24 23:30:29 UTC 2020


Author: jghali
Date: Fri Apr 24 23:30:29 2020
New Revision: 23650

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23650
Log:
Initial fix for several style related issues introduced by the "No Style" => "Default Style" behavior change which was made on PP:
- Incorrect style information displayed in PP when a style is applied directly to text frame
- Impossibility to apply a default style when another style is applied directly to text frame

Modified:
    trunk/Scribus/scribus/ui/stylecombos.cpp

Modified: trunk/Scribus/scribus/ui/stylecombos.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23650&path=/trunk/Scribus/scribus/ui/stylecombos.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylecombos.cpp	(original)
+++ trunk/Scribus/scribus/ui/stylecombos.cpp	Fri Apr 24 23:30:29 2020
@@ -32,6 +32,7 @@
 ParaStyleComboBox::ParaStyleComboBox(QWidget* parent) : QComboBox(parent)
 {
 	setEditable(false);
+	addItem( tr("[Inherited Style]") );
 	addItem( CommonStrings::trDefaultParagraphStyle );
 	connect(this, SIGNAL(activated(int)), this, SLOT(selectedStyle(int)));
 }
@@ -80,7 +81,7 @@
 	QString parStyleName = name;
 	if (parStyleName == CommonStrings::DefaultParagraphStyle)
 		parStyleName = CommonStrings::trDefaultParagraphStyle;
-	setCurrentComboItem(this, parStyleName.isEmpty() ? CommonStrings::trDefaultParagraphStyle : parStyleName);
+	setCurrentComboItem(this, parStyleName.isEmpty() ? tr("[Inherited Style]") : parStyleName);
 }
 
 void ParaStyleComboBox::updateStyleList()
@@ -94,6 +95,7 @@
 	if (m_doc != nullptr)
 	{
 		QStringList st;
+		addItem( tr("[Inherited Style]") );
 		addItem( CommonStrings::trDefaultParagraphStyle );
 		for (int i = 0; i < m_doc->paragraphStyles().count(); ++i)
 		{
@@ -138,6 +140,7 @@
 CharStyleComboBox::CharStyleComboBox(QWidget* parent) : QComboBox(parent)
 {
 	setEditable(false);
+	addItem( tr("[Inherited Style]") );
 	addItem( CommonStrings::trDefaultCharacterStyle );
 	connect(this, SIGNAL(activated(int)), this, SLOT(selectedStyle(int)));
 }
@@ -186,7 +189,7 @@
 	QString charStyleName = name;
 	if (charStyleName == CommonStrings::DefaultCharacterStyle)
 		charStyleName = CommonStrings::trDefaultCharacterStyle;
-	setCurrentComboItem(this, charStyleName.isEmpty() ? CommonStrings::trDefaultCharacterStyle : charStyleName);
+	setCurrentComboItem(this, charStyleName.isEmpty() ? tr("[Inherited Style]") : charStyleName);
 }
 
 void CharStyleComboBox::updateStyleList()
@@ -200,6 +203,7 @@
 	if (m_doc != nullptr)
 	{
 		QStringList st;
+		addItem( tr("[Inherited Style]") );
 		addItem( CommonStrings::trDefaultCharacterStyle );
 		for (int i = 0; i < m_doc->charStyles().count(); ++i)
 		{
@@ -244,6 +248,7 @@
 CellStyleComboBox::CellStyleComboBox(QWidget* parent) : QComboBox(parent)
 {
 	setEditable(false);
+	addItem( tr("[Inherited Style]") );
 	addItem( CommonStrings::trDefaultCellStyle );
 	connect(this, SIGNAL(activated(int)), this, SLOT(selectedStyle(int)));
 }
@@ -292,7 +297,7 @@
 	QString cellStyleName = name;
 	if (cellStyleName == CommonStrings::DefaultCellStyle)
 		cellStyleName = CommonStrings::trDefaultCellStyle;
-	setCurrentComboItem(this, cellStyleName.isEmpty() ? CommonStrings::trDefaultCellStyle : cellStyleName);
+	setCurrentComboItem(this, cellStyleName.isEmpty() ? tr("[Inherited Style]") : cellStyleName);
 }
 
 void CellStyleComboBox::updateStyleList()
@@ -306,6 +311,7 @@
 	if (m_doc != nullptr)
 	{
 		QStringList st;
+		addItem( tr("[Inherited Style]") );
 		addItem( CommonStrings::trDefaultCellStyle  );
 		for (int i = 0; i < m_doc->cellStyles().count(); ++i)
 		{
@@ -347,6 +353,7 @@
 TableStyleComboBox::TableStyleComboBox(QWidget* parent) : QComboBox(parent)
 {
 	setEditable(false);
+	addItem( tr("[Inherited Style]") );
 	addItem( CommonStrings::trDefaultTableStyle );
 	connect(this, SIGNAL(activated(int)), this, SLOT(selectedStyle(int)));
 }
@@ -395,7 +402,7 @@
 	QString tableStyleName = name;
 	if (tableStyleName == CommonStrings::DefaultTableStyle)
 		tableStyleName = CommonStrings::trDefaultTableStyle;
-	setCurrentComboItem(this, tableStyleName.isEmpty() ? CommonStrings::trDefaultTableStyle : tableStyleName);
+	setCurrentComboItem(this, tableStyleName.isEmpty() ? tr("[Inherited Style]") : tableStyleName);
 }
 
 void TableStyleComboBox::updateStyleList()
@@ -409,6 +416,7 @@
 	if (m_doc != nullptr)
 	{
 		QStringList st;
+		addItem( tr("[Inherited Style]") );
 		addItem( CommonStrings::trDefaultTableStyle );
 		for (int i = 0; i < m_doc->tableStyles().count(); ++i)
 		{




More information about the scribus-commit mailing list