Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include "CharacterProperties.hxx"
21 : : #include "ContainerHelper.hxx"
22 : : #include "macros.hxx"
23 : :
24 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
25 : : #include <com/sun/star/style/XStyle.hpp>
26 : : #include <com/sun/star/awt/FontSlant.hpp>
27 : : #include <com/sun/star/lang/Locale.hpp>
28 : :
29 : : #include <com/sun/star/awt/FontFamily.hpp>
30 : : #include <com/sun/star/awt/CharSet.hpp>
31 : : #include <com/sun/star/awt/FontPitch.hpp>
32 : : #include <com/sun/star/awt/FontUnderline.hpp>
33 : : #include <com/sun/star/awt/FontWeight.hpp>
34 : : #include <com/sun/star/style/CaseMap.hpp>
35 : : #include <com/sun/star/text/FontRelief.hpp>
36 : : #include <com/sun/star/text/FontEmphasis.hpp>
37 : : #include <com/sun/star/text/RubyAdjust.hpp>
38 : : #include <com/sun/star/awt/FontStrikeout.hpp>
39 : : #include <com/sun/star/text/WritingMode2.hpp>
40 : : #include <com/sun/star/i18n/ScriptType.hpp>
41 : :
42 : : #include <comphelper/InlineContainer.hxx>
43 : :
44 : :
45 : : // header for struct SvtLinguConfig
46 : : #include <unotools/lingucfg.hxx>
47 : : #include <i18npool/mslangid.hxx>
48 : : #include <vcl/outdev.hxx>
49 : :
50 : : using namespace ::com::sun::star;
51 : :
52 : : using ::com::sun::star::beans::Property;
53 : :
54 : : using ::rtl::OUString;
55 : :
56 : : namespace chart
57 : : {
58 : :
59 : 81 : void CharacterProperties::AddPropertiesToVector(
60 : : ::std::vector< Property > & rOutProperties )
61 : : {
62 : : // CharacterProperties
63 : : rOutProperties.push_back(
64 : : Property( C2U( "CharFontName" ),
65 : : PROP_CHAR_FONT_NAME,
66 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
67 : : beans::PropertyAttribute::BOUND
68 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
69 : : rOutProperties.push_back(
70 : : Property( C2U( "CharFontStyleName" ),
71 : : PROP_CHAR_FONT_STYLE_NAME,
72 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
73 : : beans::PropertyAttribute::BOUND
74 : : | beans::PropertyAttribute::MAYBEDEFAULT
75 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
76 : : // CharFontFamily (see awt.FontFamily)
77 : : rOutProperties.push_back(
78 : : Property( C2U( "CharFontFamily" ),
79 : : PROP_CHAR_FONT_FAMILY,
80 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
81 : : beans::PropertyAttribute::BOUND
82 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
83 : : // CharFontCharSet (see awt.CharSet)
84 : : rOutProperties.push_back(
85 : : Property( C2U( "CharFontCharSet" ),
86 : : PROP_CHAR_FONT_CHAR_SET,
87 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
88 : : beans::PropertyAttribute::BOUND
89 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
90 : : // CharFontPitch (see awt.FontPitch)
91 : : rOutProperties.push_back(
92 : : Property( C2U( "CharFontPitch" ),
93 : : PROP_CHAR_FONT_PITCH,
94 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
95 : : beans::PropertyAttribute::BOUND
96 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
97 : : // CharColor
98 : : rOutProperties.push_back(
99 : : Property( C2U( "CharColor" ),
100 : : PROP_CHAR_COLOR,
101 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
102 : : beans::PropertyAttribute::BOUND
103 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
104 : : // CharEscapement
105 : : rOutProperties.push_back(
106 : : Property( C2U( "CharEscapement" ),
107 : : PROP_CHAR_ESCAPEMENT,
108 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
109 : : beans::PropertyAttribute::BOUND
110 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
111 : : // CharHeight
112 : : rOutProperties.push_back(
113 : : Property( C2U( "CharHeight" ),
114 : : PROP_CHAR_CHAR_HEIGHT,
115 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
116 : : beans::PropertyAttribute::BOUND
117 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
118 : : // CharUnderline (see awt.FontUnderline)
119 : : rOutProperties.push_back(
120 : : Property( C2U( "CharUnderline" ),
121 : : PROP_CHAR_UNDERLINE,
122 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
123 : : beans::PropertyAttribute::BOUND
124 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
125 : : // CharUnderlineColor
126 : : rOutProperties.push_back(
127 : : Property( C2U( "CharUnderlineColor" ),
128 : : PROP_CHAR_UNDERLINE_COLOR,
129 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
130 : : beans::PropertyAttribute::BOUND
131 : : | beans::PropertyAttribute::MAYBEDEFAULT
132 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
133 : : // CharUnderlineHasColor
134 : : rOutProperties.push_back(
135 : : Property( C2U( "CharUnderlineHasColor" ),
136 : : PROP_CHAR_UNDERLINE_HAS_COLOR,
137 [ + - ]: 81 : ::getBooleanCppuType(),
138 : : beans::PropertyAttribute::BOUND
139 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
140 : : // CharOverline (see awt.FontUnderline)
141 : : rOutProperties.push_back(
142 : : Property( C2U( "CharOverline" ),
143 : : PROP_CHAR_OVERLINE,
144 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16* >( 0 ) ),
145 : : beans::PropertyAttribute::BOUND
146 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ) );
147 : : // CharOverlineColor
148 : : rOutProperties.push_back(
149 : : Property( C2U( "CharOverlineColor" ),
150 : : PROP_CHAR_OVERLINE_COLOR,
151 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int32* >( 0 ) ),
152 : : beans::PropertyAttribute::BOUND
153 : : | beans::PropertyAttribute::MAYBEDEFAULT
154 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ) );
155 : : // CharOverlineHasColor
156 : : rOutProperties.push_back(
157 : : Property( C2U( "CharOverlineHasColor" ),
158 : : PROP_CHAR_OVERLINE_HAS_COLOR,
159 [ + - ]: 81 : ::getBooleanCppuType(),
160 : : beans::PropertyAttribute::BOUND
161 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ) );
162 : : // CharWeight (see awt.FontWeight)
163 : : rOutProperties.push_back(
164 : : Property( C2U( "CharWeight" ),
165 : : PROP_CHAR_WEIGHT,
166 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
167 : : beans::PropertyAttribute::BOUND
168 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
169 : : // CharPosture
170 : : rOutProperties.push_back(
171 : : Property( C2U( "CharPosture" ),
172 : : PROP_CHAR_POSTURE,
173 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)),
174 : : beans::PropertyAttribute::BOUND
175 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
176 : : rOutProperties.push_back(
177 : : Property( C2U( "CharAutoKerning" ),
178 : : PROP_CHAR_AUTO_KERNING,
179 [ + - ]: 81 : ::getBooleanCppuType(),
180 : : beans::PropertyAttribute::BOUND
181 : : | beans::PropertyAttribute::MAYBEDEFAULT
182 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
183 : : rOutProperties.push_back(
184 : : Property( C2U( "CharKerning" ),
185 : : PROP_CHAR_KERNING,
186 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
187 : : beans::PropertyAttribute::BOUND
188 : : | beans::PropertyAttribute::MAYBEDEFAULT
189 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
190 : : // CharEscapementHeight
191 : : rOutProperties.push_back(
192 : : Property( C2U( "CharEscapementHeight" ),
193 : : PROP_CHAR_ESCAPEMENT_HEIGHT,
194 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int8 * >(0)),
195 : : beans::PropertyAttribute::BOUND
196 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
197 : : // CharStrikeout (see awt.FontStrikeout)
198 : : rOutProperties.push_back(
199 : : Property( C2U( "CharStrikeout" ),
200 : : PROP_CHAR_STRIKE_OUT,
201 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
202 : : beans::PropertyAttribute::BOUND
203 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
204 : : // CharWordMode
205 : : rOutProperties.push_back(
206 : : Property( C2U( "CharWordMode" ),
207 : : PROP_CHAR_WORD_MODE,
208 [ + - ]: 81 : ::getBooleanCppuType(),
209 : : beans::PropertyAttribute::BOUND
210 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
211 : : // CharLocale
212 : : rOutProperties.push_back(
213 : : Property( C2U( "CharLocale" ),
214 : : PROP_CHAR_LOCALE,
215 : 81 : ::getCppuType( reinterpret_cast< const lang::Locale * >(0)),
216 : : //#i111967# no PropertyChangeEvent is fired on change so far
217 [ + - ][ + - ]: 81 : beans::PropertyAttribute::MAYBEDEFAULT ));
218 : : // CharShadowed
219 : : rOutProperties.push_back(
220 : : Property( C2U( "CharShadowed" ),
221 : : PROP_CHAR_SHADOWED,
222 [ + - ]: 81 : ::getBooleanCppuType(),
223 : : beans::PropertyAttribute::BOUND
224 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
225 : : // CharContoured
226 : : rOutProperties.push_back(
227 : : Property( C2U( "CharContoured" ),
228 : : PROP_CHAR_CONTOURED,
229 [ + - ]: 81 : ::getBooleanCppuType(),
230 : : beans::PropertyAttribute::BOUND
231 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
232 : : // CharRelief (see text.FontRelief)
233 : : rOutProperties.push_back(
234 : : Property( C2U( "CharRelief" ),
235 : : PROP_CHAR_RELIEF,
236 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
237 : : beans::PropertyAttribute::BOUND
238 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
239 : :
240 : : // CharEmphasize (see text.FontEmphasis)
241 : : rOutProperties.push_back(
242 : : Property( C2U( "CharEmphasis" ),
243 : : PROP_CHAR_EMPHASIS,
244 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
245 : : beans::PropertyAttribute::BOUND
246 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
247 : : // CharacterPropertiesAsian
248 : : // =====
249 : : // CharFontNameAsian
250 : : rOutProperties.push_back(
251 : : Property( C2U( "CharFontNameAsian" ),
252 : : PROP_CHAR_ASIAN_FONT_NAME,
253 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
254 : : beans::PropertyAttribute::BOUND
255 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
256 : : // CharFontStyleNameAsian
257 : : rOutProperties.push_back(
258 : : Property( C2U( "CharFontStyleNameAsian" ),
259 : : PROP_CHAR_ASIAN_FONT_STYLE_NAME,
260 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
261 : : beans::PropertyAttribute::BOUND
262 : : | beans::PropertyAttribute::MAYBEDEFAULT
263 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
264 : : // CharFontFamilyAsian (see awt.FontFamily)
265 : : rOutProperties.push_back(
266 : : Property( C2U( "CharFontFamilyAsian" ),
267 : : PROP_CHAR_ASIAN_FONT_FAMILY,
268 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
269 : : beans::PropertyAttribute::BOUND
270 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
271 : : // CharFontCharSetAsian (see awt.CharSet)
272 : : rOutProperties.push_back(
273 : : Property( C2U( "CharFontCharSetAsian" ),
274 : : PROP_CHAR_ASIAN_CHAR_SET,
275 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
276 : : beans::PropertyAttribute::BOUND
277 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
278 : : // CharFontPitchAsian (see awt.FontPitch)
279 : : rOutProperties.push_back(
280 : : Property( C2U( "CharFontPitchAsian" ),
281 : : PROP_CHAR_ASIAN_FONT_PITCH,
282 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
283 : : beans::PropertyAttribute::BOUND
284 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
285 : : // CharHeightAsian
286 : : rOutProperties.push_back(
287 : : Property( C2U( "CharHeightAsian" ),
288 : : PROP_CHAR_ASIAN_CHAR_HEIGHT,
289 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
290 : : beans::PropertyAttribute::BOUND
291 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
292 : : // CharWeightAsian
293 : : rOutProperties.push_back(
294 : : Property( C2U( "CharWeightAsian" ),
295 : : PROP_CHAR_ASIAN_WEIGHT,
296 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
297 : : beans::PropertyAttribute::BOUND
298 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
299 : : // CharPostureAsian
300 : : rOutProperties.push_back(
301 : : Property( C2U( "CharPostureAsian" ),
302 : : PROP_CHAR_ASIAN_POSTURE,
303 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)),
304 : : beans::PropertyAttribute::BOUND
305 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
306 : : // CharLocaleAsian
307 : : rOutProperties.push_back(
308 : : Property( C2U( "CharLocaleAsian" ),
309 : : PROP_CHAR_ASIAN_LOCALE,
310 : 81 : ::getCppuType( reinterpret_cast< const lang::Locale * >(0)),
311 : : //#i111967# no PropertyChangeEvent is fired on change so far
312 [ + - ][ + - ]: 81 : beans::PropertyAttribute::MAYBEDEFAULT ));
313 : :
314 : : // CharacterPropertiesComplex
315 : : // ===
316 : : // CharFontNameComplex
317 : : rOutProperties.push_back(
318 : : Property( C2U( "CharFontNameComplex" ),
319 : : PROP_CHAR_COMPLEX_FONT_NAME,
320 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
321 : : beans::PropertyAttribute::BOUND
322 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
323 : : // CharFontStyleNameComplex
324 : : rOutProperties.push_back(
325 : : Property( C2U( "CharFontStyleNameComplex" ),
326 : : PROP_CHAR_COMPLEX_FONT_STYLE_NAME,
327 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const OUString * >(0)),
328 : : beans::PropertyAttribute::BOUND
329 : : | beans::PropertyAttribute::MAYBEDEFAULT
330 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEVOID ));
331 : : // CharFontFamilyComplex (see awt.FontFamily)
332 : : rOutProperties.push_back(
333 : : Property( C2U( "CharFontFamilyComplex" ),
334 : : PROP_CHAR_COMPLEX_FONT_FAMILY,
335 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
336 : : beans::PropertyAttribute::BOUND
337 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
338 : : // CharFontCharSetComplex (see awt.CharSet)
339 : : rOutProperties.push_back(
340 : : Property( C2U( "CharFontCharSetComplex" ),
341 : : PROP_CHAR_COMPLEX_CHAR_SET,
342 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
343 : : beans::PropertyAttribute::BOUND
344 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
345 : : // CharFontPitchComplex (see awt.FontPitch)
346 : : rOutProperties.push_back(
347 : : Property( C2U( "CharFontPitchComplex" ),
348 : : PROP_CHAR_COMPLEX_FONT_PITCH,
349 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
350 : : beans::PropertyAttribute::BOUND
351 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
352 : : // CharHeightComplex
353 : : rOutProperties.push_back(
354 : : Property( C2U( "CharHeightComplex" ),
355 : : PROP_CHAR_COMPLEX_CHAR_HEIGHT,
356 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
357 : : beans::PropertyAttribute::BOUND
358 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
359 : : // CharWeightComplex
360 : : rOutProperties.push_back(
361 : : Property( C2U( "CharWeightComplex" ),
362 : : PROP_CHAR_COMPLEX_WEIGHT,
363 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const float * >(0)),
364 : : beans::PropertyAttribute::BOUND
365 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
366 : : // CharPostureComplex
367 : : rOutProperties.push_back(
368 : : Property( C2U( "CharPostureComplex" ),
369 : : PROP_CHAR_COMPLEX_POSTURE,
370 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)),
371 : : beans::PropertyAttribute::BOUND
372 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
373 : : // CharLocaleComplex
374 : : rOutProperties.push_back(
375 : : Property( C2U( "CharLocaleComplex" ),
376 : : PROP_CHAR_COMPLEX_LOCALE,
377 : 81 : ::getCppuType( reinterpret_cast< const lang::Locale * >(0)),
378 : : //#i111967# no PropertyChangeEvent is fired on change so far
379 [ + - ][ + - ]: 81 : beans::PropertyAttribute::MAYBEDEFAULT ));
380 : :
381 : : // Writing Mode left to right vs right to left
382 : : rOutProperties.push_back(
383 : : Property( C2U( "WritingMode" ),
384 : : PROP_WRITING_MODE,
385 [ + - ]: 81 : ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), /*com::sun::star::text::WritingMode2*/
386 : : beans::PropertyAttribute::BOUND
387 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
388 : :
389 : : rOutProperties.push_back(
390 : : Property( C2U( "ParaIsCharacterDistance" ),
391 : : PROP_PARA_IS_CHARACTER_DISTANCE,
392 [ + - ]: 81 : ::getBooleanCppuType(),
393 : : beans::PropertyAttribute::BOUND
394 [ + - ][ + - ]: 81 : | beans::PropertyAttribute::MAYBEDEFAULT ));
395 : 81 : }
396 : :
397 : 56 : void CharacterProperties::AddDefaultsToMap(
398 : : ::chart::tPropertyValueMap & rOutMap )
399 : : {
400 : 56 : const float fDefaultFontHeight = 13.0;
401 : :
402 [ + - ]: 56 : SvtLinguConfig aLinguConfig;
403 : 56 : lang::Locale aDefaultLocale;
404 [ + - ][ + - ]: 56 : aLinguConfig.GetProperty(C2U("DefaultLocale")) >>= aDefaultLocale;
[ + - ]
405 : 56 : lang::Locale aDefaultLocale_CJK;
406 [ + - ][ + - ]: 56 : aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")) >>= aDefaultLocale_CJK;
[ + - ]
407 : 56 : lang::Locale aDefaultLocale_CTL;
408 [ + - ][ + - ]: 56 : aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")) >>= aDefaultLocale_CTL;
[ + - ]
409 : :
410 : : using namespace ::com::sun::star::i18n::ScriptType;
411 : : LanguageType nLang;
412 [ + - ][ + - ]: 56 : nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aDefaultLocale), LATIN);
413 [ + - ]: 56 : Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
414 [ + - ][ + - ]: 56 : nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK), ASIAN);
415 [ + - ]: 56 : Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
416 [ + - ][ + - ]: 56 : nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL), COMPLEX);
417 [ + - ]: 56 : Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
418 : :
419 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) );
[ + - ]
420 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) );
[ + - ]
421 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_FAMILY, sal_Int16(aFont.GetFamily()) );//awt::FontFamily::SWISS
422 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_CHAR_SET, sal_Int16(aFont.GetCharSet()) );//use awt::CharSet::DONTKNOW instead of SYSTEM to avoid assertion issue 50249
423 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_PITCH, sal_Int16(aFont.GetPitch()) );//awt::FontPitch::VARIABLE
424 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_COLOR, -1 ); //automatic color (COL_AUTO)
425 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CHAR_HEIGHT, fDefaultFontHeight );
426 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE );
427 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
428 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false );
429 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE );
430 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
431 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false );
432 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL );
433 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE );
434 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true );
435 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_KERNING, 0 );
436 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_STRIKE_OUT, awt::FontStrikeout::NONE );
437 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WORD_MODE, false );
438 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_LOCALE, aDefaultLocale );
439 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_SHADOWED, false );
440 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CONTOURED, false );
441 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_RELIEF, text::FontRelief::NONE );
442 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_EMPHASIS, text::FontEmphasis::NONE );
443 : :
444 : : // Asian (com.sun.star.style.CharacterPropertiesAsian)
445 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultFontHeight );
446 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_WEIGHT, awt::FontWeight::NORMAL );
447 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_POSTURE, awt::FontSlant_NONE );
448 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_LOCALE, aDefaultLocale_CJK );
449 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_NAME, OUString( aFontCJK.GetName() ) );
[ + - ]
450 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_STYLE_NAME, OUString(aFontCJK.GetStyleName()) );
[ + - ]
451 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_FAMILY, sal_Int16(aFontCJK.GetFamily()) );
452 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_SET, sal_Int16(aFontCJK.GetCharSet()) );
453 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_PITCH, sal_Int16(aFontCJK.GetPitch()) );
454 : :
455 : : // Complex Text Layout (com.sun.star.style.CharacterPropertiesComplex)
456 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultFontHeight );
457 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_WEIGHT, awt::FontWeight::NORMAL );
458 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_POSTURE, awt::FontSlant_NONE );
459 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_LOCALE, aDefaultLocale_CTL );
460 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_NAME, OUString( aFontCTL.GetName() ) );
[ + - ]
461 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_STYLE_NAME, OUString(aFontCTL.GetStyleName()) );
[ + - ]
462 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamily()) );
463 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_SET, sal_Int16(aFontCTL.GetCharSet()) );
464 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) );
465 : :
466 [ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( com::sun::star::text::WritingMode2::PAGE ) );
467 [ + - ][ + - ]: 56 : ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PARA_IS_CHARACTER_DISTANCE, sal_True );
[ + - ][ + - ]
[ + - ]
468 : 56 : }
469 : :
470 : 1484 : bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle )
471 : : {
472 : : return ( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle &&
473 [ + + ][ + + ]: 1484 : nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP );
474 : : }
475 : :
476 : 0 : awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet(
477 : : const uno::Reference< beans::XMultiPropertySet > & xMultiPropSet )
478 : : {
479 : 0 : awt::FontDescriptor aResult;
480 : : // Note: keep this sorted!
481 : : ::comphelper::MakeVector< OUString > aPropNames
482 [ # # ][ # # ]: 0 : ( C2U("CharFontCharSet")); // CharSet
483 : : aPropNames
484 [ # # ][ # # ]: 0 : ( C2U("CharFontFamily")) // Family
485 [ # # ][ # # ]: 0 : ( C2U("CharFontName")) // Name
486 [ # # ][ # # ]: 0 : ( C2U("CharFontPitch")) // Pitch
487 [ # # ][ # # ]: 0 : ( C2U("CharFontStyleName")) // StyleName
488 [ # # ][ # # ]: 0 : ( C2U("CharHeight")) // Height
489 [ # # ][ # # ]: 0 : ( C2U("CharPosture")) // Slant
490 [ # # ][ # # ]: 0 : ( C2U("CharStrikeout")) // Strikeout
491 [ # # ][ # # ]: 0 : ( C2U("CharUnderline")) // Underline
492 [ # # ][ # # ]: 0 : ( C2U("CharWeight")) // Weight
493 [ # # ]: 0 : ( C2U("CharWordMode")) // WordLineMode
494 [ # # ]: 0 : ;
495 : :
496 [ # # ]: 0 : uno::Sequence< OUString > aPropNameSeq( ContainerHelper::ContainerToSequence( aPropNames ));
497 [ # # ][ # # ]: 0 : uno::Sequence< uno::Any > aValues( xMultiPropSet->getPropertyValues( aPropNameSeq ));
498 : :
499 : 0 : sal_Int32 i=0;
500 : : // Note keep this sorted according to the list above (comments are the fieldnames)
501 [ # # ]: 0 : aValues[ i++ ] >>= aResult.CharSet;
502 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Family;
503 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Name;
504 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Pitch;
505 [ # # ]: 0 : aValues[ i++ ] >>= aResult.StyleName;
506 : 0 : float fCharHeight = 0;
507 [ # # ]: 0 : aValues[ i++ ] >>= fCharHeight;
508 : 0 : aResult.Height = static_cast< sal_Int16 >( fCharHeight );
509 [ # # ][ # # ]: 0 : aValues[ i++ ] >>= aResult.Slant;
510 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Strikeout;
511 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Underline;
512 [ # # ]: 0 : aValues[ i++ ] >>= aResult.Weight;
513 [ # # ]: 0 : aValues[ i++ ] >>= aResult.WordLineMode;
514 : : OSL_ASSERT( i == aValues.getLength());
515 : :
516 [ # # ][ # # ]: 0 : return aResult;
517 : : }
518 : :
519 : : } // namespace chart
520 : :
521 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|