summaryrefslogtreecommitdiff
path: root/starmath/inc/visitors.hxx
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2020-07-15 02:58:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-09-22 11:46:45 +0200
commit8c716704df4aaa83fcd198cc8d92cd3e1e542de9 (patch)
treed0633b308fca302f5e6e2e972b13bfc1658b5507 /starmath/inc/visitors.hxx
parente4d3ad9fe640e71cf3bb4c969b75ebc17ce8e335 (diff)
tdf#38885 Remove createTextFromNode
Change-Id: I85df73e498d61b976ddb908ab1b9c5e368d178cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98795 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/inc/visitors.hxx')
-rw-r--r--starmath/inc/visitors.hxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 3f903aba8820..1591d3757860 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -438,21 +438,37 @@ public:
void Visit( SmRectangleNode* pNode ) override;
void Visit( SmVerticalBraceNode* pNode ) override;
private:
- /** Extract text from a pNode that constitutes a line */
+
+ /**
+ * Extract text from a pNode that constitutes a line.
+ * @param pNode
+ * @return
+ */
void LineToText( SmNode* pNode ) {
Separate( );
- if( pNode )
- pNode->Accept( this );
+ if( pNode ) pNode->Accept( this );
Separate( );
}
+
+ /**
+ * Appends rText to the OUStringBuffer ( maCmdText ).
+ * @param rText
+ * @return
+ */
void Append( const OUString &rText ) {
maCmdText.append( rText );
}
- /** Append a blank for separation, if needed */
+
+ /**
+ * Append a blank for separation, if needed.
+ * It is needed if last char is not ' '.
+ * @return
+ */
void Separate( ){
- if( maCmdText.isEmpty() || maCmdText[ maCmdText.getLength() - 1 ] != ' ' )
+ if( !maCmdText.isEmpty() && maCmdText[ maCmdText.getLength() - 1 ] != ' ' )
maCmdText.append(' ');
}
+
/** Output text generated from the pNodes */
OUStringBuffer maCmdText;
};