r17302 by fschmid - Removed all uses of "qreal" and replaced them with "double"

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 15 21:57:43 UTC 2012


Author: fschmid
Date: Wed Feb 15 21:57:43 2012
New Revision: 17302

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17302
Log:
Removed all uses of "qreal" and replaced them with "double"

Modified:
    trunk/Scribus/scribus/canvasgesture_columnresize.cpp
    trunk/Scribus/scribus/canvasgesture_columnresize.h
    trunk/Scribus/scribus/canvasgesture_rowresize.cpp
    trunk/Scribus/scribus/canvasgesture_rowresize.h
    trunk/Scribus/scribus/canvasgesture_table.cpp
    trunk/Scribus/scribus/canvasgesture_table.h
    trunk/Scribus/scribus/canvasgesture_tableresize.cpp
    trunk/Scribus/scribus/canvasgesture_tableresize.h
    trunk/Scribus/scribus/canvasmode_edittable.cpp
    trunk/Scribus/scribus/collapsedtablepainter.cpp
    trunk/Scribus/scribus/pageitem_table.cpp
    trunk/Scribus/scribus/pageitem_table.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/tableborder.cpp
    trunk/Scribus/scribus/tableborder.h
    trunk/Scribus/scribus/tablecell.cpp
    trunk/Scribus/scribus/tablecell.h
    trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.cpp
    trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.h
    trunk/Scribus/scribus/ui/tablerowheightsdialog.cpp
    trunk/Scribus/scribus/ui/tablerowheightsdialog.h
    trunk/Scribus/scribus/ui/tablesideselector.cpp

Modified: trunk/Scribus/scribus/canvasgesture_columnresize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_columnresize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_columnresize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_columnresize.cpp Wed Feb 15 21:57:43 2012
@@ -71,8 +71,8 @@
 
 	QPointF gridPoint = globalToTableGrid(event->globalPos());
 
-	qreal requestedWidth = gridPoint.x() - m_columnPositions[m_column];
-	qreal actualWidth = 0.0;
+	double requestedWidth = gridPoint.x() - m_columnPositions[m_column];
+	double actualWidth = 0.0;
 
 	if (event->modifiers() & Qt::ShiftModifier)
 		actualWidth = resizeColumnResizeFollowing(requestedWidth);
@@ -110,13 +110,13 @@
 	m_columnPositions = table->columnPositions();
 }
 
-qreal ColumnResize::resizeColumnMoveFollowing(qreal width)
+double ColumnResize::resizeColumnMoveFollowing(double width)
 {
 	// Set column width.
-	qreal newWidth = m_columnWidths[m_column] = qMax(PageItem_Table::MinimumColumnWidth, width);
+	double newWidth = m_columnWidths[m_column] = qMax(PageItem_Table::MinimumColumnWidth, width);
 
 	// Move following columns.
-	qreal columnPosition = m_columnPositions[m_column];
+	double columnPosition = m_columnPositions[m_column];
 	for (int column = m_column; column < m_columnPositions.size(); ++column)
 	{
 		m_columnPositions[column] = columnPosition;
@@ -126,10 +126,10 @@
 	return newWidth;
 }
 
-qreal ColumnResize::resizeColumnResizeFollowing(qreal width)
+double ColumnResize::resizeColumnResizeFollowing(double width)
 {
-	qreal oldWidth = m_columnWidths[m_column];
-	qreal newWidth = 0.0;
+	double oldWidth = m_columnWidths[m_column];
+	double newWidth = 0.0;
 
 	if (m_column < table()->columns() - 1)
 	{
@@ -139,7 +139,7 @@
 			oldWidth + m_columnWidths[m_column + 1] - PageItem_Table::MinimumColumnWidth);
 
 		// Resize/move following column.
-		qreal widthChange = newWidth - oldWidth;
+		double widthChange = newWidth - oldWidth;
 		m_columnPositions[m_column + 1] += widthChange;
 		m_columnWidths[m_column + 1] -= widthChange;
 	}

Modified: trunk/Scribus/scribus/canvasgesture_columnresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_columnresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_columnresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_columnresize.h Wed Feb 15 21:57:43 2012
@@ -52,22 +52,22 @@
 	 *
 	 * The resize will imitate the behavior of the PageItem_Table::MoveFollowing strategy.
 	 */
-	qreal resizeColumnMoveFollowing(qreal width);
+	double resizeColumnMoveFollowing(double width);
 
 	/**
 	 * Resizes the column to @a width and returns the new width.
 	 *
 	 * The resize will imitate the behavior of the PageItem_Table::ResizeFollowing strategy.
 	 */
-	qreal resizeColumnResizeFollowing(qreal width);
+	double resizeColumnResizeFollowing(double width);
 
 private:
 	/// Column being resized.
 	int m_column;
 	/// List of column widths for the table outline.
-	QList<qreal> m_columnWidths;
+	QList<double> m_columnWidths;
 	/// List of column positions for the table outline.
-	QList<qreal> m_columnPositions;
+	QList<double> m_columnPositions;
 };
 
 #endif // CANVASGESTURE_COLUMNRESIZE_H

Modified: trunk/Scribus/scribus/canvasgesture_rowresize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_rowresize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rowresize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_rowresize.cpp Wed Feb 15 21:57:43 2012
@@ -71,8 +71,8 @@
 
 	QPointF gridPoint = globalToTableGrid(event->globalPos());
 
-	qreal requestedHeight = gridPoint.y() - m_rowPositions[m_row];
-	qreal actualHeight = 0.0;
+	double requestedHeight = gridPoint.y() - m_rowPositions[m_row];
+	double actualHeight = 0.0;
 
 	if (event->modifiers() & Qt::ShiftModifier)
 		actualHeight = resizeRowResizeFollowing(requestedHeight);
@@ -110,13 +110,13 @@
 	m_rowPositions = table->rowPositions();
 }
 
-qreal RowResize::resizeRowMoveFollowing(qreal height)
+double RowResize::resizeRowMoveFollowing(double height)
 {
 	// Set row height.
-	qreal newHeight = m_rowHeights[m_row] = qMax(PageItem_Table::MinimumRowHeight, height);
+	double newHeight = m_rowHeights[m_row] = qMax(PageItem_Table::MinimumRowHeight, height);
 
 	// Move following rows.
-	qreal rowPosition = m_rowPositions[m_row];
+	double rowPosition = m_rowPositions[m_row];
 	for (int row = m_row; row < m_rowPositions.size(); ++row)
 	{
 		m_rowPositions[row] = rowPosition;
@@ -126,10 +126,10 @@
 	return newHeight;
 }
 
-qreal RowResize::resizeRowResizeFollowing(qreal height)
+double RowResize::resizeRowResizeFollowing(double height)
 {
-	qreal oldHeight = m_rowHeights[m_row];
-	qreal newHeight = 0.0;
+	double oldHeight = m_rowHeights[m_row];
+	double newHeight = 0.0;
 
 	if (m_row < table()->rows() - 1)
 	{
@@ -139,7 +139,7 @@
 			oldHeight + m_rowHeights[m_row + 1] - PageItem_Table::MinimumRowHeight);
 
 		// Resize/move following row.
-		qreal heightChange = newHeight - oldHeight;
+		double heightChange = newHeight - oldHeight;
 		m_rowPositions[m_row + 1] += heightChange;
 		m_rowHeights[m_row + 1] -= heightChange;
 	}

Modified: trunk/Scribus/scribus/canvasgesture_rowresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_rowresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rowresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_rowresize.h Wed Feb 15 21:57:43 2012
@@ -52,22 +52,22 @@
 	 *
 	 * The resize will imitate the behavior of the PageItem_Table::MoveFollowing strategy.
 	 */
-	qreal resizeRowMoveFollowing(qreal height);
+	double resizeRowMoveFollowing(double height);
 
 	/**
 	 * Resizes the row to @a height and returns the new height.
 	 *
 	 * The resize will imitate the behavior of the PageItem_Table::ResizeFollowing strategy.
 	 */
-	qreal resizeRowResizeFollowing(qreal height);
+	double resizeRowResizeFollowing(double height);
 
 private:
 	/// Row being resized.
 	int m_row;
 	/// List of row heights for the table outline.
-	QList<qreal> m_rowHeights;
+	QList<double> m_rowHeights;
 	/// List of row positions for the table outline.
-	QList<qreal> m_rowPositions;
+	QList<double> m_rowPositions;
 };
 
 #endif // CANVASGESTURE_ROWRESIZE_H

Modified: trunk/Scribus/scribus/canvasgesture_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_table.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_table.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_table.cpp Wed Feb 15 21:57:43 2012
@@ -39,8 +39,8 @@
 }
 
 void TableGesture::paintTableOutline(
-	const QList<qreal>& rowHeights, const QList<qreal>& rowPositions,
-	const QList<qreal>& columnWidths, const QList<qreal>& columnPositions, QPainter* p)
+	const QList<double>& rowHeights, const QList<double>& rowPositions,
+	const QList<double>& columnWidths, const QList<double>& columnPositions, QPainter* p)
 {
 	if (!m_table || !m_canvas || !p)
 		return;
@@ -75,7 +75,7 @@
 		{
 			cell = m_table->cellAt(row, col);
 			int endRow = cell.row() + cell.rowSpan() - 1;
-			qreal bottom = rowPositions[endRow] + rowHeights[endRow];
+			double bottom = rowPositions[endRow] + rowHeights[endRow];
 
 			if (cell.column() == col)
 				endPoint.setY(bottom);
@@ -99,7 +99,7 @@
 		{
 			cell = m_table->cellAt(row, col);
 			int endCol = cell.column() + cell.columnSpan() - 1;
-			qreal right = columnPositions[endCol] + columnWidths[endCol];
+			double right = columnPositions[endCol] + columnWidths[endCol];
 
 			if (cell.row() == row)
 				endPoint.setX(right);

Modified: trunk/Scribus/scribus/canvasgesture_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_table.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_table.h (original)
+++ trunk/Scribus/scribus/canvasgesture_table.h Wed Feb 15 21:57:43 2012
@@ -59,8 +59,8 @@
 	 * The size of these vectors must match the dimensions of the currently edited table,
 	 * or the result of this function is undefined.
 	 */
-	void paintTableOutline(const QList<qreal>& rowHeights, const QList<qreal>& rowPositions,
-		const QList<qreal>& columnWidths, const QList<qreal>& columnPositions, QPainter* p);
+	void paintTableOutline(const QList<double>& rowHeights, const QList<double>& rowPositions,
+		const QList<double>& columnWidths, const QList<double>& columnPositions, QPainter* p);
 
 	/**
 	 * Paints the selection of the currently edited table.

Modified: trunk/Scribus/scribus/canvasgesture_tableresize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_tableresize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_tableresize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_tableresize.cpp Wed Feb 15 21:57:43 2012
@@ -52,9 +52,9 @@
 	QPointF gridPoint = globalToTableGrid(event->globalPos());
 
 	// Set the column  geometries for the table outline.
-	qreal requestedWidthFactor = gridPoint.x() / table()->tableWidth();
-	qreal newMinWidth = qMax(m_minWidth * requestedWidthFactor, PageItem_Table::MinimumColumnWidth);
-	qreal actualWidthFactor = newMinWidth / m_minWidth;
+	double requestedWidthFactor = gridPoint.x() / table()->tableWidth();
+	double newMinWidth = qMax(m_minWidth * requestedWidthFactor, PageItem_Table::MinimumColumnWidth);
+	double actualWidthFactor = newMinWidth / m_minWidth;
 	for (int col = 0; col < m_columnWidths.size(); ++col)
 	{
 		m_columnWidths[col] = table()->columnWidth(col) * actualWidthFactor;
@@ -62,9 +62,9 @@
 	}
 
 	// Set the row geometries for the table outline.
-	qreal requestedHeightFactor = gridPoint.y() / table()->tableHeight();
-	qreal newMinHeight = qMax(m_minHeight * requestedHeightFactor, PageItem_Table::MinimumRowHeight);
-	qreal actualHeightFactor = newMinHeight / m_minHeight;
+	double requestedHeightFactor = gridPoint.y() / table()->tableHeight();
+	double newMinHeight = qMax(m_minHeight * requestedHeightFactor, PageItem_Table::MinimumRowHeight);
+	double actualHeightFactor = newMinHeight / m_minHeight;
 	for (int row = 0; row < m_rowHeights.size(); ++row)
 	{
 		m_rowHeights[row] = table()->rowHeight(row) * actualHeightFactor;
@@ -72,8 +72,8 @@
 	}
 
 	// Display size tooltip.
-	qreal actualTableWidth = table()->tableWidth() * actualWidthFactor;
-	qreal actualTableHeight = table()->tableHeight() * actualHeightFactor;
+	double actualTableWidth = table()->tableWidth() * actualWidthFactor;
+	double actualTableHeight = table()->tableHeight() * actualHeightFactor;
 	m_canvas->displaySizeHUD(event->globalPos(), actualTableWidth, actualTableHeight, false);
 
 	m_canvas->update();

Modified: trunk/Scribus/scribus/canvasgesture_tableresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasgesture_tableresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_tableresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_tableresize.h Wed Feb 15 21:57:43 2012
@@ -48,17 +48,17 @@
 
 private:
 	/// List of row heights for the table outline.
-	QList<qreal> m_rowHeights;
+	QList<double> m_rowHeights;
 	/// List of row positions for the table outline.
-	QList<qreal> m_rowPositions;
+	QList<double> m_rowPositions;
 	/// List of column widths for the table outline.
-	QList<qreal> m_columnWidths;
+	QList<double> m_columnWidths;
 	/// List of column positions for the table outline.
-	QList<qreal> m_columnPositions;
+	QList<double> m_columnPositions;
 	/// The minimum row height before the gesture started.
-	qreal m_minHeight;
+	double m_minHeight;
 	/// The minimum column width before the gesture started.
-	qreal m_minWidth;
+	double m_minWidth;
 };
 
 #endif // CANVASGESTURE_TABLERESIZE_H

Modified: trunk/Scribus/scribus/canvasmode_edittable.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/canvasmode_edittable.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edittable.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_edittable.cpp Wed Feb 15 21:57:43 2012
@@ -150,7 +150,7 @@
 	event->accept();
 
 	QPointF canvasPoint = m_canvas->globalToCanvas(event->globalPos()).toQPointF();
-	qreal threshold = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
+	double threshold = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
 	TableHandle handle = m_table->hitTest(canvasPoint, threshold);
 
 	if (event->buttons() & Qt::LeftButton)
@@ -196,7 +196,7 @@
 {
 	event->accept();
 	QPointF canvasPoint = m_canvas->globalToCanvas(event->globalPos()).toQPointF();
-	qreal threshold = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
+	double threshold = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
 	TableHandle handle = m_table->hitTest(canvasPoint, threshold);
 
 	if (event->button() == Qt::LeftButton)

Modified: trunk/Scribus/scribus/collapsedtablepainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/collapsedtablepainter.cpp
==============================================================================
--- trunk/Scribus/scribus/collapsedtablepainter.cpp (original)
+++ trunk/Scribus/scribus/collapsedtablepainter.cpp Wed Feb 15 21:57:43 2012
@@ -100,10 +100,10 @@
 				{
 					int endCol = col + cell.columnSpan() - 1;
 					int endRow = row + cell.rowSpan() - 1;
-					qreal left = table()->columnPosition(col);
-					qreal right = table()->columnPosition(endCol) + table()->columnWidth(endCol);
-					qreal top = table()->rowPosition(row);
-					qreal bottom = table()->rowPosition(endRow) + table()->rowHeight(endRow);
+					double left = table()->columnPosition(col);
+					double right = table()->columnPosition(endCol) + table()->columnWidth(endCol);
+					double top = table()->rowPosition(row);
+					double bottom = table()->rowPosition(endRow) + table()->rowHeight(endRow);
 					// Paint right and bottom grid line.
 					paintGridLine(QPointF(right, top), QPointF(right, bottom), p);
 					paintGridLine(QPointF(left, bottom), QPointF(right, bottom), p);
@@ -148,10 +148,10 @@
 	int lastCol = table()->columns() - 1;
 	int lastRow = table()->rows() - 1;
 
-	qreal x = table()->columnPosition(0);
-	qreal y = table()->rowPosition(0);
-	qreal width = table()->columnPosition(lastCol) + table()->columnWidth(lastCol) - x;
-	qreal height = table()->rowPosition(lastRow) + table()->rowHeight(lastRow) - y;
+	double x = table()->columnPosition(0);
+	double y = table()->rowPosition(0);
+	double width = table()->columnPosition(lastCol) + table()->columnWidth(lastCol) - x;
+	double height = table()->rowPosition(lastRow) + table()->rowHeight(lastRow) - y;
 
 	QColor color;
 	table()->SetQColor(&color, colorName, 100.0);
@@ -402,7 +402,7 @@
 	// The cell starts in this column.
 	const int firstCol = cell.column();
 	// The X position of the border segments to paint.
-	const qreal borderX = table()->columnPosition(firstCol);
+	const double borderX = table()->columnPosition(firstCol);
 
 	// The start point of the border segment currently being painted.
 	QPointF start(borderX, 0.0);
@@ -478,7 +478,7 @@
 	// The cell ends in this column.
 	const int lastCol = cell.column() + cell.columnSpan() - 1;
 	// The X position of the border segments to paint.
-	const qreal borderX = table()->columnPosition(lastCol) + table()->columnWidth(lastCol);
+	const double borderX = table()->columnPosition(lastCol) + table()->columnWidth(lastCol);
 
 	// The start point of the border segment currently being painted.
 	QPointF start(borderX, 0.0);
@@ -547,7 +547,7 @@
 	// The cell ends in this column.
 	const int lastCol = cell.column() + cell.columnSpan() - 1;
 	// The Y position of the border segments to paint.
-	const qreal borderY = table()->rowPosition(firstRow);
+	const double borderY = table()->rowPosition(firstRow);
 
 	// The start point of the border segment currently being painted.
 	QPointF start(0.0, borderY);
@@ -616,7 +616,7 @@
 	// The cell ends in this column.
 	const int lastCol = cell.column() + cell.columnSpan() - 1;
 	// The Y position of the border segments to paint.
-	const qreal borderY = table()->rowPosition(lastRow) + table()->rowHeight(lastRow);
+	const double borderY = table()->rowPosition(lastRow) + table()->rowHeight(lastRow);
 
 	// The start point of the border segment currently being painted.
 	QPointF start(0.0, borderY);
@@ -681,10 +681,10 @@
 	int lastRow = row + cell.rowSpan() - 1;
 	int lastCol = col + cell.columnSpan() - 1;
 
-	qreal x = table()->columnPosition(col);
-	qreal y = table()->rowPosition(row);
-	qreal width = table()->columnPosition(lastCol) + table()->columnWidth(lastCol) - x;
-	qreal height = table()->rowPosition(lastRow) + table()->rowHeight(lastRow) - y;
+	double x = table()->columnPosition(col);
+	double y = table()->rowPosition(row);
+	double width = table()->columnPosition(lastCol) + table()->columnWidth(lastCol) - x;
+	double height = table()->rowPosition(lastRow) + table()->rowHeight(lastRow) - y;
 	p->drawRect(x, y, width, height);
 
 	p->restore();

Modified: trunk/Scribus/scribus/pageitem_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/pageitem_table.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_table.cpp (original)
+++ trunk/Scribus/scribus/pageitem_table.cpp Wed Feb 15 21:57:43 2012
@@ -38,10 +38,10 @@
 #endif
 
 // The minimum row height.
-const qreal PageItem_Table::MinimumRowHeight = 3.0;
+const double PageItem_Table::MinimumRowHeight = 3.0;
 
 // The minimum column width.
-const qreal PageItem_Table::MinimumColumnWidth = 3.0;
+const double PageItem_Table::MinimumColumnWidth = 3.0;
 
 PageItem_Table::PageItem_Table(ScribusDoc *pa, double x, double y, double w, double h,
 	double w2, QString fill, QString outline, int numRows, int numColumns) :
@@ -61,7 +61,7 @@
 	delete m_tablePainter;
 }
 
-void PageItem_Table::resize(qreal width, qreal height)
+void PageItem_Table::resize(double width, double height)
 {
 	ASSERT_VALID();
 
@@ -69,10 +69,10 @@
 	 * Distribute width proportionally to columns, but don't let any column width below
 	 * MinimumColumnWidth.
 	 */
-	qreal requestedWidthFactor = width / tableWidth();
-	qreal oldMinWidth = *std::min_element(m_columnWidths.begin(), m_columnWidths.end());
-	qreal newMinWidth = qMax(oldMinWidth * requestedWidthFactor, MinimumColumnWidth);
-	qreal actualWidthFactor = newMinWidth / oldMinWidth;
+	double requestedWidthFactor = width / tableWidth();
+	double oldMinWidth = *std::min_element(m_columnWidths.begin(), m_columnWidths.end());
+	double newMinWidth = qMax(oldMinWidth * requestedWidthFactor, MinimumColumnWidth);
+	double actualWidthFactor = newMinWidth / oldMinWidth;
 	for (int col = 0; col < columns(); ++col)
 	{
 		m_columnWidths[col] *= actualWidthFactor;
@@ -83,10 +83,10 @@
 	 * Distribute height proportionally to rows, but don't let any row height below
 	 * MinimumRowHeight.
 	 */
-	qreal requestedHeightFactor = height / tableHeight();
-	qreal oldMinHeight = *std::min_element(m_rowHeights.begin(), m_rowHeights.end());
-	qreal newMinHeight = qMax(oldMinHeight * requestedHeightFactor, MinimumRowHeight);
-	qreal actualHeightFactor = newMinHeight / oldMinHeight;
+	double requestedHeightFactor = height / tableHeight();
+	double oldMinHeight = *std::min_element(m_rowHeights.begin(), m_rowHeights.end());
+	double newMinHeight = qMax(oldMinHeight * requestedHeightFactor, MinimumRowHeight);
+	double actualHeightFactor = newMinHeight / oldMinHeight;
 	for (int row = 0; row < rows(); ++row)
 	{
 		m_rowHeights[row] *= actualHeightFactor;
@@ -108,8 +108,8 @@
 	if (index < 0 || index > rows() || numRows < 1)
 		return;
 
-	qreal rowHeight = m_rowHeights.at(qMax(index - 1, 0));
-	qreal rowPosition = index == 0 ? 0.0 : m_rowPositions.at(index - 1) + rowHeight;
+	double rowHeight = m_rowHeights.at(qMax(index - 1, 0));
+	double rowPosition = index == 0 ? 0.0 : m_rowPositions.at(index - 1) + rowHeight;
 
 	for (int row = index; row < index + numRows; ++row)
 	{
@@ -126,7 +126,7 @@
 	}
 
 	// Adjust following rows.
-	qreal insertedHeight = rowHeight * numRows;
+	double insertedHeight = rowHeight * numRows;
 	for (int nextRow = index + numRows; nextRow < rows() + numRows; ++nextRow)
 	{
 		// Adjust position of following row.
@@ -159,7 +159,7 @@
 		return;
 
 	// Remove row heights, row positions and rows of cells.
-	qreal removedHeight = 0.0;
+	double removedHeight = 0.0;
 	for (int i = 0; i < numRows; ++i)
 	{
 		// Remove row height and position.
@@ -215,8 +215,8 @@
 	if (index < 0 || index > columns() || numColumns < 1)
 		return;
 
-	qreal columnWidth = m_columnWidths.at(qMax(index - 1, 0));
-	qreal columnPosition = index == 0 ? 0.0 : m_columnPositions.at(index - 1) + columnWidth;
+	double columnWidth = m_columnWidths.at(qMax(index - 1, 0));
+	double columnPosition = index == 0 ? 0.0 : m_columnPositions.at(index - 1) + columnWidth;
 
 	for (int col = index; col < index + numColumns; ++col)
 	{
@@ -231,7 +231,7 @@
 	}
 
 	// Adjust following columns.
-	qreal insertedWidth = columnWidth * numColumns;
+	double insertedWidth = columnWidth * numColumns;
 	for (int nextColumn = index + numColumns; nextColumn < columns() + numColumns; ++nextColumn)
 	{
 		// Adjust position of following column.
@@ -264,7 +264,7 @@
 		return;
 
 	// Remove column widths, column positions and columns of cells.
-	qreal removedWidth = 0.0;
+	double removedWidth = 0.0;
 	for (int i = 0; i < numColumns; ++i)
 	{
 		// Remove columns widths and positions.
@@ -311,7 +311,7 @@
 	ASSERT_VALID();
 }
 
-qreal PageItem_Table::rowHeight(int row) const
+double PageItem_Table::rowHeight(int row) const
 {
 	if (!validRow(row))
 		return 0.0;
@@ -319,7 +319,7 @@
 	return m_rowHeights.at(row);
 }
 
-void PageItem_Table::resizeRow(int row, qreal height, ResizeStrategy strategy)
+void PageItem_Table::resizeRow(int row, double height, ResizeStrategy strategy)
 {
 	ASSERT_VALID();
 
@@ -347,7 +347,7 @@
 		return;
 
 	const int numRows = endRow - startRow + 1;
-	const qreal newHeight = (rowPosition(endRow) + rowHeight(endRow) - rowPosition(startRow)) / numRows;
+	const double newHeight = (rowPosition(endRow) + rowHeight(endRow) - rowPosition(startRow)) / numRows;
 
 	for (int row = startRow; row <= endRow; ++row)
 		resizeRow(row, newHeight);
@@ -359,13 +359,13 @@
 		return;
 
 	const int numColumns = endColumn - startColumn + 1;
-	const qreal newWidth = (columnPosition(endColumn) + columnWidth(endColumn) - columnPosition(startColumn)) / numColumns;
+	const double newWidth = (columnPosition(endColumn) + columnWidth(endColumn) - columnPosition(startColumn)) / numColumns;
 
 	for (int column = startColumn; column <= endColumn; ++column)
 		resizeColumn(column, newWidth);
 }
 
-qreal PageItem_Table::rowPosition(int row) const
+double PageItem_Table::rowPosition(int row) const
 {
 	if (!validRow(row))
 		return 0.0;
@@ -373,7 +373,7 @@
 	return m_rowPositions.at(row);
 }
 
-qreal PageItem_Table::columnWidth(int column) const
+double PageItem_Table::columnWidth(int column) const
 {
 	if (!validColumn(column))
 		return 0.0;
@@ -381,7 +381,7 @@
 	return m_columnWidths.at(column);
 }
 
-void PageItem_Table::resizeColumn(int column, qreal width, ResizeStrategy strategy)
+void PageItem_Table::resizeColumn(int column, double width, ResizeStrategy strategy)
 {
 	ASSERT_VALID();
 
@@ -403,7 +403,7 @@
 	ASSERT_VALID();
 }
 
-qreal PageItem_Table::columnPosition(int column) const
+double PageItem_Table::columnPosition(int column) const
 {
 	if (!validColumn(column))
 		return 0.0;
@@ -625,7 +625,7 @@
 	m_activeColumn = activeCell().column();
 }
 
-TableHandle PageItem_Table::hitTest(const QPointF& point, qreal threshold) const
+TableHandle PageItem_Table::hitTest(const QPointF& point, double threshold) const
 {
 	const QPointF framePoint = getTransform().inverted().map(point);
 	const QPointF gridPoint = framePoint - gridOffset();
@@ -639,10 +639,10 @@
 	if (!gridRect.adjusted(-threshold, -threshold, threshold, threshold).contains(gridPoint))
 		return TableHandle(TableHandle::None);
 
-	const qreal tableHeight = this->tableHeight();
-	const qreal tableWidth = this->tableWidth();
-	const qreal x = gridPoint.x();
-	const qreal y = gridPoint.y();
+	const double tableHeight = this->tableHeight();
+	const double tableWidth = this->tableWidth();
+	const double x = gridPoint.x();
+	const double y = gridPoint.y();
 
 	// Test if hit is on left edge of table.
 	if (x <= threshold)
@@ -671,10 +671,10 @@
 	if (hitRect.adjusted(threshold, threshold, -threshold, -threshold).contains(gridPoint))
 		return TableHandle(TableHandle::CellSelect); // Hit interior of cell.
 
-	const qreal toLeft = x - hitRect.left();
-	const qreal toRight = hitRect.right() - x;
-	const qreal toTop = y - hitRect.top();
-	const qreal toBottom = hitRect.bottom() - y;
+	const double toLeft = x - hitRect.left();
+	const double toRight = hitRect.right() - x;
+	const double toTop = y - hitRect.top();
+	const double toBottom = hitRect.bottom() - y;
 	TableHandle handle(TableHandle::None);
 
 	// Test which side of the cell was hit.
@@ -917,9 +917,9 @@
 	ASSERT_VALID();
 }
 
-qreal PageItem_Table::maxLeftBorderWidth() const
-{
-	qreal maxWidth = 0.0;
+double PageItem_Table::maxLeftBorderWidth() const
+{
+	double maxWidth = 0.0;
 	TableCell cell;
 	for (int row = 0; row < rows(); row += cell.rowSpan())
 	{
@@ -929,9 +929,9 @@
 	return maxWidth;
 }
 
-qreal PageItem_Table::maxRightBorderWidth() const
-{
-	qreal maxWidth = 0.0;
+double PageItem_Table::maxRightBorderWidth() const
+{
+	double maxWidth = 0.0;
 	TableCell cell;
 	for (int row = 0; row < rows(); row += cell.rowSpan())
 	{
@@ -941,9 +941,9 @@
 	return maxWidth;
 }
 
-qreal PageItem_Table::maxTopBorderWidth() const
-{
-	qreal maxWidth = 0.0;
+double PageItem_Table::maxTopBorderWidth() const
+{
+	double maxWidth = 0.0;
 	TableCell cell;
 	for (int col = 0; col < columns(); col += cell.columnSpan())
 	{
@@ -953,9 +953,9 @@
 	return maxWidth;
 }
 
-qreal PageItem_Table::maxBottomBorderWidth() const
-{
-	qreal maxWidth = 0.0;
+double PageItem_Table::maxBottomBorderWidth() const
+{
+	double maxWidth = 0.0;
 	TableCell cell;
 	for (int col = 0; col < columns(); col += cell.columnSpan())
 	{
@@ -965,13 +965,13 @@
 	return maxWidth;
 }
 
-qreal PageItem_Table::resizeRowMoveFollowing(int row, qreal height)
+double PageItem_Table::resizeRowMoveFollowing(int row, double height)
 {
 	// Set row height.
-	qreal newHeight = m_rowHeights[row] = qMax(MinimumRowHeight, height);
+	double newHeight = m_rowHeights[row] = qMax(MinimumRowHeight, height);
 
 	// Move following rows.
-	qreal rowPosition = m_rowPositions[row];
+	double rowPosition = m_rowPositions[row];
 	for (int nextRow = row; nextRow < m_rowPositions.size(); ++nextRow)
 	{
 		m_rowPositions[nextRow] = rowPosition;
@@ -981,10 +981,10 @@
 	return newHeight;
 }
 
-qreal PageItem_Table::resizeRowResizeFollowing(int row, qreal height)
-{
-	qreal oldHeight = m_rowHeights[row];
-	qreal newHeight = oldHeight;
+double PageItem_Table::resizeRowResizeFollowing(int row, double height)
+{
+	double oldHeight = m_rowHeights[row];
+	double newHeight = oldHeight;
 
 	if (row < rows() - 1)
 	{
@@ -994,7 +994,7 @@
 			oldHeight + m_rowHeights[row + 1] - MinimumRowHeight);
 
 		// Resize/move following row.
-		qreal heightChange = newHeight - oldHeight;
+		double heightChange = newHeight - oldHeight;
 		m_rowPositions[row + 1] += heightChange;
 		m_rowHeights[row + 1] -= heightChange;
 	}
@@ -1007,13 +1007,13 @@
 	return newHeight;
 }
 
-qreal PageItem_Table::resizeColumnMoveFollowing(int column, qreal width)
+double PageItem_Table::resizeColumnMoveFollowing(int column, double width)
 {
 	// Set column width.
-	qreal newWidth = m_columnWidths[column] = qMax(MinimumColumnWidth, width);
+	double newWidth = m_columnWidths[column] = qMax(MinimumColumnWidth, width);
 
 	// Move following columns.
-	qreal columnPosition = m_columnPositions[column];
+	double columnPosition = m_columnPositions[column];
 	for (int nextColumn = column; nextColumn < m_columnPositions.size(); ++nextColumn)
 	{
 		m_columnPositions[nextColumn] = columnPosition;
@@ -1023,10 +1023,10 @@
 	return newWidth;
 }
 
-qreal PageItem_Table::resizeColumnResizeFollowing(int column, qreal width)
-{
-	qreal oldWidth = m_columnWidths[column];
-	qreal newWidth = oldWidth;
+double PageItem_Table::resizeColumnResizeFollowing(int column, double width)
+{
+	double oldWidth = m_columnWidths[column];
+	double newWidth = oldWidth;
 
 	if (column < columns() - 1)
 	{
@@ -1036,7 +1036,7 @@
 			oldWidth + m_columnWidths[column + 1] - MinimumColumnWidth);
 
 		// Resize/move following column.
-		qreal widthChange = newWidth - oldWidth;
+		double widthChange = newWidth - oldWidth;
 		m_columnPositions[column + 1] += widthChange;
 		m_columnWidths[column + 1] -= widthChange;
 	}

Modified: trunk/Scribus/scribus/pageitem_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/pageitem_table.h
==============================================================================
--- trunk/Scribus/scribus/pageitem_table.h (original)
+++ trunk/Scribus/scribus/pageitem_table.h Wed Feb 15 21:57:43 2012
@@ -75,10 +75,10 @@
 	};
 
 	/// The minimum row height.
-	static const qreal MinimumRowHeight;
+	static const double MinimumRowHeight;
 
 	/// The minimum column width.
-	static const qreal MinimumColumnWidth;
+	static const double MinimumColumnWidth;
 
 public:
 	/// Construct a new table item with @a numRows rows and @a numColumns columns.
@@ -99,14 +99,14 @@
 	 *
 	 * This is the width of the table grid, not including any borders along the left and right side.
 	 */
-	qreal tableWidth() const { return m_columnPositions.last() + m_columnWidths.last(); }
+	double tableWidth() const { return m_columnPositions.last() + m_columnWidths.last(); }
 
 	/**
 	 * Returns the height of the table.
 	 *
 	 * This is the height of the table grid, not including any borders along the top and left side.
 	 */
-	qreal tableHeight() const { return m_rowPositions.last() + m_rowHeights.last(); }
+	double tableHeight() const { return m_rowPositions.last() + m_rowHeights.last(); }
 
 	/**
 	 * Returns the offset of the table grid from the item origin.
@@ -119,7 +119,7 @@
 	 * The effective table width includes the width of the table grid plus half the width of the widest
 	 * borders found along its left and right side.
 	 */
-	qreal effectiveWidth() const { return tableWidth() + (maxLeftBorderWidth() + maxRightBorderWidth()) / 2; }
+	double effectiveWidth() const { return tableWidth() + (maxLeftBorderWidth() + maxRightBorderWidth()) / 2; }
 
 	/**
 	 * Returns the effective height of the table.
@@ -127,7 +127,7 @@
 	 * The effective table height includes the height of the table grid plus half the width of the widest
 	 * borders found along its top and bottom side.
 	 */
-	qreal effectiveHeight() const { return tableHeight() + (maxTopBorderWidth() + maxBottomBorderWidth()) / 2; }
+	double effectiveHeight() const { return tableHeight() + (maxTopBorderWidth() + maxBottomBorderWidth()) / 2; }
 
 	/**
 	 * Resizes the table grid to @a width, @a height.
@@ -137,7 +137,7 @@
 	 * If any row or column hits the limit MinimumRowHeight or MinimumColumnWidth, resizing in that
 	 * direction will stop for the entire table.
 	 */
-	void resize(qreal width, qreal height);
+	void resize(double width, double height);
 
 	/**
 	 * Inserts @a numRows rows before the row at @a index.
@@ -160,19 +160,19 @@
 	/**
 	 * Returns the height of @a row, or 0 if @a row does not exist.
 	 */
-	qreal rowHeight(int row) const;
+	double rowHeight(int row) const;
 
 	/**
 	 * Returns the list of row heights for the table.
 	 */
-	QList<qreal> rowHeights() const { return m_rowHeights; }
+	QList<double> rowHeights() const { return m_rowHeights; }
 
 	/**
 	 * Resizes @a row to @a height using resize strategy @a strategy.
 	 *
 	 * If @a row does not exists, this method does nothing.
 	 */
-	void resizeRow(int row, qreal height, ResizeStrategy strategy = MoveFollowing);
+	void resizeRow(int row, double height, ResizeStrategy strategy = MoveFollowing);
 
 	/**
 	 * Distributes the rows from @a startRow to @a endRow evenly.
@@ -187,12 +187,12 @@
 	/**
 	 * Returns the position of @a row, or 0 if @a row does not exist.
 	 */
-	qreal rowPosition(int row) const;
+	double rowPosition(int row) const;
 
 	/**
 	 * Returns the list of row positions for the table.
 	 */
-	QList<qreal> rowPositions() const { return m_rowPositions; }
+	QList<double> rowPositions() const { return m_rowPositions; }
 
 	/**
 	 * Inserts @a numColumns columns before the column at @a index.
@@ -215,19 +215,19 @@
 	/**
 	 * Returns the width of @a column, or 0 if @a column does not exist.
 	 */
-	qreal columnWidth(int column) const;
+	double columnWidth(int column) const;
 
 	/**
 	 * Returns the list of column widths for the table.
 	 */
-	QList<qreal> columnWidths() const { return m_columnWidths; }
+	QList<double> columnWidths() const { return m_columnWidths; }
 
 	/**
 	 * Resizes @a column to @a width using resize strategy @a strategy.
 	 *
 	 * If @a column does not exists, this method does nothing.
 	 */
-	void resizeColumn(int column, qreal width, ResizeStrategy strategy = MoveFollowing);
+	void resizeColumn(int column, double width, ResizeStrategy strategy = MoveFollowing);
 
 	/**
 	 * Distributes the columns from @a startColumn to @a endColumn evenly.
@@ -242,12 +242,12 @@
 	/**
 	 * Returns the position of @a column, or 0 if @a column does not exist.
 	 */
-	qreal columnPosition(int column) const;
+	double columnPosition(int column) const;
 
 	/**
 	 * Returns the list of column positions for the table.
 	 */
-	QList<qreal> columnPositions() const { return m_columnPositions; }
+	QList<double> columnPositions() const { return m_columnPositions; }
 
 	/**
 	 * Merges the cell at the specified @a row and @a column with the adjacent cells into
@@ -368,7 +368,7 @@
 	 * The returned handle describes what was hit. @a threshold is a distance in points.
 	 * @a point is considered to hit a handle if it is within @a threshold from it.
 	 */
-	TableHandle hitTest(const QPointF& point, qreal threshold) const;
+	TableHandle hitTest(const QPointF& point, double threshold) const;
 
 	/// Resizes the table to fit the frame.
 	void adjustTableToFrame();
@@ -502,26 +502,26 @@
 	bool validCell(int row, int column) const { return validRow(row) && validColumn(column); }
 
 	/// Returns the width of the widest border along the left side of this table.
-	qreal maxLeftBorderWidth() const;
+	double maxLeftBorderWidth() const;
 
 	/// Returns the width of the widest border along the right side of this table.
-	qreal maxRightBorderWidth() const;
+	double maxRightBorderWidth() const;
 
 	/// Returns the width of the widest border along the top side of this table.
-	qreal maxTopBorderWidth() const;
+	double maxTopBorderWidth() const;
 
 	/// Returns the width of the widest border along the bottom side of this table.
-	qreal maxBottomBorderWidth() const;
+	double maxBottomBorderWidth() const;
 
 	/// TODO: Turn these into strategies to be reused in resize gestures.
 	/// Resizes @a row according to the MoveFollowing strategy and returns the new height.
-	qreal resizeRowMoveFollowing(int row, qreal height);
+	double resizeRowMoveFollowing(int row, double height);
 	/// Resizes @a row according to the ResizeFollowing strategy and returns the new height.
-	qreal resizeRowResizeFollowing(int row, qreal height);
+	double resizeRowResizeFollowing(int row, double height);
 	/// Resizes @a column according to the MoveFollowing strategy and returns the new width.
-	qreal resizeColumnMoveFollowing(int row, qreal width);
+	double resizeColumnMoveFollowing(int row, double width);
 	/// Resizes @a column according to the ResizeFollowing strategy and returns the new width.
-	qreal resizeColumnResizeFollowing(int row, qreal width);
+	double resizeColumnResizeFollowing(int row, double width);
 
 	/**
 	 * Updates row and column spans following a change in rows or columns.
@@ -551,14 +551,14 @@
 	int m_columns;
 
 	/// Vertical positions of rows.
-	QList<qreal> m_rowPositions;
+	QList<double> m_rowPositions;
 	/// Height of rows.
-	QList<qreal> m_rowHeights;
+	QList<double> m_rowHeights;
 
 	/// Horizontal positions of columns.
-	QList<qreal> m_columnPositions;
+	QList<double> m_columnPositions;
 	/// Width of columns.
-	QList<qreal> m_columnWidths;
+	QList<double> m_columnWidths;
 
 	/// List of areas of merged cells.
 	QList<CellArea> m_cellAreas;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Wed Feb 15 21:57:43 2012
@@ -1792,8 +1792,9 @@
 		if (item->isTable())
 		{
 			//PTYPE == PageItem::Table or 16 (pageitem.h)
-			PageItem_Table* tableItem=item->asTable();
+			PageItem_Table* tableItem = item->asTable();
 			docu.writeStartElement("TableData");
+			docu.writeAttribute("FillColor", tableItem->fillColor());
 			//for each cell, write it to the doc
 			foreach (QList<TableCell> cellRow, tableItem->cellRows())
 			{

Modified: trunk/Scribus/scribus/tableborder.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/tableborder.cpp
==============================================================================
--- trunk/Scribus/scribus/tableborder.cpp (original)
+++ trunk/Scribus/scribus/tableborder.cpp Wed Feb 15 21:57:43 2012
@@ -27,7 +27,7 @@
 	setColor("Black");
 }
 
-TableBorderLine::TableBorderLine(qreal width, Qt::PenStyle style, const QString& color)
+TableBorderLine::TableBorderLine(double width, Qt::PenStyle style, const QString& color)
 {
 	setWidth(width);
 	setStyle(style);
@@ -43,12 +43,12 @@
  * TableBorder definitions.
  */
 
-TableBorder::TableBorder(qreal width, Qt::PenStyle style, const QString& color)
+TableBorder::TableBorder(double width, Qt::PenStyle style, const QString& color)
 {
 	addBorderLine(TableBorderLine(width, style, color));
 }
 
-qreal TableBorder::width() const
+double TableBorder::width() const
 {
 	return isNull() ? 0.0 : m_borderLines.first().width();
 }

Modified: trunk/Scribus/scribus/tableborder.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/tableborder.h
==============================================================================
--- trunk/Scribus/scribus/tableborder.h (original)
+++ trunk/Scribus/scribus/tableborder.h Wed Feb 15 21:57:43 2012
@@ -25,13 +25,13 @@
 	TableBorderLine();
 
 	/// Creates a new table border line with @a width, @a style and @a color.
-	TableBorderLine(qreal width, Qt::PenStyle style, const QString& color);
+	TableBorderLine(double width, Qt::PenStyle style, const QString& color);
 
 	/// Returns the width of this table border line.
-	qreal width() const { return m_width; }
+	double width() const { return m_width; }
 
 	/// Sets the width of this table border line to @a width.
-	void setWidth(qreal width) { m_width = width; }
+	void setWidth(double width) { m_width = width; }
 
 	/// Returns the pen style of this table border line.
 	Qt::PenStyle style() const { return m_style; }
@@ -62,7 +62,7 @@
 
 private:
 	/// The width of the table border line.
-	qreal m_width;
+	double m_width;
 	/// The pen style of the table border line.
 	Qt::PenStyle m_style;
 	/// The color of the table border line.
@@ -82,10 +82,10 @@
 	TableBorder() {}
 
 	/// Creates a new table border with a single border line with @a width, @a style and @a color.
-	TableBorder(qreal width, Qt::PenStyle style, const QString& color);
+	TableBorder(double width, Qt::PenStyle style, const QString& color);
 
 	/// Returns the width of the first table border line, or 0.0 if this is a null border.
-	qreal width() const;
+	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; }

Modified: trunk/Scribus/scribus/tablecell.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/tablecell.cpp
==============================================================================
--- trunk/Scribus/scribus/tablecell.cpp (original)
+++ trunk/Scribus/scribus/tablecell.cpp Wed Feb 15 21:57:43 2012
@@ -49,10 +49,10 @@
 	const int endRow = row() + rowSpan() - 1;
 	const int endCol = column() + columnSpan() - 1;
 
-	const qreal x = d->table->columnPosition(column());
-	const qreal y = d->table->rowPosition(row());
-	const qreal width = d->table->columnPosition(endCol) + d->table->columnWidth(endCol) - x;
-	const qreal height = d->table->rowPosition(endRow) + d->table->rowHeight(endRow) - y;
+	const double x = d->table->columnPosition(column());
+	const double y = d->table->rowPosition(row());
+	const double width = d->table->columnPosition(endCol) + d->table->columnWidth(endCol) - x;
+	const double height = d->table->rowPosition(endRow) + d->table->rowHeight(endRow) - y;
 
 	return QRectF(x, y, width, height);
 }
@@ -62,10 +62,10 @@
 	if (!isValid())
 		return QRectF();
 
-	const qreal x = d->textFrame->xPos();
-	const qreal y = d->textFrame->yPos();
-	const qreal width = d->textFrame->width();
-	const qreal height = d->textFrame->height();
+	const double x = d->textFrame->xPos();
+	const double y = d->textFrame->yPos();
+	const double width = d->textFrame->width();
+	const double height = d->textFrame->height();
 
 	return QRectF(x, y, width, height);
 }
@@ -94,25 +94,25 @@
 	d->table->updateCells();
 }
 
-void TableCell::setLeftPadding(qreal padding)
+void TableCell::setLeftPadding(double padding)
 {
 	d->style.setLeftPadding(padding);
 	d->table->updateCells();
 }
 
-void TableCell::setRightPadding(qreal padding)
+void TableCell::setRightPadding(double padding)
 {
 	d->style.setRightPadding(padding);
 	d->table->updateCells();
 }
 
-void TableCell::setTopPadding(qreal padding)
+void TableCell::setTopPadding(double padding)
 {
 	d->style.setTopPadding(padding);
 	d->table->updateCells();
 }
 
-void TableCell::setBottomPadding(qreal padding)
+void TableCell::setBottomPadding(double padding)
 {
 	d->style.setBottomPadding(padding);
 	d->table->updateCells();
@@ -162,12 +162,12 @@
 	return str;
 }
 
-qreal TableCell::maxLeftBorderWidth() const
-{
-	const int endRow = row() + rowSpan() - 1;
-
-	qreal maxWidth = 0.0;
-	qreal currentWidth = 0.0;
+double TableCell::maxLeftBorderWidth() const
+{
+	const int endRow = row() + rowSpan() - 1;
+
+	double maxWidth = 0.0;
+	double currentWidth = 0.0;
 	for (int currentRow = row(); currentRow <= endRow; ++currentRow)
 	{
 		TableCell cellLeft = d->table->cellAt(currentRow, column() - 1);
@@ -181,13 +181,13 @@
 	return maxWidth;
 }
 
-qreal TableCell::maxRightBorderWidth() const
-{
-	const int endRow = row() + rowSpan() - 1;
-	const int endCol = column() + columnSpan() - 1;
-
-	qreal maxWidth = 0.0;
-	qreal currentWidth = 0.0;
+double TableCell::maxRightBorderWidth() const
+{
+	const int endRow = row() + rowSpan() - 1;
+	const int endCol = column() + columnSpan() - 1;
+
+	double maxWidth = 0.0;
+	double currentWidth = 0.0;
 	for (int currentRow = row(); currentRow <= endRow; ++currentRow)
 	{
 		TableCell cellRight = d->table->cellAt(currentRow, endCol + 1);
@@ -201,12 +201,12 @@
 	return maxWidth;
 }
 
-qreal TableCell::maxTopBorderWidth() const
-{
-	const int endCol = column() + columnSpan() - 1;
-
-	qreal maxWidth = 0.0;
-	qreal currentWidth = 0.0;
+double TableCell::maxTopBorderWidth() const
+{
+	const int endCol = column() + columnSpan() - 1;
+
+	double maxWidth = 0.0;
+	double currentWidth = 0.0;
 	for (int currentCol = column(); currentCol <= endCol; ++currentCol)
 	{
 		TableCell cellAbove = d->table->cellAt(row() - 1, currentCol);
@@ -220,13 +220,13 @@
 	return maxWidth;
 }
 
-qreal TableCell::maxBottomBorderWidth() const
-{
-	const int endRow = row() + rowSpan() - 1;
-	const int endCol = column() + columnSpan() - 1;
-
-	qreal maxWidth = 0.0;
-	qreal currentWidth = 0.0;
+double TableCell::maxBottomBorderWidth() const
+{
+	const int endRow = row() + rowSpan() - 1;
+	const int endCol = column() + columnSpan() - 1;
+
+	double maxWidth = 0.0;
+	double currentWidth = 0.0;
 	for (int currentCol = column(); currentCol <= endCol; ++currentCol)
 	{
 		TableCell cellBelow = d->table->cellAt(endRow + 1, currentCol);

Modified: trunk/Scribus/scribus/tablecell.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/tablecell.h
==============================================================================
--- trunk/Scribus/scribus/tablecell.h (original)
+++ trunk/Scribus/scribus/tablecell.h Wed Feb 15 21:57:43 2012
@@ -166,28 +166,28 @@
 	TableBorder bottomBorder() const { return d->style.bottomBorder(); }
 
 	/// Sets the left padding of this cell to @a padding.
-	void setLeftPadding(qreal padding);
+	void setLeftPadding(double padding);
 
 	/// Returns the left padding of this cell.
-	qreal leftPadding() const { return d->style.leftPadding(); }
+	double leftPadding() const { return d->style.leftPadding(); }
 
 	/// Sets the right padding of this cell to @a padding.
-	void setRightPadding(qreal padding);
+	void setRightPadding(double padding);
 
 	/// Returns the right padding of this cell.
-	qreal rightPadding() const { return d->style.rightPadding(); }
+	double rightPadding() const { return d->style.rightPadding(); }
 
 	/// Sets the top padding of this cell to @a padding.
-	void setTopPadding(qreal padding);
+	void setTopPadding(double padding);
 
 	/// Returns the top padding of this cell.
-	qreal topPadding() const { return d->style.topPadding(); }
+	double topPadding() const { return d->style.topPadding(); }
 
 	/// Sets the bottom padding of this cell to @a padding.
-	void setBottomPadding(qreal padding);
+	void setBottomPadding(double padding);
 
 	/// Returns the bottom padding of this cell.
-	qreal bottomPadding() const { return d->style.bottomPadding(); }
+	double bottomPadding() const { return d->style.bottomPadding(); }
 
 	/// Sets the cell style for this cell to @a style.
 	void setStyle(const QString& style);
@@ -234,13 +234,13 @@
 	void moveLeft(int numColumns) { d->column -= numColumns; }
 
 	/// Returns the maximum border width found along left side of cell.
-	qreal maxLeftBorderWidth() const;
+	double maxLeftBorderWidth() const;
 	/// Returns the maximum border width found along right side of cell.
-	qreal maxRightBorderWidth() const;
+	double maxRightBorderWidth() const;
 	/// Returns the maximum border width found along top side of cell.
-	qreal maxTopBorderWidth() const;
+	double maxTopBorderWidth() const;
 	/// Returns the maximum border width found along bottom side of cell.
-	qreal maxBottomBorderWidth() const;
+	double maxBottomBorderWidth() const;
 
 private:
 	friend class PageItem_Table;

Modified: trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.cpp Wed Feb 15 21:57:43 2012
@@ -22,7 +22,7 @@
 	tableColumnWidth->setMinimum(PageItem_Table::MinimumColumnWidth * m_doc->unitRatio());
 }
 
-qreal TableColumnWidthsDialog::columnWidth() const
+double TableColumnWidthsDialog::columnWidth() const
 {
 	Q_ASSERT(m_doc);
 

Modified: trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.h (original)
+++ trunk/Scribus/scribus/ui/tablecolumnwidthsdialog.h Wed Feb 15 21:57:43 2012
@@ -24,7 +24,7 @@
 	explicit TableColumnWidthsDialog(ScribusDoc* doc, QWidget *parent = 0);
 
 	/// Returns the column width the user entered.
-	qreal columnWidth() const;
+	double columnWidth() const;
 
 private:
 	ScribusDoc* m_doc;

Modified: trunk/Scribus/scribus/ui/tablerowheightsdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/ui/tablerowheightsdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tablerowheightsdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/tablerowheightsdialog.cpp Wed Feb 15 21:57:43 2012
@@ -22,7 +22,7 @@
 	tableRowHeight->setMinimum(PageItem_Table::MinimumRowHeight * m_doc->unitRatio());
 }
 
-qreal TableRowHeightsDialog::rowHeight() const
+double TableRowHeightsDialog::rowHeight() const
 {
 	Q_ASSERT(m_doc);
 

Modified: trunk/Scribus/scribus/ui/tablerowheightsdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/ui/tablerowheightsdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/tablerowheightsdialog.h (original)
+++ trunk/Scribus/scribus/ui/tablerowheightsdialog.h Wed Feb 15 21:57:43 2012
@@ -24,7 +24,7 @@
 	explicit TableRowHeightsDialog(ScribusDoc* doc, QWidget *parent = 0);
 
 	/// Returns the row height the user entered.
-	qreal rowHeight() const;
+	double rowHeight() const;
 
 private:
 	ScribusDoc* m_doc;

Modified: trunk/Scribus/scribus/ui/tablesideselector.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17302&path=/trunk/Scribus/scribus/ui/tablesideselector.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tablesideselector.cpp (original)
+++ trunk/Scribus/scribus/ui/tablesideselector.cpp Wed Feb 15 21:57:43 2012
@@ -49,8 +49,8 @@
 
 void TableSideSelector::paintEvent(QPaintEvent* event)
 {
-	qreal edgeWidth = 5;
-	qreal inset = edgeWidth/2 + frameWidth()*2;
+	double edgeWidth = 5;
+	double inset = edgeWidth/2 + frameWidth()*2;
 
 	QPointF topLeft(inset, inset);
 	QPointF topRight(width() - inset, inset);
@@ -120,11 +120,11 @@
 
 TableSideSelector::Side TableSideSelector::closestSide(const QPointF& point) const
 {
-	QList<QPair<qreal, Side> > distances;
-	distances.append(QPair<qreal, Side>(QLineF(point, m_left.pointAt(0.5)).length(), Left));
-	distances.append(QPair<qreal, Side>(QLineF(point, m_right.pointAt(0.5)).length(), Right));
-	distances.append(QPair<qreal, Side>(QLineF(point, m_top.pointAt(0.5)).length(), Top));
-	distances.append(QPair<qreal, Side>(QLineF(point, m_bottom.pointAt(0.5)).length(), Bottom));
+	QList<QPair<double, Side> > distances;
+	distances.append(QPair<double, Side>(QLineF(point, m_left.pointAt(0.5)).length(), Left));
+	distances.append(QPair<double, Side>(QLineF(point, m_right.pointAt(0.5)).length(), Right));
+	distances.append(QPair<double, Side>(QLineF(point, m_top.pointAt(0.5)).length(), Top));
+	distances.append(QPair<double, Side>(QLineF(point, m_bottom.pointAt(0.5)).length(), Bottom));
 	qSort(distances);
 
 	return distances.first().second;




More information about the scribus-commit mailing list