xref: /aoo42x/main/sw/source/ui/config/fontcfg.cxx (revision efeef26f)
1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*efeef26fSAndrew Rist  * distributed with this work for additional information
6*efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*efeef26fSAndrew Rist  *
11*efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*efeef26fSAndrew Rist  *
13*efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*efeef26fSAndrew Rist  * specific language governing permissions and limitations
18*efeef26fSAndrew Rist  * under the License.
19*efeef26fSAndrew Rist  *
20*efeef26fSAndrew Rist  *************************************************************/
21*efeef26fSAndrew Rist 
22*efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <fontcfg.hxx>
29cdf0e10cSrcweir #include <i18npool/mslangid.hxx>
30cdf0e10cSrcweir #include <vcl/outdev.hxx>
31cdf0e10cSrcweir #include <unotools/lingucfg.hxx>
32cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
33cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
34cdf0e10cSrcweir #include <com/sun/star/i18n/ScriptType.hpp>
35cdf0e10cSrcweir #include <swtypes.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <unomid.h>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir using namespace utl;
40cdf0e10cSrcweir using rtl::OUString;
41cdf0e10cSrcweir using namespace com::sun::star::uno;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir /* -----------------07.10.2002 12:15-----------------
44cdf0e10cSrcweir  *
45cdf0e10cSrcweir  * --------------------------------------------------*/
lcl_LanguageOfType(sal_Int16 nType,sal_Int16 eWestern,sal_Int16 eCJK,sal_Int16 eCTL)46cdf0e10cSrcweir inline LanguageType lcl_LanguageOfType(sal_Int16 nType, sal_Int16 eWestern, sal_Int16 eCJK, sal_Int16 eCTL)
47cdf0e10cSrcweir {
48cdf0e10cSrcweir     return LanguageType(
49cdf0e10cSrcweir                 nType < FONT_STANDARD_CJK ? eWestern :
50cdf0e10cSrcweir                     nType >= FONT_STANDARD_CTL ? eCTL : eCJK);
51cdf0e10cSrcweir }
52cdf0e10cSrcweir /* -----------------------------08.09.00 15:52--------------------------------
53cdf0e10cSrcweir 
54cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
GetPropertyNames()55cdf0e10cSrcweir Sequence<OUString> SwStdFontConfig::GetPropertyNames()
56cdf0e10cSrcweir {
57cdf0e10cSrcweir     Sequence<OUString> aNames;
58cdf0e10cSrcweir     if(!aNames.getLength())
59cdf0e10cSrcweir     {
60cdf0e10cSrcweir         static const char* aPropNames[] =
61cdf0e10cSrcweir         {
62cdf0e10cSrcweir             "DefaultFont/Standard",    // 0
63cdf0e10cSrcweir             "DefaultFont/Heading",     // 1
64cdf0e10cSrcweir             "DefaultFont/List",        // 2
65cdf0e10cSrcweir             "DefaultFont/Caption",     // 3
66cdf0e10cSrcweir             "DefaultFont/Index",       // 4
67cdf0e10cSrcweir             "DefaultFontCJK/Standard", // 5
68cdf0e10cSrcweir             "DefaultFontCJK/Heading",  // 6
69cdf0e10cSrcweir             "DefaultFontCJK/List",     // 7
70cdf0e10cSrcweir             "DefaultFontCJK/Caption",  // 8
71cdf0e10cSrcweir             "DefaultFontCJK/Index",    // 9
72cdf0e10cSrcweir             "DefaultFontCTL/Standard", // 10
73cdf0e10cSrcweir             "DefaultFontCTL/Heading",  // 11
74cdf0e10cSrcweir             "DefaultFontCTL/List",     // 12
75cdf0e10cSrcweir             "DefaultFontCTL/Caption",  // 13
76cdf0e10cSrcweir             "DefaultFontCTL/Index",    // 14
77cdf0e10cSrcweir             "DefaultFont/StandardHeight",    // 15
78cdf0e10cSrcweir             "DefaultFont/HeadingHeight",     // 16
79cdf0e10cSrcweir             "DefaultFont/ListHeight",        // 17
80cdf0e10cSrcweir             "DefaultFont/CaptionHeight",     // 18
81cdf0e10cSrcweir             "DefaultFont/IndexHeight",       // 19
82cdf0e10cSrcweir             "DefaultFontCJK/StandardHeight", // 20
83cdf0e10cSrcweir             "DefaultFontCJK/HeadingHeight",  // 21
84cdf0e10cSrcweir             "DefaultFontCJK/ListHeight",     // 22
85cdf0e10cSrcweir             "DefaultFontCJK/CaptionHeight",  // 23
86cdf0e10cSrcweir             "DefaultFontCJK/IndexHeight",    // 24
87cdf0e10cSrcweir             "DefaultFontCTL/StandardHeight", // 25
88cdf0e10cSrcweir             "DefaultFontCTL/HeadingHeight",  // 26
89cdf0e10cSrcweir             "DefaultFontCTL/ListHeight",     // 27
90cdf0e10cSrcweir             "DefaultFontCTL/CaptionHeight",  // 28
91cdf0e10cSrcweir             "DefaultFontCTL/IndexHeight"     // 29
92cdf0e10cSrcweir         };
93cdf0e10cSrcweir         const int nCount = sizeof(aPropNames)/sizeof(const char*);
94cdf0e10cSrcweir         aNames.realloc(nCount);
95cdf0e10cSrcweir         OUString* pNames = aNames.getArray();
96cdf0e10cSrcweir         for(int i = 0; i < nCount; i++)
97cdf0e10cSrcweir         {
98cdf0e10cSrcweir             pNames[i] = OUString::createFromAscii(aPropNames[i]);
99cdf0e10cSrcweir         }
100cdf0e10cSrcweir     }
101cdf0e10cSrcweir 	return aNames;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir /*-----------------03.09.96 15.00-------------------
104cdf0e10cSrcweir 
105cdf0e10cSrcweir --------------------------------------------------*/
106cdf0e10cSrcweir 
SwStdFontConfig()107cdf0e10cSrcweir SwStdFontConfig::SwStdFontConfig() :
108cdf0e10cSrcweir     utl::ConfigItem(C2U("Office.Writer"))
109cdf0e10cSrcweir {
110cdf0e10cSrcweir     SvtLinguOptions aLinguOpt;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     SvtLinguConfig().GetOptions( aLinguOpt );
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
115cdf0e10cSrcweir                 eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
116cdf0e10cSrcweir                 eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     for(sal_Int16 i = 0; i < DEF_FONT_COUNT; i++)
119cdf0e10cSrcweir     {
120cdf0e10cSrcweir         sDefaultFonts[i] = GetDefaultFor(i,
121cdf0e10cSrcweir             lcl_LanguageOfType(i, eWestern, eCJK, eCTL));
122cdf0e10cSrcweir         nDefaultFontHeight[i] = -1;
123cdf0e10cSrcweir     }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     Sequence<OUString> aNames = GetPropertyNames();
126cdf0e10cSrcweir 	Sequence<Any> aValues = GetProperties(aNames);
127cdf0e10cSrcweir 	const Any* pValues = aValues.getConstArray();
128cdf0e10cSrcweir 	DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
129cdf0e10cSrcweir 	if(aValues.getLength() == aNames.getLength())
130cdf0e10cSrcweir 	{
131cdf0e10cSrcweir 		for(int nProp = 0; nProp < aNames.getLength(); nProp++)
132cdf0e10cSrcweir 		{
133cdf0e10cSrcweir 			if(pValues[nProp].hasValue())
134cdf0e10cSrcweir 			{
135cdf0e10cSrcweir                 if( nProp < DEF_FONT_COUNT)
136cdf0e10cSrcweir                 {
137cdf0e10cSrcweir                     OUString sVal;
138cdf0e10cSrcweir                     pValues[nProp] >>= sVal;
139cdf0e10cSrcweir                     sDefaultFonts[nProp] = sVal;
140cdf0e10cSrcweir                 }
141cdf0e10cSrcweir                 else
142cdf0e10cSrcweir                 {
143cdf0e10cSrcweir                    pValues[nProp] >>= nDefaultFontHeight[nProp - DEF_FONT_COUNT];
144cdf0e10cSrcweir                    nDefaultFontHeight[nProp - DEF_FONT_COUNT] = MM100_TO_TWIP(nDefaultFontHeight[nProp - DEF_FONT_COUNT]);
145cdf0e10cSrcweir                 }
146cdf0e10cSrcweir             }
147cdf0e10cSrcweir 		}
148cdf0e10cSrcweir 	}
149cdf0e10cSrcweir }
150cdf0e10cSrcweir /* -----------------------------08.09.00 15:58--------------------------------
151cdf0e10cSrcweir 
152cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
Commit()153cdf0e10cSrcweir void	SwStdFontConfig::Commit()
154cdf0e10cSrcweir {
155cdf0e10cSrcweir 	Sequence<OUString> aNames = GetPropertyNames();
156cdf0e10cSrcweir 	Sequence<Any> aValues(aNames.getLength());
157cdf0e10cSrcweir 	Any* pValues = aValues.getArray();
158cdf0e10cSrcweir     SvtLinguOptions aLinguOpt;
159cdf0e10cSrcweir 
160cdf0e10cSrcweir     SvtLinguConfig().GetOptions( aLinguOpt );
161cdf0e10cSrcweir 
162cdf0e10cSrcweir     sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
163cdf0e10cSrcweir                 eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
164cdf0e10cSrcweir                 eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     for(sal_uInt16 nProp = 0;
167cdf0e10cSrcweir         nProp < sal::static_int_cast< sal_uInt16, sal_Int32 >( aNames.getLength() );
168cdf0e10cSrcweir             nProp++)
169cdf0e10cSrcweir 	{
170cdf0e10cSrcweir         if( nProp < DEF_FONT_COUNT )
171cdf0e10cSrcweir         {
172cdf0e10cSrcweir             if(GetDefaultFor(nProp, lcl_LanguageOfType(nProp, eWestern, eCJK, eCTL)) != sDefaultFonts[nProp])
173cdf0e10cSrcweir                 pValues[nProp] <<= OUString(sDefaultFonts[nProp]);
174cdf0e10cSrcweir         }
175cdf0e10cSrcweir         else
176cdf0e10cSrcweir         {
177cdf0e10cSrcweir             if(nDefaultFontHeight[nProp - DEF_FONT_COUNT] > 0)
178cdf0e10cSrcweir                 pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(nDefaultFontHeight[nProp - DEF_FONT_COUNT]));
179cdf0e10cSrcweir         }
180cdf0e10cSrcweir 	}
181cdf0e10cSrcweir 	PutProperties(aNames, aValues);
182cdf0e10cSrcweir }
183cdf0e10cSrcweir /* -----------------------------08.09.00 15:56--------------------------------
184cdf0e10cSrcweir 
185cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
~SwStdFontConfig()186cdf0e10cSrcweir SwStdFontConfig::~SwStdFontConfig()
187cdf0e10cSrcweir {}
188cdf0e10cSrcweir /*-----------------18.01.97 10.05-------------------
189cdf0e10cSrcweir 
190cdf0e10cSrcweir --------------------------------------------------*/
IsFontDefault(sal_uInt16 nFontType) const191cdf0e10cSrcweir sal_Bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const
192cdf0e10cSrcweir {
193cdf0e10cSrcweir     sal_Bool bSame = sal_False;
194cdf0e10cSrcweir     SvtLinguOptions aLinguOpt;
195cdf0e10cSrcweir 
196cdf0e10cSrcweir     SvtLinguConfig().GetOptions( aLinguOpt );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir     sal_Int16   eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
199cdf0e10cSrcweir                 eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
200cdf0e10cSrcweir                 eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
201cdf0e10cSrcweir 
202cdf0e10cSrcweir     String sDefFont(GetDefaultFor(FONT_STANDARD, eWestern));
203cdf0e10cSrcweir     String sDefFontCJK(GetDefaultFor(FONT_STANDARD_CJK, eCJK));
204cdf0e10cSrcweir     String sDefFontCTL(GetDefaultFor(FONT_STANDARD_CTL, eCTL));
205cdf0e10cSrcweir     LanguageType eLang = lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL);
206cdf0e10cSrcweir     switch( nFontType )
207cdf0e10cSrcweir 	{
208cdf0e10cSrcweir 		case FONT_STANDARD:
209cdf0e10cSrcweir             bSame = sDefaultFonts[nFontType] == sDefFont;
210cdf0e10cSrcweir 		break;
211cdf0e10cSrcweir         case FONT_STANDARD_CJK:
212cdf0e10cSrcweir             bSame = sDefaultFonts[nFontType] == sDefFontCJK;
213cdf0e10cSrcweir 		break;
214cdf0e10cSrcweir         case FONT_STANDARD_CTL:
215cdf0e10cSrcweir             bSame = sDefaultFonts[nFontType] == sDefFontCTL;
216cdf0e10cSrcweir 		break;
217cdf0e10cSrcweir         case FONT_OUTLINE :
218cdf0e10cSrcweir         case FONT_OUTLINE_CJK :
219cdf0e10cSrcweir         case FONT_OUTLINE_CTL :
220cdf0e10cSrcweir             bSame = sDefaultFonts[nFontType] ==
221cdf0e10cSrcweir                 GetDefaultFor(nFontType, eLang);
222cdf0e10cSrcweir         break;
223cdf0e10cSrcweir         case FONT_LIST    :
224cdf0e10cSrcweir         case FONT_CAPTION :
225cdf0e10cSrcweir         case FONT_INDEX   :
226cdf0e10cSrcweir             bSame = sDefaultFonts[nFontType] == sDefFont &&
227cdf0e10cSrcweir                     sDefaultFonts[FONT_STANDARD] == sDefFont;
228cdf0e10cSrcweir 		break;
229cdf0e10cSrcweir         case FONT_LIST_CJK    :
230cdf0e10cSrcweir         case FONT_CAPTION_CJK :
231cdf0e10cSrcweir         case FONT_INDEX_CJK   :
232cdf0e10cSrcweir 		{
233cdf0e10cSrcweir             sal_Bool b1 = sDefaultFonts[FONT_STANDARD_CJK] == sDefFontCJK;
234cdf0e10cSrcweir             bSame = b1 && sDefaultFonts[nFontType] == sDefFontCJK;
235cdf0e10cSrcweir 		}
236cdf0e10cSrcweir 		break;
237cdf0e10cSrcweir         case FONT_LIST_CTL    :
238cdf0e10cSrcweir         case FONT_CAPTION_CTL :
239cdf0e10cSrcweir         case FONT_INDEX_CTL   :
240cdf0e10cSrcweir 		{
241cdf0e10cSrcweir             sal_Bool b1 = sDefaultFonts[FONT_STANDARD_CJK] == sDefFontCTL;
242cdf0e10cSrcweir             bSame = b1 && sDefaultFonts[nFontType] == sDefFontCTL;
243cdf0e10cSrcweir 		}
244cdf0e10cSrcweir 		break;
245cdf0e10cSrcweir     }
246cdf0e10cSrcweir 	return bSame;
247cdf0e10cSrcweir }
248cdf0e10cSrcweir 
249cdf0e10cSrcweir /* -----------------11.01.99 13:16-------------------
250cdf0e10cSrcweir  * Standards auslesen
251cdf0e10cSrcweir  * --------------------------------------------------*/
GetDefaultFor(sal_uInt16 nFontType,LanguageType eLang)252cdf0e10cSrcweir String  SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
253cdf0e10cSrcweir {
254cdf0e10cSrcweir     String sRet;
255cdf0e10cSrcweir     sal_uInt16 nFontId;
256cdf0e10cSrcweir     switch( nFontType )
257cdf0e10cSrcweir 	{
258cdf0e10cSrcweir         case FONT_OUTLINE :
259cdf0e10cSrcweir             nFontId = DEFAULTFONT_LATIN_HEADING;
260cdf0e10cSrcweir         break;
261cdf0e10cSrcweir         case FONT_OUTLINE_CJK :
262cdf0e10cSrcweir             nFontId = DEFAULTFONT_CJK_HEADING;
263cdf0e10cSrcweir         break;
264cdf0e10cSrcweir         case FONT_OUTLINE_CTL :
265cdf0e10cSrcweir             nFontId = DEFAULTFONT_CTL_HEADING;
266cdf0e10cSrcweir         break;
267cdf0e10cSrcweir         case FONT_STANDARD_CJK:
268cdf0e10cSrcweir         case FONT_LIST_CJK    :
269cdf0e10cSrcweir         case FONT_CAPTION_CJK :
270cdf0e10cSrcweir         case FONT_INDEX_CJK   :
271cdf0e10cSrcweir             nFontId = DEFAULTFONT_CJK_TEXT;
272cdf0e10cSrcweir         break;
273cdf0e10cSrcweir         case FONT_STANDARD_CTL:
274cdf0e10cSrcweir         case FONT_LIST_CTL    :
275cdf0e10cSrcweir         case FONT_CAPTION_CTL :
276cdf0e10cSrcweir         case FONT_INDEX_CTL   :
277cdf0e10cSrcweir             nFontId = DEFAULTFONT_CTL_TEXT;
278cdf0e10cSrcweir         break;
279cdf0e10cSrcweir //        case FONT_STANDARD:
280cdf0e10cSrcweir //        case FONT_LIST    :
281cdf0e10cSrcweir //        case FONT_CAPTION :
282cdf0e10cSrcweir //        case FONT_INDEX   :
283cdf0e10cSrcweir         default:
284cdf0e10cSrcweir             nFontId = DEFAULTFONT_LATIN_TEXT;
285cdf0e10cSrcweir     }
286cdf0e10cSrcweir     Font aFont = OutputDevice::GetDefaultFont(nFontId, eLang, DEFAULTFONT_FLAGS_ONLYONE);
287cdf0e10cSrcweir     return  aFont.GetName();
288cdf0e10cSrcweir }
289cdf0e10cSrcweir 
290cdf0e10cSrcweir /*-- 11.10.2005 10:43:43---------------------------------------------------
291cdf0e10cSrcweir 
292cdf0e10cSrcweir   -----------------------------------------------------------------------*/
GetDefaultHeightFor(sal_uInt16 nFontType,LanguageType eLang)293cdf0e10cSrcweir sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang)
294cdf0e10cSrcweir {
295cdf0e10cSrcweir     sal_Int32 nRet = FONTSIZE_DEFAULT;
296cdf0e10cSrcweir     switch( nFontType )
297cdf0e10cSrcweir     {
298cdf0e10cSrcweir         case  FONT_OUTLINE:
299cdf0e10cSrcweir         case  FONT_OUTLINE_CJK:
300cdf0e10cSrcweir         case  FONT_OUTLINE_CTL:
301cdf0e10cSrcweir             nRet = FONTSIZE_OUTLINE;
302cdf0e10cSrcweir         break;
303cdf0e10cSrcweir     }
304cdf0e10cSrcweir     if( eLang == LANGUAGE_THAI && nFontType >= FONT_STANDARD_CTL )
305cdf0e10cSrcweir     {
306cdf0e10cSrcweir         nRet = nRet * 4 / 3;
307cdf0e10cSrcweir     }
308cdf0e10cSrcweir     return nRet;
309cdf0e10cSrcweir }
310cdf0e10cSrcweir 
311cdf0e10cSrcweir /*-- 11.10.2005 10:50:06---------------------------------------------------
312cdf0e10cSrcweir 
313cdf0e10cSrcweir   -----------------------------------------------------------------------*/
ChangeInt(sal_uInt16 nFontType,sal_Int32 nHeight)314cdf0e10cSrcweir void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight )
315cdf0e10cSrcweir {
316cdf0e10cSrcweir     DBG_ASSERT( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()");
317cdf0e10cSrcweir     if( nFontType < DEF_FONT_COUNT && nDefaultFontHeight[nFontType] != nHeight)
318cdf0e10cSrcweir     {
319cdf0e10cSrcweir         SvtLinguOptions aLinguOpt;
320cdf0e10cSrcweir         SvtLinguConfig().GetOptions( aLinguOpt );
321cdf0e10cSrcweir 
322cdf0e10cSrcweir         sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN),
323cdf0e10cSrcweir                   eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN),
324cdf0e10cSrcweir                   eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
325cdf0e10cSrcweir 
326cdf0e10cSrcweir         // #i92090# default height value sets back to -1
327cdf0e10cSrcweir         const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL));
328cdf0e10cSrcweir         const bool bIsDefaultHeight = nHeight == nDefaultHeight;
329cdf0e10cSrcweir         if( bIsDefaultHeight && nDefaultFontHeight[nFontType] > 0 )
330cdf0e10cSrcweir         {
331cdf0e10cSrcweir             SetModified();
332cdf0e10cSrcweir             nDefaultFontHeight[nFontType] = -1;
333cdf0e10cSrcweir         }
334cdf0e10cSrcweir         else if( !bIsDefaultHeight && nHeight != nDefaultFontHeight[nFontType] )
335cdf0e10cSrcweir         {
336cdf0e10cSrcweir             SetModified();
337cdf0e10cSrcweir             nDefaultFontHeight[nFontType] = nHeight;
338cdf0e10cSrcweir         }
339cdf0e10cSrcweir     }
340cdf0e10cSrcweir }
341cdf0e10cSrcweir 
342cdf0e10cSrcweir /*-- 08.11.2005 14:18:26---------------------------------------------------
343cdf0e10cSrcweir 
344cdf0e10cSrcweir   -----------------------------------------------------------------------*/
GetFontHeight(sal_uInt8 nFont,sal_uInt8 nScriptType,LanguageType eLang)345cdf0e10cSrcweir sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang )
346cdf0e10cSrcweir {
347cdf0e10cSrcweir     DBG_ASSERT(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()");
348cdf0e10cSrcweir     sal_Int32 nRet = nDefaultFontHeight[nFont + FONT_PER_GROUP * nScriptType];
349cdf0e10cSrcweir     if(nRet <= 0)
350cdf0e10cSrcweir         return GetDefaultHeightFor(nFont + FONT_PER_GROUP * nScriptType, eLang);
351cdf0e10cSrcweir     return nRet;
352cdf0e10cSrcweir }
353cdf0e10cSrcweir 
Notify(const::com::sun::star::uno::Sequence<rtl::OUString> &)354cdf0e10cSrcweir void SwStdFontConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
355cdf0e10cSrcweir 
356