starmath: m_pTree can be private

Which shows that subclasses only read it, never write it.

Change-Id: I90ea4528d4362c068ba02113b1b038a811ea32b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96321
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna 2020-06-15 12:12:43 +02:00
parent a35c18aeff
commit 43bdac0ebd
3 changed files with 8 additions and 5 deletions

View file

@ -28,7 +28,7 @@ SmOoxmlExport::SmOoxmlExport(const SmNode *const pIn, OoxmlVersion const v,
void SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& serializer, const sal_Int8 nAlign ) void SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& serializer, const sal_Int8 nAlign )
{ {
if( m_pTree == nullptr ) if( GetTree() == nullptr )
return; return;
m_pSerializer = serializer; m_pSerializer = serializer;
@ -66,7 +66,7 @@ void SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& se
m_pSerializer->singleElementNS(XML_m, XML_jc, FSNS(XML_m, XML_val), "right"); m_pSerializer->singleElementNS(XML_m, XML_jc, FSNS(XML_m, XML_val), "right");
m_pSerializer->endElementNS(XML_m, XML_oMathParaPr); m_pSerializer->endElementNS(XML_m, XML_oMathParaPr);
m_pSerializer->startElementNS(XML_m, XML_oMath); m_pSerializer->startElementNS(XML_m, XML_oMath);
HandleNode(m_pTree, 0); HandleNode(GetTree(), 0);
m_pSerializer->endElementNS(XML_m, XML_oMath); m_pSerializer->endElementNS(XML_m, XML_oMath);
m_pSerializer->endElementNS(XML_m, XML_oMathPara); m_pSerializer->endElementNS(XML_m, XML_oMathPara);
} }
@ -74,7 +74,7 @@ void SmOoxmlExport::ConvertFromStarMath( const ::sax_fastparser::FSHelperPtr& se
{ {
m_pSerializer->startElementNS(XML_m, XML_oMath, m_pSerializer->startElementNS(XML_m, XML_oMath,
FSNS(XML_xmlns, XML_m), "http://schemas.openxmlformats.org/officeDocument/2006/math"); FSNS(XML_xmlns, XML_m), "http://schemas.openxmlformats.org/officeDocument/2006/math");
HandleNode( m_pTree, 0 ); HandleNode( GetTree(), 0 );
m_pSerializer->endElementNS( XML_m, XML_oMath ); m_pSerializer->endElementNS( XML_m, XML_oMath );
} }
} }

View file

@ -24,12 +24,12 @@ SmRtfExport::SmRtfExport(const SmNode* pIn)
void SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding) void SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding)
{ {
if (!m_pTree) if (!GetTree())
return; return;
m_pBuffer = &rBuffer; m_pBuffer = &rBuffer;
m_nEncoding = nEncoding; m_nEncoding = nEncoding;
m_pBuffer->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE LO_STRING_SVTOOLS_RTF_MOMATH " "); m_pBuffer->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE LO_STRING_SVTOOLS_RTF_MOMATH " ");
HandleNode(m_pTree, 0); HandleNode(GetTree(), 0);
m_pBuffer->append("}"); // moMath m_pBuffer->append("}"); // moMath
} }

View file

@ -49,6 +49,9 @@ protected:
virtual void HandleBrace(const SmBraceNode* pNode, int nLevel) = 0; virtual void HandleBrace(const SmBraceNode* pNode, int nLevel) = 0;
virtual void HandleVerticalBrace(const SmVerticalBraceNode* pNode, int nLevel) = 0; virtual void HandleVerticalBrace(const SmVerticalBraceNode* pNode, int nLevel) = 0;
virtual void HandleBlank() = 0; virtual void HandleBlank() = 0;
const SmNode* GetTree() const { return m_pTree; }
private:
const SmNode* const m_pTree; const SmNode* const m_pTree;
}; };