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 @@
#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();
......
......@@ -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();
......
......@@ -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
......
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