summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-09-18 19:00:02 +0300
committerخالد حسني <khaled@libreoffice.org>2023-09-18 19:09:34 +0200
commitf28b043b4eb40e90b330721fc43d19ae6c06951e (patch)
tree38c204ae0c5c34e4c291257925f4e8a2d0e673e9 /starmath
parent6182deca602d533d1b2e379ba62d890681608144 (diff)
starmath: Fix editing symbols in the Symbols Catalogue
Fallout from: commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny <khaled@libreoffice.org> 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: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/symbol.hxx2
-rw-r--r--starmath/source/symbol.cxx8
2 files changed, 9 insertions, 1 deletions
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 <utility.hxx>
#include <cfgitem.hxx>
#include <smmod.hxx>
+#include <format.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
@@ -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;
+}
+
/**************************************************************************/