Kaydet (Commit) b2a76e66 authored tarafından Caolán McNamara's avatar Caolán McNamara

move SvtLinguOptions into SmDocShell

Change-Id: I46b84ab4cb9cc5d25b6cb60241fcc8a65e449886
üst c2b1336b
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <vcl/jobset.hxx> #include <vcl/jobset.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <sax/fshelper.hxx> #include <sax/fshelper.hxx>
#include <unotools/lingucfg.hxx>
#include <oox/core/filterbase.hxx> #include <oox/core/filterbase.hxx>
#include <oox/mathml/import.hxx> #include <oox/mathml/import.hxx>
#include <oox/export/utils.hxx> #include <oox/export/utils.hxx>
...@@ -65,7 +66,6 @@ class SmCursor; ...@@ -65,7 +66,6 @@ class SmCursor;
class SmDocShell; class SmDocShell;
class EditEngine; class EditEngine;
class SmPrinterAccess class SmPrinterAccess
{ {
VclPtr<Printer> pPrinter; VclPtr<Printer> pPrinter;
...@@ -77,9 +77,7 @@ public: ...@@ -77,9 +77,7 @@ public:
OutputDevice* GetRefDev() { return pRefDev.get(); } OutputDevice* GetRefDev() { return pRefDev.get(); }
}; };
void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool, const SvtLinguOptions &rOpt);
void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool);
class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
{ {
...@@ -90,6 +88,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener ...@@ -90,6 +88,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
SmFormat maFormat; SmFormat maFormat;
SmParser maParser; SmParser maParser;
OUString maAccText; OUString maAccText;
SvtLinguOptions maLinguOptions;
SmTableNode *mpTree; SmTableNode *mpTree;
SfxItemPool *mpEditEngineItemPool; SfxItemPool *mpEditEngineItemPool;
EditEngine *mpEditEngine; EditEngine *mpEditEngine;
...@@ -188,6 +187,7 @@ public: ...@@ -188,6 +187,7 @@ public:
EditEngine & GetEditEngine(); EditEngine & GetEditEngine();
SfxItemPool & GetEditEngineItemPool(); SfxItemPool & GetEditEngineItemPool();
const SvtLinguOptions & GetLinguOptions() const { return maLinguOptions; }
void DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection = false); void DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection = false);
Size GetSize(); Size GetSize();
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <svl/fstathelper.hxx> #include <svl/fstathelper.hxx>
#include <svl/intitem.hxx> #include <svl/intitem.hxx>
#include <svl/itempool.hxx> #include <svl/itempool.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/linguprops.hxx> #include <unotools/linguprops.hxx>
#include <unotools/pathoptions.hxx> #include <unotools/pathoptions.hxx>
#include <svl/ptitem.hxx> #include <svl/ptitem.hxx>
...@@ -287,12 +286,9 @@ void SmDocShell::ArrangeFormula() ...@@ -287,12 +286,9 @@ void SmDocShell::ArrangeFormula()
maAccText.clear(); maAccText.clear();
} }
void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool) void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool, const SvtLinguOptions &rOpt)
{ {
// set fonts to be used // set fonts to be used
SvtLinguOptions aOpt;
SvtLinguConfig().GetOptions( aOpt );
struct FontDta { struct FontDta {
sal_Int16 nFallbackLang; sal_Int16 nFallbackLang;
sal_Int16 nLang; sal_Int16 nLang;
...@@ -310,9 +306,9 @@ void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool) ...@@ -310,9 +306,9 @@ void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool)
{ LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_NONE, { LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_NONE,
DefaultFontType::CTL_TEXT, EE_CHAR_FONTINFO_CTL } DefaultFontType::CTL_TEXT, EE_CHAR_FONTINFO_CTL }
}; };
aTable[0].nLang = aOpt.nDefaultLanguage; aTable[0].nLang = rOpt.nDefaultLanguage;
aTable[1].nLang = aOpt.nDefaultLanguage_CJK; aTable[1].nLang = rOpt.nDefaultLanguage_CJK;
aTable[2].nLang = aOpt.nDefaultLanguage_CTL; aTable[2].nLang = rOpt.nDefaultLanguage_CTL;
for (FontDta & rFntDta : aTable) for (FontDta & rFntDta : aTable)
{ {
...@@ -348,7 +344,7 @@ EditEngine& SmDocShell::GetEditEngine() ...@@ -348,7 +344,7 @@ EditEngine& SmDocShell::GetEditEngine()
mpEditEngineItemPool = EditEngine::CreatePool(); mpEditEngineItemPool = EditEngine::CreatePool();
SetEditEngineDefaultFonts(*mpEditEngineItemPool); SetEditEngineDefaultFonts(*mpEditEngineItemPool, maLinguOptions);
mpEditEngine = new EditEngine( mpEditEngineItemPool ); mpEditEngine = new EditEngine( mpEditEngineItemPool );
...@@ -640,6 +636,8 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) ...@@ -640,6 +636,8 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags )
, mnModifyCount(0) , mnModifyCount(0)
, mbFormulaArranged(false) , mbFormulaArranged(false)
{ {
SvtLinguConfig().GetOptions(maLinguOptions);
SetPool(&SfxGetpApp()->GetPool()); SetPool(&SfxGetpApp()->GetPool());
SmModule *pp = SM_MOD(); SmModule *pp = SM_MOD();
......
...@@ -230,7 +230,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& ) ...@@ -230,7 +230,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
pEditEngine->SetDefTab(sal_uInt16(GetTextWidth("XXXX"))); pEditEngine->SetDefTab(sal_uInt16(GetTextWidth("XXXX")));
SetEditEngineDefaultFonts(pDoc->GetEditEngineItemPool()); SetEditEngineDefaultFonts(pDoc->GetEditEngineItemPool(), pDoc->GetLinguOptions());
// forces new settings to be used // forces new settings to be used
// unfortunately this resets the whole edit engine // unfortunately this resets the whole edit engine
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment