1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 /** The SmNode is the basic structure of formula data.
22 * Each token is stored in one node of specific kind.
23 * They can have SmNodeType. It allows to identify node type after abstraction.
24 * Here goes the subclasses tree:
28 * SmStructureNode Head of tree diagram
31 * SmExpressionNode { content }
32 * SmUnHorNode unary operators +-; -+; +x; -x; ...
33 * SmRootNode Root structure
34 * SmBinHorNode binary operators A + B
35 * SmBinVerNode over; frac; ...
36 * SmBinDiagonalNode wideslash
37 * SmSubSupNode csub, csup, lsub, from, to, ...
38 * SmBraceNode (); []; left lbrace right rbrace; ...
39 * SmBracebodyNode ( content ); [ content ]; ...
40 * SmVerticalBraceNode overbrace; underbrace;
41 * SmOperNode sum from to; int from to;
42 * SmAlignNode text alignment
43 * SmAttributeNode font attributes; bold;
44 * SmFontNode font serif; ...
46 * SmVisibleNode drawable node
47 * SmGraphicNode graphics display
49 * SmPolyLineNode overline; underline; widehat; ...
50 * SmBlankNode blank space; ~; ...
51 * SmTextNode "text"; func functname; ...
53 * SmGlyphSpecialNode %symbolname
54 * SmMathSymbolNode math symbols
55 * SmMathIdentifierNode variable
56 * SmRootSymbolNode root symbol
58 * SmErrorNode red ? for errors
68 #include "nodetype.hxx"
70 #include <editeng/editdata.hxx>
72 enum class FontAttribute
{
80 template<> struct typed_flags
<FontAttribute
> : is_typed_flags
<FontAttribute
, 0x0003> {};
84 enum class FontSizeType
{
92 // flags to interdict respective status changes
93 enum class FontChangeMask
{
105 template<> struct typed_flags
<FontChangeMask
> : is_typed_flags
<FontChangeMask
, 0x003f> {};
112 class SmStructureNode
;
114 typedef std::vector
< SmNode
* > SmNodeArray
;
116 enum class SmScaleMode
123 class SmNode
: public SmRect
125 // Rendering info for SmRect
127 // Anclage to the code
129 ESelection m_aESelection
;
132 SmScaleMode meScaleMode
;
133 RectHorAlign meRectHorAlign
;
134 FontChangeMask mnFlags
;
135 FontAttribute mnAttributes
;
138 // index in accessible text; -1 if not (yet) applicable
139 sal_Int32 mnAccIndex
;
142 SmNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
);
145 SmNode(const SmNode
&) = delete;
146 SmNode
& operator=(const SmNode
&) = delete;
151 * Checks node visibility.
152 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
153 * @return node visibility
155 virtual bool IsVisible() const = 0;
158 * Gets the number of subnodes.
159 * @return number of subnodes
161 virtual size_t GetNumSubNodes() const = 0;
164 * Gets the subnode of index nIndex.
166 * @return subnode of index nIndex
168 virtual SmNode
* GetSubNode(size_t nIndex
) = 0;
169 const SmNode
* GetSubNode(size_t nIndex
) const
170 { return const_cast<SmNode
*>(this)->GetSubNode(nIndex
); }
172 virtual const SmNode
* GetLeftMost() const;
175 * Gets the FontChangeMask flags.
176 * @return FontChangeMask flags
178 FontChangeMask
&Flags() { return mnFlags
; }
181 * Gets the font attributes.
182 * @return font attributes
184 FontAttribute
&Attributes() { return mnAttributes
; }
187 * Checks if it is a visible node rendered invisible.
188 * @return rendered visibility
190 bool IsPhantom() const { return mbIsPhantom
; }
193 * Sets the render visibility of a visible node to bIsPhantom.
197 void SetPhantom(bool bIsPhantom
);
200 * Sets the font color.
204 void SetColor(const Color
&rColor
);
207 * Sets the font attribute nAttrib.
208 * Check FontAttribute class.
212 void SetAttribute(FontAttribute nAttrib
);
215 * Clears the font attribute nAttrib.
216 * Check FontAttribute class.
220 void ClearAttribute(FontAttribute nAttrib
);
226 const SmFace
& GetFont() const { return maFace
; };
227 SmFace
& GetFont() { return maFace
; };
230 * Sets the font to rFace.
234 void SetFont(const SmFace
&rFace
);
237 * Sets the font size to rRelSize with type nType.
238 * Check FontSizeType for details.
243 void SetFontSize(const Fraction
&rRelSize
, FontSizeType nType
);
246 * Sets the font size to rRelSize with type FontSizeType::ABSOLUT.
250 void SetSize(const Fraction
&rScale
);
253 * Prepare preliminary settings about font and text
254 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
260 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
, int nDepth
);
263 * Prepare preliminary font attributes
264 * Called on Prepare(...).
267 void PrepareAttributes();
270 * Sets the alignment of the text.
271 * Check RectHorAlign class for details.
272 * The subtrees will be affected if bApplyToSubTree.
274 * @param bApplyToSubTree
277 void SetRectHorAlign(RectHorAlign eHorAlign
, bool bApplyToSubTree
= true );
280 * Gets the alignment of the text.
281 * @return alignment of the text
283 RectHorAlign
GetRectHorAlign() const { return meRectHorAlign
; }
286 * Parses itself to SmRect.
289 const SmRect
& GetRect() const { return *this; }
292 * Moves the rectangle by rVector.
296 void Move(const Point
&rVector
);
299 * Moves the rectangle to rPoint, being the top left corner the origin.
303 void MoveTo(const Point
&rPoint
) { Move(rPoint
- GetTopLeft()); }
306 * Prepares the SmRect to render.
311 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) = 0;
314 * Appends to rText the node text.
318 virtual void GetAccessibleText( OUStringBuffer
&rText
) const = 0;
321 * Gets the node accessible index.
322 * Used for visual editing.
323 * @return node accessible index
325 sal_Int32
GetAccessibleIndex() const { return mnAccIndex
; }
328 * Sets the node accessible index to nAccIndex.
329 * Used for visual editing.
333 void SetAccessibleIndex(sal_Int32 nAccIndex
) { mnAccIndex
= nAccIndex
; }
336 * Finds the node with accessible index nAccIndex.
337 * Used for visual editing.
339 * @return node with accessible index nAccIndex
341 const SmNode
* FindNodeWithAccessibleIndex(sal_Int32 nAccIndex
) const;
344 * Gets the line in the text where the node is located.
345 * It is used to do the visual <-> text correspondence.
348 sal_uInt16
GetRow() const { return sal::static_int_cast
<sal_uInt16
>(m_aESelection
.nStartPara
); }
351 * Gets the column of the line in the text where the node is located.
352 * It is used to do the visual <-> text correspondence.
355 sal_uInt16
GetColumn() const { return sal::static_int_cast
<sal_uInt16
>(m_aESelection
.nStartPos
); }
358 * Gets the scale mode.
361 SmScaleMode
GetScaleMode() const { return meScaleMode
; }
364 * Sets the scale mode to eMode.
368 void SetScaleMode(SmScaleMode eMode
) { meScaleMode
= eMode
; }
370 //visual stuff TODO comment
371 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nWidth
);
372 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
);
375 * Gets the node type.
378 SmNodeType
GetType() const { return meType
; }
382 * The token contains the data extracted from the text mode.
383 * Ej: text, type (sub, sup, int,...), row and column,...
386 const SmToken
& GetToken() const { return maNodeToken
; }
387 SmToken
& GetToken() { return maNodeToken
; }
390 * Gets node position in input text.
391 * @return node position in input text
393 const ESelection
& GetSelection() const { return m_aESelection
; }
396 * Gets node position in input text.
399 void SetSelection(ESelection aESelection
) { m_aESelection
= aESelection
; }
402 * Finds the node from the position in the text.
403 * It is used to do the visual <-> text correspondence.
406 * @return the given node
408 const SmNode
* FindTokenAt(sal_uInt16 nRow
, sal_uInt16 nCol
) const;
411 * Finds the closest rectangle in the screen.
413 * @return the given node
415 const SmNode
* FindRectClosestTo(const Point
&rPoint
) const;
419 * Calls the method for this class on the visitor.
423 virtual void Accept(SmVisitor
* pVisitor
) = 0;
426 * Checks if the node is selected.
427 * @return the node is selected
429 bool IsSelected() const {return mbIsSelected
;}
432 * Sets the node to Selected.
436 void SetSelected(bool Selected
) {mbIsSelected
= Selected
;}
439 * Gets the parent node of this node.
440 * @return parent node
442 const SmStructureNode
* GetParent() const { return mpParentNode
; }
443 SmStructureNode
* GetParent() { return mpParentNode
; }
446 * Sets the parent node.
450 void SetParent(SmStructureNode
* parent
){ mpParentNode
= parent
; }
453 * Sets the token for this node.
457 void SetToken(SmToken
const & token
){ maNodeToken
= token
; }
460 SmStructureNode
* mpParentNode
;
464 /** Abstract baseclass for all composite node
466 * Subclasses of this class can have subnodes. Nodes that doesn't derivate from
467 * this class does not have subnodes.
469 class SmStructureNode
: public SmNode
471 SmNodeArray maSubNodes
;
474 SmStructureNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, size_t nSize
= 0)
475 : SmNode(eNodeType
, rNodeToken
)
476 , maSubNodes(nSize
) {}
479 virtual ~SmStructureNode() override
;
482 * Checks node visibility.
483 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
484 * @return node visibility
486 virtual bool IsVisible() const override
;
489 * Gets the number of subnodes.
490 * @return number of subnodes
492 virtual size_t GetNumSubNodes() const override
;
495 * Gets the subnode of index nIndex.
497 * @return subnode of index nIndex
499 using SmNode::GetSubNode
;
500 virtual SmNode
* GetSubNode(size_t nIndex
) override
;
503 * Gets the subnode of index nIndex, used for operators.
505 * @return subnode of index nIndex
507 SmNode
* GetSubNodeBinMo(size_t nIndex
) const;
510 * Does the cleaning of the subnodes.
513 void ClearSubNodes();
516 * Sets subnodes, used for operators.
522 void SetSubNodes(std::unique_ptr
<SmNode
> pFirst
, std::unique_ptr
<SmNode
> pSecond
,
523 std::unique_ptr
<SmNode
> pThird
= nullptr);
532 void SetSubNodes(SmNode
* pFirst
, SmNode
* pSecond
, SmNode
* pThird
);
535 * Sets subnodes, used for operators.
536 * The data is reordered so the items are correctly ordered.
542 void SetSubNodesBinMo(std::unique_ptr
<SmNode
> pFirst
, std::unique_ptr
<SmNode
> pSecond
,
543 std::unique_ptr
<SmNode
> pThird
= nullptr);
546 * Sets subnodes, used for operators.
547 * The data is reordered so the items are correctly ordered.
553 void SetSubNodesBinMo(SmNode
* pFirst
, SmNode
* pSecond
, SmNode
* pThird
);
560 void SetSubNodes(SmNodeArray
&& rNodeArray
);
563 * Appends to rText the node text.
567 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
570 * Gets the first subnode.
571 * @return first subnode
573 SmNodeArray::iterator
begin() {return maSubNodes
.begin();}
576 * Gets the last subnode.
577 * @return last subnode
579 SmNodeArray::iterator
end() {return maSubNodes
.end();}
582 * Gets the last subnode.
583 * @return last subnode
585 SmNodeArray::reverse_iterator
rbegin() {return maSubNodes
.rbegin();}
588 * Gets the first subnode.
589 * @return first subnode
591 SmNodeArray::reverse_iterator
rend() {return maSubNodes
.rend();}
594 * Get the index of the child node pSubNode.
595 * Returns -1, if pSubNode isn't a subnode of this.
597 * @return index of the child node
599 int IndexOfSubNode(SmNode
const * pSubNode
);
602 * Sets the subnode pNode at nIndex.
603 * If necessary increases the subnodes length.
608 void SetSubNode(size_t nIndex
, SmNode
* pNode
);
611 /** Sets parent on children of this node */
612 void ClaimPaternity();
616 /** Abstract base class for all visible node
618 * Nodes that doesn't derivate from this class doesn't draw anything, but their
621 class SmVisibleNode
: public SmNode
624 SmVisibleNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
625 : SmNode(eNodeType
, rNodeToken
) {}
630 * Checks node visibility.
631 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
632 * @return node visibility
634 virtual bool IsVisible() const override
;
637 * Gets the number of subnodes.
638 * @return number of subnodes
640 virtual size_t GetNumSubNodes() const override
;
643 * Gets the subnode of index nIndex.
645 * @return subnode of index nIndex
647 using SmNode::GetSubNode
;
648 virtual SmNode
* GetSubNode(size_t nIndex
) override
;
652 class SmGraphicNode
: public SmVisibleNode
655 SmGraphicNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
656 : SmVisibleNode(eNodeType
, rNodeToken
) {}
661 * Appends to rText the node text.
665 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
669 /** Draws a rectangle
671 * Used for drawing the line in the OVER and OVERSTRIKE commands.
673 class SmRectangleNode final
: public SmGraphicNode
678 explicit SmRectangleNode(const SmToken
&rNodeToken
)
679 : SmGraphicNode(SmNodeType::Rectangle
, rNodeToken
)
682 //visual stuff TODO comment
683 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nWidth
) override
;
684 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
) override
;
687 * Prepares the SmRect to render.
692 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
696 * Calls the method for this class on the visitor.
700 void Accept(SmVisitor
* pVisitor
) override
;
704 /** Polygon line node
706 * Used to draw the slash of the WIDESLASH command by SmBinDiagonalNode.
708 class SmPolyLineNode final
: public SmGraphicNode
710 tools::Polygon maPoly
;
715 explicit SmPolyLineNode(const SmToken
&rNodeToken
);
718 * Gets the width of the rect.
721 tools::Long
GetWidth() const { return mnWidth
; }
724 * Gets the polygon to draw the node.
727 tools::Polygon
&GetPolygon() { return maPoly
; }
729 //visual stuff TODO comment
730 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nWidth
) override
;
731 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
) override
;
734 * Prepares the SmRect to render.
739 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
743 * Calls the method for this class on the visitor.
747 void Accept(SmVisitor
* pVisitor
) override
;
753 * @remarks This class also serves as baseclass for all nodes that contains text.
755 class SmTextNode
: public SmVisibleNode
760 sal_uInt16 mnFontDesc
;
761 /** Index within text where the selection starts
762 * @remarks Only valid if SmNode::IsSelected() is true
764 sal_Int32 mnSelectionStart
;
765 /** Index within text where the selection ends
766 * @remarks Only valid if SmNode::IsSelected() is true
768 sal_Int32 mnSelectionEnd
;
771 SmTextNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, sal_uInt16 nFontDescP
);
774 SmTextNode(const SmToken
&rNodeToken
, sal_uInt16 nFontDescP
);
777 * Returns the font type being used (text, variable, symbol, ...).
780 sal_uInt16
GetFontDesc() const { return mnFontDesc
; }
783 * Sets the node text to rText.
787 void SetText(const OUString
&rText
) { maText
= rText
; }
790 * Gets the node text.
793 const OUString
& GetText() const { return maText
; }
794 OUString
& GetText() { return maText
; }
797 * Change the text of this node, including the underlying token to rText.
801 void ChangeText(const OUString
&rText
);
804 * Try to guess the correct FontDesc, used during visual editing
807 void AdjustFontDesc();
810 * Index within GetText() where the selection starts.
811 * @remarks Only valid of SmNode::IsSelected() is true.
814 sal_Int32
GetSelectionStart() const { return mnSelectionStart
; }
817 * Index within GetText() where the selection ends.
818 * @remarks Only valid of SmNode::IsSelected() is true.
821 sal_Int32
GetSelectionEnd() const {return mnSelectionEnd
; }
824 * Sets the index within GetText() where the selection starts to index.
828 void SetSelectionStart(sal_Int32 index
) {mnSelectionStart
= index
;}
831 * Sets the index within GetText() where the selection ends to index.
835 void SetSelectionEnd(sal_Int32 index
) {mnSelectionEnd
= index
;}
838 * Prepare preliminary settings about font and text
839 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
845 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
846 int nDepth
) override
;
849 * Prepares the SmRect to render.
854 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
857 * Appends to rText the node text.
861 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
865 * Calls the method for this class on the visitor.
869 void Accept(SmVisitor
* pVisitor
) override
;
872 * Converts the character from StarMath's private area symbols to a matching Unicode
873 * character, if necessary. To be used when converting GetText() to a normal text.
875 * @return unicode char
877 static sal_Unicode
ConvertSymbolToUnicode(sal_Unicode nIn
);
881 /** Special node for user defined characters
883 * Node used for pre- and user-defined characters from:
884 * officecfg/registry/data/org/openoffice/Office/Math.xcu
886 * This is just single characters, I think.
888 class SmSpecialNode
: public SmTextNode
890 bool mbIsFromGreekSymbolSet
;
893 SmSpecialNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, sal_uInt16 _nFontDesc
);
896 explicit SmSpecialNode(const SmToken
&rNodeToken
);
899 * Prepare preliminary settings about font and text
900 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
906 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
907 int nDepth
) override
;
910 * Prepares the SmRect to render.
915 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
919 * Calls the method for this class on the visitor.
923 void Accept(SmVisitor
* pVisitor
) override
;
927 /** Glyph node for custom operators
929 * This node is used with commands: oper, uoper and boper.
930 * E.g. in "A boper op B", "op" will be an instance of SmGlyphSpecialNode.
931 * "boper" simply interprets "op", the following token, as a binary operator.
932 * The command "uoper" interprets the following token as unary operator.
933 * For these commands an instance of SmGlyphSpecialNode is used for the
934 * operator token, following the command.
936 class SmGlyphSpecialNode final
: public SmSpecialNode
939 explicit SmGlyphSpecialNode(const SmToken
&rNodeToken
)
940 : SmSpecialNode(SmNodeType::GlyphSpecial
, rNodeToken
, FNT_MATH
)
944 * Prepares the SmRect to render.
949 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
953 * Calls the method for this class on the visitor.
957 void Accept(SmVisitor
* pVisitor
) override
;
963 * Use for math symbols such as plus, minus and integral in the INT command.
965 class SmMathSymbolNode
: public SmSpecialNode
968 SmMathSymbolNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
969 : SmSpecialNode(eNodeType
, rNodeToken
, FNT_MATH
)
971 SetText(GetToken().cMathChar
);
975 explicit SmMathSymbolNode(const SmToken
&rNodeToken
);
977 //visual stuff TODO comment
978 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nWidth
) override
;
979 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
) override
;
982 * Prepare preliminary settings about font and text
983 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
989 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
990 int nDepth
) override
;
993 * Prepares the SmRect to render.
998 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1002 * Calls the method for this class on the visitor.
1006 void Accept(SmVisitor
* pVisitor
) override
;
1012 * This behaves essentially the same as SmMathSymbolNode and is only used to
1013 * represent math symbols that should be exported as <mi> elements rather than
1016 class SmMathIdentifierNode final
: public SmMathSymbolNode
1019 explicit SmMathIdentifierNode(const SmToken
&rNodeToken
)
1020 : SmMathSymbolNode(SmNodeType::MathIdent
, rNodeToken
) {}
1024 /** Root symbol node
1026 * Root symbol node used by SmRootNode to create the root symbol, in front of
1027 * the line with the line above. I don't think this node should be used for
1030 class SmRootSymbolNode final
: public SmMathSymbolNode
1032 sal_uLong mnBodyWidth
; // width of body (argument) of root sign
1035 explicit SmRootSymbolNode(const SmToken
&rNodeToken
)
1036 : SmMathSymbolNode(SmNodeType::RootSymbol
, rNodeToken
)
1037 , mnBodyWidth(0) { }
1040 * Gets the body width.
1041 * Allows to know how long is the root and paint it.
1042 * @return body width
1044 sal_uLong
GetBodyWidth() const {return mnBodyWidth
;};
1046 //visual stuff TODO comment
1047 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nHeight
) override
;
1048 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
) override
;
1052 * Calls the method for this class on the visitor.
1056 void Accept(SmVisitor
* pVisitor
) override
;
1062 * Used to create the <?> command, that denotes place where something can be
1064 * It is drawn as a square with a shadow.
1066 class SmPlaceNode final
: public SmMathSymbolNode
1069 explicit SmPlaceNode(const SmToken
&rNodeToken
)
1070 : SmMathSymbolNode(SmNodeType::Place
, rNodeToken
) { }
1071 SmPlaceNode() : SmMathSymbolNode(SmNodeType::Place
, SmToken(TPLACE
, MS_PLACE
, "<?>")) { };
1074 * Prepare preliminary settings about font and text
1075 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1081 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1082 int nDepth
) override
;
1085 * Prepares the SmRect to render.
1090 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1094 * Calls the method for this class on the visitor.
1098 void Accept(SmVisitor
* pVisitor
) override
;
1102 /** Error node, for parsing errors
1104 * This node is used for parsing errors and draws a questionmark turned upside
1105 * down (inverted question mark).
1107 class SmErrorNode final
: public SmMathSymbolNode
1110 explicit SmErrorNode(const SmToken
&rNodeToken
)
1111 : SmMathSymbolNode(SmNodeType::Error
, rNodeToken
) { SetText(OUString(MS_ERROR
)); }
1114 * Prepare preliminary settings about font and text
1115 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1121 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1122 int nDepth
) override
;
1125 * Prepares the SmRect to render.
1130 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1134 * Calls the method for this class on the visitor.
1138 void Accept(SmVisitor
* pVisitor
) override
;
1144 * This is the root node for the formula tree. This node is also used for the
1145 * STACK and BINOM commands. When used for root node, its
1146 * children are instances of SmLineNode, and in some obscure cases the child
1147 * can be an instance of SmExpressionNode, mainly when errors occur.
1149 class SmTableNode final
: public SmStructureNode
1151 tools::Long mnFormulaBaseline
;
1153 explicit SmTableNode(const SmToken
&rNodeToken
)
1154 : SmStructureNode(SmNodeType::Table
, rNodeToken
)
1155 , mnFormulaBaseline(0) { }
1157 virtual const SmNode
* GetLeftMost() const override
;
1160 * Prepares the SmRect to render.
1165 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1168 * Gets the formula baseline.
1169 * @return formula baseline
1171 tools::Long
GetFormulaBaseline() const;
1175 * Calls the method for this class on the visitor.
1179 void Accept(SmVisitor
* pVisitor
) override
;
1185 * Used as child of SmTableNode when the SmTableNode is the root node of the
1188 class SmLineNode
: public SmStructureNode
1190 bool mbUseExtraSpaces
;
1193 SmLineNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
1194 : SmStructureNode(eNodeType
, rNodeToken
)
1195 , mbUseExtraSpaces(true) { }
1198 explicit SmLineNode(const SmToken
&rNodeToken
)
1199 : SmStructureNode(SmNodeType::Line
, rNodeToken
)
1200 , mbUseExtraSpaces(true) { }
1203 * Sets if it going to use extra spaces.
1204 * It is used to set if there has to be space between node while rendering.
1205 * By default it is true.
1209 void SetUseExtraSpaces(bool bVal
) { mbUseExtraSpaces
= bVal
; }
1212 * Checks if it is using extra spaces.
1213 * It is used for calculating space between nodes when rendering.
1214 * By default it is true.
1215 * @return is using extra spaces
1217 bool IsUseExtraSpaces() const { return mbUseExtraSpaces
; };
1220 * Prepare preliminary settings about font and text
1221 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1227 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1228 int nDepth
) override
;
1231 * Prepares the SmRect to render.
1236 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1240 * Calls the method for this class on the visitor.
1244 void Accept(SmVisitor
* pVisitor
) override
;
1250 * Used whenever you have an expression such as "A OVER {B + C}", here there is
1251 * an expression node that allows "B + C" to be the denominator of the
1252 * SmBinVerNode, that the OVER command creates.
1254 class SmExpressionNode final
: public SmLineNode
1257 explicit SmExpressionNode(const SmToken
&rNodeToken
)
1258 : SmLineNode(SmNodeType::Expression
, rNodeToken
) { }
1261 * Prepares the SmRect to render.
1266 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1270 * Calls the method for this class on the visitor.
1274 void Accept(SmVisitor
* pVisitor
) override
;
1278 /** Unary horizontal node
1280 * The same as SmBinHorNode except this is for unary operators.
1282 class SmUnHorNode final
: public SmStructureNode
1285 explicit SmUnHorNode(const SmToken
&rNodeToken
)
1286 : SmStructureNode(SmNodeType::UnHor
, rNodeToken
, 2) { }
1289 * Prepares the SmRect to render.
1294 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1298 * Calls the method for this class on the visitor.
1302 void Accept(SmVisitor
* pVisitor
) override
;
1308 * Used for create square roots and other roots, example:
1309 * \f$ \sqrt[\mbox{[Argument]}]{\mbox{[Body]}} \f$.
1312 * 0: Argument (optional)<BR>
1313 * 1: Symbol (instance of SmRootSymbolNode)<BR>
1315 * Where argument is optional and may be NULL.
1317 class SmRootNode final
: public SmStructureNode
1320 explicit SmRootNode(const SmToken
&rNodeToken
)
1321 : SmStructureNode(SmNodeType::Root
, rNodeToken
, 3) { }
1324 * Prepares the SmRect to render.
1329 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1333 * Calls the method for this class on the visitor.
1337 void Accept(SmVisitor
* pVisitor
) override
;
1340 * Returns the node containing the data of the order of the root.
1341 * @return order data
1343 const SmNode
* Argument() const { return const_cast<SmRootNode
*>(this)->Argument(); }
1344 SmNode
* Argument() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1347 * Returns the node containing the data of the character used for the root.
1348 * @return symbol data
1350 const SmRootSymbolNode
* Symbol() const { return const_cast<SmRootNode
*>(this)->Symbol(); }
1351 SmRootSymbolNode
* Symbol() { assert( GetNumSubNodes() == 3 );
1352 assert( GetSubNode( 1 )->GetType()
1353 == SmNodeType::RootSymbol
);
1354 return static_cast< SmRootSymbolNode
* >
1355 ( GetSubNode( 1 )); }
1358 * Returns the node containing the data inside the root.
1361 const SmNode
* Body() const { return const_cast<SmRootNode
*>(this)->Body(); }
1362 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1367 /** Binary horizontal node
1369 * This node is used for binary operators. In a formula such as "A + B".
1372 * 0: Left operand<BR>
1373 * 1: Binary operator<BR>
1374 * 2: Right operand<BR>
1376 * None of the children may be NULL.
1378 class SmBinHorNode final
: public SmStructureNode
1381 explicit SmBinHorNode(const SmToken
&rNodeToken
)
1382 : SmStructureNode(SmNodeType::BinHor
, rNodeToken
, 3) { }
1385 * Prepares the SmRect to render.
1390 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1394 * Calls the method for this class on the visitor.
1398 void Accept(SmVisitor
* pVisitor
) override
;
1401 * Returns the node containing the data of the binary operator.
1402 * @return symbol data
1404 const SmNode
* Symbol() const { return const_cast<SmBinHorNode
*>(this)->Symbol(); }
1405 SmNode
* Symbol() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1408 * Returns the node containing the data of the left operand.
1409 * @return left operand data
1411 const SmNode
* LeftOperand() const { return const_cast<SmBinHorNode
*>(this)->LeftOperand(); }
1412 SmNode
* LeftOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1415 * Returns the node containing the data of the right operand.
1416 * @return right operand data
1418 const SmNode
* RightOperand() const { return const_cast<SmBinHorNode
*>(this)->RightOperand(); }
1419 SmNode
* RightOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1423 /** Binary horizontal node
1425 * This node is used for creating the OVER command, consider the formula:
1426 * "numerator OVER denominator", which looks like
1427 * \f$ \frac{\mbox{numerator}}{\mbox{denominator}} \f$
1431 * 1: Line (instance of SmRectangleNode)<BR>
1432 * 2: Denominator<BR>
1433 * None of the children may be NULL.
1435 class SmBinVerNode final
: public SmStructureNode
1438 explicit SmBinVerNode(const SmToken
&rNodeToken
)
1439 : SmStructureNode(SmNodeType::BinVer
, rNodeToken
, 3) { }
1441 virtual const SmNode
* GetLeftMost() const override
;
1444 * Prepares the SmRect to render.
1449 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1453 * Calls the method for this class on the visitor.
1457 void Accept(SmVisitor
* pVisitor
) override
;
1461 /** Binary diagonal node
1463 * Used for implementing the WIDESLASH command, example: "A WIDESLASH B".
1466 * 0: Left operand<BR>
1467 * 1: right operand<BR>
1468 * 2: Line (instance of SmPolyLineNode).<BR>
1469 * None of the children may be NULL.
1471 class SmBinDiagonalNode final
: public SmStructureNode
1476 * Returns the position and size of the diagonal line by reference.
1481 * @return position and size of the diagonal line
1483 void GetOperPosSize(Point
&rPos
, Size
&rSize
, const Point
&rDiagPoint
, double fAngleDeg
) const;
1486 explicit SmBinDiagonalNode(const SmToken
&rNodeToken
)
1487 : SmStructureNode(SmNodeType::BinDiagonal
, rNodeToken
, 3)
1488 , mbAscending(false) { }
1491 * Checks if it is of ascending type.
1500 * @return ascending.
1502 bool IsAscending() const { return mbAscending
; }
1505 * Sets if the wideslash is ascending to bVal.
1509 void SetAscending(bool bVal
) { mbAscending
= bVal
; }
1512 * Prepares the SmRect to render.
1517 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1521 * Calls the method for this class on the visitor.
1525 void Accept(SmVisitor
* pVisitor
) override
;
1529 /** Enum used to index sub-/supscripts in the 'maSubNodes' array
1532 * See graphic for positions at char:
1547 { CSUB
, CSUP
, RSUB
, RSUP
, LSUB
, LSUP
1550 /** numbers of entries in the above enum (that is: the number of possible
1553 #define SUBSUP_NUM_ENTRIES 6
1555 /** Super- and subscript node
1557 * Used for creating super- and subscripts for commands such as:
1558 * "^", "_", "lsup", "lsub", "csup" and "csub".
1559 * Example: "A^2" which looks like: \f$ A^2 \f$
1561 * This node is also used for creating limits on SmOperNode, when
1562 * "FROM" and "TO" commands are used with "INT", "SUM" or similar.
1564 * Children of this node can be enumerated using the SmSubSup enum.
1565 * Please note that children may be NULL, except for the body.
1566 * It is recommended that you access children using GetBody() and
1569 class SmSubSupNode final
: public SmStructureNode
1574 explicit SmSubSupNode(const SmToken
&rNodeToken
)
1575 : SmStructureNode(SmNodeType::SubSup
, rNodeToken
, 1 + SUBSUP_NUM_ENTRIES
)
1576 , mbUseLimits(false) { }
1579 * Returns the node with the data of what has to be superindex or subindex.
1582 const SmNode
* GetBody() const { return const_cast<SmSubSupNode
*>(this)->GetBody(); }
1583 SmNode
* GetBody() { return GetSubNode(0); }
1586 * Checks if it is going to be used for a limit.
1587 * Example lim from { x toward 0 } { {sin x}over x } = 1
1588 * @return is a limit
1590 bool IsUseLimits() const { return mbUseLimits
; };
1593 * Sets if it is going to be used for a limit to bVal.
1597 void SetUseLimits(bool bVal
) { mbUseLimits
= bVal
; }
1600 * Gets the node with the data of what has to be superindex or subindex.
1601 * The position to check is given by eSubSup.
1602 * @remarks this method may return NULL.
1606 const SmNode
* GetSubSup(SmSubSup eSubSup
) const { return const_cast< SmSubSupNode
* >
1607 ( this )->GetSubSup( eSubSup
); }
1608 SmNode
* GetSubSup(SmSubSup eSubSup
) { return GetSubNode(1 + eSubSup
); };
1611 * Sets the node with the data of what has to be superindex or subindex.
1614 void SetBody(SmNode
* pBody
) { SetSubNode(0, pBody
); }
1617 * Sets the node with the data of what has to be superindex or subindex.
1618 * The position to check is given by eSubSup.
1622 void SetSubSup(SmSubSup eSubSup
, SmNode
* pScript
) { SetSubNode( 1 + eSubSup
, pScript
); }
1625 * Prepares the SmRect to render.
1630 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1634 * Calls the method for this class on the visitor.
1638 void Accept(SmVisitor
* pVisitor
) override
;
1643 /** Node for brace construction
1645 * Used for "lbrace [body] rbrace" and similar constructions.
1646 * Should look like \f$ \{\mbox{[body]}\} \f$
1649 * 0: Opening brace<BR>
1650 * 1: Body (usually SmBracebodyNode)<BR>
1651 * 2: Closing brace<BR>
1652 * None of the children can be NULL.
1654 * Note that child 1 (Body) is usually SmBracebodyNode, but it can also be e.g. SmExpressionNode.
1656 class SmBraceNode final
: public SmStructureNode
1659 explicit SmBraceNode(const SmToken
&rNodeToken
)
1660 : SmStructureNode(SmNodeType::Brace
, rNodeToken
, 3) { }
1663 * Returns the node containing the data of the opening brace.
1664 * @return opening brace data
1666 const SmMathSymbolNode
* OpeningBrace() const { return const_cast<SmBraceNode
*>
1667 (this)->OpeningBrace(); }
1668 SmMathSymbolNode
* OpeningBrace() { assert( GetNumSubNodes() == 3 );
1669 assert( GetSubNode( 0 )->GetType()
1670 == SmNodeType::Math
);
1671 return static_cast< SmMathSymbolNode
* >
1672 ( GetSubNode( 0 )); }
1675 * Returns the node containing the data of what is between braces.
1678 const SmNode
* Body() const { return const_cast<SmBraceNode
*>(this)->Body(); }
1679 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1682 * Returns the node containing the data of the closing brace.
1683 * @return closing brace data
1685 const SmMathSymbolNode
* ClosingBrace() const { return const_cast<SmBraceNode
*>
1686 (this)->ClosingBrace(); }
1687 SmMathSymbolNode
* ClosingBrace() { assert( GetNumSubNodes() == 3 );
1688 assert( GetSubNode( 2 )->GetType()
1689 == SmNodeType::Math
);
1690 return static_cast< SmMathSymbolNode
* >
1691 ( GetSubNode( 2 )); }
1694 * Prepares the SmRect to render.
1699 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1703 * Calls the method for this class on the visitor.
1707 void Accept(SmVisitor
* pVisitor
) override
;
1711 /** Body of an SmBraceNode
1713 * This usually only has one child an SmExpressionNode, however, it can also
1714 * have other children.
1715 * Consider the formula "lbrace [body1] mline [body2] rbrace", looks like:
1716 * \f$ \{\mbox{[body1] | [body2]}\} \f$.
1717 * In this case SmBracebodyNode will have three children, "[body1]", "|" and
1720 class SmBracebodyNode final
: public SmStructureNode
1722 tools::Long mnBodyHeight
;
1725 explicit SmBracebodyNode(const SmToken
&rNodeToken
)
1726 : SmStructureNode(SmNodeType::Bracebody
, rNodeToken
)
1727 , mnBodyHeight(0) { }
1730 * Prepares the SmRect to render.
1735 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1736 tools::Long
GetBodyHeight() const { return mnBodyHeight
; }
1740 * Calls the method for this class on the visitor.
1744 void Accept(SmVisitor
* pVisitor
) override
;
1748 /** Node for vertical brace construction
1750 * Used to implement commands "[body] underbrace [script]" and
1751 * "[body] overbrace [script]".
1752 * Underbrace should look like this \f$ \underbrace{\mbox{body}}_{\mbox{script}}\f$.
1758 * (None of these children are optional, e.g. they must all be not NULL).
1760 class SmVerticalBraceNode final
: public SmStructureNode
1763 explicit SmVerticalBraceNode(const SmToken
&rNodeToken
)
1764 : SmStructureNode(SmNodeType::VerticalBrace
, rNodeToken
, 3) { }
1767 * Returns the node containing the data of what the brace is pointing for.
1771 const SmNode
* Body() const { return const_cast<SmVerticalBraceNode
*>(this)->Body(); }
1772 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1775 * Returns the node containing the data of the brace.
1776 * @return brace data
1778 const SmMathSymbolNode
* Brace() const { return const_cast<SmVerticalBraceNode
*>
1780 SmMathSymbolNode
* Brace() { assert( GetNumSubNodes() == 3 );
1781 assert( GetSubNode( 1 )->GetType()
1782 == SmNodeType::Math
);
1783 return static_cast< SmMathSymbolNode
* >
1784 ( GetSubNode( 1 )); }
1787 * Returns the node containing the data of what is in the brace.
1789 * @return opening brace data
1791 const SmNode
* Script() const { return const_cast<SmVerticalBraceNode
*>(this)->Script(); }
1792 SmNode
* Script() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1795 * Prepares the SmRect to render.
1800 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1804 * Calls the method for this class on the visitor.
1808 void Accept(SmVisitor
* pVisitor
) override
;
1813 * Used for commands like SUM, INT and similar.
1816 * 0: Operation (instance of SmMathSymbolNode or SmSubSupNode)<BR>
1818 * None of the children may be NULL.
1821 class SmOperNode final
: public SmStructureNode
1824 explicit SmOperNode(const SmToken
&rNodeToken
)
1825 : SmStructureNode(SmNodeType::Oper
, rNodeToken
, 2) { }
1828 * Returns the node with the operator data
1829 * @return operator data
1831 const SmNode
* GetSymbol() const { return const_cast<SmOperNode
*>(this)->GetSymbol(); }
1832 SmNode
* GetSymbol();
1835 * Returns the height of the node in base to the symbol
1836 * ( rSymbol contains the operator data )
1837 * and the font format ( rFormat ).
1840 * @return node's height
1842 tools::Long
CalcSymbolHeight(const SmNode
&rSymbol
, const SmFormat
&rFormat
) const;
1845 * Prepares the SmRect to render.
1850 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1854 * Calls the method for this class on the visitor.
1858 void Accept(SmVisitor
* pVisitor
) override
;
1862 /** Node used for alignment
1864 * This node has exactly one child at index 0.
1866 class SmAlignNode final
: public SmStructureNode
1869 explicit SmAlignNode(const SmToken
&rNodeToken
)
1870 : SmStructureNode(SmNodeType::Align
, rNodeToken
) { }
1873 * Prepares the SmRect to render.
1878 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1882 * Calls the method for this class on the visitor.
1886 void Accept(SmVisitor
* pVisitor
) override
;
1892 * Used to give an attribute to another node. Used for commands such as:
1893 * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHARPOON, WIDEHAT and WIDETILDE.
1898 * None of these may be NULL.
1900 class SmAttributeNode final
: public SmStructureNode
1903 explicit SmAttributeNode(const SmToken
&rNodeToken
)
1904 : SmStructureNode(SmNodeType::Attribute
, rNodeToken
, 2) {}
1907 * Prepares the SmRect to render.
1912 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1916 * Calls the method for this class on the visitor.
1920 void Accept(SmVisitor
* pVisitor
) override
;
1923 * Gets the attribute data.
1924 * @return attribute data
1926 const SmNode
* Attribute() const { return const_cast<SmAttributeNode
*>(this)->Attribute(); }
1927 SmNode
* Attribute() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 0 ); }
1930 * Gets the body data ( the nodes affected by the attribute ).
1933 const SmNode
* Body() const { return const_cast<SmAttributeNode
*>(this)->Body(); }
1934 SmNode
* Body() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 1 ); }
1940 * Used to change the font of its children.
1942 class SmFontNode final
: public SmStructureNode
1944 FontSizeType meSizeType
;
1945 Fraction maFontSize
;
1948 explicit SmFontNode(const SmToken
&rNodeToken
)
1949 : SmStructureNode(SmNodeType::Font
, rNodeToken
)
1950 , meSizeType(FontSizeType::MULTIPLY
)
1954 * Sets font size to rValue in nType mode.
1955 * Check FontSizeType for details.
1960 void SetSizeParameter(const Fraction
&rValue
, FontSizeType nType
)
1961 { meSizeType
= nType
; maFontSize
= rValue
; }
1964 * Returns the font size.
1965 * @return font size.
1967 const Fraction
& GetSizeParameter() const {return maFontSize
;}
1970 * Returns the font size type.
1971 * Check FontSizeType for details.
1972 * @return font size type.
1974 FontSizeType
GetSizeType() const {return meSizeType
;}
1977 * Prepare preliminary settings about font and text
1978 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1984 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1985 int nDepth
) override
;
1988 * Prepares the SmRect to render.
1993 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1997 * Calls the method for this class on the visitor.
2001 void Accept(SmVisitor
* pVisitor
) override
;
2007 * Used to implement the MATRIX command, example:
2008 * "matrix{ 1 # 2 ## 3 # 4}".
2010 class SmMatrixNode final
: public SmStructureNode
2012 sal_uInt16 mnNumRows
,
2016 explicit SmMatrixNode(const SmToken
&rNodeToken
)
2017 : SmStructureNode(SmNodeType::Matrix
, rNodeToken
)
2022 * Gets the number of rows of the matrix.
2023 * @return rows number
2025 sal_uInt16
GetNumRows() const {return mnNumRows
;}
2028 * Gets the number of columns of the matrix.
2029 * @return columns number
2031 sal_uInt16
GetNumCols() const {return mnNumCols
;}
2034 * Sets the dimensions of the matrix.
2035 * @param nMatrixRows
2036 * @param nMatrixCols
2039 void SetRowCol(sal_uInt16 nMatrixRows
, sal_uInt16 nMatrixCols
)
2040 { mnNumRows
= nMatrixRows
; mnNumCols
= nMatrixCols
; }
2042 virtual const SmNode
* GetLeftMost() const override
;
2045 * Prepares the SmRect to render.
2050 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
2054 * Calls the method for this class on the visitor.
2058 void Accept(SmVisitor
* pVisitor
) override
;
2062 /** Node for whitespace
2064 * Used to implement the commands "~" and "`". This node is just a blank space.
2066 class SmBlankNode final
: public SmGraphicNode
2071 explicit SmBlankNode(const SmToken
&rNodeToken
)
2072 : SmGraphicNode(SmNodeType::Blank
, rNodeToken
)
2075 void IncreaseBy(const SmToken
&rToken
, sal_uInt32 nMultiplyBy
= 1);
2076 void Clear() { mnNum
= 0; }
2077 sal_uInt16
GetBlankNum() const { return mnNum
; }
2078 void SetBlankNum(sal_uInt16 nNumber
) { mnNum
= nNumber
; }
2081 * Prepare preliminary settings about font and text
2082 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
2088 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
2089 int nDepth
) override
;
2092 * Prepares the SmRect to render.
2097 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
2101 * Calls the method for this class on the visitor.
2105 void Accept(SmVisitor
* pVisitor
) override
;
2109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */