r22195 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 19 23:38:08 UTC 2017


Author: jghali
Date: Thu Oct 19 23:38:07 2017
New Revision: 22195

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22195
Log:
#15021: Removing border lines using table properties panel doesn't work

Modified:
    trunk/Scribus/scribus/tableborder.h
    trunk/Scribus/scribus/ui/propertiespalette_table.cpp
    trunk/Scribus/scribus/ui/propertiespalette_table.h

Modified: trunk/Scribus/scribus/tableborder.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22195&path=/trunk/Scribus/scribus/tableborder.h
==============================================================================
--- trunk/Scribus/scribus/tableborder.h	(original)
+++ trunk/Scribus/scribus/tableborder.h	Thu Oct 19 23:38:07 2017
@@ -96,7 +96,7 @@
 	double width() const;
 
 	/// Returns the list of border lines for this border in the order they should be painted.
-	QList<TableBorderLine> borderLines() const { return m_borderLines; }
+	const QList<TableBorderLine>& borderLines() const { return m_borderLines; }
 
 	/**
 	 * Returns the border line at @a index from the list of border lines for this border, or

Modified: trunk/Scribus/scribus/ui/propertiespalette_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22195&path=/trunk/Scribus/scribus/ui/propertiespalette_table.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_table.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_table.cpp	Thu Oct 19 23:38:07 2017
@@ -325,6 +325,22 @@
 	removeBorderLineButton->setEnabled(borderLineList->count() > 1);
 }
 
+void PropertiesPalette_Table::updateBorderLineList(const TableBorderLine& current)
+{
+	updateBorderLineList();
+
+	const QList<TableBorderLine>& borderLines = m_currentBorder.borderLines();
+	for (int i = 0; i < borderLines.count(); ++i)
+	{
+		const TableBorderLine& borderLine = borderLines.at(i);
+		if (borderLine == current)
+		{
+			borderLineList->setCurrentRow(i);
+			break;
+		}
+	}
+}
+
 void PropertiesPalette_Table::updateBorderLineListItem()
 {
 	QListWidgetItem* item = borderLineList->currentItem();
@@ -442,6 +458,8 @@
 	int index = borderLineList->currentRow();
 	borderLineList->removeItemWidget(borderLineList->currentItem());
 	m_currentBorder.removeBorderLine(index);
+	
+	updateBorders();
 	updateBorderLineList();
 }
 
@@ -453,7 +471,7 @@
 	m_currentBorder.replaceBorderLine(index, borderLine);
 
 	updateBorders();
-	updateBorderLineListItem();
+	updateBorderLineList(borderLine);
 }
 
 void PropertiesPalette_Table::on_borderLineShade_valueChanged(double shade)

Modified: trunk/Scribus/scribus/ui/propertiespalette_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22195&path=/trunk/Scribus/scribus/ui/propertiespalette_table.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_table.h	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_table.h	Thu Oct 19 23:38:07 2017
@@ -104,6 +104,8 @@
 	void showCellStyle(const QString& name);
 	/// Updates the list of border lines from the current border.
 	void updateBorderLineList();
+	/// Updates the list of border lines from the current border.
+	void updateBorderLineList(const TableBorderLine& current);
 	/// Updates the current item in the list of border lines.
 	void updateBorderLineListItem();
 	/// Updates the selected table with the current border.




More information about the scribus-commit mailing list