summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-05-15 09:59:18 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-05-15 10:30:37 +0200
commit4a816a816e8b4e213394898bd0e307dd90fcbb64 (patch)
tree762499fd1fb6ade7faeea9072da3422995b59c1c /writerfilter/source
parentafeabb04605c3280326e78a4dee3511f21710604 (diff)
fdo#62977 allow SAL_MAX_INT16..SAL_MAX_UINT16 when importing RTF_U
Change-Id: Ie36d5881b0ebe8c38526690ca27d02bfb7af7829
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 361ab17c5911..9943d7471147 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3061,7 +3061,10 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().nUc = nParam;
break;
case RTF_U:
- if ((SAL_MIN_INT16 <= nParam) && (nParam <= SAL_MAX_INT16))
+ // sal_Unicode is unsigned 16-bit, RTF may represent that as a
+ // signed SAL_MIN_INT16..SAL_MAX_INT16 or 0..SAL_MAX_UINT16. The
+ // static_cast() will do the right thing.
+ if ((SAL_MIN_INT16 <= nParam) && (nParam <= SAL_MAX_UINT16))
{
m_aUnicodeBuffer.append(static_cast<sal_Unicode>(nParam));
m_aStates.top().nCharsToSkip = m_aStates.top().nUc;