summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2011-09-09 12:54:10 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-09-09 12:54:10 +0200
commit8f1069afd65d60704f4e81cfb905a8134c66781f (patch)
tree9e885ee07ba8e7273d48b03f88b5df9266732803
parent45032bb9d5287ad9b70717386c9e431974cea074 (diff)
Some cosmetical fixes
-rw-r--r--src/lib/VSD11Parser.cpp4
-rw-r--r--src/lib/VSDXContentCollector.cpp24
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/VSD11Parser.cpp b/src/lib/VSD11Parser.cpp
index 665f0fb..fbd50a8 100644
--- a/src/lib/VSD11Parser.cpp
+++ b/src/lib/VSD11Parser.cpp
@@ -114,7 +114,7 @@ void libvisio::VSD11Parser::readText(WPXInputStream *input)
void libvisio::VSD11Parser::readCharIX(WPXInputStream *input)
{
- WPXString fontFace = "Arial";
+ WPXString fontFace("Arial");
unsigned charCount = readU32(input);
unsigned short fontID = readU16(input);
input->seek(1, WPX_SEEK_CUR); // Color ID
@@ -216,7 +216,7 @@ void libvisio::VSD11Parser::readFillStyle(WPXInputStream *input)
void libvisio::VSD11Parser::readCharIXStyle(WPXInputStream *input)
{
- WPXString fontFace = "Arial";
+ WPXString fontFace("Arial");
unsigned charCount = readU32(input);
unsigned short fontID = readU16(input);
input->seek(1, WPX_SEEK_CUR); // Color ID
diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index 3f7050f..9b1fcb9 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -148,7 +148,18 @@ void libvisio::VSDXContentCollector::_flushText()
{
text.clear();
- if (m_textFormat == VSD_TEXT_ANSI)
+ if (m_textFormat == VSD_TEXT_UTF16)
+ {
+ unsigned long max = m_charFormats[i].charCount <= (m_textStream.size()/2) ? m_charFormats[i].charCount : (m_textStream.size()/2);
+ VSD_DEBUG_MSG(("Charcount: %d, max: %lu, stream size: %lu\n", m_charFormats[i].charCount, max, (unsigned long)m_textStream.size()));
+ max = (m_charFormats[i].charCount == 0 && m_textStream.size()) ? m_textStream.size()/2 : max;
+ VSD_DEBUG_MSG(("Charcount: %d, max: %lu, stream size: %lu\n", m_charFormats[i].charCount, max, (unsigned long)m_textStream.size()));
+ VSDInternalStream tmpStream(m_textStream, max*2);
+ _appendUTF16LE(text, &tmpStream);
+
+ m_textStream.erase(m_textStream.begin(), m_textStream.begin() + (max*2));
+ }
+ else
{
unsigned long max = m_charFormats[i].charCount <= m_textStream.size() ? m_charFormats[i].charCount : m_textStream.size();
max = (m_charFormats[i].charCount == 0 && m_textStream.size()) ? m_textStream.size() : max;
@@ -162,17 +173,6 @@ void libvisio::VSDXContentCollector::_flushText()
m_textStream.erase(m_textStream.begin(), m_textStream.begin() + max);
}
- else if (m_textFormat == VSD_TEXT_UTF16)
- {
- unsigned long max = m_charFormats[i].charCount <= (m_textStream.size()/2) ? m_charFormats[i].charCount : (m_textStream.size()/2);
- VSD_DEBUG_MSG(("Charcount: %d, max: %lu, stream size: %lu\n", m_charFormats[i].charCount, max, (unsigned long)m_textStream.size()));
- max = (m_charFormats[i].charCount == 0 && m_textStream.size()) ? m_textStream.size()/2 : max;
- VSD_DEBUG_MSG(("Charcount: %d, max: %lu, stream size: %lu\n", m_charFormats[i].charCount, max, (unsigned long)m_textStream.size()));
- VSDInternalStream tmpStream(m_textStream, max*2);
- _appendUTF16LE(text, &tmpStream);
-
- m_textStream.erase(m_textStream.begin(), m_textStream.begin() + (max*2));
- }
WPXPropertyList textProps;
if (m_fonts[m_charFormats[i].faceID] == "")
textProps.insert("style:font-name", m_charFormats[i].face);