aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-11-14 14:04:25 +0100
committerSebastian Geerken <devnull@localhost>2012-11-14 14:04:25 +0100
commit53e9245bcbaea2b7b4485369aa2289f1d102f26c (patch)
tree686a6e3125fca5c7889d2010633d697704bf33c9 /dw/textblock.cc
parent7a991750e1f7bdfe6bd39f95343cc742d00c6596 (diff)
Cleaned up preferences.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 213594d3..f6e1ad9c 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -46,7 +46,18 @@ Textblock::DivChar Textblock::divChars[NUM_DIV_CHARS] = {
{ "\xe2\x80\x94", false, true, PENALTY_HYPHEN, PENALTY_HYPHEN }
};
-Textblock::Textblock (bool limitTextWidth, int penaltyHyphen)
+
+int Textblock::penalties[PENALTY_NUM][2] = {
+ { 100, 100 }
+};
+
+void Textblock::init (int penaltyHyphen, int penaltyHyphen2)
+{
+ penalties[PENALTY_HYPHEN][0] = penaltyHyphen;
+ penalties[PENALTY_HYPHEN][1] = penaltyHyphen2;
+}
+
+Textblock::Textblock (bool limitTextWidth)
{
registerName ("dw::Textblock", &CLASS_ID);
setFlags (BLOCK_LEVEL);
@@ -92,8 +103,6 @@ Textblock::Textblock (bool limitTextWidth, int penaltyHyphen)
availDescent = 0;
this->limitTextWidth = limitTextWidth;
- penalties[PENALTY_HYPHEN][0] = penaltyHyphen;
- penalties[PENALTY_HYPHEN][1] = INT_MAX; // TODO Configuration
for (int layer = 0; layer < core::HIGHLIGHT_NUM_LAYERS; layer++) {
/* hlStart[layer].index > hlEnd[layer].index means no highlighting */