diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-06-19 12:25:32 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-06-19 12:25:32 +0200 |
commit | 0618ceafcdcddb22d9c3a07ebb5a6642e08ecb75 (patch) | |
tree | 923a518d15d265ebd1f4fc4185278035c2aa002d | |
parent | 43d13b0962879d84adfe3933bb6687bcfe2d3e3f (diff) |
Sync this with libcdr
-rw-r--r-- | src/lib/libvisio_utils.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libvisio_utils.cpp b/src/lib/libvisio_utils.cpp index 22b6507..d73ba4d 100644 --- a/src/lib/libvisio_utils.cpp +++ b/src/lib/libvisio_utils.cpp @@ -430,13 +430,12 @@ void libvisio::appendCharacters(WPXString &text, const std::vector<unsigned char void libvisio::appendCharacters(WPXString &text, const std::vector<unsigned char> &characters) { - std::vector<unsigned char>::const_iterator iter = characters.begin(); - while (iter != characters.end()) + for (std::vector<unsigned char>::const_iterator iter = characters.begin(); + iter != characters.end();) { uint16_t high_surrogate = 0; bool fail = false; uint32_t ucs4Character = 0; - uint16_t character = 0; while (true) { if (iter == characters.end()) @@ -444,7 +443,7 @@ void libvisio::appendCharacters(WPXString &text, const std::vector<unsigned char fail = true; break; } - character = *iter++; + uint16_t character = *iter++; character |= (uint16_t)(*iter++) << 8; if (character >= 0xdc00 && character < 0xe000) /* low surrogate */ { |