diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-24 15:13:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-24 17:21:24 +0200 |
commit | 79a56a87e7485e0da6f5bc271012932f2642a662 (patch) | |
tree | a4790c78dd79ae24217ca4cb934d0e866d1b7fec /writerfilter | |
parent | 0a5bd26f9d21506f71951a383d8d0d8e5abf3f77 (diff) |
RTFDocumentImpl::pushState: use switch here as well
Change-Id: Ibb1c68612159fcdbfd92dc6b4cd3719d4db240f3
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index b221f44b3d33..523a9096e207 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3181,30 +3181,30 @@ int RTFDocumentImpl::pushState() m_nGroup++; - if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE) - m_aStates.top().nDestinationState = DESTINATION_FONTENTRY; - else if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET) - m_aStates.top().nDestinationState = DESTINATION_STYLEENTRY; - else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT || - m_aStates.top().nDestinationState == DESTINATION_SHAPETEXT || - m_aStates.top().nDestinationState == DESTINATION_FORMFIELD || - (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && !m_bEq) || - m_aStates.top().nDestinationState == DESTINATION_MNUM || - m_aStates.top().nDestinationState == DESTINATION_MDEN || - m_aStates.top().nDestinationState == DESTINATION_ME || - m_aStates.top().nDestinationState == DESTINATION_MFNAME || - m_aStates.top().nDestinationState == DESTINATION_MLIM || - m_aStates.top().nDestinationState == DESTINATION_MSUB || - m_aStates.top().nDestinationState == DESTINATION_MSUP) - m_aStates.top().nDestinationState = DESTINATION_NORMAL; - else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && m_bEq) - m_aStates.top().nDestinationState = DESTINATION_EQINSTRUCTION; - else if (m_aStates.top().nDestinationState == DESTINATION_REVISIONTABLE) - m_aStates.top().nDestinationState = DESTINATION_REVISIONENTRY; - else if (m_aStates.top().nDestinationState == DESTINATION_EQINSTRUCTION) + switch (m_aStates.top().nDestinationState) + { + case DESTINATION_FONTTABLE: m_aStates.top().nDestinationState = DESTINATION_FONTENTRY; break; + case DESTINATION_STYLESHEET: m_aStates.top().nDestinationState = DESTINATION_STYLEENTRY; break; + case DESTINATION_FIELDRESULT: + case DESTINATION_SHAPETEXT: + case DESTINATION_FORMFIELD: + case DESTINATION_EQINSTRUCTION: + case DESTINATION_MNUM: + case DESTINATION_MDEN: + case DESTINATION_ME: + case DESTINATION_MFNAME: + case DESTINATION_MLIM: + case DESTINATION_MSUB: + case DESTINATION_MSUP: m_aStates.top().nDestinationState = DESTINATION_NORMAL; - else if (m_aStates.top().nDestinationState == DESTINATION_MOMATH) - m_aStates.top().nDestinationState = DESTINATION_MR; + break; + case DESTINATION_FIELDINSTRUCTION: + m_aStates.top().nDestinationState = !m_bEq ? DESTINATION_NORMAL : DESTINATION_EQINSTRUCTION; + break; + case DESTINATION_REVISIONTABLE: m_aStates.top().nDestinationState = DESTINATION_REVISIONENTRY; break; + case DESTINATION_MOMATH: m_aStates.top().nDestinationState = DESTINATION_MR; break; + default: break; + } return 0; } |