writerfilter/source/rtftok/rtfcontrolwords.cxx | 2 - writerfilter/source/rtftok/rtfcontrolwords.hxx | 22 ++++++++++++++---- writerfilter/source/rtftok/rtfdispatchdestination.cxx | 7 ++--- 3 files changed, 22 insertions(+), 9 deletions(-)
New commits: commit 28e2f6dc3d49c79f16c6667f9575053c36a247ef Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Feb 5 21:24:57 2019 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Feb 6 09:03:29 2019 +0100 writerfilter: make members private in RTFMathSymbol Change-Id: I5c63c28ba4c63e17b74e656d5382d45c9fcc6baa Reviewed-on: https://gerrit.libreoffice.org/67428 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx b/writerfilter/source/rtftok/rtfcontrolwords.cxx index 0f958577cfe3..6672efc686c9 100644 --- a/writerfilter/source/rtftok/rtfcontrolwords.cxx +++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx @@ -1900,7 +1900,7 @@ int nRTFMathControlWords = SAL_N_ELEMENTS(aRTFMathControlWords); bool RTFMathSymbol::operator<(const RTFMathSymbol& rOther) const { - return eKeyword < rOther.eKeyword; + return m_eKeyword < rOther.m_eKeyword; } } // namespace rtftok diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx index c9ba4bbbafab..67c6e5e67fe7 100644 --- a/writerfilter/source/rtftok/rtfcontrolwords.hxx +++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx @@ -2024,11 +2024,25 @@ extern RTFSymbol const aRTFControlWords[]; extern int nRTFControlWords; /// Represents an RTF Math Control Word -struct RTFMathSymbol +class RTFMathSymbol { - RTFKeyword eKeyword; - int nToken; ///< This is the OOXML token equivalent. - Destination eDestination; + RTFKeyword m_eKeyword; + int m_nToken; ///< This is the OOXML token equivalent. + Destination m_eDestination; + +public: + RTFMathSymbol(RTFKeyword eKeyword, int nToken = 0, + Destination eDestination = Destination::NORMAL) + : m_eKeyword(eKeyword) + , m_nToken(nToken) + , m_eDestination(eDestination) + { + } + + int GetToken() const { return m_nToken; } + + Destination GetDestination() const { return m_eDestination; } + bool operator<(const RTFMathSymbol& rOther) const; }; diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx b/writerfilter/source/rtftok/rtfdispatchdestination.cxx index 02e6c3da72fd..68adede7d9f0 100644 --- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx +++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx @@ -635,12 +635,11 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) default: { // Check if it's a math token. - RTFMathSymbol aSymbol; - aSymbol.eKeyword = nKeyword; + RTFMathSymbol aSymbol(nKeyword); if (RTFTokenizer::lookupMathKeyword(aSymbol)) { - m_aMathBuffer.appendOpeningTag(aSymbol.nToken); - m_aStates.top().eDestination = aSymbol.eDestination; + m_aMathBuffer.appendOpeningTag(aSymbol.GetToken()); + m_aStates.top().eDestination = aSymbol.GetDestination(); return RTFError::OK; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits