diff options
| author | Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org> | 2017-06-10 04:57:16 +0000 |
|---|---|---|
| committer | Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org> | 2017-06-10 04:57:16 +0000 |
| commit | 0ddf7f86b0157cd45bde038d462e47f62dca0d70 (patch) | |
| tree | eeed9a1d148c3420271c6a93f83a24c871c4b417 | |
| parent | libnrtype/Layout-TNG refactoring for better code legibility (diff) | |
| download | inkscape-0ddf7f86b0157cd45bde038d462e47f62dca0d70.tar.gz inkscape-0ddf7f86b0157cd45bde038d462e47f62dca0d70.zip | |
Group all of the ParagraphInfo class implementation
| -rw-r--r-- | src/libnrtype/Layout-TNG-Compute.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index 79fdadb54..c3f634897 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -183,17 +183,26 @@ class Layout::Calculator std::vector<PangoLogAttr> char_attributes; ///< For every character in the paragraph. std::vector<UnbrokenSpan> unbroken_spans; - template<typename T> static void free_sequence(T &seq); - void free(); + template<typename T> static void free_sequence(T &seq) + { + for (typename T::iterator it(seq.begin()); it != seq.end(); ++it) { + it->free(); + } + seq.clear(); + } + + void free() + { + free_sequence(input_items); + free_sequence(pango_items); + free_sequence(unbroken_spans); + } }; -/* *********************************************************************************************************/ -// Initialisation of ParagraphInfo structure -#if 0 /* unused */ - void _initialiseInputItems(ParagraphInfo *para) const; -#endif +/* *********************************************************************************************************/ +// Initialisation of ParagraphInfo structure void _buildPangoItemizationForPara(ParagraphInfo *para) const; @@ -953,21 +962,6 @@ void Layout::Calculator::BrokenSpan::setZero() word_spacing = 0.0; } -template<typename T> void Layout::Calculator::ParagraphInfo::free_sequence(T &seq) -{ - for (typename T::iterator it(seq.begin()); it != seq.end(); ++it) { - it->free(); - } - seq.clear(); -} - -void Layout::Calculator::ParagraphInfo::free() -{ - free_sequence(input_items); - free_sequence(pango_items); - free_sequence(unbroken_spans); -} - ///** // * For sections of text with a block-progression different to the rest // * of the flow, the best thing to do is to detect them in advance and |
