Kaydet (Commit) 28e2f6dc authored tarafından Miklos Vajna's avatar Miklos Vajna

writerfilter: make members private in RTFMathSymbol

Change-Id: I5c63c28ba4c63e17b74e656d5382d45c9fcc6baa
Reviewed-on: https://gerrit.libreoffice.org/67428
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst d3e888cf
...@@ -1900,7 +1900,7 @@ int nRTFMathControlWords = SAL_N_ELEMENTS(aRTFMathControlWords); ...@@ -1900,7 +1900,7 @@ int nRTFMathControlWords = SAL_N_ELEMENTS(aRTFMathControlWords);
bool RTFMathSymbol::operator<(const RTFMathSymbol& rOther) const bool RTFMathSymbol::operator<(const RTFMathSymbol& rOther) const
{ {
return eKeyword < rOther.eKeyword; return m_eKeyword < rOther.m_eKeyword;
} }
} // namespace rtftok } // namespace rtftok
......
...@@ -2024,11 +2024,25 @@ extern RTFSymbol const aRTFControlWords[]; ...@@ -2024,11 +2024,25 @@ extern RTFSymbol const aRTFControlWords[];
extern int nRTFControlWords; extern int nRTFControlWords;
/// Represents an RTF Math Control Word /// Represents an RTF Math Control Word
struct RTFMathSymbol class RTFMathSymbol
{ {
RTFKeyword eKeyword; RTFKeyword m_eKeyword;
int nToken; ///< This is the OOXML token equivalent. int m_nToken; ///< This is the OOXML token equivalent.
Destination eDestination; 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; bool operator<(const RTFMathSymbol& rOther) const;
}; };
......
...@@ -635,12 +635,11 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) ...@@ -635,12 +635,11 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
default: default:
{ {
// Check if it's a math token. // Check if it's a math token.
RTFMathSymbol aSymbol; RTFMathSymbol aSymbol(nKeyword);
aSymbol.eKeyword = nKeyword;
if (RTFTokenizer::lookupMathKeyword(aSymbol)) if (RTFTokenizer::lookupMathKeyword(aSymbol))
{ {
m_aMathBuffer.appendOpeningTag(aSymbol.nToken); m_aMathBuffer.appendOpeningTag(aSymbol.GetToken());
m_aStates.top().eDestination = aSymbol.eDestination; m_aStates.top().eDestination = aSymbol.GetDestination();
return RTFError::OK; return RTFError::OK;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment