diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-07-14 15:53:15 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-07-15 07:56:39 +0000 |
commit | 1eb533a0456f508972b3af16b8b867672d09ac49 (patch) | |
tree | 40ba4f72683f778c5c218d5eaecb3c53b488057b /starmath | |
parent | e6d2827fc385353f07d1703714f715718576c130 (diff) |
starmath: Make AdjustFontDesc() precede Prepare()
because what Prepare() does depends on both nFontDesc and token
of the SmTextNode.
Change-Id: Ib7f8c408eb8f95a10f27ccbd3d80cdd0d6ea6d56
Reviewed-on: https://gerrit.libreoffice.org/27210
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/node.hxx | 3 | ||||
-rw-r--r-- | starmath/source/cursor.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index d03f0f23e12b..a62f1ccefa72 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -157,6 +157,9 @@ public: void SetFontSize(const Fraction &rRelSize, FontSizeType nType); void SetSize(const Fraction &rScale); + /** Prepare preliminary settings about font and text + * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.) + */ virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); void PrepareAttributes(); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index f27dbcd3a0d1..bef900af6ed4 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -988,10 +988,9 @@ void SmCursor::InsertText(const OUString& aString) token.aText = aString; SmTextNode* pText = new SmTextNode(token, FNT_VARIABLE); - - //Prepare the new node - pText->Prepare(mpDocShell->GetFormat(), *mpDocShell); + pText->SetText(aString); pText->AdjustFontDesc(); + pText->Prepare(mpDocShell->GetFormat(), *mpDocShell); SmNodeList* pList = new SmNodeList(); pList->push_front(pText); |