diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-26 09:10:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-26 09:14:46 +0200 |
commit | 351e8d77f95734f74474e45af060cb1450ea7961 (patch) | |
tree | ea238df4f2dfec9a5475f6ac4535824ab47e9ab5 /writerfilter | |
parent | fdo#66180 librelogo: clockwise HEADING (diff) | |
download | core-351e8d77f95734f74474e45af060cb1450ea7961.tar.gz core-351e8d77f95734f74474e45af060cb1450ea7961.zip |
Kill RTFDocumentImpl::getState()
RTFParserState is private to RTFDocumentImpl, exposing it is not a good
idea. One more step towards RTFTokenizer not speaking directly to
RTFDocumentImpl, but through an interface.
Change-Id: I3f626d4f2c560a20d9e24105459e95a66d0a87ca
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 24 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfskipdestination.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtftokenizer.cxx | 8 |
5 files changed, 33 insertions, 9 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 76ab7eaea2da..c60128eb0fe4 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4633,9 +4633,29 @@ uno::Reference<lang::XMultiServiceFactory> RTFDocumentImpl::getModelFactory() return m_xModelFactory; } -RTFParserState& RTFDocumentImpl::getState() +bool RTFDocumentImpl::isInBackground() { - return m_aStates.top(); + return m_aStates.top().bInBackground; +} + +RTFInternalState RTFDocumentImpl::getInternalState() +{ + return m_aStates.top().nInternalState; +} + +void RTFDocumentImpl::setInternalState(RTFInternalState nInternalState) +{ + m_aStates.top().nInternalState = nInternalState; +} + +RTFDesitnationState RTFDocumentImpl::getDestinationState() +{ + return m_aStates.top().nDestinationState; +} + +void RTFDocumentImpl::setDestinationState(RTFDesitnationState nDestinationState) +{ + m_aStates.top().nDestinationState = nDestinationState; } void RTFDocumentImpl::setDestinationText(OUString& rString) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index b8783095f628..44c5f9248f9e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -438,7 +438,11 @@ namespace writerfilter { void setIgnoreFirst(OUString& rIgnoreFirst); void seek(sal_uInt32 nPos); uno::Reference<lang::XMultiServiceFactory> getModelFactory(); - RTFParserState& getState(); + bool isInBackground(); + RTFInternalState getInternalState(); + void setInternalState(RTFInternalState nInternalState); + RTFDesitnationState getDestinationState(); + void setDestinationState(RTFDesitnationState nDestinationState); void setDestinationText(OUString& rString); /// Resolve a picture: If not inline, then anchored. int resolvePict(bool bInline); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index c47a29b796a3..0e07a4570342 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -639,7 +639,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose) } } - if (m_rImport.getState().bInBackground) + if (m_rImport.isInBackground()) { RTFSprms aAttributes; aAttributes.set(NS_ooxml::LN_CT_Background_color, RTFValue::Pointer_t(new RTFValue(xPropertySet->getPropertyValue("FillColor").get<sal_Int32>()))); diff --git a/writerfilter/source/rtftok/rtfskipdestination.cxx b/writerfilter/source/rtftok/rtfskipdestination.cxx index 0bd6a3c092a9..46c7b9ed9a3e 100644 --- a/writerfilter/source/rtftok/rtfskipdestination.cxx +++ b/writerfilter/source/rtftok/rtfskipdestination.cxx @@ -26,7 +26,7 @@ RTFSkipDestination::~RTFSkipDestination() if (!m_bParsed) { SAL_INFO("writerfilter", OSL_THIS_FUNC << ": skipping destination"); - m_rImport.getState().nDestinationState = DESTINATION_SKIP; + m_rImport.setDestinationState(DESTINATION_SKIP); } m_rImport.setSkipUnknown(false); } diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index 873c7e981105..aa3708fa6368 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -82,7 +82,7 @@ int RTFTokenizer::resolveParse() if (m_nGroup < 0) return ERROR_GROUP_UNDER; - if (m_nGroup > 0 && m_rImport.getState().nInternalState == INTERNAL_BIN) + if (m_nGroup > 0 && m_rImport.getInternalState() == INTERNAL_BIN) { ret = m_rImport.resolveChars(ch); if (ret) @@ -122,7 +122,7 @@ int RTFTokenizer::resolveParse() default: if (m_nGroup == 0) return ERROR_CHAR_OVER; - if (m_rImport.getState().nInternalState == INTERNAL_NORMAL) + if (m_rImport.getInternalState() == INTERNAL_NORMAL) { ret = m_rImport.resolveChars(ch); if (ret) @@ -144,7 +144,7 @@ int RTFTokenizer::resolveParse() return ret; count = 2; b = 0; - m_rImport.getState().nInternalState = INTERNAL_NORMAL; + m_rImport.setInternalState(INTERNAL_NORMAL); } } break; @@ -269,7 +269,7 @@ int RTFTokenizer::resolveKeyword() int RTFTokenizer::dispatchKeyword(OString& rKeyword, bool bParam, int nParam) { - if (m_rImport.getState().nDestinationState == DESTINATION_SKIP) + if (m_rImport.getDestinationState() == DESTINATION_SKIP) return 0; /*SAL_INFO("writefilter", OSL_THIS_FUNC << ": keyword '\\" << rKeyword.getStr() << "' with param? " << (bParam ? 1 : 0) <<" param val: '" << (bParam ? nParam : 0) << "'");*/ |