diff options
| author | Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> | 2019-05-03 02:52:43 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2019-05-12 12:32:48 +0000 |
| commit | 795066a6e73505878709fd367defc15be94d5b1a (patch) | |
| tree | 8661987c28bd97d61ae8490a783b5fcd1d586cd1 /src/libnrtype | |
| parent | Add Delete to Objects Dialog context menu (diff) | |
| download | inkscape-795066a6e73505878709fd367defc15be94d5b1a.tar.gz inkscape-795066a6e73505878709fd367defc15be94d5b1a.zip | |
Stop crash on newline when entering rtl text
Fixes https://gitlab.com/inkscape/inkscape/issues/72
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/Layout-TNG-Compute.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index 76a1e4708..e3f53f820 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -711,12 +711,10 @@ void Layout::Calculator::_outputLine(ParagraphInfo const ¶, counter_directional_width_remaining = 0.0; std::vector<BrokenSpan>::const_iterator it_following_span; for (it_following_span = it_span ; it_following_span != it_chunk->broken_spans.end() ; it_following_span++) { + if (_flow._input_stream[it_following_span->start.iter_span->input_index]->Type() == CONTROL_CODE) break; Layout::Direction following_span_progression = static_cast<InputStreamTextSource const *>(_flow._input_stream[it_following_span->start.iter_span->input_index])->styleGetBlockProgression(); if (!Layout::_directions_are_orthogonal(following_span_progression, _block_progression)) { - if (it_following_span->start.iter_span->pango_item_index == -1) { // when the span came from a control code - if (new_span.direction != para.direction) break; - } else - if (new_span.direction != (para.pango_items[it_following_span->start.iter_span->pango_item_index].item->analysis.level & 1 ? RIGHT_TO_LEFT : LEFT_TO_RIGHT)) break; + if (new_span.direction != (para.pango_items[it_following_span->start.iter_span->pango_item_index].item->analysis.level & 1 ? RIGHT_TO_LEFT : LEFT_TO_RIGHT)) break; } counter_directional_width_remaining += direction_sign * (it_following_span->width + it_following_span->whitespace_count * add_to_each_whitespace); } |
