diff options
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.hxx | 13 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLParserState.hxx | 15 |
3 files changed, 19 insertions, 18 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index b89a5cf33f56..421438039c0e 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -150,8 +150,7 @@ OOXMLFastContextHandler::OOXMLFastContextHandler inPositionV(pContext->inPositionV), m_xContext(pContext->m_xContext), m_bDiscardChildren(pContext->m_bDiscardChildren), - m_bTookChoice(pContext->m_bTookChoice), - m_aSavedAlternateStates(pContext->m_aSavedAlternateStates) + m_bTookChoice(pContext->m_bTookChoice) { mpParserState = pContext->mpParserState; @@ -179,7 +178,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref m_bDiscardChildren = false; aState.m_bTookChoice = m_bTookChoice; m_bTookChoice = false; - m_aSavedAlternateStates.push_back(aState); + mpParserState->getSavedAlternateStates().push_back(aState); } break; case OOXML_Choice: @@ -241,8 +240,8 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) m_bDiscardChildren = false; else if (Element == (NS_mce | OOXML_AlternateContent)) { - SavedAlternateState aState(m_aSavedAlternateStates.back()); - m_aSavedAlternateStates.pop_back(); + SavedAlternateState aState(mpParserState->getSavedAlternateStates().back()); + mpParserState->getSavedAlternateStates().pop_back(); m_bDiscardChildren = aState.m_bDiscardChildren; m_bTookChoice = aState.m_bTookChoice; } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index 88b1b80cd83a..eb315cf8880d 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -43,18 +43,6 @@ namespace ooxml typedef boost::shared_ptr<Stream> StreamPointer_t; -/** - * Struct to store our 'alternate state'. If multiple mc:AlternateContent - * elements arrive, then while the inner ones are active, the original state is - * saved away, and once they inner goes out of scope, the original state is - * restored. - */ -struct SavedAlternateState -{ - bool m_bDiscardChildren; - bool m_bTookChoice; ///< Did we take the Choice or want Fallback instead? -}; - class OOXMLFastContextHandler: public ::cppu::WeakImplHelper1< xml::sax::XFastContextHandler> @@ -290,7 +278,6 @@ private: uno::Reference< uno::XComponentContext > m_xContext; bool m_bDiscardChildren; bool m_bTookChoice; ///< Did we take the Choice or want Fallback instead? - std::vector<SavedAlternateState> m_aSavedAlternateStates; static sal_uInt32 mnInstanceCount; diff --git a/writerfilter/source/ooxml/OOXMLParserState.hxx b/writerfilter/source/ooxml/OOXMLParserState.hxx index 0cafc11cb5f8..935ee52d3fe6 100644 --- a/writerfilter/source/ooxml/OOXMLParserState.hxx +++ b/writerfilter/source/ooxml/OOXMLParserState.hxx @@ -31,6 +31,18 @@ namespace writerfilter { namespace ooxml { +/** + * Struct to store our 'alternate state'. If multiple mc:AlternateContent + * elements arrive, then while the inner ones are active, the original state is + * saved away, and once they inner goes out of scope, the original state is + * restored. + */ +struct SavedAlternateState +{ + bool m_bDiscardChildren; + bool m_bTookChoice; ///< Did we take the Choice or want Fallback instead? +}; + class OOXMLParserState { bool mbInSectionGroup; @@ -51,6 +63,7 @@ class OOXMLParserState bool savedInParagraphGroup; bool savedInCharacterGroup; bool savedLastParagraphInSection; + std::vector<SavedAlternateState> maSavedAlternateStates; public: typedef boost::shared_ptr<OOXMLParserState> Pointer_t; @@ -64,6 +77,8 @@ public: void setLastParagraphInSection(bool bLastParagraphInSection); bool isLastParagraphInSection() const { return mbLastParagraphInSection;} + std::vector<SavedAlternateState>& getSavedAlternateStates() { return maSavedAlternateStates; } + bool isInParagraphGroup() const { return mbInParagraphGroup;} void setInParagraphGroup(bool bInParagraphGroup); |