summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-05-08 15:19:23 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-05-08 15:19:23 +0000
commit72d3556428cd68013cb604a708f27d3de0f60855 (patch)
tree7012c1472c435f94b02812d855980db3192a3f53 /src/libnrtype
parentfixes a few of jenkins warnings (diff)
downloadinkscape-72d3556428cd68013cb604a708f27d3de0f60855.tar.gz
inkscape-72d3556428cd68013cb604a708f27d3de0f60855.zip
fix for bug 1391374.
apparently, libnrtype drastically misses unit tests. Fixed bugs: - https://launchpad.net/bugs/1391374 (bzr r14127)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-OutIter.cpp4
-rw-r--r--src/libnrtype/Layout-TNG.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp
index c9c318960..707897f50 100644
--- a/src/libnrtype/Layout-TNG-OutIter.cpp
+++ b/src/libnrtype/Layout-TNG-OutIter.cpp
@@ -788,12 +788,12 @@ bool Layout::iterator::prevLineCursor(int n)
{
if (!_cursor_moving_vertically)
beginCursorUpDown();
- unsigned line_index;
+ int line_index;
if (_char_index == _parent_layout->_characters.size())
line_index = _parent_layout->_lines.size() - 1;
else
line_index = _parent_layout->_characters[_char_index].chunk(_parent_layout).in_line;
- if (line_index == 0)
+ if (line_index <= 0)
return false; // nowhere to go
else
n = MIN (n, static_cast<int>(line_index));
diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h
index e91c32ebe..26db1fad9 100644
--- a/src/libnrtype/Layout-TNG.h
+++ b/src/libnrtype/Layout-TNG.h
@@ -701,7 +701,11 @@ private:
/** The overall block-progression of the whole flow. */
inline Direction _blockProgression() const
- {return static_cast<InputStreamTextSource*>(_input_stream.front())->styleGetBlockProgression();}
+ {
+ if(!_input_stream.empty())
+ return static_cast<InputStreamTextSource*>(_input_stream.front())->styleGetBlockProgression();
+ return TOP_TO_BOTTOM;
+ }
/** so that LEFT_TO_RIGHT == RIGHT_TO_LEFT but != TOP_TO_BOTTOM */
static bool _directions_are_orthogonal(Direction d1, Direction d2);