diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-27 16:50:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-07-29 17:32:40 +0200 |
commit | 572bad05f8ea7de79807fbfeeff30a6d477a105e (patch) | |
tree | 28c6ba1d055f7c1b89779620d17a3b8ed1b6c4f6 /writerfilter | |
parent | Make RTFValue::Clone a deep copy (diff) | |
download | core-572bad05f8ea7de79807fbfeeff30a6d477a105e.tar.gz core-572bad05f8ea7de79807fbfeeff30a6d477a105e.zip |
Introduce RTFParserState::Clone, closes fdo#36922
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 24 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 24 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 87e344ad036f..01082eeb5461 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2275,9 +2275,9 @@ int RTFDocumentImpl::pushState() m_nGroupStartPos = Strm().Tell(); RTFParserState aState; if (m_aStates.empty()) - aState = m_aDefaultState; + aState = m_aDefaultState.Clone(); else - aState = m_aStates.top(); + aState = m_aStates.top().Clone(); m_aStates.push(aState); m_nGroup++; @@ -2788,6 +2788,26 @@ RTFParserState::RTFParserState() { } +RTFParserState RTFParserState::Clone() +{ + RTFParserState aRet(*this); + aRet.aTableSprms = RTFSprm::Clone(aTableSprms); + aRet.aTableAttributes = RTFSprm::Clone(aTableAttributes); + aRet.aCharacterSprms = RTFSprm::Clone(aCharacterSprms); + aRet.aCharacterAttributes = RTFSprm::Clone(aCharacterAttributes); + aRet.aParagraphSprms = RTFSprm::Clone(aParagraphSprms); + aRet.aParagraphAttributes = RTFSprm::Clone(aParagraphAttributes); + aRet.aSectionSprms = RTFSprm::Clone(aSectionSprms); + aRet.aSectionAttributes = RTFSprm::Clone(aSectionAttributes); + aRet.aTableRowSprms = RTFSprm::Clone(aTableRowSprms); + aRet.aTableRowAttributes = RTFSprm::Clone(aTableRowAttributes); + aRet.aTableCellSprms = RTFSprm::Clone(aTableCellSprms); + aRet.aTableCellAttributes = RTFSprm::Clone(aTableCellAttributes); + aRet.aTabAttributes = RTFSprm::Clone(aTabAttributes); + aRet.aListLevelEntries = RTFSprm::Clone(aListLevelEntries); + return aRet; +} + RTFColorTableEntry::RTFColorTableEntry() : nRed(0), nGreen(0), diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index a7bd0260cd1d..401ea6933a3a 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -180,6 +180,8 @@ namespace writerfilter { { public: RTFParserState(); + /// Does a deep copy of the state data. + RTFParserState Clone(); RTFInternalState nInternalState; RTFDesitnationState nDestinationState; RTFBorderState nBorderState; |