From b9508dd55f82d35f09a58021dc001cf79b390e08 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 6 Jun 2012 12:58:07 +0200 Subject: fdo#50665 rtftok: don't ignore character properties of text fields The dmapper part was already fixed in commit 9486851baea59d16c449d79bd61a38f6e686cfe0 for DOCX, this fixes the RTF tokenizer. Change-Id: Iaca706e50367bb744f5a03e15134bda1646df8fc --- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 +++++-- writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'writerfilter/source/rtftok') diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 51e95fda85cd..3acbddc96f54 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -846,12 +846,15 @@ bool RTFFrame::inFrame() || nY > 0; } -void RTFDocumentImpl::singleChar(sal_uInt8 nValue) +void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps) { sal_uInt8 sValue[] = { nValue }; if (!m_pCurrentBuffer) { Mapper().startCharacterGroup(); + // Should we send run properties? + if (bRunProps) + runProps(); Mapper().text(sValue, 1); Mapper().endCharacterGroup(); } @@ -1561,7 +1564,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) OUString aStr("PAGE"); singleChar(0x13); text(aStr); - singleChar(0x14); + singleChar(0x14, true); singleChar(0x15); } break; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 0f1a4cab662c..93ed15d55398 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -404,7 +404,7 @@ namespace writerfilter { void text(rtl::OUString& rString); // Sends a single character to dmapper, taking care of buffering. - void singleChar(sal_uInt8 nValue); + void singleChar(sal_uInt8 nValue, bool bRunProps = false); // Sends run properties to dmapper, taking care of buffering. void runProps(); void parBreak(); -- cgit