summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-09-19 10:22:37 +0300
committerخالد حسني <khaled@libreoffice.org>2023-09-19 14:22:11 +0200
commit37f91706e6efd36074187234530f8c8ee8a3edd8 (patch)
tree53709d3067eeab1e11d590ac21b5dec3970e02a9 /starmath/source
parent8a9c3e82386d700549cac30f2555952046e021cb (diff)
starmath: Get the font from current format for special symbols
We want to use the current format when using the symbol in a document, and fallback for stabdard format when rendering the symbol in symbols dialog. Fixup for the following two commits: commit f28b043b4eb40e90b330721fc43d19ae6c06951e Author: Khaled Hosny <khaled@libreoffice.org> Date: Mon Sep 18 19:00:02 2023 +0300 starmath: Fix editing symbols in the Symbols Catalogue 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: Id3730749a49015120ecf9719027f932fd90c605a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157043 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/node.cxx5
-rw-r--r--starmath/source/symbol.cxx8
2 files changed, 7 insertions, 6 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 92eafe8dbccb..01b14c177e43 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2192,10 +2192,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
sal_UCS4 cChar = pSym->GetCharacter();
OUString aTmp( &cChar, 1 );
SetText( aTmp );
- if (pSym->GetFace().GetFamilyName().isEmpty())
- GetFont() = rFormat.GetFont(FNT_VARIABLE);
- else
- GetFont() = pSym->GetFace();
+ GetFont() = pSym->GetFace(&rFormat);
}
else
{
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 7bff8d995d5c..a75b6a912670 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -81,10 +81,14 @@ bool SmSym::IsEqualInUI( const SmSym& rSymbol ) const
m_cChar == rSymbol.m_cChar;
}
-const vcl::Font& SmSym::GetFace() const
+const vcl::Font& SmSym::GetFace(const SmFormat* pFormat) const
{
if (m_aFace.GetFamilyName().isEmpty())
- return SM_MOD()->GetConfig()->GetStandardFormat().GetFont(FNT_MATH);
+ {
+ if (!pFormat)
+ pFormat = &SM_MOD()->GetConfig()->GetStandardFormat();
+ return pFormat->GetFont(FNT_VARIABLE);
+ }
return m_aFace;
}