From: Abdelrazak Younes Date: Thu, 6 Dec 2007 08:39:42 +0000 (+0000) Subject: Code simplification. We don't need to memorize the current Row hfill anymore. X-Git-Tag: 1.6.10~7035 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=eb96d94ce7a3dddba58091fa23b4e1ed95477691;p=features.git Code simplification. We don't need to memorize the current Row hfill anymore. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21987 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Row.cpp b/src/Row.cpp index f4e6201435..c1a2e6cd7b 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -24,13 +24,13 @@ namespace lyx { Row::Row() - : separator(0), hfill(0), label_hfill(0), x(0), + : separator(0), label_hfill(0), x(0), sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(0), end_(0) {} Row::Row(pos_type pos) - : separator(0), hfill(0), label_hfill(0), x(0), + : separator(0), label_hfill(0), x(0), sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(pos), end_(0) {} diff --git a/src/Row.h b/src/Row.h index cb25a4dcd9..ae8ed71fd1 100644 --- a/src/Row.h +++ b/src/Row.h @@ -68,8 +68,6 @@ public: /// width of a separator (i.e. space) double separator; - /// width of hfills in the body - double hfill; /// width of hfills in the label double label_hfill; /// the x position of the row diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 737024af1b..4adffdcdd8 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -513,7 +513,6 @@ void TextMetrics::computeRowMetrics(pit_type const pit, Row & row, int width) const { row.label_hfill = 0; - row.hfill = 0; row.separator = 0; Buffer & buffer = bv_->buffer(); @@ -553,12 +552,11 @@ void TextMetrics::computeRowMetrics(pit_type const pit, row.label_hfill = labelFill(pit, row) / double(nlh); } - // are there any hfills in the row? - int const nh = numberOfHfills(par, row); - - if (nh) { - if (w > 0) - row.hfill = w / nh; + double hfill = 0; + if (w > 0) { + // are there any hfills in the row? + if (int nh = numberOfHfills(par, row)) + hfill = w / double(nh); // we don't have to look at the alignment if it is ALIGN_LEFT and // if the row is already larger then the permitted width as then // we force the LEFT_ALIGN'edness! @@ -653,7 +651,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit, continue; Dimension dim = row.dimension(); if (pm.hfillExpansion(row, ii->pos)) - dim.wid = int(ii->pos >= body_pos ? row.hfill : row.label_hfill); + dim.wid = int(ii->pos >= body_pos ? hfill : row.label_hfill); else dim.wid = 3; // Cache the inset dimension.