LibreOffice Module starmath (master) 1
rtfexport.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include "rtfexport.hxx"
11
12#include <svtools/rtfkeywd.hxx>
14
16 : SmWordExportBase(pIn)
17 , m_pBuffer(nullptr)
18 , m_nEncoding(RTL_TEXTENCODING_DONTKNOW)
19{
20}
21
22void SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding)
23{
24 if (!GetTree())
25 return;
26 m_pBuffer = &rBuffer;
27 m_nEncoding = nEncoding;
29 HandleNode(GetTree(), 0);
30 m_pBuffer->append("}"); // moMath
31}
32
33// NOTE: This is still work in progress and unfinished, but it already covers a good
34// part of the rtf math stuff.
35
36void SmRtfExport::HandleVerticalStack(const SmNode* pNode, int nLevel)
37{
39 int size = pNode->GetNumSubNodes();
40 for (int i = 0; i < size; ++i)
41 {
42 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
43 HandleNode(pNode->GetSubNode(i), nLevel + 1);
44 m_pBuffer->append("}"); // me
45 }
46 m_pBuffer->append("}"); // meqArr
47}
48
49void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/)
50{
51 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MR " ");
52
53 if (pNode->GetToken().eType == TTEXT) // literal text
55
56 auto pTemp = static_cast<const SmTextNode*>(pNode);
57 SAL_INFO("starmath.rtf", "Text: " << pTemp->GetText());
58 for (sal_Int32 i = 0; i < pTemp->GetText().getLength(); i++)
59 {
60 sal_uInt16 nChar = pTemp->GetText()[i];
61 OUString aValue(SmTextNode::ConvertSymbolToUnicode(nChar));
63 }
64
65 m_pBuffer->append("}"); // mr
66}
67
68void SmRtfExport::HandleFractions(const SmNode* pNode, int nLevel, const char* type)
69{
70 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MF " ");
71 if (type)
72 {
75 m_pBuffer->append(type);
76 m_pBuffer->append("}"); // mtype
77 m_pBuffer->append("}"); // mfPr
78 }
79 assert(pNode->GetNumSubNodes() == 3);
81 HandleNode(pNode->GetSubNode(0), nLevel + 1);
82 m_pBuffer->append("}"); // mnum
84 HandleNode(pNode->GetSubNode(2), nLevel + 1);
85 m_pBuffer->append("}"); // mden
86 m_pBuffer->append("}"); // mf
87}
88
89void SmRtfExport::HandleAttribute(const SmAttributeNode* pNode, int nLevel)
90{
91 switch (pNode->Attribute()->GetToken().eType)
92 {
93 case TCHECK:
94 case TACUTE:
95 case TGRAVE:
96 case TBREVE:
97 case TCIRCLE:
98 case TVEC:
99 case TTILDE:
100 case THAT:
101 case TDOT:
102 case TDDOT:
103 case TDDDOT:
104 case TWIDETILDE:
105 case TWIDEHAT:
106 case TWIDEHARPOON:
107 case TWIDEVEC:
108 case TBAR:
109 {
110 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MACC " ");
112 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MCHR " ");
113 OUString aValue(pNode->Attribute()->GetToken().cMathChar);
115 m_pBuffer->append("}"); // mchr
116 m_pBuffer->append("}"); // maccPr
117 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
118 HandleNode(pNode->Body(), nLevel + 1);
119 m_pBuffer->append("}"); // me
120 m_pBuffer->append("}"); // macc
121 break;
122 }
123 case TOVERLINE:
124 case TUNDERLINE:
125 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MBAR " ");
127 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MPOS " ");
128 m_pBuffer->append((pNode->Attribute()->GetToken().eType == TUNDERLINE) ? "bot" : "top");
129 m_pBuffer->append("}"); // mpos
130 m_pBuffer->append("}"); // mbarPr
131 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
132 HandleNode(pNode->Body(), nLevel + 1);
133 m_pBuffer->append("}"); // me
134 m_pBuffer->append("}"); // mbar
135 break;
136 case TOVERSTRIKE:
139 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MHIDETOP " 1}");
140 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MHIDEBOT " 1}");
143 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSTRIKEH " 1}");
144 m_pBuffer->append("}"); // mborderBoxPr
145 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
146 HandleNode(pNode->Body(), nLevel + 1);
147 m_pBuffer->append("}"); // me
148 m_pBuffer->append("}"); // mborderBox
149 break;
150 default:
151 HandleAllSubNodes(pNode, nLevel);
152 break;
153 }
154}
155
156void SmRtfExport::HandleRoot(const SmRootNode* pNode, int nLevel)
157{
158 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MRAD " ");
159 if (const SmNode* argument = pNode->Argument())
160 {
161 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MDEG " ");
162 HandleNode(argument, nLevel + 1);
163 m_pBuffer->append("}"); // mdeg
164 }
165 else
166 {
168 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MDEGHIDE " 1}");
169 m_pBuffer->append("}"); // mradPr
170 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MDEG " }"); // empty but present
171 }
172 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
173 HandleNode(pNode->Body(), nLevel + 1);
174 m_pBuffer->append("}"); // me
175 m_pBuffer->append("}"); // mrad
176}
177
178namespace
179{
180OString mathSymbolToString(const SmNode* node, rtl_TextEncoding nEncoding)
181{
182 assert(node->GetType() == SmNodeType::Math || node->GetType() == SmNodeType::MathIdent);
183 auto txtnode = static_cast<const SmTextNode*>(node);
184 if (txtnode->GetText().isEmpty())
185 return {};
186 assert(txtnode->GetText().getLength() == 1);
187 sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode(txtnode->GetText()[0]);
188 OUString aValue(chr);
189 return msfilter::rtfutil::OutString(aValue, nEncoding);
190}
191}
192
193void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel)
194{
195 SAL_INFO("starmath.rtf", "Operator: " << int(pNode->GetToken().eType));
196 switch (pNode->GetToken().eType)
197 {
198 case TINT:
199 case TINTD:
200 case TIINT:
201 case TIIINT:
202 case TLINT:
203 case TLLINT:
204 case TLLLINT:
205 case TPROD:
206 case TCOPROD:
207 case TSUM:
208 {
209 const SmSubSupNode* subsup
210 = pNode->GetSubNode(0)->GetType() == SmNodeType::SubSup
211 ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0))
212 : nullptr;
213 const SmNode* operation = subsup ? subsup->GetBody() : pNode->GetSubNode(0);
214 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MNARY " ");
216 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MCHR " ");
217 m_pBuffer->append(mathSymbolToString(operation, m_nEncoding));
218 m_pBuffer->append("}"); // mchr
219 if (!subsup || !subsup->GetSubSup(CSUB))
220 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUBHIDE " 1}");
221 if (!subsup || !subsup->GetSubSup(CSUP))
222 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUPHIDE " 1}");
223 m_pBuffer->append("}"); // mnaryPr
224 if (!subsup || !subsup->GetSubSup(CSUB))
225 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUB " }");
226 else
227 {
228 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUB " ");
229 HandleNode(subsup->GetSubSup(CSUB), nLevel + 1);
230 m_pBuffer->append("}"); // msub
231 }
232 if (!subsup || !subsup->GetSubSup(CSUP))
233 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUP " }");
234 else
235 {
236 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUP " ");
237 HandleNode(subsup->GetSubSup(CSUP), nLevel + 1);
238 m_pBuffer->append("}"); // msup
239 }
240 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
241 HandleNode(pNode->GetSubNode(1), nLevel + 1); // body
242 m_pBuffer->append("}"); // me
243 m_pBuffer->append("}"); // mnary
244 break;
245 }
246 case TLIM:
247 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MFUNC " ");
250 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
251 HandleNode(pNode->GetSymbol(), nLevel + 1);
252 m_pBuffer->append("}"); // me
253 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " ");
254 if (const SmSubSupNode* subsup
255 = pNode->GetSubNode(0)->GetType() == SmNodeType::SubSup
256 ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0))
257 : nullptr)
258 if (subsup->GetSubSup(CSUB))
259 HandleNode(subsup->GetSubSup(CSUB), nLevel + 1);
260 m_pBuffer->append("}"); // mlim
261 m_pBuffer->append("}"); // mlimLow
262 m_pBuffer->append("}"); // mfName
263 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
264 HandleNode(pNode->GetSubNode(1), nLevel + 1); // body
265 m_pBuffer->append("}"); // me
266 m_pBuffer->append("}"); // mfunc
267 break;
268 default:
269 SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled oper type");
270 break;
271 }
272}
273
274void SmRtfExport::HandleSubSupScriptInternal(const SmSubSupNode* pNode, int nLevel, int flags)
275{
276 // rtf supports only a certain combination of sub/super scripts, but LO can have any,
277 // so try to merge it using several tags if necessary
278 if (flags == 0) // none
279 return;
280 if ((flags & (1 << RSUP | 1 << RSUB)) == (1 << RSUP | 1 << RSUB))
281 {
282 // m:sSubSup
284 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
285 flags &= ~(1 << RSUP | 1 << RSUB);
286 if (flags == 0)
287 HandleNode(pNode->GetBody(), nLevel + 1);
288 else
289 HandleSubSupScriptInternal(pNode, nLevel, flags);
290 m_pBuffer->append("}"); // me
291 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUB " ");
292 HandleNode(pNode->GetSubSup(RSUB), nLevel + 1);
293 m_pBuffer->append("}"); // msub
294 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUP " ");
295 HandleNode(pNode->GetSubSup(RSUP), nLevel + 1);
296 m_pBuffer->append("}"); // msup
297 m_pBuffer->append("}"); // msubSup
298 }
299 else if ((flags & (1 << RSUB)) == 1 << RSUB)
300 {
301 // m:sSub
302 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSSUB " ");
303 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
304 flags &= ~(1 << RSUB);
305 if (flags == 0)
306 HandleNode(pNode->GetBody(), nLevel + 1);
307 else
308 HandleSubSupScriptInternal(pNode, nLevel, flags);
309 m_pBuffer->append("}"); // me
310 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUB " ");
311 HandleNode(pNode->GetSubSup(RSUB), nLevel + 1);
312 m_pBuffer->append("}"); // msub
313 m_pBuffer->append("}"); // msSub
314 }
315 else if ((flags & (1 << RSUP)) == 1 << RSUP)
316 {
317 // m:sSup
318 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSSUP " ");
319 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
320 flags &= ~(1 << RSUP);
321 if (flags == 0)
322 HandleNode(pNode->GetBody(), nLevel + 1);
323 else
324 HandleSubSupScriptInternal(pNode, nLevel, flags);
325 m_pBuffer->append("}"); // me
326 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUP " ");
327 HandleNode(pNode->GetSubSup(RSUP), nLevel + 1);
328 m_pBuffer->append("}"); // msup
329 m_pBuffer->append("}"); // msSup
330 }
331 else if ((flags & (1 << LSUP | 1 << LSUB)) == (1 << LSUP | 1 << LSUB))
332 {
333 // m:sPre
334 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSPRE " ");
335 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUB " ");
336 HandleNode(pNode->GetSubSup(LSUB), nLevel + 1);
337 m_pBuffer->append("}"); // msub
338 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSUP " ");
339 HandleNode(pNode->GetSubSup(LSUP), nLevel + 1);
340 m_pBuffer->append("}"); // msup
341 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
342 flags &= ~(1 << LSUP | 1 << LSUB);
343 if (flags == 0)
344 HandleNode(pNode->GetBody(), nLevel + 1);
345 else
346 HandleSubSupScriptInternal(pNode, nLevel, flags);
347 m_pBuffer->append("}"); // me
348 m_pBuffer->append("}"); // msPre
349 }
350 else if ((flags & (1 << CSUB)) == (1 << CSUB))
351 {
352 // m:limLow looks like a good element for central superscript
354 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
355 flags &= ~(1 << CSUB);
356 if (flags == 0)
357 HandleNode(pNode->GetBody(), nLevel + 1);
358 else
359 HandleSubSupScriptInternal(pNode, nLevel, flags);
360 m_pBuffer->append("}"); // me
361 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " ");
362 HandleNode(pNode->GetSubSup(CSUB), nLevel + 1);
363 m_pBuffer->append("}"); // mlim
364 m_pBuffer->append("}"); // mlimLow
365 }
366 else if ((flags & (1 << CSUP)) == (1 << CSUP))
367 {
368 // m:limUpp looks like a good element for central superscript
370 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
371 flags &= ~(1 << CSUP);
372 if (flags == 0)
373 HandleNode(pNode->GetBody(), nLevel + 1);
374 else
375 HandleSubSupScriptInternal(pNode, nLevel, flags);
376 m_pBuffer->append("}"); // me
377 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " ");
378 HandleNode(pNode->GetSubSup(CSUP), nLevel + 1);
379 m_pBuffer->append("}"); // mlim
380 m_pBuffer->append("}"); // mlimUpp
381 }
382 else
383 SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled subsup type");
384}
385
386void SmRtfExport::HandleMatrix(const SmMatrixNode* pNode, int nLevel)
387{
388 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MM " ");
389 for (size_t row = 0; row < pNode->GetNumRows(); ++row)
390 {
391 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MMR " ");
392 for (size_t col = 0; col < pNode->GetNumCols(); ++col)
393 {
394 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
395 if (const SmNode* node = pNode->GetSubNode(row * pNode->GetNumCols() + col))
396 HandleNode(node, nLevel + 1);
397 m_pBuffer->append("}"); // me
398 }
399 m_pBuffer->append("}"); // mmr
400 }
401 m_pBuffer->append("}"); // mm
402}
403
404void SmRtfExport::HandleBrace(const SmBraceNode* pNode, int nLevel)
405{
406 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MD " ");
407 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MDPR " ");
410 m_pBuffer->append("}"); // mbegChr
411 std::vector<const SmNode*> subnodes;
412 if (pNode->Body()->GetType() == SmNodeType::Bracebody)
413 {
414 auto body = static_cast<const SmBracebodyNode*>(pNode->Body());
415 bool separatorWritten = false; // assume all separators are the same
416 for (size_t i = 0; i < body->GetNumSubNodes(); ++i)
417 {
418 const SmNode* subnode = body->GetSubNode(i);
419 if (subnode->GetType() == SmNodeType::Math
420 || subnode->GetType() == SmNodeType::MathIdent)
421 {
422 // do not write, but write what separator it is
423 auto math = static_cast<const SmMathSymbolNode*>(subnode);
424 if (!separatorWritten)
425 {
428 m_pBuffer->append("}"); // msepChr
429 separatorWritten = true;
430 }
431 }
432 else
433 subnodes.push_back(subnode);
434 }
435 }
436 else
437 subnodes.push_back(pNode->Body());
440 m_pBuffer->append("}"); // mendChr
441 m_pBuffer->append("}"); // mdPr
442 for (const SmNode* subnode : subnodes)
443 {
444 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
445 HandleNode(subnode, nLevel + 1);
446 m_pBuffer->append("}"); // me
447 }
448 m_pBuffer->append("}"); // md
449}
450
452{
453 SAL_INFO("starmath.rtf", "Vertical: " << int(pNode->GetToken().eType));
454 switch (pNode->GetToken().eType)
455 {
456 case TOVERBRACE:
457 case TUNDERBRACE:
458 {
459 bool top = (pNode->GetToken().eType == TOVERBRACE);
460 if (top)
462 else
464 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
467 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MCHR " ");
468 m_pBuffer->append(mathSymbolToString(pNode->Brace(), m_nEncoding));
469 m_pBuffer->append("}"); // mchr
470 // TODO not sure if pos and vertJc are correct
472 .append(top ? "top" : "bot")
473 .append("}");
475 .append(top ? "bot" : "top")
476 .append("}");
477 m_pBuffer->append("}"); // mgroupChrPr
478 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_ME " ");
479 HandleNode(pNode->Body(), nLevel + 1);
480 m_pBuffer->append("}"); // me
481 m_pBuffer->append("}"); // mgroupChr
482 m_pBuffer->append("}"); // me
483 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " ");
484 HandleNode(pNode->Script(), nLevel + 1);
485 m_pBuffer->append("}"); // mlim
486 m_pBuffer->append("}"); // mlimUpp or mlimLow
487 break;
488 }
489 default:
490 SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled vertical brace type");
491 break;
492 }
493}
494
496{
497 m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MR " ");
498 m_pBuffer->append(" ");
499 m_pBuffer->append("}"); // mr
500}
501
502/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::boost::spirit::classic::rule< ScannerT > argument
Attribute node.
Definition: node.hxx:1890
const SmNode * Body() const
Gets the body data ( the nodes affected by the attribute ).
Definition: node.hxx:1922
const SmNode * Attribute() const
Gets the attribute data.
Definition: node.hxx:1915
Node for brace construction.
Definition: node.hxx:1646
const SmMathSymbolNode * OpeningBrace() const
Returns the node containing the data of the opening brace.
Definition: node.hxx:1655
const SmNode * Body() const
Returns the node containing the data of what is between braces.
Definition: node.hxx:1667
const SmMathSymbolNode * ClosingBrace() const
Returns the node containing the data of the closing brace.
Definition: node.hxx:1674
Body of an SmBraceNode.
Definition: node.hxx:1710
Math symbol node.
Definition: node.hxx:955
Matrix node.
Definition: node.hxx:2000
sal_uInt16 GetNumRows() const
Gets the number of rows of the matrix.
Definition: node.hxx:2014
sal_uInt16 GetNumCols() const
Gets the number of columns of the matrix.
Definition: node.hxx:2020
Definition: node.hxx:125
virtual size_t GetNumSubNodes() const =0
Gets the number of subnodes.
const SmToken & GetToken() const
Gets the token.
Definition: node.hxx:387
virtual SmNode * GetSubNode(size_t nIndex)=0
Gets the subnode of index nIndex.
SmNodeType GetType() const
Gets the node type.
Definition: node.hxx:379
Operation Node.
Definition: node.hxx:1811
const SmNode * GetSymbol() const
Returns the node with the operator data.
Definition: node.hxx:1820
Root node.
Definition: node.hxx:1307
const SmNode * Body() const
Returns the node containing the data inside the root.
Definition: node.hxx:1350
const SmNode * Argument() const
Returns the node containing the data of the order of the root.
Definition: node.hxx:1332
void HandleBlank() override
Definition: rtfexport.cxx:495
OStringBuffer * m_pBuffer
Definition: rtfexport.hxx:38
void HandleText(const SmNode *pNode, int nLevel) override
Definition: rtfexport.cxx:49
void HandleVerticalStack(const SmNode *pNode, int nLevel) override
Definition: rtfexport.cxx:36
void HandleMatrix(const SmMatrixNode *pNode, int nLevel) override
Definition: rtfexport.cxx:386
void HandleFractions(const SmNode *pNode, int nLevel, const char *type) override
Definition: rtfexport.cxx:68
rtl_TextEncoding m_nEncoding
Definition: rtfexport.hxx:39
void HandleVerticalBrace(const SmVerticalBraceNode *pNode, int nLevel) override
Definition: rtfexport.cxx:451
void HandleBrace(const SmBraceNode *pNode, int nLevel) override
Definition: rtfexport.cxx:404
void HandleSubSupScriptInternal(const SmSubSupNode *pNode, int nLevel, int flags) override
Definition: rtfexport.cxx:274
void ConvertFromStarMath(OStringBuffer &rBuffer, rtl_TextEncoding nEncoding)
Definition: rtfexport.cxx:22
void HandleAttribute(const SmAttributeNode *pNode, int nLevel) override
Definition: rtfexport.cxx:89
SmRtfExport(const SmNode *pIn)
Definition: rtfexport.cxx:15
void HandleRoot(const SmRootNode *pNode, int nLevel) override
Definition: rtfexport.cxx:156
void HandleOperator(const SmOperNode *pNode, int nLevel) override
Definition: rtfexport.cxx:193
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
Definition: node.cxx:435
Super- and subscript node.
Definition: node.hxx:1559
const SmNode * GetBody() const
Returns the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1571
const SmNode * GetSubSup(SmSubSup eSubSup) const
Gets the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1595
Text node.
Definition: node.hxx:747
static sal_Unicode ConvertSymbolToUnicode(sal_Unicode nIn)
Converts the character from StarMath's private area symbols to a matching Unicode character,...
Definition: node.cxx:1899
Node for vertical brace construction.
Definition: node.hxx:1750
const SmMathSymbolNode * Brace() const
Returns the node containing the data of the brace.
Definition: node.hxx:1767
const SmNode * Script() const
Returns the node containing the data of what is in the brace.
Definition: node.hxx:1780
const SmNode * Body() const
Returns the node containing the data of what the brace is pointing for.
Definition: node.hxx:1760
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)
sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1]
OString top
#define SAL_INFO(area, stream)
RttiCompleteObjectLocator col
double getLength(const B2DPolygon &rCandidate)
size
int i
OString OutString(std::u16string_view rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
@ LSUB
Definition: node.hxx:1536
@ CSUB
Definition: node.hxx:1536
@ RSUP
Definition: node.hxx:1536
@ RSUB
Definition: node.hxx:1536
@ LSUP
Definition: node.hxx:1536
@ CSUP
Definition: node.hxx:1536
static OString mathSymbolToString(const SmNode *node)
#define LO_STRING_SVTOOLS_RTF_MSUBHIDE
#define LO_STRING_SVTOOLS_RTF_MBORDERBOX
#define LO_STRING_SVTOOLS_RTF_MSSUP
#define LO_STRING_SVTOOLS_RTF_MF
#define LO_STRING_SVTOOLS_RTF_MMR
#define LO_STRING_SVTOOLS_RTF_MBAR
#define LO_STRING_SVTOOLS_RTF_MRADPR
#define LO_STRING_SVTOOLS_RTF_MRAD
#define LO_STRING_SVTOOLS_RTF_MNOR
#define LO_STRING_SVTOOLS_RTF_MFUNC
#define LO_STRING_SVTOOLS_RTF_MSTRIKEH
#define LO_STRING_SVTOOLS_RTF_MHIDELEFT
#define LO_STRING_SVTOOLS_RTF_MDEGHIDE
#define LO_STRING_SVTOOLS_RTF_MSPRE
#define LO_STRING_SVTOOLS_RTF_MGROUPCHRPR
#define LO_STRING_SVTOOLS_RTF_MACCPR
#define LO_STRING_SVTOOLS_RTF_MVERTJC
#define LO_STRING_SVTOOLS_RTF_MLIM
#define LO_STRING_SVTOOLS_RTF_MBORDERBOXPR
#define LO_STRING_SVTOOLS_RTF_MFPR
#define LO_STRING_SVTOOLS_RTF_MDPR
#define LO_STRING_SVTOOLS_RTF_MSUPHIDE
#define LO_STRING_SVTOOLS_RTF_MHIDEBOT
#define LO_STRING_SVTOOLS_RTF_MD
#define LO_STRING_SVTOOLS_RTF_MSSUBSUP
#define LO_STRING_SVTOOLS_RTF_MNARYPR
#define LO_STRING_SVTOOLS_RTF_ME
#define LO_STRING_SVTOOLS_RTF_MTYPE
#define LO_STRING_SVTOOLS_RTF_MSUP
#define LO_STRING_SVTOOLS_RTF_MHIDERIGHT
#define LO_STRING_SVTOOLS_RTF_MOMATH
#define LO_STRING_SVTOOLS_RTF_MHIDETOP
#define LO_STRING_SVTOOLS_RTF_MFNAME
#define LO_STRING_SVTOOLS_RTF_MDEG
#define LO_STRING_SVTOOLS_RTF_MDEN
#define LO_STRING_SVTOOLS_RTF_MNARY
#define LO_STRING_SVTOOLS_RTF_MBARPR
#define LO_STRING_SVTOOLS_RTF_MR
#define LO_STRING_SVTOOLS_RTF_MLIMLOW
#define LO_STRING_SVTOOLS_RTF_MGROUPCHR
#define LO_STRING_SVTOOLS_RTF_MBEGCHR
#define LO_STRING_SVTOOLS_RTF_MNUM
#define OOO_STRING_SVTOOLS_RTF_IGNORE
#define LO_STRING_SVTOOLS_RTF_MLIMUPP
#define LO_STRING_SVTOOLS_RTF_MPOS
#define LO_STRING_SVTOOLS_RTF_MENDCHR
#define LO_STRING_SVTOOLS_RTF_MM
#define LO_STRING_SVTOOLS_RTF_MEQARR
#define LO_STRING_SVTOOLS_RTF_MSUB
#define LO_STRING_SVTOOLS_RTF_MSEPCHR
#define LO_STRING_SVTOOLS_RTF_MSSUB
#define LO_STRING_SVTOOLS_RTF_MACC
#define LO_STRING_SVTOOLS_RTF_MCHR
SmTokenType eType
Definition: token.hxx:213
OUString cMathChar
Definition: token.hxx:214
@ TDDDOT
Definition: token.hxx:137
@ TWIDEHAT
Definition: token.hxx:121
@ TCHECK
Definition: token.hxx:123
@ TBREVE
Definition: token.hxx:120
@ TWIDEHARPOON
Definition: token.hxx:121
@ TGRAVE
Definition: token.hxx:120
@ TDOT
Definition: token.hxx:137
@ TBAR
Definition: token.hxx:118
@ TUNDERLINE
Definition: token.hxx:118
@ TACUTE
Definition: token.hxx:120
@ TIINT
Definition: token.hxx:135
@ TWIDEVEC
Definition: token.hxx:121
@ TTILDE
Definition: token.hxx:122
@ THAT
Definition: token.hxx:120
@ TVEC
Definition: token.hxx:122
@ TDDOT
Definition: token.hxx:137
@ TUNDERBRACE
Definition: token.hxx:126
@ TPROD
Definition: token.hxx:83
@ TLIM
Definition: token.hxx:86
@ TOVERLINE
Definition: token.hxx:118
@ TLLLINT
Definition: token.hxx:136
@ TLINT
Definition: token.hxx:136
@ TIIINT
Definition: token.hxx:135
@ TINT
Definition: token.hxx:135
@ TLLINT
Definition: token.hxx:136
@ TWIDETILDE
Definition: token.hxx:121
@ TTEXT
Definition: token.hxx:124
@ TINTD
Definition: token.hxx:135
@ TOVERBRACE
Definition: token.hxx:126
@ TCIRCLE
Definition: token.hxx:122
@ TCOPROD
Definition: token.hxx:83
@ TSUM
Definition: token.hxx:83
@ TOVERSTRIKE
Definition: token.hxx:118
sal_uInt16 sal_Unicode
ResultType type