From f28b043b4eb40e90b330721fc43d19ae6c06951e Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 18 Sep 2023 19:00:02 +0300 Subject: starmath: Fix editing symbols in the Symbols Catalogue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fallout from: commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny Date: Tue Sep 12 18:35:46 2023 +0300 tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols Change-Id: I1f440dccc920b24010160dbeee58795ffd8f85ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157025 Tested-by: Jenkins Reviewed-by: خالد حسني --- starmath/inc/symbol.hxx | 2 +- starmath/source/symbol.cxx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'starmath') diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 39ce0be6e38c..a3d08b37d522 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -51,7 +51,7 @@ public: SmSym& operator = (const SmSym& rSymbol); - const vcl::Font& GetFace() const { return m_aFace; } + const vcl::Font& GetFace() const; sal_UCS4 GetCharacter() const { return m_cChar; } const OUString& GetName() const { return m_aName; } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 3baf79702faf..7bff8d995d5c 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,13 @@ bool SmSym::IsEqualInUI( const SmSym& rSymbol ) const m_cChar == rSymbol.m_cChar; } +const vcl::Font& SmSym::GetFace() const +{ + if (m_aFace.GetFamilyName().isEmpty()) + return SM_MOD()->GetConfig()->GetStandardFormat().GetFont(FNT_MATH); + return m_aFace; +} + /**************************************************************************/ -- cgit