From 0ddf7f86b0157cd45bde038d462e47f62dca0d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sat, 10 Jun 2017 01:57:16 -0300 Subject: Group all of the ParagraphInfo class implementation --- src/libnrtype/Layout-TNG-Compute.cpp | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'src/libnrtype') 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 char_attributes; ///< For every character in the paragraph. std::vector unbroken_spans; - template static void free_sequence(T &seq); - void free(); + template 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 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 -- cgit v1.2.3