12#include <oox/token/tokens.hxx>
13#include <rtl/ustring.hxx>
24, m_DocumentType(documentType)
53 if (nAlign != FormulaImExportBase::eFormulaAlign::INLINE)
56 FSNS(XML_xmlns, XML_m),
"http://schemas.openxmlformats.org/officeDocument/2006/math");
58 if (nAlign == FormulaImExportBase::eFormulaAlign::CENTER)
60 if (nAlign == FormulaImExportBase::eFormulaAlign::LEFT)
62 if (nAlign == FormulaImExportBase::eFormulaAlign::RIGHT)
73 FSNS(XML_xmlns, XML_m),
"http://schemas.openxmlformats.org/officeDocument/2006/math");
111 m_pSerializer->singleElementNS( XML_w, XML_rFonts,
FSNS( XML_w, XML_ascii ),
"Cambria Math",
112 FSNS( XML_w, XML_hAnsi ),
"Cambria Math" );
115 m_pSerializer->startElementNS(XML_m, XML_t,
FSNS(XML_xml, XML_space),
"preserve");
118 OUStringBuffer buf(pTemp->
GetText());
122 if ((nPendingAttributes) &&
123 (
i == ((pTemp->
GetText().getLength()+1)/2)-1))
152 if ((nPendingAttributes) &&
153 (
i == ((pTemp->
GetText().getLength()+1)/2)-1))
156 while (nPendingAttributes)
161 nPendingAttributes--;
163 nInsertion=
pS->Tell();
177 if(
type !=
nullptr )
283 assert( txtnode->
GetText().getLength() == 1 );
311 if( subsup ==
nullptr || subsup->
GetSubSup(
CSUB ) == nullptr )
313 if( subsup ==
nullptr || subsup->
GetSubSup(
CSUP ) == nullptr )
316 if( subsup ==
nullptr || subsup->
GetSubSup(
CSUB ) == nullptr )
324 if( subsup ==
nullptr || subsup->
GetSubSup(
CSUP ) ==
nullptr )
349 if( subsup->GetSubSup(
CSUB ) !=
nullptr )
361 SAL_WARN(
"starmath.ooxml",
"Unhandled operation");
377 flags &= ~( 1 <<
RSUP | 1 <<
RSUB );
391 else if(( flags & ( 1 <<
RSUB )) == 1 <<
RSUB )
395 flags &= ~( 1 <<
RSUB );
406 else if(( flags & ( 1 <<
RSUP )) == 1 <<
RSUP )
410 flags &= ~( 1 <<
RSUP );
431 flags &= ~( 1 <<
LSUP | 1 <<
LSUB );
439 else if(( flags & ( 1 <<
CSUB )) == ( 1 <<
CSUB ))
443 flags &= ~( 1 <<
CSUB );
454 else if(( flags & ( 1 <<
CSUP )) == ( 1 <<
CSUP ))
458 flags &= ~( 1 <<
CSUP );
471 SAL_WARN(
"starmath.ooxml",
"Unhandled sub/sup combination");
480 for (
size_t row = 0; row < pNode->
GetNumRows(); ++row)
507 std::vector< const SmNode* > subnodes;
511 bool separatorWritten =
false;
518 if( !separatorWritten )
522 separatorWritten =
true;
526 subnodes.push_back( subnode );
530 subnodes.push_back( pNode->
Body());
539 for(
const SmNode* subnode : subnodes)
565 FSNS( XML_m, XML_val ),
top ?
"top" :
"bot" );
567 top ?
"bot" :
"top");
581 SAL_WARN(
"starmath.ooxml",
"Unhandled vertical brace");
590 m_pSerializer->startElementNS(XML_m, XML_t,
FSNS(XML_xml, XML_space),
"preserve");
::boost::spirit::classic::rule< ScannerT > argument
const SmNode * Body() const
Gets the body data ( the nodes affected by the attribute ).
const SmNode * Attribute() const
Gets the attribute data.
Node for brace construction.
const SmMathSymbolNode * OpeningBrace() const
Returns the node containing the data of the opening brace.
const SmNode * Body() const
Returns the node containing the data of what is between braces.
const SmMathSymbolNode * ClosingBrace() const
Returns the node containing the data of the closing brace.
sal_uInt16 GetNumRows() const
Gets the number of rows of the matrix.
sal_uInt16 GetNumCols() const
Gets the number of columns of the matrix.
virtual size_t GetNumSubNodes() const =0
Gets the number of subnodes.
const SmToken & GetToken() const
Gets the token.
virtual SmNode * GetSubNode(size_t nIndex)=0
Gets the subnode of index nIndex.
SmNodeType GetType() const
Gets the node type.
const SmFace & GetFont() const
Gets the font.
void HandleAttribute(const SmAttributeNode *pNode, int nLevel) override
SmOoxmlExport(const SmNode *pIn, oox::core::OoxmlVersion version, oox::drawingml::DocumentType documentType)
oox::drawingml::DocumentType const m_DocumentType
needed to determine markup for nested run properties
void HandleFractions(const SmNode *pNode, int nLevel, const char *type) override
void HandleVerticalStack(const SmNode *pNode, int nLevel) override
void HandleSubSupScriptInternal(const SmSubSupNode *pNode, int nLevel, int flags) override
::sax_fastparser::FSHelperPtr m_pSerializer
void HandleOperator(const SmOperNode *pNode, int nLevel) override
void HandleBrace(const SmBraceNode *pNode, int nLevel) override
void HandleRoot(const SmRootNode *pNode, int nLevel) override
void HandleVerticalBrace(const SmVerticalBraceNode *pNode, int nLevel) override
void HandleText(const SmNode *pNode, int nLevel) override
void ConvertFromStarMath(const ::sax_fastparser::FSHelperPtr &m_pSerializer, const sal_Int8)
void HandleMatrix(const SmMatrixNode *pNode, int nLevel) override
oox::core::OoxmlVersion version
void HandleBlank() override
const SmNode * GetSymbol() const
Returns the node with the operator data.
const SmNode * Body() const
Returns the node containing the data inside the root.
const SmNode * Argument() const
Returns the node containing the data of the order of the root.
virtual size_t GetNumSubNodes() const override
Gets the number of subnodes.
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
Super- and subscript node.
const SmNode * GetBody() const
Returns the node with the data of what has to be superindex or subindex.
const SmNode * GetSubSup(SmSubSup eSubSup) const
Gets the node with the data of what has to be superindex or subindex.
static sal_Unicode ConvertSymbolToUnicode(sal_Unicode nIn)
Converts the character from StarMath's private area symbols to a matching Unicode character,...
const OUString & GetText() const
Gets the node text.
Node for vertical brace construction.
const SmMathSymbolNode * Brace() const
Returns the node containing the data of the brace.
const SmNode * Script() const
Returns the node containing the data of what is in the brace.
const SmNode * Body() const
Returns the node containing the data of what the brace is pointing for.
Base class implementing writing of formulas to Word.
void HandleAllSubNodes(const SmNode *pNode, int nLevel)
const SmNode * GetTree() const
void HandleNode(const SmNode *pNode, int nLevel)
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
RttiCompleteObjectLocator col
double getLength(const B2DPolygon &rCandidate)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static OString mathSymbolToString(const SmNode *node)