diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-05 21:24:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-06 09:03:29 +0100 |
commit | 28e2f6dc3d49c79f16c6667f9575053c36a247ef (patch) | |
tree | 5e3f4de489398cdeedc2f52da346ce93efeea1b6 | |
parent | d3e888cf9e053259076671e8bea0d667c1f92357 (diff) |
writerfilter: make members private in RTFMathSymbol
Change-Id: I5c63c28ba4c63e17b74e656d5382d45c9fcc6baa
Reviewed-on: https://gerrit.libreoffice.org/67428
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | writerfilter/source/rtftok/rtfcontrolwords.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfcontrolwords.hxx | 22 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchdestination.cxx | 7 |
3 files changed, 22 insertions, 9 deletions
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; } |