diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-08 09:08:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-08 09:09:19 +0100 |
commit | 1f1ddaad5dd401b70ae69fb18f7873d652242154 (patch) | |
tree | e6d1d49f62276bbb08586d8c79bca2ea5a5b11bb /writerfilter | |
parent | 8085555f6de5905028fdc0761c9e5b2fd4a3609a (diff) |
Related: tdf#96308 RTF import: fix RTF_DEFTAB handling
Change-Id: Ia2655bf5748ea62155613a222d0cb17b678196c5
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2c32453cc093..19c0cbefd225 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -704,6 +704,14 @@ oox::GraphicHelper& RTFDocumentImpl::getGraphicHelper() return *m_pGraphicHelper; } +bool RTFDocumentImpl::isStyleSheetImport() +{ + if (m_aStates.empty()) + return false; + Destination eDestination = m_aStates.top().eDestination; + return eDestination == Destination::STYLESHEET || eDestination == Destination::STYLEENTRY; +} + void RTFDocumentImpl::resolve(Stream& rMapper) { m_pMapperStream = &rMapper; @@ -6328,7 +6336,7 @@ RTFFrame::RTFFrame(RTFParserState* pParserState) void RTFFrame::setSprm(Id nId, Id nValue) { - if (m_pParserState->m_pDocumentImpl->getFirstRun()) + if (m_pParserState->m_pDocumentImpl->getFirstRun() && !m_pParserState->m_pDocumentImpl->isStyleSheetImport()) { m_pParserState->m_pDocumentImpl->checkFirstRun(); m_pParserState->m_pDocumentImpl->setNeedPar(false); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index d0671a1b5bb4..7ef2b4fdce70 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -395,6 +395,8 @@ public: /// Get the default parser state. RTFParserState& getDefaultState(); oox::GraphicHelper& getGraphicHelper(); + /// Are we inside the stylesheet table? + bool isStyleSheetImport(); private: SvStream& Strm(); |