summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-02-22 17:06:18 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-02-22 17:13:22 +0100
commit0915f1b3d77afa694a2ca692aec307846827da99 (patch)
tree6cc521135822e5d1d0e81d953430305ddc6a9a69
parent0389b77a3cbea09ddbae238d7934d4c6349a8d37 (diff)
fdo#42465 fix RTF import of unicode characters with backwards compatibility
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 581f9123f8ad..f293bf6a10ba 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -732,6 +732,7 @@ int RTFDocumentImpl::resolveChars(char ch)
OStringBuffer aBuf;
bool bUnicodeChecked = false;
+ bool bSkipped = false;
while(!Strm().IsEof() && ch != '{' && ch != '}' && ch != '\\')
{
if (ch != 0x0d && ch != 0x0a)
@@ -746,7 +747,10 @@ int RTFDocumentImpl::resolveChars(char ch)
aBuf.append(ch);
}
else
+ {
+ bSkipped = true;
m_aStates.top().nCharsToSkip--;
+ }
}
// read a single char if we're in hex mode
if (m_aStates.top().nInternalState == INTERNAL_HEX)
@@ -758,7 +762,8 @@ int RTFDocumentImpl::resolveChars(char ch)
if (m_aStates.top().nInternalState == INTERNAL_HEX)
{
- m_aHexBuffer.append(ch);
+ if (!bSkipped)
+ m_aHexBuffer.append(ch);
return 0;
}