[Libreoffice-commits] libvisio.git: 2 commits - src/lib
Fridrich Štrba
fridrich.strba at bluewin.ch
Tue Dec 15 04:09:04 PST 2015
src/lib/VSDContentCollector.cpp | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
New commits:
commit dc440a5e00a655839bb5c7c8b360f8aaca3529d3
Author: Fridrich Štrba <fridrich.strba at bluewin.ch>
Date: Tue Dec 15 13:08:40 2015 +0100
Fix several paragraphs with the same character properties
Change-Id: I6dc3cd2be929b6213f3fb4f415a997f3211765ab
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index cf17936..be5fa13 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -445,8 +445,8 @@ void libvisio::VSDContentCollector::_flushText()
m_shapeOutputText->addStartTextObject(textBlockProps);
- unsigned int charIndex = 0;
- unsigned int paraCharCount = 0;
+ unsigned charIndex = 0;
+ unsigned paraCharCount = 0;
unsigned long textBufferPosition = 0;
const unsigned char *pTextBuffer = m_textStream.getDataBuffer();
const unsigned long nTextBufferLength = m_textStream.size();
@@ -499,6 +499,15 @@ void libvisio::VSDContentCollector::_flushText()
// Find char format that overlaps
while (charIndex < m_charFormats.size() && paraCharCount)
{
+ if (paraCharCount < m_charFormats[charIndex].charCount)
+ {
+ // Insert duplicate
+ std::vector<VSDCharStyle>::iterator charIt = m_charFormats.begin() + charIndex;
+ VSDCharStyle tmpCharFormat = m_charFormats[charIndex];
+ m_charFormats.insert(charIt, tmpCharFormat);
+ m_charFormats[charIndex].charCount = paraCharCount;
+ m_charFormats[charIndex+1].charCount -= paraCharCount;
+ }
paraCharCount -= m_charFormats[charIndex].charCount;
librevenge::RVNGPropertyList textProps;
@@ -623,15 +632,6 @@ void libvisio::VSDContentCollector::_flushText()
m_shapeOutputText->addCloseSpan();
charIndex++;
- if (charIndex < m_charFormats.size() && paraCharCount && m_charFormats[charIndex].charCount > paraCharCount)
- {
- // Insert duplicate
- std::vector<VSDCharStyle>::iterator charIt = m_charFormats.begin() + charIndex;
- VSDCharStyle tmpCharFormat = m_charFormats[charIndex];
- m_charFormats.insert(charIt, tmpCharFormat);
- m_charFormats[charIndex].charCount = paraCharCount;
- m_charFormats[charIndex+1].charCount -= paraCharCount;
- }
}
m_shapeOutputText->addCloseParagraph();
}
commit 75001ca3c32757f08ed38ed9a64c50e7657c6002
Author: Fridrich Štrba <fridrich.strba at bluewin.ch>
Date: Tue Dec 15 10:49:21 2015 +0100
Output default tab-stop
Change-Id: Ic80a63e1d5ce827a5a7054413c9cab989c4fb19a
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index abf57bf..cf17936 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -461,6 +461,8 @@ void libvisio::VSDContentCollector::_flushText()
paraProps.insert("fo:margin-right", (*paraIt).indRight);
paraProps.insert("fo:margin-top", (*paraIt).spBefore);
paraProps.insert("fo:margin-bottom", (*paraIt).spAfter);
+ if (m_textBlockStyle.defaultTabStop > 0.0)
+ paraProps.insert("style:tab-stop-distance", m_textBlockStyle.defaultTabStop);
switch ((*paraIt).align)
{
case 0: // left
More information about the Libreoffice-commits
mailing list