summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2c851b95a2fb..48124554481d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3805,9 +3805,11 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
if (bHex && !m_aHexBuffer.isEmpty())
{
rtl_TextEncoding nEncoding = m_aStates.top().getCurrentEncoding();
- if ((m_aStates.top().getDestination() == Destination::FONTENTRY
- || m_aStates.top().getDestination() == Destination::FIELDINSTRUCTION)
- && m_aStates.top().getCurrentEncoding() == RTL_TEXTENCODING_SYMBOL)
+ if (nEncoding == RTL_TEXTENCODING_SYMBOL
+ && (m_aStates.top().getDestination() == Destination::FONTENTRY
+ || (m_aStates.size() > 1
+ && m_aStates[m_aStates.size() - 2].getDestination()
+ == Destination::FIELDINSTRUCTION)))
nEncoding = RTL_TEXTENCODING_MS_1252;
OUString aString = OStringToOUString(m_aHexBuffer, nEncoding);
m_aHexBuffer.setLength(0);