diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-27 22:55:40 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-27 22:55:40 +0100 |
commit | f81b6a04609f1164ea4a006af43c2e9ce6dbf242 (patch) | |
tree | 8e637d39ee2e12ef8c288fe6eee6a113e738cdc2 | |
parent | 24a9ae3175685a60079547bfdea65a4a4c7eabc4 (diff) |
Avoid paragraphs without span and thus fix make check
Change-Id: Id9376f0c4f63d092771d6c505b0ef9989e531005
-rw-r--r-- | src/lib/VSDContentCollector.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index 17a6a38..899c837 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -468,6 +468,7 @@ void libvisio::VSDContentCollector::_flushText() bool isParagraphOpened(false); bool isSpanOpened(false); + bool isParagraphWithoutSpan(false); std::vector<VSDParaStyle>::const_iterator paraIt = m_paraFormats.begin(); std::vector<VSDCharStyle>::const_iterator charIt = m_charFormats.begin(); @@ -516,9 +517,13 @@ void libvisio::VSDContentCollector::_flushText() else m_shapeOutputText->addOpenListElement(paraProps); isParagraphOpened = true; + isParagraphWithoutSpan = true; } - if (!isSpanOpened && (*(textIt()) != '\n')) // Avoid an empty span + /* Avoid empty span but also a paragraph without span at all. + * This allows editing of the empty paragraph after the import, + * using the original span properties. */ + if (!isSpanOpened && ((*(textIt()) != '\n') || isParagraphWithoutSpan)) { librevenge::RVNGPropertyList textProps; _fillCharProperties(textProps, *charIt); @@ -534,6 +539,7 @@ void libvisio::VSDContentCollector::_flushText() } m_shapeOutputText->addOpenSpan(textProps); isSpanOpened = true; + isParagraphWithoutSpan = false; } if (*(textIt()) == '\n') |