diff options
-rw-r--r-- | starmath/inc/document.hxx | 8 | ||||
-rw-r--r-- | starmath/source/document.cxx | 16 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 2 |
3 files changed, 12 insertions, 14 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index 756fc0f926ef..83cda04329a6 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -29,6 +29,7 @@ #include <vcl/jobset.hxx> #include <vcl/virdev.hxx> #include <sax/fshelper.hxx> +#include <unotools/lingucfg.hxx> #include <oox/core/filterbase.hxx> #include <oox/mathml/import.hxx> #include <oox/export/utils.hxx> @@ -65,7 +66,6 @@ class SmCursor; class SmDocShell; class EditEngine; - class SmPrinterAccess { VclPtr<Printer> pPrinter; @@ -77,9 +77,7 @@ public: OutputDevice* GetRefDev() { return pRefDev.get(); } }; - -void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool); - +void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool, const SvtLinguOptions &rOpt); class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener { @@ -90,6 +88,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener SmFormat maFormat; SmParser maParser; OUString maAccText; + SvtLinguOptions maLinguOptions; SmTableNode *mpTree; SfxItemPool *mpEditEngineItemPool; EditEngine *mpEditEngine; @@ -188,6 +187,7 @@ public: EditEngine & GetEditEngine(); SfxItemPool & GetEditEngineItemPool(); + const SvtLinguOptions & GetLinguOptions() const { return maLinguOptions; } void DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection = false); Size GetSize(); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 3e2bf427990b..a07c39f2d6d6 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -46,7 +46,6 @@ #include <svl/fstathelper.hxx> #include <svl/intitem.hxx> #include <svl/itempool.hxx> -#include <unotools/lingucfg.hxx> #include <unotools/linguprops.hxx> #include <unotools/pathoptions.hxx> #include <svl/ptitem.hxx> @@ -287,12 +286,9 @@ void SmDocShell::ArrangeFormula() maAccText.clear(); } -void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool) +void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool, const SvtLinguOptions &rOpt) { // set fonts to be used - SvtLinguOptions aOpt; - SvtLinguConfig().GetOptions( aOpt ); - struct FontDta { sal_Int16 nFallbackLang; sal_Int16 nLang; @@ -310,9 +306,9 @@ void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool) { LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_NONE, DefaultFontType::CTL_TEXT, EE_CHAR_FONTINFO_CTL } }; - aTable[0].nLang = aOpt.nDefaultLanguage; - aTable[1].nLang = aOpt.nDefaultLanguage_CJK; - aTable[2].nLang = aOpt.nDefaultLanguage_CTL; + aTable[0].nLang = rOpt.nDefaultLanguage; + aTable[1].nLang = rOpt.nDefaultLanguage_CJK; + aTable[2].nLang = rOpt.nDefaultLanguage_CTL; for (FontDta & rFntDta : aTable) { @@ -348,7 +344,7 @@ EditEngine& SmDocShell::GetEditEngine() mpEditEngineItemPool = EditEngine::CreatePool(); - SetEditEngineDefaultFonts(*mpEditEngineItemPool); + SetEditEngineDefaultFonts(*mpEditEngineItemPool, maLinguOptions); mpEditEngine = new EditEngine( mpEditEngineItemPool ); @@ -640,6 +636,8 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) , mnModifyCount(0) , mbFormulaArranged(false) { + SvtLinguConfig().GetOptions(maLinguOptions); + SetPool(&SfxGetpApp()->GetPool()); SmModule *pp = SM_MOD(); diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 89275bb3dceb..ac3244561dce 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -230,7 +230,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& ) pEditEngine->SetDefTab(sal_uInt16(GetTextWidth("XXXX"))); - SetEditEngineDefaultFonts(pDoc->GetEditEngineItemPool()); + SetEditEngineDefaultFonts(pDoc->GetEditEngineItemPool(), pDoc->GetLinguOptions()); // forces new settings to be used // unfortunately this resets the whole edit engine |