diff options
author | Sebastian Geerken <devnull@localhost> | 2014-07-22 15:58:24 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-07-22 15:58:24 +0200 |
commit | b6aeac03a3e6c5f4ea7edaad9a42b79cf5a8fe10 (patch) | |
tree | ea92b6c09c3f254693f3ac609997e0e4743e907d /dw | |
parent | 6cfa2fc2dc1613cd6589cf76a3b425a71e17e7ce (diff) |
Adjust_table_min_width is also applied to table cells (to avoid inconsistent rendering).
Diffstat (limited to 'dw')
-rw-r--r-- | dw/alignedtablecell.cc | 6 | ||||
-rw-r--r-- | dw/alignedtablecell.hh | 2 | ||||
-rw-r--r-- | dw/simpletablecell.cc | 6 | ||||
-rw-r--r-- | dw/simpletablecell.hh | 3 | ||||
-rw-r--r-- | dw/table.cc | 17 | ||||
-rw-r--r-- | dw/table.hh | 3 | ||||
-rw-r--r-- | dw/widget.cc | 1 |
7 files changed, 34 insertions, 4 deletions
diff --git a/dw/alignedtablecell.cc b/dw/alignedtablecell.cc index a9f091f3..f1e1203a 100644 --- a/dw/alignedtablecell.cc +++ b/dw/alignedtablecell.cc @@ -20,6 +20,7 @@ #include "alignedtablecell.hh" +#include "table.hh" #include "../lout/debug.hh" #include <stdio.h> @@ -62,6 +63,11 @@ int AlignedTableCell::applyPerHeight (int containerHeight, return core::style::multiplyWithPerLength (containerHeight, perHeight); } +bool AlignedTableCell::getAdjustMinWidth () +{ + return Table::getAdjustTableMinWidth (); +} + int AlignedTableCell::wordWrap(int wordIndex, bool wrapAll) { Textblock::Word *word; diff --git a/dw/alignedtablecell.hh b/dw/alignedtablecell.hh index caf59307..20733bce 100644 --- a/dw/alignedtablecell.hh +++ b/dw/alignedtablecell.hh @@ -12,6 +12,8 @@ private: int charWordIndex, charWordPos; protected: + bool getAdjustMinWidth (); + int wordWrap (int wordIndex, bool wrapAll); int getValue (); diff --git a/dw/simpletablecell.cc b/dw/simpletablecell.cc index 083deaed..43dec92a 100644 --- a/dw/simpletablecell.cc +++ b/dw/simpletablecell.cc @@ -20,6 +20,7 @@ #include "simpletablecell.hh" +#include "table.hh" #include "../lout/debug.hh" namespace dw { @@ -38,6 +39,11 @@ SimpleTableCell::~SimpleTableCell() DBG_OBJ_DELETE (); } +bool SimpleTableCell::getAdjustMinWidth () +{ + return Table::getAdjustTableMinWidth (); +} + bool SimpleTableCell::isBlockLevel () { return false; diff --git a/dw/simpletablecell.hh b/dw/simpletablecell.hh index a452add9..45a6d31f 100644 --- a/dw/simpletablecell.hh +++ b/dw/simpletablecell.hh @@ -7,6 +7,9 @@ namespace dw { class SimpleTableCell: public Textblock { +protected: + bool getAdjustMinWidth (); + public: static int CLASS_ID; diff --git a/dw/table.cc b/dw/table.cc index b19db790..3959f01a 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -894,7 +894,7 @@ void Table::forceCalcCellSizes (bool calcHeights) colWidths, 0); } else { DBG_OBJ_MSGF ("resize", 1, - "subcase 2b: %d columns with specified width", + "subcase 2b: %d column(s) with specified width", numColWidthSpecified); // Seperate columns with specified and unspecified width, and @@ -943,15 +943,26 @@ void Table::forceCalcCellSizes (bool calcHeights) DBG_OBJ_MSG_END (); } + DBG_OBJ_MSG ("resize", 1, "finally setting column widths:"); + DBG_OBJ_MSG_START (); + colWidths->setSize (colExtremes->size()); indexNotSpecified = 0; for (int col = 0; col < colExtremes->size(); col++) - if (colWidthSpecified->get (col)) + if (colWidthSpecified->get (col)) { + DBG_OBJ_MSGF ("resize", 1, "#%d: specified, gets maximum %d", + col, colExtremes->getRef(col)->maxWidth); colWidths->set (col, colExtremes->getRef(col)->maxWidth); - else { + } else { + DBG_OBJ_MSGF ("resize", 1, "#%d: not specified, gets value %d " + "at position %d from temporary list", + col, apportionDest.get (indexNotSpecified), + indexNotSpecified); colWidths->set (col, apportionDest.get (indexNotSpecified)); indexNotSpecified++; } + + DBG_OBJ_MSG_END (); } } else { // Normal apportioning. diff --git a/dw/table.hh b/dw/table.hh index 109bbf30..a20e8c6b 100644 --- a/dw/table.hh +++ b/dw/table.hh @@ -491,6 +491,9 @@ public: inline static void setAdjustTableMinWidth (bool adjustTableMinWidth) { Table::adjustTableMinWidth = adjustTableMinWidth; } + inline static int getAdjustTableMinWidth () + { return Table::adjustTableMinWidth; } + Table(bool limitTextWidth); ~Table(); diff --git a/dw/widget.cc b/dw/widget.cc index 9cf53ec4..7192008a 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -760,7 +760,6 @@ void Widget::getExtremes (Extremes *extremes) assert (!queueResizeEntered ()); DBG_OBJ_ENTER0 ("resize", 0, "getExtremes"); - DBG_OBJ_MSG_START (); enterGetExtremes (); |