LibreOffice Module sc (master) 1
xlstyle.cxx
Go to the documentation of this file.
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 <xlstyle.hxx>
21#include <com/sun/star/awt/FontFamily.hpp>
22#include <com/sun/star/awt/FontSlant.hpp>
23#include <com/sun/star/awt/FontStrikeout.hpp>
24#include <com/sun/star/awt/FontUnderline.hpp>
25#include <com/sun/star/i18n/ScriptType.hpp>
26#include <vcl/svapp.hxx>
27#include <vcl/settings.hxx>
28#include <vcl/font.hxx>
29#include <sal/macros.h>
30#include <sal/log.hxx>
31#include <rtl/tencinfo.h>
32#include <svl/numformat.hxx>
33#include <svtools/colorcfg.hxx>
34#include <vcl/unohelp.hxx>
35#include <editeng/svxfont.hxx>
37#include <global.hxx>
38#include <xlroot.hxx>
39#include <xltools.hxx>
40// Color data =================================================================
41
43#define EXC_PALETTE_EGA_COLORS_LIGHT \
44 Color(0x000000), Color(0xFFFFFF), Color(0xFF0000), Color(0x00FF00), Color(0x0000FF), Color(0xFFFF00), Color(0xFF00FF), Color(0x00FFFF)
46#define EXC_PALETTE_EGA_COLORS_DARK \
47 Color(0x800000), Color(0x008000), Color(0x000080), Color(0x808000), Color(0x800080), Color(0x008080), Color(0xC0C0C0), Color(0x808080)
48
51{
53};
54
57{
61};
62
65{
69/* 24 */ Color(0x8080FF), Color(0x802060), Color(0xFFFFC0), Color(0xA0E0E0), Color(0x600080), Color(0xFF8080), Color(0x0080C0), Color(0xC0C0FF),
70/* 32 */ Color(0x000080), Color(0xFF00FF), Color(0xFFFF00), Color(0x00FFFF), Color(0x800080), Color(0x800000), Color(0x008080), Color(0x0000FF),
71/* 40 */ Color(0x00CFFF), Color(0x69FFFF), Color(0xE0FFE0), Color(0xFFFF80), Color(0xA6CAF0), Color(0xDD9CB3), Color(0xB38FEE), Color(0xE3E3E3),
72/* 48 */ Color(0x2A6FF9), Color(0x3FB8CD), Color(0x488436), Color(0x958C41), Color(0x8E5E42), Color(0xA0627A), Color(0x624FAC), Color(0x969696),
73/* 56 */ Color(0x1D2FBE), Color(0x286676), Color(0x004500), Color(0x453E01), Color(0x6A2813), Color(0x85396A), Color(0x4A3285), Color(0x424242)
74};
75
78{
82/* 24 */ Color(0x9999FF), Color(0x993366), Color(0xFFFFCC), Color(0xCCFFFF), Color(0x660066), Color(0xFF8080), Color(0x0066CC), Color(0xCCCCFF),
83/* 32 */ Color(0x000080), Color(0xFF00FF), Color(0xFFFF00), Color(0x00FFFF), Color(0x800080), Color(0x800000), Color(0x008080), Color(0x0000FF),
84/* 40 */ Color(0x00CCFF), Color(0xCCFFFF), Color(0xCCFFCC), Color(0xFFFF99), Color(0x99CCFF), Color(0xFF99CC), Color(0xCC99FF), Color(0xFFCC99),
85/* 48 */ Color(0x3366FF), Color(0x33CCCC), Color(0x99CC00), Color(0xFFCC00), Color(0xFF9900), Color(0xFF6600), Color(0x666699), Color(0x969696),
86/* 56 */ Color(0x003366), Color(0x339966), Color(0x003300), Color(0x333300), Color(0x993300), Color(0x993366), Color(0x333399), Color(0x333333)
87};
88
89#undef EXC_PALETTE_EGA_COLORS_LIGHT
90#undef EXC_PALETTE_EGA_COLORS_DARK
91
93 mpnColorTable( nullptr ),
94 mnTableSize( 0 )
95{
99 mnFaceColor = rSett.GetFaceColor();
100 // Don't use the system HelpBack and HelpText colours as it causes problems
101 // with modern gnome. This is because mnNoteText and mnNoteBack are used
102 // when colour indices ( instead of real colours ) are specified.
103 // Note: That this it is not an unusual scenario that we get the Note
104 // background specified as a real colour and the text specified as a
105 // colour index. That means the text colour would be picked from
106 // the system where the note background would be picked from a real colour.
107 // Previously the note text colour was picked from the system tooltip
108 // text colour, on modern gnome(e.g. 3) that tends to be 'white' with the
109 // default theme.
110 // Using the Libreoffice defaults ( instead of system specific colours
111 // ) lessens the chance of the one colour being an unsuitable combination
112 // because by default the note text is black and the note background is
113 // a light yellow colour ( very similar to Excel's normal defaults )
116
117 // default colors
118 switch( rRoot.GetBiff() )
119 {
120 case EXC_BIFF2:
123 break;
124 case EXC_BIFF3:
125 case EXC_BIFF4:
128 break;
129 case EXC_BIFF5:
132 break;
133 case EXC_BIFF8:
136 break;
137 default:
139 }
140}
141
142Color XclDefaultPalette::GetDefColor( sal_uInt16 nXclIndex ) const
143{
144 Color nColor;
145 if( nXclIndex < mnTableSize )
146 nColor = mpnColorTable[ nXclIndex ];
147 else switch( nXclIndex )
148 {
151 case EXC_COLOR_CHWINDOWTEXT: nColor = mnWindowText; break;
154 case EXC_COLOR_CHWINDOWBACK: nColor = mnWindowBack; break;
155 case EXC_COLOR_BUTTONBACK: nColor = mnFaceColor; break;
156 case EXC_COLOR_CHBORDERAUTO: nColor = COL_BLACK; break; // TODO: really always black?
157 case EXC_COLOR_NOTEBACK: nColor = mnNoteBack; break;
158 case EXC_COLOR_NOTETEXT: nColor = mnNoteText; break;
159 case EXC_COLOR_FONTAUTO: nColor = COL_AUTO; break;
160 default:
161 SAL_WARN("sc", "XclDefaultPalette::GetDefColor - unknown default color index: " << nXclIndex );
162 nColor = COL_AUTO;
163 }
164 return nColor;
165}
166
167// Font Data ==================================================================
168
169namespace Awt = ::com::sun::star::awt;
170namespace AwtFontFamily = Awt::FontFamily;
171namespace AwtFontLineStyle = Awt::FontUnderline;
172namespace AwtFontStrikeout = Awt::FontStrikeout;
173
175{
176 Clear();
177}
178
180{
181 Clear();
182 FillFromVclFont( rFont );
183}
184
186{
187 FillFromSvxFont( rFont );
188}
189
191{
192 maName.clear();
193 maStyle.clear();
195 mnHeight = 0;
202}
203
205{
206 maName = XclTools::GetXclFontName( rFont.GetFamilyName() ); // substitute with MS fonts
207 maStyle.clear();
208 maColor = rFont.GetColor();
209 SetScUnderline( rFont.GetUnderline() );
211 SetScHeight( rFont.GetFontSize().Height() );
212 SetScWeight( rFont.GetWeight() );
213 SetScFamily( rFont.GetFamilyType() );
214 SetFontEncoding( rFont.GetCharSet() );
215 SetScPosture( rFont.GetItalic() );
216 SetScStrikeout( rFont.GetStrikeout() );
217 mbOutline = rFont.IsOutline();
218 mbShadow = rFont.IsShadow();
219}
220
222{
223 FillFromVclFont( rFont );
225}
226
227// *** conversion of VCL/SVX constants *** ------------------------------------
228
229FontFamily XclFontData::GetScFamily( rtl_TextEncoding eDefTextEnc ) const
230{
231 FontFamily eScFamily;
232 // ! format differs from Windows documentation: family is in lower nibble, pitch unknown
233 switch( mnFamily & 0x0F )
234 {
235 case EXC_FONTFAM_ROMAN: eScFamily = FAMILY_ROMAN; break;
236 case EXC_FONTFAM_SWISS: eScFamily = FAMILY_SWISS; break;
237 case EXC_FONTFAM_MODERN: eScFamily = FAMILY_MODERN; break;
238 case EXC_FONTFAM_SCRIPT: eScFamily = FAMILY_SCRIPT; break;
239 case EXC_FONTFAM_DECORATIVE: eScFamily = FAMILY_DECORATIVE; break;
240 default:
241 eScFamily =
242 ((eDefTextEnc == RTL_TEXTENCODING_APPLE_ROMAN) &&
243 (maName.equalsIgnoreAsciiCase( "Geneva" ) || maName.equalsIgnoreAsciiCase( "Chicago" ))) ?
245 }
246 return eScFamily;
247}
248
249rtl_TextEncoding XclFontData::GetFontEncoding() const
250{
251 // convert Windows character set to text encoding identifier
252 return rtl_getTextEncodingFromWindowsCharset( mnCharSet );
253}
254
256{
258}
259
261{
262 FontWeight eScWeight;
263
264 if( !mnWeight ) eScWeight = WEIGHT_DONTKNOW;
265 else if( mnWeight < 150 ) eScWeight = WEIGHT_THIN;
266 else if( mnWeight < 250 ) eScWeight = WEIGHT_ULTRALIGHT;
267 else if( mnWeight < 325 ) eScWeight = WEIGHT_LIGHT;
268 else if( mnWeight < 375 ) eScWeight = WEIGHT_SEMILIGHT;
269 else if( mnWeight < 450 ) eScWeight = WEIGHT_NORMAL;
270 else if( mnWeight < 550 ) eScWeight = WEIGHT_MEDIUM;
271 else if( mnWeight < 650 ) eScWeight = WEIGHT_SEMIBOLD;
272 else if( mnWeight < 750 ) eScWeight = WEIGHT_BOLD;
273 else if( mnWeight < 850 ) eScWeight = WEIGHT_ULTRABOLD;
274 else eScWeight = WEIGHT_BLACK;
275
276 return eScWeight;
277}
278
280{
281 FontLineStyle eScUnderl = LINESTYLE_NONE;
282 switch( mnUnderline )
283 {
285 case EXC_FONTUNDERL_SINGLE_ACC: eScUnderl = LINESTYLE_SINGLE; break;
287 case EXC_FONTUNDERL_DOUBLE_ACC: eScUnderl = LINESTYLE_DOUBLE; break;
288 }
289 return eScUnderl;
290}
291
293{
294 SvxEscapement eScEscapem = SvxEscapement::Off;
295 switch( mnEscapem )
296 {
297 case EXC_FONTESC_SUPER: eScEscapem = SvxEscapement::Superscript; break;
298 case EXC_FONTESC_SUB: eScEscapem = SvxEscapement::Subscript; break;
299 }
300 return eScEscapem;
301}
302
304{
306}
307
308void XclFontData::SetScHeight( sal_Int32 nTwips )
309{
310 mnHeight = static_cast< sal_uInt16 >( ::std::min( nTwips, static_cast<sal_Int32>(0x7FFFL) ) );
311}
312
314{
315 switch( eScFamily )
316 {
324 default:
325 OSL_FAIL( "XclFontData::SetScFamily - unknown font family" );
327 }
328}
329
330void XclFontData::SetFontEncoding( rtl_TextEncoding eFontEnc )
331{
332 // convert text encoding identifier to Windows character set
333 mnCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontEnc );
334}
335
337{
338 mbItalic = (eScPosture == ITALIC_OBLIQUE) || (eScPosture == ITALIC_NORMAL);
339}
340
342{
343 switch( eScWeight )
344 {
356 default: mnWeight = EXC_FONTWGHT_NORMAL;
357 }
358}
359
361{
362 switch( eScUnderl )
363 {
364 case LINESTYLE_NONE:
366 case LINESTYLE_DOUBLE:
369 }
370}
371
372void XclFontData::SetScEscapement( short nScEscapem )
373{
374 if( nScEscapem > 0 )
376 else if( nScEscapem < 0 )
378 else
380}
381
383{
385 (eScStrikeout == STRIKEOUT_SINGLE) || (eScStrikeout == STRIKEOUT_DOUBLE) ||
386 (eScStrikeout == STRIKEOUT_BOLD) || (eScStrikeout == STRIKEOUT_SLASH) ||
387 (eScStrikeout == STRIKEOUT_X);
388}
389
390// *** conversion of API constants *** ----------------------------------------
391
393{
394 return o3tl::convert<double>(mnHeight, o3tl::Length::twip, o3tl::Length::pt);
395}
396
398{
399 sal_Int16 nApiFamily = AwtFontFamily::DONTKNOW;
400 switch( mnFamily )
401 {
402 case FAMILY_DECORATIVE: nApiFamily = AwtFontFamily::DECORATIVE; break;
403 case FAMILY_MODERN: nApiFamily = AwtFontFamily::MODERN; break;
404 case FAMILY_ROMAN: nApiFamily = AwtFontFamily::ROMAN; break;
405 case FAMILY_SCRIPT: nApiFamily = AwtFontFamily::SCRIPT; break;
406 case FAMILY_SWISS: nApiFamily = AwtFontFamily::SWISS; break;
407 case FAMILY_SYSTEM: nApiFamily = AwtFontFamily::SYSTEM; break;
408 }
409 return nApiFamily;
410}
411
413{
414 // API constants are equal to rtl_TextEncoding constants
415 return static_cast< sal_Int16 >( GetFontEncoding() );
416}
417
418Awt::FontSlant XclFontData::GetApiPosture() const
419{
420 return mbItalic ? Awt::FontSlant_ITALIC : Awt::FontSlant_NONE;
421}
422
424{
426}
427
429{
430 sal_Int16 nApiUnderl = AwtFontLineStyle::NONE;
431 switch( mnUnderline )
432 {
434 case EXC_FONTUNDERL_SINGLE_ACC: nApiUnderl = AwtFontLineStyle::SINGLE; break;
436 case EXC_FONTUNDERL_DOUBLE_ACC: nApiUnderl = AwtFontLineStyle::DOUBLE; break;
437 }
438 return nApiUnderl;
439}
440
442{
443 sal_Int16 nApiEscapem = 0;
444 switch( mnEscapem )
445 {
446 case EXC_FONTESC_SUPER: nApiEscapem = 33; break;
447 case EXC_FONTESC_SUB: nApiEscapem = -33; break;
448 }
449 return nApiEscapem;
450}
451
453{
454 return mbStrikeout ? AwtFontStrikeout::SINGLE : AwtFontStrikeout::NONE;
455}
456
457void XclFontData::SetApiHeight( float fPoint )
458{
459 mnHeight = std::min(o3tl::convert(fPoint, o3tl::Length::pt, o3tl::Length::twip) + 0.5, 32767.0);
460}
461
462void XclFontData::SetApiFamily( sal_Int16 nApiFamily )
463{
464 switch( nApiFamily )
465 {
466 case AwtFontFamily::DECORATIVE: mnFamily = FAMILY_DECORATIVE; break;
467 case AwtFontFamily::MODERN: mnFamily = FAMILY_MODERN; break;
468 case AwtFontFamily::ROMAN: mnFamily = FAMILY_ROMAN; break;
469 case AwtFontFamily::SCRIPT: mnFamily = FAMILY_SCRIPT; break;
470 case AwtFontFamily::SWISS: mnFamily = FAMILY_SWISS; break;
471 case AwtFontFamily::SYSTEM: mnFamily = FAMILY_SYSTEM; break;
472 default: mnFamily = FAMILY_DONTKNOW;
473 }
474}
475
476void XclFontData::SetApiPosture( Awt::FontSlant eApiPosture )
477{
478 mbItalic =
479 (eApiPosture == Awt::FontSlant_OBLIQUE) ||
480 (eApiPosture == Awt::FontSlant_ITALIC) ||
481 (eApiPosture == Awt::FontSlant_REVERSE_OBLIQUE) ||
482 (eApiPosture == Awt::FontSlant_REVERSE_ITALIC);
483}
484
485void XclFontData::SetApiWeight( float fApiWeight )
486{
488}
489
490void XclFontData::SetApiUnderline( sal_Int16 nApiUnderl )
491{
492 switch( nApiUnderl )
493 {
495 case AwtFontLineStyle::DONTKNOW: mnUnderline = EXC_FONTUNDERL_NONE; break;
496 case AwtFontLineStyle::DOUBLE:
497 case AwtFontLineStyle::DOUBLEWAVE: mnUnderline = EXC_FONTUNDERL_DOUBLE; break;
499 }
500}
501
502void XclFontData::SetApiEscapement( sal_Int16 nApiEscapem )
503{
504 if( nApiEscapem > 0 )
506 else if( nApiEscapem < 0 )
508 else
510}
511
512void XclFontData::SetApiStrikeout( sal_Int16 nApiStrikeout )
513{
515 (nApiStrikeout != AwtFontStrikeout::NONE) &&
516 (nApiStrikeout != AwtFontStrikeout::DONTKNOW);
517}
518
519bool operator==( const XclFontData& rLeft, const XclFontData& rRight )
520{
521 return
522 (rLeft.mnHeight == rRight.mnHeight) &&
523 (rLeft.mnWeight == rRight.mnWeight) &&
524 (rLeft.mnUnderline == rRight.mnUnderline) &&
525 (rLeft.maColor == rRight.maColor) &&
526 (rLeft.mnEscapem == rRight.mnEscapem) &&
527 (rLeft.mnFamily == rRight.mnFamily) &&
528 (rLeft.mnCharSet == rRight.mnCharSet) &&
529 (rLeft.mbItalic == rRight.mbItalic) &&
530 (rLeft.mbStrikeout == rRight.mbStrikeout) &&
531 (rLeft.mbOutline == rRight.mbOutline) &&
532 (rLeft.mbShadow == rRight.mbShadow) &&
533 (rLeft.maName == rRight.maName);
534}
535
536namespace {
537
539const char *const sppcPropNamesChCommon[] =
540{
541 "CharUnderline", "CharStrikeout", "CharColor", "CharContoured", "CharShadowed", nullptr
542};
544const char *const sppcPropNamesChWstrn[] =
545{
546 "CharFontName", "CharHeight", "CharPosture", "CharWeight", nullptr
547};
549const char *const sppcPropNamesChAsian[] =
550{
551 "CharFontNameAsian", "CharHeightAsian", "CharPostureAsian", "CharWeightAsian", nullptr
552};
554const char *const sppcPropNamesChCmplx[] =
555{
556 "CharFontNameComplex", "CharHeightComplex", "CharPostureComplex", "CharWeightComplex", nullptr
557};
559const char *const sppcPropNamesChEscapement[] =
560{
561 "CharEscapement", "CharEscapementHeight", nullptr
562};
563const sal_Int8 EXC_API_ESC_HEIGHT = 58;
564
566const char *const *const sppcPropNamesChWstrnNoName = sppcPropNamesChWstrn + 1;
568const char *const *const sppcPropNamesChAsianNoName = sppcPropNamesChAsian + 1;
570const char *const *const sppcPropNamesChCmplxNoName = sppcPropNamesChCmplx + 1;
571
573const char *const sppcPropNamesControl[] =
574{
575 "FontName", "FontFamily", "FontCharset", "FontHeight", "FontSlant",
576 "FontWeight", "FontLineStyle", "FontStrikeout", "TextColor", nullptr
577};
578
580void lclSetApiFontSettings( XclFontData& rFontData,
581 const OUString& rApiFontName, float fApiHeight, float fApiWeight,
582 Awt::FontSlant eApiPosture, sal_Int16 nApiUnderl, sal_Int16 nApiStrikeout )
583{
584 rFontData.maName = XclTools::GetXclFontName( rApiFontName );
585 rFontData.SetApiHeight( fApiHeight );
586 rFontData.SetApiWeight( fApiWeight );
587 rFontData.SetApiPosture( eApiPosture );
588 rFontData.SetApiUnderline( nApiUnderl );
589 rFontData.SetApiStrikeout( nApiStrikeout );
590}
591
593void lclWriteChartFont( ScfPropertySet& rPropSet,
594 ScfPropSetHelper& rHlpName, ScfPropSetHelper& rHlpNoName,
595 const XclFontData& rFontData, bool bHasFontName )
596{
597 // select the font helper
598 ScfPropSetHelper& rPropSetHlp = bHasFontName ? rHlpName : rHlpNoName;
599 // initialize the font helper (must be called before writing any properties)
600 rPropSetHlp.InitializeWrite();
601 // write font name
602 if( bHasFontName )
603 rPropSetHlp << rFontData.maName;
604 // write remaining properties
605 rPropSetHlp << rFontData.GetApiHeight() << rFontData.GetApiPosture() << rFontData.GetApiWeight();
606 // write properties to property set
607 rPropSetHlp.WriteToPropertySet( rPropSet );
608}
609
610} // namespace
611
613 maHlpChCommon( sppcPropNamesChCommon ),
614 maHlpChWstrn( sppcPropNamesChWstrn ),
615 maHlpChAsian( sppcPropNamesChAsian ),
616 maHlpChCmplx( sppcPropNamesChCmplx ),
617 maHlpChWstrnNoName( sppcPropNamesChWstrnNoName ),
618 maHlpChAsianNoName( sppcPropNamesChAsianNoName ),
619 maHlpChCmplxNoName( sppcPropNamesChCmplxNoName ),
620 maHlpChEscapement( sppcPropNamesChEscapement ),
621 maHlpControl( sppcPropNamesControl )
622{
623}
624
626 const ScfPropertySet& rPropSet, XclFontPropSetType eType, sal_Int16 nScript )
627{
628 switch( eType )
629 {
631 {
632 OUString aApiFontName;
633 float fApiHeight, fApiWeight;
634 sal_Int16 nApiUnderl = 0, nApiStrikeout = 0;
635 Awt::FontSlant eApiPosture;
636
637 // read script type dependent properties
638 ScfPropSetHelper& rPropSetHlp = GetChartHelper( nScript );
639 rPropSetHlp.ReadFromPropertySet( rPropSet );
640 rPropSetHlp >> aApiFontName >> fApiHeight >> eApiPosture >> fApiWeight;
641 // read common properties
643 maHlpChCommon >> nApiUnderl
644 >> nApiStrikeout
645 >> rFontData.maColor
646 >> rFontData.mbOutline
647 >> rFontData.mbShadow;
648
649 // convert API property values to Excel settings
650 lclSetApiFontSettings( rFontData, aApiFontName,
651 fApiHeight, fApiWeight, eApiPosture, nApiUnderl, nApiStrikeout );
652
653 // font escapement
654 sal_Int16 nApiEscapement = 0;
655 sal_Int8 nApiEscHeight = 0;
659 maHlpChEscapement >> nApiEscapement >> nApiEscHeight;
660 rFontData.SetApiEscapement( nApiEscapement );
661 }
662 break;
663
665 {
666 OUString aApiFontName;
667 float fApiHeight(0.0), fApiWeight(0.0);
668 sal_Int16 nApiFamily(0), nApiCharSet(0), nApiPosture(0), nApiUnderl(0), nApiStrikeout(0);
669
670 // read font properties
672 maHlpControl >> aApiFontName
673 >> nApiFamily
674 >> nApiCharSet
675 >> fApiHeight
676 >> nApiPosture
677 >> fApiWeight
678 >> nApiUnderl
679 >> nApiStrikeout
680 >> rFontData.maColor;
681
682 // convert API property values to Excel settings
683 Awt::FontSlant eApiPosture = static_cast< Awt::FontSlant >( nApiPosture );
684 lclSetApiFontSettings( rFontData, aApiFontName,
685 fApiHeight, fApiWeight, eApiPosture, nApiUnderl, nApiStrikeout );
686 rFontData.SetApiFamily( nApiFamily );
687 rFontData.SetFontEncoding( nApiCharSet );
688 }
689 break;
690 }
691}
692
694 ScfPropertySet& rPropSet, XclFontPropSetType eType,
695 const XclFontData& rFontData, bool bHasWstrn, bool bHasAsian, bool bHasCmplx,
696 const Color* pFontColor )
697{
698 switch( eType )
699 {
701 {
702 // write common properties
704 const Color& rColor = pFontColor ? *pFontColor : rFontData.maColor;
705 maHlpChCommon << rFontData.GetApiUnderline()
706 << rFontData.GetApiStrikeout()
707 << rColor
708 << rFontData.mbOutline
709 << rFontData.mbShadow;
711
712 // write script type dependent properties
713 lclWriteChartFont( rPropSet, maHlpChWstrn, maHlpChWstrnNoName, rFontData, bHasWstrn );
714 lclWriteChartFont( rPropSet, maHlpChAsian, maHlpChAsianNoName, rFontData, bHasAsian );
715 lclWriteChartFont( rPropSet, maHlpChCmplx, maHlpChCmplxNoName, rFontData, bHasCmplx );
716
717 // font escapement
718 if( rFontData.GetScEscapement() != SvxEscapement::Off )
719 {
721 maHlpChEscapement << rFontData.GetApiEscapement() << EXC_API_ESC_HEIGHT;
723 }
724 }
725 break;
726
728 {
730 maHlpControl << rFontData.maName
731 << rFontData.GetApiFamily()
732 << rFontData.GetApiFontEncoding()
733 << static_cast< sal_Int16 >( rFontData.GetApiHeight() + 0.5 )
734 << rFontData.GetApiPosture()
735 << rFontData.GetApiWeight()
736 << rFontData.GetApiUnderline()
737 << rFontData.GetApiStrikeout()
738 << rFontData.maColor;
740 }
741 break;
742 }
743}
744
746{
747 namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
748 switch( nScript )
749 {
750 case ApiScriptType::LATIN: return maHlpChWstrn;
751 case ApiScriptType::ASIAN: return maHlpChAsian;
752 case ApiScriptType::COMPLEX: return maHlpChCmplx;
753 default: OSL_FAIL( "XclFontPropSetHelper::GetChartHelper - unknown script type" );
754 }
755 return maHlpChWstrn;
756}
757
758// Number formats =============================================================
759
760namespace {
761
763const NfIndexTableOffset PRV_NF_INDEX_REUSE = NF_INDEX_TABLE_ENTRIES;
764
766constexpr LanguageType PRV_LANGUAGE_GERMAN_PRIM = primary(LANGUAGE_GERMAN);
768constexpr LanguageType PRV_LANGUAGE_FRENCH_PRIM = primary(LANGUAGE_FRENCH);
770constexpr LanguageType PRV_LANGUAGE_ASIAN_PRIM = primary(LANGUAGE_CHINESE);
771
773struct XclBuiltInFormat
774{
775 sal_uInt16 mnXclNumFmt;
776 const char* mpFormat;
777 NfIndexTableOffset meOffset;
778 sal_uInt16 mnXclReuseFmt;
779};
780
782#define EXC_NUMFMT_STRING( nXclNumFmt, pcUtf8 ) \
783 { nXclNumFmt, pcUtf8, NF_NUMBER_STANDARD, 0 }
784
786#define EXC_NUMFMT_OFFSET( nXclNumFmt, eOffset ) \
787 { nXclNumFmt, nullptr, eOffset, 0 }
788
790#define EXC_NUMFMT_REUSE( nXclNumFmt, nXclReuse ) \
791 { nXclNumFmt, nullptr, PRV_NF_INDEX_REUSE, nXclReuse }
792
794#define EXC_NUMFMT_ENDTABLE() \
795 { EXC_FORMAT_NOTFOUND, nullptr, NF_NUMBER_STANDARD, 0 }
796
797// Currency unit characters
798#define UTF8_BAHT "\340\270\277"
799#define UTF8_EURO "\342\202\254"
800#define UTF8_POUND_UK "\302\243"
801#define UTF8_SHEQEL "\342\202\252"
802#define UTF8_WON "\357\277\246"
803#define UTF8_YEN_CS "\357\277\245"
804#define UTF8_YEN_JP "\302\245"
805
806// Japanese/Chinese date/time characters
807#define UTF8_CJ_YEAR "\345\271\264"
808#define UTF8_CJ_MON "\346\234\210"
809#define UTF8_CJ_DAY "\346\227\245"
810#define UTF8_CJ_HOUR "\346\231\202"
811#define UTF8_CJ_MIN "\345\210\206"
812#define UTF8_CJ_SEC "\347\247\222"
813
814// Chinese Simplified date/time characters
815#define UTF8_CS_HOUR "\346\227\266"
816
817// Korean date/time characters
818#define UTF8_KO_YEAR "\353\205\204"
819#define UTF8_KO_MON "\354\233\224"
820#define UTF8_KO_DAY "\354\235\274"
821#define UTF8_KO_HOUR "\354\213\234"
822#define UTF8_KO_MIN "\353\266\204"
823#define UTF8_KO_SEC "\354\264\210"
824
826const XclBuiltInFormat spBuiltInFormats_DONTKNOW[] =
827{
828 EXC_NUMFMT_OFFSET( 0, NF_NUMBER_STANDARD ), // General
830 EXC_NUMFMT_OFFSET( 2, NF_NUMBER_DEC2 ), // 0.00
832 EXC_NUMFMT_OFFSET( 4, NF_NUMBER_1000DEC2 ), // #,##0.00
833 // 5...8 contained in file
835 EXC_NUMFMT_OFFSET( 10, NF_PERCENT_DEC2 ), // 0.00%
836 EXC_NUMFMT_OFFSET( 11, NF_SCIENTIFIC_000E00 ), // 0.00E+00
837 EXC_NUMFMT_OFFSET( 12, NF_FRACTION_1D ), // # ?/?
838 EXC_NUMFMT_OFFSET( 13, NF_FRACTION_2D ), // # ??/??
839
840 // 14...22 date and time formats
850
851 // 23...36 international formats
852 EXC_NUMFMT_REUSE( 23, 0 ),
853 EXC_NUMFMT_REUSE( 24, 0 ),
854 EXC_NUMFMT_REUSE( 25, 0 ),
855 EXC_NUMFMT_REUSE( 26, 0 ),
856 EXC_NUMFMT_REUSE( 27, 14 ),
857 EXC_NUMFMT_REUSE( 28, 14 ),
858 EXC_NUMFMT_REUSE( 29, 14 ),
859 EXC_NUMFMT_REUSE( 30, 14 ),
860 EXC_NUMFMT_REUSE( 31, 14 ),
861 EXC_NUMFMT_REUSE( 32, 21 ),
862 EXC_NUMFMT_REUSE( 33, 21 ),
863 EXC_NUMFMT_REUSE( 34, 21 ),
864 EXC_NUMFMT_REUSE( 35, 21 ),
865 EXC_NUMFMT_REUSE( 36, 14 ),
866
867 // 37...44 accounting formats
868 // 41...44 contained in file
869 EXC_NUMFMT_STRING( 37, "#,##0;-#,##0" ),
870 EXC_NUMFMT_STRING( 38, "#,##0;[RED]-#,##0" ),
871 EXC_NUMFMT_STRING( 39, "#,##0.00;-#,##0.00" ),
872 EXC_NUMFMT_STRING( 40, "#,##0.00;[RED]-#,##0.00" ),
873
874 // 45...49 more special formats
875 EXC_NUMFMT_STRING( 45, "mm:ss" ),
876 EXC_NUMFMT_STRING( 46, "[h]:mm:ss" ),
877 EXC_NUMFMT_STRING( 47, "mm:ss.0" ),
878 EXC_NUMFMT_STRING( 48, "##0.0E+0" ),
880
881 // 50...81 international formats
882 EXC_NUMFMT_REUSE( 50, 14 ),
883 EXC_NUMFMT_REUSE( 51, 14 ),
884 EXC_NUMFMT_REUSE( 52, 14 ),
885 EXC_NUMFMT_REUSE( 53, 14 ),
886 EXC_NUMFMT_REUSE( 54, 14 ),
887 EXC_NUMFMT_REUSE( 55, 14 ),
888 EXC_NUMFMT_REUSE( 56, 14 ),
889 EXC_NUMFMT_REUSE( 57, 14 ),
890 EXC_NUMFMT_REUSE( 58, 14 ),
891 EXC_NUMFMT_REUSE( 59, 1 ),
892 EXC_NUMFMT_REUSE( 60, 2 ),
893 EXC_NUMFMT_REUSE( 61, 3 ),
894 EXC_NUMFMT_REUSE( 62, 4 ),
895 EXC_NUMFMT_REUSE( 67, 9 ),
896 EXC_NUMFMT_REUSE( 68, 10 ),
897 EXC_NUMFMT_REUSE( 69, 12 ),
898 EXC_NUMFMT_REUSE( 70, 13 ),
899 EXC_NUMFMT_REUSE( 71, 14 ),
900 EXC_NUMFMT_REUSE( 72, 14 ),
901 EXC_NUMFMT_REUSE( 73, 15 ),
902 EXC_NUMFMT_REUSE( 74, 16 ),
903 EXC_NUMFMT_REUSE( 75, 17 ),
904 EXC_NUMFMT_REUSE( 76, 20 ),
905 EXC_NUMFMT_REUSE( 77, 21 ),
906 EXC_NUMFMT_REUSE( 78, 22 ),
907 EXC_NUMFMT_REUSE( 79, 45 ),
908 EXC_NUMFMT_REUSE( 80, 46 ),
909 EXC_NUMFMT_REUSE( 81, 47 ),
910
911 // 82...163 not used, must not occur in a file (Excel may crash)
912
914};
915
916// ENGLISH --------------------------------------------------------------------
917
919const XclBuiltInFormat spBuiltInFormats_ENGLISH[] =
920{
921 EXC_NUMFMT_STRING( 15, "DD-MMM-YY" ),
922 EXC_NUMFMT_STRING( 16, "DD-MMM" ),
923 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
924 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
925 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
926 EXC_NUMFMT_STRING( 22, "DD/MM/YYYY hh:mm" ),
928};
929
930const XclBuiltInFormat spBuiltInFormats_ENGLISH_UK[] =
931{
932 EXC_NUMFMT_STRING( 63, UTF8_POUND_UK "#,##0;-" UTF8_POUND_UK "#,##0" ),
933 EXC_NUMFMT_STRING( 64, UTF8_POUND_UK "#,##0;[RED]-" UTF8_POUND_UK "#,##0" ),
934 EXC_NUMFMT_STRING( 65, UTF8_POUND_UK "#,##0.00;-" UTF8_POUND_UK "#,##0.00" ),
935 EXC_NUMFMT_STRING( 66, UTF8_POUND_UK "#,##0.00;[RED]-" UTF8_POUND_UK "#,##0.00" ),
937};
938
939const XclBuiltInFormat spBuiltInFormats_ENGLISH_EIRE[] =
940{
941 EXC_NUMFMT_STRING( 63, UTF8_EURO "#,##0;-" UTF8_EURO "#,##0" ),
942 EXC_NUMFMT_STRING( 64, UTF8_EURO "#,##0;[RED]-" UTF8_EURO "#,##0" ),
943 EXC_NUMFMT_STRING( 65, UTF8_EURO "#,##0.00;-" UTF8_EURO "#,##0.00" ),
944 EXC_NUMFMT_STRING( 66, UTF8_EURO "#,##0.00;[RED]-" UTF8_EURO "#,##0.00" ),
946};
947
948const XclBuiltInFormat spBuiltInFormats_ENGLISH_US[] =
949{
950 EXC_NUMFMT_STRING( 14, "M/D/YYYY" ),
951 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
952 EXC_NUMFMT_STRING( 16, "D-MMM" ),
953 EXC_NUMFMT_STRING( 20, "h:mm" ),
954 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
955 EXC_NUMFMT_STRING( 22, "M/D/YYYY h:mm" ),
956 EXC_NUMFMT_STRING( 37, "#,##0_);(#,##0)" ),
957 EXC_NUMFMT_STRING( 38, "#,##0_);[RED](#,##0)" ),
958 EXC_NUMFMT_STRING( 39, "#,##0.00_);(#,##0.00)" ),
959 EXC_NUMFMT_STRING( 40, "#,##0.00_);[RED](#,##0.00)" ),
960 EXC_NUMFMT_STRING( 63, "$#,##0_);($#,##0)" ),
961 EXC_NUMFMT_STRING( 64, "$#,##0_);[RED]($#,##0)" ),
962 EXC_NUMFMT_STRING( 65, "$#,##0.00_);($#,##0.00)" ),
963 EXC_NUMFMT_STRING( 66, "$#,##0.00_);[RED]($#,##0.00)" ),
965};
966
967const XclBuiltInFormat spBuiltInFormats_ENGLISH_CAN[] =
968{
969 EXC_NUMFMT_STRING( 20, "h:mm" ),
970 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
971 EXC_NUMFMT_STRING( 22, "DD/MM/YYYY h:mm" ),
972 EXC_NUMFMT_STRING( 63, "$#,##0;-$#,##0" ),
973 EXC_NUMFMT_STRING( 64, "$#,##0;[RED]-$#,##0" ),
974 EXC_NUMFMT_STRING( 65, "$#,##0.00;-$#,##0.00" ),
975 EXC_NUMFMT_STRING( 66, "$#,##0.00;[RED]-$#,##0.00" ),
977};
978
979const XclBuiltInFormat spBuiltInFormats_ENGLISH_AUS[] =
980{
981 EXC_NUMFMT_STRING( 14, "D/MM/YYYY" ),
982 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
983 EXC_NUMFMT_STRING( 16, "D-MMM" ),
984 EXC_NUMFMT_STRING( 20, "h:mm" ),
985 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
986 EXC_NUMFMT_STRING( 22, "D/MM/YYYY h:mm" ),
987 EXC_NUMFMT_STRING( 63, "$#,##0;-$#,##0" ),
988 EXC_NUMFMT_STRING( 64, "$#,##0;[RED]-$#,##0" ),
989 EXC_NUMFMT_STRING( 65, "$#,##0.00;-$#,##0.00" ),
990 EXC_NUMFMT_STRING( 66, "$#,##0.00;[RED]-$#,##0.00" ),
992};
993
994const XclBuiltInFormat spBuiltInFormats_ENGLISH_SAFRICA[] =
995{
996 EXC_NUMFMT_STRING( 14, "YYYY/MM/DD" ),
997 EXC_NUMFMT_OFFSET( 18, NF_TIME_HHMMAMPM ),
998 EXC_NUMFMT_OFFSET( 19, NF_TIME_HHMMSSAMPM ),
999 EXC_NUMFMT_STRING( 22, "YYYY/MM/DD hh:mm" ),
1000 EXC_NUMFMT_STRING( 63, "\\R #,##0;\\R -#,##0" ),
1001 EXC_NUMFMT_STRING( 64, "\\R #,##0;[RED]\\R -#,##0" ),
1002 EXC_NUMFMT_STRING( 65, "\\R #,##0.00;\\R -#,##0.00" ),
1003 EXC_NUMFMT_STRING( 66, "\\R #,##0.00;[RED]\\R -#,##0.00" ),
1005};
1006
1007// FRENCH ---------------------------------------------------------------------
1008
1010const XclBuiltInFormat spBuiltInFormats_FRENCH[] =
1011{
1012 EXC_NUMFMT_STRING( 15, "DD-MMM-YY" ),
1013 EXC_NUMFMT_STRING( 16, "DD-MMM" ),
1014 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1015 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1016 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1018};
1019
1020const XclBuiltInFormat spBuiltInFormats_FRENCH_FRANCE[] =
1021{
1022 EXC_NUMFMT_STRING( 22, "DD/MM/YYYY hh:mm" ),
1023 EXC_NUMFMT_STRING( 37, "#,##0\\ _" UTF8_EURO ";-#,##0\\ _" UTF8_EURO ),
1024 EXC_NUMFMT_STRING( 38, "#,##0\\ _" UTF8_EURO ";[RED]-#,##0\\ _" UTF8_EURO ),
1025 EXC_NUMFMT_STRING( 39, "#,##0.00\\ _" UTF8_EURO ";-#,##0.00\\ _" UTF8_EURO ),
1026 EXC_NUMFMT_STRING( 40, "#,##0.00\\ _" UTF8_EURO ";[RED]-#,##0.00\\ _" UTF8_EURO ),
1027 EXC_NUMFMT_STRING( 63, "#,##0\\ " UTF8_EURO ";-#,##0\\ " UTF8_EURO ),
1028 EXC_NUMFMT_STRING( 64, "#,##0\\ " UTF8_EURO ";[RED]-#,##0\\ " UTF8_EURO ),
1029 EXC_NUMFMT_STRING( 65, "#,##0.00\\ " UTF8_EURO ";-#,##0.00\\ " UTF8_EURO ),
1030 EXC_NUMFMT_STRING( 66, "#,##0.00\\ " UTF8_EURO ";[RED]-#,##0.00\\ " UTF8_EURO ),
1032};
1033
1034const XclBuiltInFormat spBuiltInFormats_FRENCH_CANADIAN[] =
1035{
1036 EXC_NUMFMT_STRING( 22, "YYYY-MM-DD hh:mm" ),
1037 EXC_NUMFMT_STRING( 37, "#,##0\\ _$_-;#,##0\\ _$-" ),
1038 EXC_NUMFMT_STRING( 38, "#,##0\\ _$_-;[RED]#,##0\\ _$-" ),
1039 EXC_NUMFMT_STRING( 39, "#,##0.00\\ _$_-;#,##0.00\\ _$-" ),
1040 EXC_NUMFMT_STRING( 40, "#,##0.00\\ _$_-;[RED]#,##0.00\\ _$-" ),
1041 EXC_NUMFMT_STRING( 63, "#,##0\\ $_-;#,##0\\ $-" ),
1042 EXC_NUMFMT_STRING( 64, "#,##0\\ $_-;[RED]#,##0\\ $-" ),
1043 EXC_NUMFMT_STRING( 65, "#,##0.00\\ $_-;#,##0.00\\ $-" ),
1044 EXC_NUMFMT_STRING( 66, "#,##0.00\\ $_-;[RED]#,##0.00\\ $-" ),
1046};
1047
1048const XclBuiltInFormat spBuiltInFormats_FRENCH_SWISS[] =
1049{
1050 EXC_NUMFMT_STRING( 15, "DD.MMM.YY" ),
1051 EXC_NUMFMT_STRING( 16, "DD.MMM" ),
1052 EXC_NUMFMT_STRING( 17, "MMM.YY" ),
1053 EXC_NUMFMT_STRING( 22, "DD.MM.YYYY hh:mm" ),
1054 EXC_NUMFMT_STRING( 63, "\"SFr. \"#,##0;\"SFr. \"-#,##0" ),
1055 EXC_NUMFMT_STRING( 64, "\"SFr. \"#,##0;[RED]\"SFr. \"-#,##0" ),
1056 EXC_NUMFMT_STRING( 65, "\"SFr. \"#,##0.00;\"SFr. \"-#,##0.00" ),
1057 EXC_NUMFMT_STRING( 66, "\"SFr. \"#,##0.00;[RED]\"SFr. \"-#,##0.00" ),
1059};
1060
1061const XclBuiltInFormat spBuiltInFormats_FRENCH_BELGIAN[] =
1062{
1063 EXC_NUMFMT_STRING( 14, "D/MM/YYYY" ),
1064 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
1065 EXC_NUMFMT_STRING( 16, "D-MMM" ),
1066 EXC_NUMFMT_STRING( 20, "h:mm" ),
1067 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
1068 EXC_NUMFMT_STRING( 22, "D/MM/YYYY h:mm" ),
1070};
1071
1072// GERMAN ---------------------------------------------------------------------
1073
1075const XclBuiltInFormat spBuiltInFormats_GERMAN[] =
1076{
1077 EXC_NUMFMT_STRING( 15, "DD. MMM YY" ),
1078 EXC_NUMFMT_STRING( 16, "DD. MMM" ),
1079 EXC_NUMFMT_STRING( 17, "MMM YY" ),
1080 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1081 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1082 EXC_NUMFMT_STRING( 22, "DD.MM.YYYY hh:mm" ),
1084};
1085
1086const XclBuiltInFormat spBuiltInFormats_GERMAN_GERMANY[] =
1087{
1088 EXC_NUMFMT_STRING( 37, "#,##0 _" UTF8_EURO ";-#,##0 _" UTF8_EURO ),
1089 EXC_NUMFMT_STRING( 38, "#,##0 _" UTF8_EURO ";[RED]-#,##0 _" UTF8_EURO ),
1090 EXC_NUMFMT_STRING( 39, "#,##0.00 _" UTF8_EURO ";-#,##0.00 _" UTF8_EURO ),
1091 EXC_NUMFMT_STRING( 40, "#,##0.00 _" UTF8_EURO ";[RED]-#,##0.00 _" UTF8_EURO ),
1092 EXC_NUMFMT_STRING( 63, "#,##0 " UTF8_EURO ";-#,##0 " UTF8_EURO ),
1093 EXC_NUMFMT_STRING( 64, "#,##0 " UTF8_EURO ";[RED]-#,##0 " UTF8_EURO ),
1094 EXC_NUMFMT_STRING( 65, "#,##0.00 " UTF8_EURO ";-#,##0.00 " UTF8_EURO ),
1095 EXC_NUMFMT_STRING( 66, "#,##0.00 " UTF8_EURO ";[RED]-#,##0.00 " UTF8_EURO ),
1097};
1098
1099const XclBuiltInFormat spBuiltInFormats_GERMAN_AUSTRIAN[] =
1100{
1101 EXC_NUMFMT_STRING( 15, "DD.MMM.YY" ),
1102 EXC_NUMFMT_STRING( 16, "DD.MMM" ),
1103 EXC_NUMFMT_STRING( 17, "MMM.YY" ),
1104 EXC_NUMFMT_STRING( 63, UTF8_EURO " #,##0;-" UTF8_EURO " #,##0" ),
1105 EXC_NUMFMT_STRING( 64, UTF8_EURO " #,##0;[RED]-" UTF8_EURO " #,##0" ),
1106 EXC_NUMFMT_STRING( 65, UTF8_EURO " #,##0.00;-" UTF8_EURO " #,##0.00" ),
1107 EXC_NUMFMT_STRING( 66, UTF8_EURO " #,##0.00;[RED]-" UTF8_EURO " #,##0.00" ),
1109};
1110
1111const XclBuiltInFormat spBuiltInFormats_GERMAN_SWISS[] =
1112{
1113 EXC_NUMFMT_STRING( 63, "\"SFr. \"#,##0;\"SFr. \"-#,##0" ),
1114 EXC_NUMFMT_STRING( 64, "\"SFr. \"#,##0;[RED]\"SFr. \"-#,##0" ),
1115 EXC_NUMFMT_STRING( 65, "\"SFr. \"#,##0.00;\"SFr. \"-#,##0.00" ),
1116 EXC_NUMFMT_STRING( 66, "\"SFr. \"#,##0.00;[RED]\"SFr. \"-#,##0.00" ),
1118};
1119
1120const XclBuiltInFormat spBuiltInFormats_GERMAN_LUXEMBOURG[] =
1121{
1122 EXC_NUMFMT_STRING( 15, "DD.MMM.YY" ),
1123 EXC_NUMFMT_STRING( 16, "DD.MMM" ),
1124 EXC_NUMFMT_STRING( 17, "MMM.YY" ),
1125 EXC_NUMFMT_STRING( 37, "#,##0 _" UTF8_EURO ";-#,##0 _" UTF8_EURO ),
1126 EXC_NUMFMT_STRING( 38, "#,##0 _" UTF8_EURO ";[RED]-#,##0 _" UTF8_EURO ),
1127 EXC_NUMFMT_STRING( 39, "#,##0.00 _" UTF8_EURO ";-#,##0.00 _" UTF8_EURO ),
1128 EXC_NUMFMT_STRING( 40, "#,##0.00 _" UTF8_EURO ";[RED]-#,##0.00 _" UTF8_EURO ),
1129 EXC_NUMFMT_STRING( 63, "#,##0 " UTF8_EURO ";-#,##0 " UTF8_EURO ),
1130 EXC_NUMFMT_STRING( 64, "#,##0 " UTF8_EURO ";[RED]-#,##0 " UTF8_EURO ),
1131 EXC_NUMFMT_STRING( 65, "#,##0.00 " UTF8_EURO ";-#,##0.00 " UTF8_EURO ),
1132 EXC_NUMFMT_STRING( 66, "#,##0.00 " UTF8_EURO ";[RED]-#,##0.00 " UTF8_EURO ),
1134};
1135
1136const XclBuiltInFormat spBuiltInFormats_GERMAN_LIECHTENSTEIN[] =
1137{
1138 EXC_NUMFMT_STRING( 63, "\"CHF \"#,##0;\"CHF \"-#,##0" ),
1139 EXC_NUMFMT_STRING( 64, "\"CHF \"#,##0;[RED]\"CHF \"-#,##0" ),
1140 EXC_NUMFMT_STRING( 65, "\"CHF \"#,##0.00;\"CHF \"-#,##0.00" ),
1141 EXC_NUMFMT_STRING( 66, "\"CHF \"#,##0.00;[RED]\"CHF \"-#,##0.00" ),
1143};
1144
1145// ITALIAN --------------------------------------------------------------------
1146
1147const XclBuiltInFormat spBuiltInFormats_ITALIAN_ITALY[] =
1148{
1149 EXC_NUMFMT_STRING( 15, "DD-MMM-YY" ),
1150 EXC_NUMFMT_STRING( 16, "DD-MMM" ),
1151 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1152 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1153 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1154 EXC_NUMFMT_STRING( 20, "h:mm" ),
1155 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
1156 EXC_NUMFMT_STRING( 22, "DD/MM/YYYY h:mm" ),
1157 EXC_NUMFMT_STRING( 63, UTF8_EURO " #,##0;-" UTF8_EURO " #,##0" ),
1158 EXC_NUMFMT_STRING( 64, UTF8_EURO " #,##0;[RED]-" UTF8_EURO " #,##0" ),
1159 EXC_NUMFMT_STRING( 65, UTF8_EURO " #,##0.00;-" UTF8_EURO " #,##0.00" ),
1160 EXC_NUMFMT_STRING( 66, UTF8_EURO " #,##0.00;[RED]-" UTF8_EURO " #,##0.00" ),
1162};
1163
1164const XclBuiltInFormat spBuiltInFormats_ITALIAN_SWISS[] =
1165{
1166 EXC_NUMFMT_STRING( 15, "DD.MMM.YY" ),
1167 EXC_NUMFMT_STRING( 16, "DD.MMM" ),
1168 EXC_NUMFMT_STRING( 17, "MMM.YY" ),
1169 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1170 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1171 EXC_NUMFMT_STRING( 22, "DD.MM.YYYY hh:mm" ),
1172 EXC_NUMFMT_STRING( 63, "\"SFr. \"#,##0;\"SFr. \"-#,##0" ),
1173 EXC_NUMFMT_STRING( 64, "\"SFr. \"#,##0;[RED]\"SFr. \"-#,##0" ),
1174 EXC_NUMFMT_STRING( 65, "\"SFr. \"#,##0.00;\"SFr. \"-#,##0.00" ),
1175 EXC_NUMFMT_STRING( 66, "\"SFr. \"#,##0.00;[RED]\"SFr. \"-#,##0.00" ),
1177};
1178
1179// SWEDISH --------------------------------------------------------------------
1180
1181const XclBuiltInFormat spBuiltInFormats_SWEDISH_SWEDEN[] =
1182{
1183 EXC_NUMFMT_STRING( 15, "DD-MMM-YY" ),
1184 EXC_NUMFMT_STRING( 16, "DD-MMM" ),
1185 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1186 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1187 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1188 EXC_NUMFMT_STRING( 22, "YYYY-MM-DD hh:mm" ),
1189 EXC_NUMFMT_STRING( 37, "#,##0 _k_r;-#,##0 _k_r" ),
1190 EXC_NUMFMT_STRING( 38, "#,##0 _k_r;[RED]-#,##0 _k_r" ),
1191 EXC_NUMFMT_STRING( 39, "#,##0.00 _k_r;-#,##0.00 _k_r" ),
1192 EXC_NUMFMT_STRING( 40, "#,##0.00 _k_r;[RED]-#,##0.00 _k_r" ),
1193 EXC_NUMFMT_STRING( 63, "#,##0 \"kr\";-#,##0 \"kr\"" ),
1194 EXC_NUMFMT_STRING( 64, "#,##0 \"kr\";[RED]-#,##0 \"kr\"" ),
1195 EXC_NUMFMT_STRING( 65, "#,##0.00 \"kr\";-#,##0.00 \"kr\"" ),
1196 EXC_NUMFMT_STRING( 66, "#,##0.00 \"kr\";[RED]-#,##0.00 \"kr\"" ),
1198};
1199
1200const XclBuiltInFormat spBuiltInFormats_SWEDISH_FINLAND[] =
1201{
1202 EXC_NUMFMT_STRING( 9, "0 %" ),
1203 EXC_NUMFMT_STRING( 10, "0.00 %" ),
1204 EXC_NUMFMT_STRING( 15, "DD.MMM.YY" ),
1205 EXC_NUMFMT_STRING( 16, "DD.MMM" ),
1206 EXC_NUMFMT_STRING( 17, "MMM.YY" ),
1207 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1208 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1209 EXC_NUMFMT_STRING( 22, "D.M.YYYY hh:mm" ),
1210 EXC_NUMFMT_STRING( 37, "#,##0 _" UTF8_EURO ";-#,##0 _" UTF8_EURO ),
1211 EXC_NUMFMT_STRING( 38, "#,##0 _" UTF8_EURO ";[RED]-#,##0 _" UTF8_EURO ),
1212 EXC_NUMFMT_STRING( 39, "#,##0.00 _" UTF8_EURO ";-#,##0.00 _" UTF8_EURO ),
1213 EXC_NUMFMT_STRING( 40, "#,##0.00 _" UTF8_EURO ";[RED]-#,##0.00 _" UTF8_EURO ),
1214 EXC_NUMFMT_STRING( 63, "#,##0 " UTF8_EURO ";-#,##0 " UTF8_EURO ),
1215 EXC_NUMFMT_STRING( 64, "#,##0 " UTF8_EURO ";[RED]-#,##0 " UTF8_EURO ),
1216 EXC_NUMFMT_STRING( 65, "#,##0.00 " UTF8_EURO ";-#,##0.00 " UTF8_EURO ),
1217 EXC_NUMFMT_STRING( 66, "#,##0.00 " UTF8_EURO ";[RED]-#,##0.00 " UTF8_EURO ),
1219};
1220
1221// ASIAN ----------------------------------------------------------------------
1222
1224const XclBuiltInFormat spBuiltInFormats_ASIAN[] =
1225{
1226 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1227 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1228 EXC_NUMFMT_STRING( 20, "h:mm" ),
1229 EXC_NUMFMT_STRING( 21, "h:mm:ss" ),
1230 EXC_NUMFMT_STRING( 23, "$#,##0_);($#,##0)" ),
1231 EXC_NUMFMT_STRING( 24, "$#,##0_);[RED]($#,##0)" ),
1232 EXC_NUMFMT_STRING( 25, "$#,##0.00_);($#,##0.00)" ),
1233 EXC_NUMFMT_STRING( 26, "$#,##0.00_);[RED]($#,##0.00)" ),
1234 EXC_NUMFMT_REUSE( 29, 28 ),
1235 EXC_NUMFMT_REUSE( 36, 27 ),
1236 EXC_NUMFMT_REUSE( 50, 27 ),
1237 EXC_NUMFMT_REUSE( 51, 28 ),
1238 EXC_NUMFMT_REUSE( 52, 34 ),
1239 EXC_NUMFMT_REUSE( 53, 35 ),
1240 EXC_NUMFMT_REUSE( 54, 28 ),
1241 EXC_NUMFMT_REUSE( 55, 34 ),
1242 EXC_NUMFMT_REUSE( 56, 35 ),
1243 EXC_NUMFMT_REUSE( 57, 27 ),
1244 EXC_NUMFMT_REUSE( 58, 28 ),
1246};
1247
1248const XclBuiltInFormat spBuiltInFormats_JAPANESE[] =
1249{
1250 EXC_NUMFMT_STRING( 14, "YYYY/M/D" ),
1251 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
1252 EXC_NUMFMT_STRING( 16, "D-MMM" ),
1253 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1254 EXC_NUMFMT_STRING( 22, "YYYY/M/D h:mm" ),
1255 EXC_NUMFMT_STRING( 27, "[$-0411]GE.M.D" ),
1256 EXC_NUMFMT_STRING( 28, "[$-0411]GGGE" UTF8_CJ_YEAR "M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1257 EXC_NUMFMT_STRING( 30, "[$-0411]M/D/YY" ),
1258 EXC_NUMFMT_STRING( 31, "[$-0411]YYYY" UTF8_CJ_YEAR "M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1259 EXC_NUMFMT_STRING( 32, "[$-0411]h" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN ),
1260 EXC_NUMFMT_STRING( 33, "[$-0411]h" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN "ss" UTF8_CJ_SEC ),
1261 EXC_NUMFMT_STRING( 34, "[$-0411]YYYY" UTF8_CJ_YEAR "M" UTF8_CJ_MON ),
1262 EXC_NUMFMT_STRING( 35, "[$-0411]M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1263 EXC_NUMFMT_STRING( 63, UTF8_YEN_JP "#,##0;-" UTF8_YEN_JP "#,##0" ),
1264 EXC_NUMFMT_STRING( 64, UTF8_YEN_JP "#,##0;[RED]-" UTF8_YEN_JP "#,##0" ),
1265 EXC_NUMFMT_STRING( 65, UTF8_YEN_JP "#,##0.00;-" UTF8_YEN_JP "#,##0.00" ),
1266 EXC_NUMFMT_STRING( 66, UTF8_YEN_JP "#,##0.00;[RED]-" UTF8_YEN_JP "#,##0.00" ),
1268};
1269
1270const XclBuiltInFormat spBuiltInFormats_KOREAN[] =
1271{
1272 EXC_NUMFMT_STRING( 14, "YYYY-MM-DD" ),
1273 EXC_NUMFMT_STRING( 15, "DD-MMM-YY" ),
1274 EXC_NUMFMT_STRING( 16, "DD-MMM" ),
1275 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1276 EXC_NUMFMT_STRING( 22, "YYYY-MM-DD h:mm" ),
1277 EXC_NUMFMT_STRING( 27, "[$-0412]YYYY" UTF8_CJ_YEAR " MM" UTF8_CJ_MON " DD" UTF8_CJ_DAY ),
1278 EXC_NUMFMT_STRING( 28, "[$-0412]MM-DD" ),
1279 EXC_NUMFMT_STRING( 30, "[$-0412]MM-DD-YY" ),
1280 EXC_NUMFMT_STRING( 31, "[$-0412]YYYY" UTF8_KO_YEAR " MM" UTF8_KO_MON " DD" UTF8_KO_DAY ),
1281 EXC_NUMFMT_STRING( 32, "[$-0412]h" UTF8_KO_HOUR " mm" UTF8_KO_MIN ),
1282 EXC_NUMFMT_STRING( 33, "[$-0412]h" UTF8_KO_HOUR " mm" UTF8_KO_MIN " ss" UTF8_KO_SEC ),
1283 EXC_NUMFMT_STRING( 34, "[$-0412]YYYY\"/\"MM\"/\"DD" ),
1284 EXC_NUMFMT_STRING( 35, "[$-0412]YYYY-MM-DD" ),
1285 EXC_NUMFMT_STRING( 63, UTF8_WON "#,##0;-" UTF8_WON "#,##0" ),
1286 EXC_NUMFMT_STRING( 64, UTF8_WON "#,##0;[RED]-" UTF8_WON "#,##0" ),
1287 EXC_NUMFMT_STRING( 65, UTF8_WON "#,##0.00;-" UTF8_WON "#,##0.00" ),
1288 EXC_NUMFMT_STRING( 66, UTF8_WON "#,##0.00;[RED]-" UTF8_WON "#,##0.00" ),
1290};
1291
1292const XclBuiltInFormat spBuiltInFormats_CHINESE_SIMPLIFIED[] =
1293{
1294 EXC_NUMFMT_STRING( 14, "YYYY-M-D" ),
1295 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
1296 EXC_NUMFMT_STRING( 16, "D-MMM" ),
1297 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1298 EXC_NUMFMT_STRING( 22, "YYYY-M-D h:mm" ),
1299 EXC_NUMFMT_STRING( 27, "[$-0804]YYYY" UTF8_CJ_YEAR "M" UTF8_CJ_MON ),
1300 EXC_NUMFMT_STRING( 28, "[$-0804]M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1301 EXC_NUMFMT_STRING( 30, "[$-0804]M-D-YY" ),
1302 EXC_NUMFMT_STRING( 31, "[$-0804]YYYY" UTF8_CJ_YEAR "M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1303 EXC_NUMFMT_STRING( 32, "[$-0804]h" UTF8_CS_HOUR "mm" UTF8_CJ_MIN ),
1304 EXC_NUMFMT_STRING( 33, "[$-0804]h" UTF8_CS_HOUR "mm" UTF8_CJ_MIN "ss" UTF8_CJ_SEC ),
1305 EXC_NUMFMT_STRING( 34, "[$-0804]AM/PMh" UTF8_CS_HOUR "mm" UTF8_CJ_MIN ),
1306 EXC_NUMFMT_STRING( 35, "[$-0804]AM/PMh" UTF8_CS_HOUR "mm" UTF8_CJ_MIN "ss" UTF8_CJ_SEC ),
1307 EXC_NUMFMT_REUSE( 52, 27 ),
1308 EXC_NUMFMT_REUSE( 53, 28 ),
1309 EXC_NUMFMT_STRING( 63, UTF8_YEN_CS "#,##0;-" UTF8_YEN_CS "#,##0" ),
1310 EXC_NUMFMT_STRING( 64, UTF8_YEN_CS "#,##0;[RED]-" UTF8_YEN_CS "#,##0" ),
1311 EXC_NUMFMT_STRING( 65, UTF8_YEN_CS "#,##0.00;-" UTF8_YEN_CS "#,##0.00" ),
1312 EXC_NUMFMT_STRING( 66, UTF8_YEN_CS "#,##0.00;[RED]-" UTF8_YEN_CS "#,##0.00" ),
1314};
1315
1316const XclBuiltInFormat spBuiltInFormats_CHINESE_TRADITIONAL[] =
1317{
1318 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
1319 EXC_NUMFMT_STRING( 16, "D-MMM" ),
1320 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1321 EXC_NUMFMT_STRING( 18, "hh:mm AM/PM" ),
1322 EXC_NUMFMT_STRING( 19, "hh:mm:ss AM/PM" ),
1323 EXC_NUMFMT_OFFSET( 20, NF_TIME_HHMM ),
1324 EXC_NUMFMT_OFFSET( 21, NF_TIME_HHMMSS ),
1325 EXC_NUMFMT_STRING( 22, "YYYY/M/D hh:mm" ),
1326 EXC_NUMFMT_STRING( 23, "US$#,##0_);(US$#,##0)" ),
1327 EXC_NUMFMT_STRING( 24, "US$#,##0_);[RED](US$#,##0)" ),
1328 EXC_NUMFMT_STRING( 25, "US$#,##0.00_);(US$#,##0.00)" ),
1329 EXC_NUMFMT_STRING( 26, "US$#,##0.00_);[RED](US$#,##0.00)" ),
1330 EXC_NUMFMT_STRING( 27, "[$-0404]E/M/D" ),
1331 EXC_NUMFMT_STRING( 28, "[$-0404]E" UTF8_CJ_YEAR "M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1332 EXC_NUMFMT_STRING( 30, "[$-0404]M/D/YY" ),
1333 EXC_NUMFMT_STRING( 31, "[$-0404]YYYY" UTF8_CJ_YEAR "M" UTF8_CJ_MON "D" UTF8_CJ_DAY ),
1334 EXC_NUMFMT_STRING( 32, "[$-0404]hh" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN ),
1335 EXC_NUMFMT_STRING( 33, "[$-0404]hh" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN "ss" UTF8_CJ_SEC ),
1336 EXC_NUMFMT_STRING( 34, "[$-0404]AM/PMhh" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN ),
1337 EXC_NUMFMT_STRING( 35, "[$-0404]AM/PMhh" UTF8_CJ_HOUR "mm" UTF8_CJ_MIN "ss" UTF8_CJ_SEC ),
1338 EXC_NUMFMT_STRING( 63, "$#,##0;-$#,##0" ),
1339 EXC_NUMFMT_STRING( 64, "$#,##0;[RED]-$#,##0" ),
1340 EXC_NUMFMT_STRING( 65, "$#,##0.00;-$#,##0.00" ),
1341 EXC_NUMFMT_STRING( 66, "$#,##0.00;[RED]-$#,##0.00" ),
1343};
1344
1345// OTHER ----------------------------------------------------------------------
1346
1347const XclBuiltInFormat spBuiltInFormats_HEBREW[] =
1348{
1349 EXC_NUMFMT_STRING( 15, "DD-MMMM-YY" ),
1350 EXC_NUMFMT_STRING( 16, "DD-MMMM" ),
1351 EXC_NUMFMT_STRING( 17, "MMMM-YY" ),
1352 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1353 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1354 EXC_NUMFMT_STRING( 63, UTF8_SHEQEL " #,##0;" UTF8_SHEQEL " -#,##0" ),
1355 EXC_NUMFMT_STRING( 64, UTF8_SHEQEL " #,##0;[RED]" UTF8_SHEQEL " -#,##0" ),
1356 EXC_NUMFMT_STRING( 65, UTF8_SHEQEL " #,##0.00;" UTF8_SHEQEL " -#,##0.00" ),
1357 EXC_NUMFMT_STRING( 66, UTF8_SHEQEL " #,##0.00;[RED]" UTF8_SHEQEL " -#,##0.00" ),
1359};
1360
1361const XclBuiltInFormat spBuiltInFormats_THAI[] =
1362{
1363 EXC_NUMFMT_STRING( 14, "D/M/YYYY" ),
1364 EXC_NUMFMT_STRING( 15, "D-MMM-YY" ),
1365 EXC_NUMFMT_STRING( 16, "D-MMM" ),
1366 EXC_NUMFMT_STRING( 17, "MMM-YY" ),
1367 EXC_NUMFMT_STRING( 18, "h:mm AM/PM" ),
1368 EXC_NUMFMT_STRING( 19, "h:mm:ss AM/PM" ),
1369 EXC_NUMFMT_STRING( 22, "D/M/YYYY h:mm" ),
1370 EXC_NUMFMT_STRING( 59, "t0" ),
1371 EXC_NUMFMT_STRING( 60, "t0.00" ),
1372 EXC_NUMFMT_STRING( 61, "t#,##0" ),
1373 EXC_NUMFMT_STRING( 62, "t#,##0.00" ),
1374 EXC_NUMFMT_STRING( 63, "t" UTF8_BAHT "#,##0_);t(" UTF8_BAHT "#,##0)" ),
1375 EXC_NUMFMT_STRING( 64, "t" UTF8_BAHT "#,##0_);[RED]t(" UTF8_BAHT "#,##0)" ),
1376 EXC_NUMFMT_STRING( 65, "t" UTF8_BAHT "#,##0.00_);t(" UTF8_BAHT "#,##0.00)" ),
1377 EXC_NUMFMT_STRING( 66, "t" UTF8_BAHT "#,##0.00_);[RED]t(" UTF8_BAHT "#,##0.00)" ),
1378 EXC_NUMFMT_STRING( 67, "t0%" ),
1379 EXC_NUMFMT_STRING( 68, "t0.00%" ),
1380 EXC_NUMFMT_STRING( 69, "t# ?/?" ),
1381 EXC_NUMFMT_STRING( 70, "t# ?\?/?\?" ),
1382 EXC_NUMFMT_STRING( 71, "tD/M/EE" ),
1383 EXC_NUMFMT_STRING( 72, "tD-MMM-E" ),
1384 EXC_NUMFMT_STRING( 73, "tD-MMM" ),
1385 EXC_NUMFMT_STRING( 74, "tMMM-E" ),
1386 EXC_NUMFMT_STRING( 75, "th:mm" ),
1387 EXC_NUMFMT_STRING( 76, "th:mm:ss" ),
1388 EXC_NUMFMT_STRING( 77, "tD/M/EE h:mm" ),
1389 EXC_NUMFMT_STRING( 78, "tmm:ss" ),
1390 EXC_NUMFMT_STRING( 79, "t[h]:mm:ss" ),
1391 EXC_NUMFMT_STRING( 80, "tmm:ss.0" ),
1392 EXC_NUMFMT_STRING( 81, "D/M/E" ),
1394};
1395
1396#undef EXC_NUMFMT_ENDTABLE
1397#undef EXC_NUMFMT_REUSE
1398#undef EXC_NUMFMT_OFFSET
1399#undef EXC_NUMFMT_STRING
1400
1402struct XclBuiltInFormatTable
1403{
1405 LanguageType meParentLang;
1406 const XclBuiltInFormat* mpFormats;
1407};
1408
1409const XclBuiltInFormatTable spBuiltInFormatTables[] =
1410{ // language parent language format table
1411 { LANGUAGE_DONTKNOW, LANGUAGE_NONE, spBuiltInFormats_DONTKNOW },
1412
1413 { LANGUAGE_ENGLISH, LANGUAGE_DONTKNOW, spBuiltInFormats_ENGLISH },
1414 { LANGUAGE_ENGLISH_UK, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_UK },
1415 { LANGUAGE_ENGLISH_EIRE, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_EIRE },
1416 { LANGUAGE_ENGLISH_US, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_US },
1417 { LANGUAGE_ENGLISH_CAN, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_CAN },
1418 { LANGUAGE_ENGLISH_AUS, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_AUS },
1419 { LANGUAGE_ENGLISH_SAFRICA, LANGUAGE_ENGLISH, spBuiltInFormats_ENGLISH_SAFRICA },
1421
1422 { PRV_LANGUAGE_FRENCH_PRIM, LANGUAGE_DONTKNOW, spBuiltInFormats_FRENCH },
1423 { LANGUAGE_FRENCH, PRV_LANGUAGE_FRENCH_PRIM, spBuiltInFormats_FRENCH_FRANCE },
1424 { LANGUAGE_FRENCH_CANADIAN, PRV_LANGUAGE_FRENCH_PRIM, spBuiltInFormats_FRENCH_CANADIAN },
1425 { LANGUAGE_FRENCH_SWISS, PRV_LANGUAGE_FRENCH_PRIM, spBuiltInFormats_FRENCH_SWISS },
1426 { LANGUAGE_FRENCH_BELGIAN, LANGUAGE_FRENCH, spBuiltInFormats_FRENCH_BELGIAN },
1429
1430 { PRV_LANGUAGE_GERMAN_PRIM, LANGUAGE_DONTKNOW, spBuiltInFormats_GERMAN },
1431 { LANGUAGE_GERMAN, PRV_LANGUAGE_GERMAN_PRIM, spBuiltInFormats_GERMAN_GERMANY },
1432 { LANGUAGE_GERMAN_AUSTRIAN, PRV_LANGUAGE_GERMAN_PRIM, spBuiltInFormats_GERMAN_AUSTRIAN },
1433 { LANGUAGE_GERMAN_SWISS, PRV_LANGUAGE_GERMAN_PRIM, spBuiltInFormats_GERMAN_SWISS },
1434 { LANGUAGE_GERMAN_LUXEMBOURG, PRV_LANGUAGE_GERMAN_PRIM, spBuiltInFormats_GERMAN_LUXEMBOURG },
1435 { LANGUAGE_GERMAN_LIECHTENSTEIN, PRV_LANGUAGE_GERMAN_PRIM, spBuiltInFormats_GERMAN_LIECHTENSTEIN },
1436
1437 { LANGUAGE_ITALIAN, LANGUAGE_DONTKNOW, spBuiltInFormats_ITALIAN_ITALY },
1438 { LANGUAGE_ITALIAN_SWISS, LANGUAGE_DONTKNOW, spBuiltInFormats_ITALIAN_SWISS },
1439
1440 { LANGUAGE_SWEDISH, LANGUAGE_DONTKNOW, spBuiltInFormats_SWEDISH_SWEDEN },
1441 { LANGUAGE_SWEDISH_FINLAND, LANGUAGE_DONTKNOW, spBuiltInFormats_SWEDISH_FINLAND },
1442
1443 { PRV_LANGUAGE_ASIAN_PRIM, LANGUAGE_DONTKNOW, spBuiltInFormats_ASIAN },
1444 { LANGUAGE_JAPANESE, PRV_LANGUAGE_ASIAN_PRIM, spBuiltInFormats_JAPANESE },
1445 { LANGUAGE_KOREAN, PRV_LANGUAGE_ASIAN_PRIM, spBuiltInFormats_KOREAN },
1446 { LANGUAGE_CHINESE_SIMPLIFIED, PRV_LANGUAGE_ASIAN_PRIM, spBuiltInFormats_CHINESE_SIMPLIFIED },
1447 { LANGUAGE_CHINESE_TRADITIONAL, PRV_LANGUAGE_ASIAN_PRIM, spBuiltInFormats_CHINESE_TRADITIONAL },
1448
1449 { LANGUAGE_HEBREW, LANGUAGE_DONTKNOW, spBuiltInFormats_HEBREW },
1450 { LANGUAGE_THAI, LANGUAGE_DONTKNOW, spBuiltInFormats_THAI }
1451};
1452
1453} // namespace
1454
1456 meSysLang( rRoot.GetSysLanguage() ),
1457 mnStdScNumFmt( rRoot.GetFormatter().GetStandardIndex( ScGlobal::eLnge ) )
1458{
1459 // *** insert default formats (BIFF5+ only)***
1460
1461 if( rRoot.GetBiff() >= EXC_BIFF5 )
1463}
1464
1466{
1467 maFmtMap.clear();
1468}
1469
1470void XclNumFmtBuffer::InsertFormat( sal_uInt16 nXclNumFmt, const OUString& rFormat )
1471{
1472 XclNumFmt& rNumFmt = maFmtMap[ nXclNumFmt ];
1473 rNumFmt.maFormat = rFormat;
1474 // #i62053# rFormat may be an empty string, meOffset must be initialized
1475 rNumFmt.meOffset = NF_NUMBER_STANDARD;
1476 rNumFmt.meLanguage = LANGUAGE_SYSTEM;
1477}
1478
1480{
1481 // build a map containing tables for all languages
1482 typedef ::std::map< LanguageType, const XclBuiltInFormatTable* > XclBuiltInMap;
1483 XclBuiltInMap aBuiltInMap;
1484 for(const auto &rTable : spBuiltInFormatTables)
1485 aBuiltInMap[ rTable.meLanguage ] = &rTable;
1486
1487 // build a list of table pointers for the current language, with all parent tables
1488 typedef ::std::vector< const XclBuiltInFormatTable* > XclBuiltInVec;
1489 XclBuiltInVec aBuiltInVec;
1490 for( XclBuiltInMap::const_iterator aMIt = aBuiltInMap.find( meSysLang ), aMEnd = aBuiltInMap.end();
1491 aMIt != aMEnd; aMIt = aBuiltInMap.find( aMIt->second->meParentLang ) )
1492 aBuiltInVec.push_back( aMIt->second );
1493 // language not supported
1494 if( aBuiltInVec.empty() )
1495 {
1496 SAL_WARN("sc", "XclNumFmtBuffer::InsertBuiltinFormats - language not supported (#i29949#) 0x" << std::hex << meSysLang );
1497 XclBuiltInMap::const_iterator aMIt = aBuiltInMap.find( LANGUAGE_DONTKNOW );
1498 OSL_ENSURE( aMIt != aBuiltInMap.end(), "XclNumFmtBuffer::InsertBuiltinFormats - default map not found" );
1499 if( aMIt != aBuiltInMap.end() )
1500 aBuiltInVec.push_back( aMIt->second );
1501 }
1502
1503 // insert the default formats in the format map, from root parent to system language
1504 std::map< sal_uInt16, sal_uInt16 > aReuseMap;
1505 for( XclBuiltInVec::reverse_iterator aVIt = aBuiltInVec.rbegin(), aVEnd = aBuiltInVec.rend(); aVIt != aVEnd; ++aVIt )
1506 {
1507 // put LANGUAGE_SYSTEM for all entries in default table
1508 LanguageType eLang = ((*aVIt)->meLanguage == LANGUAGE_DONTKNOW) ? LANGUAGE_SYSTEM : meSysLang;
1509 for( const XclBuiltInFormat* pBuiltIn = (*aVIt)->mpFormats; pBuiltIn && (pBuiltIn->mnXclNumFmt != EXC_FORMAT_NOTFOUND); ++pBuiltIn )
1510 {
1511 XclNumFmt& rNumFmt = maFmtMap[ pBuiltIn->mnXclNumFmt ];
1512
1513 rNumFmt.meOffset = pBuiltIn->meOffset;
1514 rNumFmt.meLanguage = eLang;
1515
1516 if( pBuiltIn->mpFormat )
1517 rNumFmt.maFormat = OUString( pBuiltIn->mpFormat, strlen(pBuiltIn->mpFormat), RTL_TEXTENCODING_UTF8 );
1518 else
1519 rNumFmt.maFormat.clear();
1520
1521 if( pBuiltIn->meOffset == PRV_NF_INDEX_REUSE )
1522 aReuseMap[ pBuiltIn->mnXclNumFmt ] = pBuiltIn->mnXclReuseFmt;
1523 else
1524 aReuseMap.erase( pBuiltIn->mnXclNumFmt );
1525 }
1526 }
1527
1528 // copy reused number formats
1529 for( const auto& [rXclNumFmt, rXclReuseFmt] : aReuseMap )
1530 maFmtMap[ rXclNumFmt ] = maFmtMap[ rXclReuseFmt ];
1531}
1532
1533// Cell formatting data (XF) ==================================================
1534
1536 mbLocked( true ), // default in Excel and Calc
1537 mbHidden( false )
1538{
1539}
1540
1541bool operator==( const XclCellProt& rLeft, const XclCellProt& rRight )
1542{
1543 return (rLeft.mbLocked == rRight.mbLocked) && (rLeft.mbHidden == rRight.mbHidden);
1544}
1545
1547 mnHorAlign( EXC_XF_HOR_GENERAL ),
1548 mnVerAlign( EXC_XF_VER_BOTTOM ),
1549 mnOrient( EXC_ORIENT_NONE ),
1550 mnTextDir( EXC_XF_TEXTDIR_CONTEXT ),
1551 mnRotation( EXC_ROT_NONE ),
1552 mnIndent( 0 ),
1553 mbLineBreak( false ),
1554 mbShrink( false )
1555{
1556}
1557
1559{
1560 SvxCellHorJustify eHorJust = SvxCellHorJustify::Standard;
1561 switch( mnHorAlign )
1562 {
1563 case EXC_XF_HOR_GENERAL: eHorJust = SvxCellHorJustify::Standard; break;
1564 case EXC_XF_HOR_LEFT: eHorJust = SvxCellHorJustify::Left; break;
1566 case EXC_XF_HOR_CENTER: eHorJust = SvxCellHorJustify::Center; break;
1567 case EXC_XF_HOR_RIGHT: eHorJust = SvxCellHorJustify::Right; break;
1568 case EXC_XF_HOR_FILL: eHorJust = SvxCellHorJustify::Repeat; break;
1569 case EXC_XF_HOR_JUSTIFY:
1570 case EXC_XF_HOR_DISTRIB: eHorJust = SvxCellHorJustify::Block; break;
1571 default: OSL_FAIL( "XclCellAlign::GetScHorAlign - unknown horizontal alignment" );
1572 }
1573 return eHorJust;
1574}
1575
1577{
1578 return (mnHorAlign == EXC_XF_HOR_DISTRIB) ? SvxCellJustifyMethod::Distribute : SvxCellJustifyMethod::Auto;
1579}
1580
1582{
1583 SvxCellVerJustify eVerJust = SvxCellVerJustify::Standard;
1584 switch( mnVerAlign )
1585 {
1586 case EXC_XF_VER_TOP: eVerJust = SvxCellVerJustify::Top; break;
1587 case EXC_XF_VER_CENTER: eVerJust = SvxCellVerJustify::Center; break;
1588 case EXC_XF_VER_BOTTOM: eVerJust = SvxCellVerJustify::Standard; break;
1589 case EXC_XF_VER_JUSTIFY:
1590 case EXC_XF_VER_DISTRIB: eVerJust = SvxCellVerJustify::Block; break;
1591 default: OSL_FAIL( "XclCellAlign::GetScVerAlign - unknown vertical alignment" );
1592 }
1593 return eVerJust;
1594}
1595
1597{
1598 return (mnVerAlign == EXC_XF_VER_DISTRIB) ? SvxCellJustifyMethod::Distribute : SvxCellJustifyMethod::Auto;
1599}
1600
1602{
1603 SvxFrameDirection eFrameDir = SvxFrameDirection::Environment;
1604 switch( mnTextDir )
1605 {
1606 case EXC_XF_TEXTDIR_CONTEXT: eFrameDir = SvxFrameDirection::Environment; break;
1607 case EXC_XF_TEXTDIR_LTR: eFrameDir = SvxFrameDirection::Horizontal_LR_TB; break;
1608 case EXC_XF_TEXTDIR_RTL: eFrameDir = SvxFrameDirection::Horizontal_RL_TB; break;
1609 default: OSL_FAIL( "XclCellAlign::GetScFrameDir - unknown CTL text direction" );
1610 }
1611 return eFrameDir;
1612}
1613
1615{
1616 switch( eHorJust )
1617 {
1618 case SvxCellHorJustify::Standard: mnHorAlign = EXC_XF_HOR_GENERAL; break;
1619 case SvxCellHorJustify::Left: mnHorAlign = EXC_XF_HOR_LEFT; break;
1620 case SvxCellHorJustify::Center: mnHorAlign = EXC_XF_HOR_CENTER; break;
1621 case SvxCellHorJustify::Right: mnHorAlign = EXC_XF_HOR_RIGHT; break;
1622 case SvxCellHorJustify::Block: mnHorAlign = EXC_XF_HOR_JUSTIFY; break;
1623 case SvxCellHorJustify::Repeat: mnHorAlign = EXC_XF_HOR_FILL; break;
1624 default: mnHorAlign = EXC_XF_HOR_GENERAL;
1625 OSL_FAIL( "XclCellAlign::SetScHorAlign - unknown horizontal alignment" );
1626 }
1627}
1628
1630{
1631 switch( eVerJust )
1632 {
1633 case SvxCellVerJustify::Standard: mnVerAlign = EXC_XF_VER_BOTTOM; break;
1634 case SvxCellVerJustify::Top: mnVerAlign = EXC_XF_VER_TOP; break;
1635 case SvxCellVerJustify::Center: mnVerAlign = EXC_XF_VER_CENTER; break;
1636 case SvxCellVerJustify::Bottom: mnVerAlign = EXC_XF_VER_BOTTOM; break;
1637 default: mnVerAlign = EXC_XF_VER_BOTTOM;
1638 OSL_FAIL( "XclCellAlign::SetScVerAlign - unknown vertical alignment" );
1639 }
1640}
1641
1643{
1644 switch( eFrameDir )
1645 {
1646 case SvxFrameDirection::Environment: mnTextDir = EXC_XF_TEXTDIR_CONTEXT; break;
1647 case SvxFrameDirection::Horizontal_LR_TB: mnTextDir = EXC_XF_TEXTDIR_LTR; break;
1648 case SvxFrameDirection::Horizontal_RL_TB: mnTextDir = EXC_XF_TEXTDIR_RTL; break;
1650 OSL_FAIL( "XclCellAlign::SetScFrameDir - unknown CTL text direction" );
1651 }
1652}
1653
1654bool operator==( const XclCellAlign& rLeft, const XclCellAlign& rRight )
1655{
1656 return
1657 (rLeft.mnHorAlign == rRight.mnHorAlign) && (rLeft.mnVerAlign == rRight.mnVerAlign) &&
1658 (rLeft.mnTextDir == rRight.mnTextDir) && (rLeft.mnOrient == rRight.mnOrient) &&
1659 (rLeft.mnRotation == rRight.mnRotation) && (rLeft.mnIndent == rRight.mnIndent) &&
1660 (rLeft.mbLineBreak == rRight.mbLineBreak) && (rLeft.mbShrink == rRight.mbShrink);
1661}
1662
1664 mnLeftColor( 0 ),
1665 mnRightColor( 0 ),
1666 mnTopColor( 0 ),
1667 mnBottomColor( 0 ),
1668 mnDiagColor( 0 ),
1669 mnLeftLine( EXC_LINE_NONE ),
1670 mnRightLine( EXC_LINE_NONE ),
1671 mnTopLine( EXC_LINE_NONE ),
1672 mnBottomLine( EXC_LINE_NONE ),
1673 mnDiagLine( EXC_LINE_NONE ),
1674 mbDiagTLtoBR( false ),
1675 mbDiagBLtoTR( false )
1676{
1677}
1678
1679bool operator==( const XclCellBorder& rLeft, const XclCellBorder& rRight )
1680{
1681 return
1682 (rLeft.mnLeftColor == rRight.mnLeftColor) && (rLeft.mnRightColor == rRight.mnRightColor) &&
1683 (rLeft.mnTopColor == rRight.mnTopColor) && (rLeft.mnBottomColor == rRight.mnBottomColor) &&
1684 (rLeft.mnLeftLine == rRight.mnLeftLine) && (rLeft.mnRightLine == rRight.mnRightLine) &&
1685 (rLeft.mnTopLine == rRight.mnTopLine) && (rLeft.mnBottomLine == rRight.mnBottomLine) &&
1686 (rLeft.mnDiagColor == rRight.mnDiagColor) && (rLeft.mnDiagLine == rRight.mnDiagLine) &&
1687 (rLeft.mbDiagTLtoBR == rRight.mbDiagTLtoBR) && (rLeft.mbDiagBLtoTR == rRight.mbDiagBLtoTR);
1688}
1689
1691 mnForeColor( EXC_COLOR_WINDOWTEXT ),
1692 mnBackColor( EXC_COLOR_WINDOWBACK ),
1693 mnPattern( EXC_PATT_NONE )
1694{
1695}
1696
1698 mnForeColor( EXC_COLOR_WINDOWTEXT ),
1699 mnBackColor( EXC_COLOR_WINDOWBACK ),
1700 mnPattern( nPattern )
1701{
1702}
1703
1705{
1707}
1708
1709bool operator==( const XclCellArea& rLeft, const XclCellArea& rRight )
1710{
1711 return
1712 (rLeft.mnForeColor == rRight.mnForeColor) && (rLeft.mnBackColor == rRight.mnBackColor) &&
1713 (rLeft.mnPattern == rRight.mnPattern);
1714}
1715
1716XclXFBase::XclXFBase( bool bCellXF ) :
1717 mnParent( bCellXF ? EXC_XF_DEFAULTSTYLE : EXC_XF_STYLEPARENT ),
1718 mbCellXF( bCellXF )
1719{
1720 SetAllUsedFlags( false );
1721}
1722
1724{
1725}
1726
1728{
1730}
1731
1733{
1735}
1736
1737bool XclXFBase::Equals( const XclXFBase& rCmp ) const
1738{
1739 return
1740 (mbCellXF == rCmp.mbCellXF) && (mnParent == rCmp.mnParent) &&
1741 (mbProtUsed == rCmp.mbProtUsed) && (mbFontUsed == rCmp.mbFontUsed) &&
1742 (mbFmtUsed == rCmp.mbFmtUsed) && (mbAlignUsed == rCmp.mbAlignUsed) &&
1743 (mbBorderUsed == rCmp.mbBorderUsed) && (mbAreaUsed == rCmp.mbAreaUsed);
1744}
1745
1746/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Generic helper class for reading from and writing to property sets.
Definition: fapihelper.hxx:214
void ReadFromPropertySet(const ScfPropertySet &rPropSet)
Reads all values from the passed property set.
Definition: fapihelper.cxx:307
void WriteToPropertySet(ScfPropertySet &rPropSet) const
Writes all values to the passed property set.
Definition: fapihelper.cxx:353
void InitializeWrite()
Must be called before reading or storing property values in the helper.
Definition: fapihelper.cxx:336
A wrapper for a UNO property set.
Definition: fapihelper.hxx:104
constexpr tools::Long Height() const
const Color & GetWindowColor() const
const Color & GetWindowTextColor() const
const Color & GetFaceColor() const
short GetEscapement() const
XclDefaultPalette(const XclRoot &rRoot)
Definition: xlstyle.cxx:92
Color mnWindowBack
System window text color.
Definition: xlstyle.hxx:267
Color mnNoteText
System button background color.
Definition: xlstyle.hxx:269
Color GetDefColor(sal_uInt16 nXclIndex) const
Returns the default color for a (non-zero-based) Excel color or COL_AUTO on error.
Definition: xlstyle.cxx:142
const Color * mpnColorTable
Definition: xlstyle.hxx:265
Color mnNoteBack
Note text color.
Definition: xlstyle.hxx:270
sal_uInt32 mnTableSize
Note background color.
Definition: xlstyle.hxx:271
Color mnFaceColor
System window background color.
Definition: xlstyle.hxx:268
Color mnWindowText
The table with RGB values.
Definition: xlstyle.hxx:266
ScfPropSetHelper maHlpChAsian
Chart properties for Western script.
Definition: xlstyle.hxx:426
ScfPropSetHelper maHlpChWstrnNoName
Chart properties for Complex script.
Definition: xlstyle.hxx:428
ScfPropSetHelper maHlpChAsianNoName
Chart properties for Western script, no font name.
Definition: xlstyle.hxx:429
void ReadFontProperties(XclFontData &rFontData, const ScfPropertySet &rPropSet, XclFontPropSetType eType, sal_Int16 nScript=-1)
Reads all font properties from the passed property set.
Definition: xlstyle.cxx:625
ScfPropSetHelper maHlpControl
Chart properties for font escapement.
Definition: xlstyle.hxx:432
ScfPropSetHelper maHlpChCommon
Definition: xlstyle.hxx:424
void WriteFontProperties(ScfPropertySet &rPropSet, XclFontPropSetType eType, const XclFontData &rFontData, bool bHasWstrn, bool bHasAsian, bool bHasCmplx, const Color *pFontColor)
Writes all font properties to the passed property set, uses passed color as font color.
Definition: xlstyle.cxx:693
ScfPropSetHelper maHlpChEscapement
Chart properties for Complex script, no font name.
Definition: xlstyle.hxx:431
ScfPropSetHelper maHlpChCmplx
Chart properties for Asian script.
Definition: xlstyle.hxx:427
ScfPropSetHelper maHlpChCmplxNoName
Chart properties for Asian script, no font name.
Definition: xlstyle.hxx:430
ScfPropSetHelper & GetChartHelper(sal_Int16 nScript)
Returns a chart property set helper according to the passed script type.
Definition: xlstyle.cxx:745
ScfPropSetHelper maHlpChWstrn
Chart properties for all scripts.
Definition: xlstyle.hxx:425
void InsertFormat(sal_uInt16 nXclNumFmt, const OUString &rFormat)
Inserts a new number format for the specified Excel format index.
Definition: xlstyle.cxx:1470
void InsertBuiltinFormats()
Inserts built-in number formats for the current system language.
Definition: xlstyle.cxx:1479
void InitializeImport()
Clears all buffered data, used to set up for a new sheet.
Definition: xlstyle.cxx:1465
XclNumFmtBuffer(const XclRoot &rRoot)
Definition: xlstyle.cxx:1455
XclNumFmtMap maFmtMap
Definition: xlstyle.hxx:468
const LanguageType meSysLang
Map containing all default and user-defined formats.
Definition: xlstyle.hxx:469
Access to global data for a filter object (imported or exported document) from other classes.
Definition: xlroot.hxx:128
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:141
static OUString GetXclFontName(const OUString &rFontName)
Returns the matching Excel font name for a passed Calc font name.
Definition: xltools.cxx:455
Contains base members for XF record import/export.
Definition: xlstyle.hxx:563
bool mbBorderUsed
true = alignment used.
Definition: xlstyle.hxx:594
bool mbAreaUsed
true = border data used.
Definition: xlstyle.hxx:595
bool mbProtUsed
true = cell XF, false = style XF.
Definition: xlstyle.hxx:590
bool HasUsedFlags() const
Returns true, if any "attribute used" flags are ste in this XF.
Definition: xlstyle.cxx:1732
bool mbFmtUsed
true = font index used.
Definition: xlstyle.hxx:592
sal_uInt16 mnParent
Definition: xlstyle.hxx:588
bool mbAlignUsed
true = number format used.
Definition: xlstyle.hxx:593
bool mbCellXF
Index to parent style XF.
Definition: xlstyle.hxx:589
bool Equals(const XclXFBase &rCmp) const
Returns true, if this object is equal to the passed.
Definition: xlstyle.cxx:1737
void SetAllUsedFlags(bool bUsed)
Sets all "attribute used" flags to the passed state.
Definition: xlstyle.cxx:1727
virtual ~XclXFBase()
Definition: xlstyle.cxx:1723
XclXFBase(bool bCellXF)
Definition: xlstyle.cxx:1716
bool mbFontUsed
true = cell protection used.
Definition: xlstyle.hxx:591
static Color GetDefaultColor(ColorConfigEntry eEntry)
FontFamily GetFamilyType()
FontStrikeout GetStrikeout() const
bool IsShadow() const
FontItalic GetItalic()
const OUString & GetFamilyName() const
const Size & GetFontSize() const
const Color & GetColor() const
FontWeight GetWeight()
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
bool IsOutline() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
LanguageType meLanguage
DocumentType eType
FontLineStyle
LINESTYLE_SINGLE
LINESTYLE_DOUBLEWAVE
LINESTYLE_DOUBLE
LINESTYLE_NONE
LINESTYLE_DONTKNOW
FontStrikeout
STRIKEOUT_BOLD
STRIKEOUT_DOUBLE
STRIKEOUT_SINGLE
STRIKEOUT_X
STRIKEOUT_SLASH
STRIKEOUT_NONE
FontItalic
ITALIC_NORMAL
ITALIC_NONE
ITALIC_OBLIQUE
FontFamily
FAMILY_DECORATIVE
FAMILY_SYSTEM
FAMILY_DONTKNOW
FAMILY_SCRIPT
FAMILY_SWISS
FAMILY_MODERN
FAMILY_ROMAN
WEIGHT_ULTRALIGHT
WEIGHT_ULTRABOLD
WEIGHT_THIN
WEIGHT_BOLD
WEIGHT_NORMAL
WEIGHT_LIGHT
WEIGHT_DONTKNOW
WEIGHT_SEMIBOLD
WEIGHT_SEMILIGHT
WEIGHT_MEDIUM
WEIGHT_BLACK
SvxFrameDirection
#define LANGUAGE_GERMAN_AUSTRIAN
#define LANGUAGE_ENGLISH
#define LANGUAGE_GERMAN_SWISS
#define LANGUAGE_SYSTEM
#define LANGUAGE_ENGLISH_AUS
#define LANGUAGE_CHINESE_TRADITIONAL
#define LANGUAGE_FRENCH_LUXEMBOURG
#define LANGUAGE_THAI
#define LANGUAGE_NONE
#define LANGUAGE_SWEDISH_FINLAND
#define LANGUAGE_GERMAN_LUXEMBOURG
#define LANGUAGE_ENGLISH_CAN
#define LANGUAGE_ITALIAN_SWISS
#define LANGUAGE_FRENCH_SWISS
#define LANGUAGE_FRENCH
#define LANGUAGE_ITALIAN
#define LANGUAGE_CHINESE_SIMPLIFIED
#define LANGUAGE_JAPANESE
#define LANGUAGE_FRENCH_MONACO
#define LANGUAGE_ENGLISH_EIRE
#define LANGUAGE_KOREAN
#define LANGUAGE_SWEDISH
#define LANGUAGE_ENGLISH_UK
#define LANGUAGE_ENGLISH_NZ
#define LANGUAGE_FRENCH_CANADIAN
#define LANGUAGE_FRENCH_BELGIAN
#define LANGUAGE_DONTKNOW
#define LANGUAGE_HEBREW
#define LANGUAGE_GERMAN
#define LANGUAGE_ENGLISH_SAFRICA
#define LANGUAGE_GERMAN_LIECHTENSTEIN
constexpr LanguageType primary(LanguageType lt)
#define LANGUAGE_ENGLISH_US
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
FontWeight
CALCNOTESBACKGROUND
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
const BuiltinFormat * mpFormats
The locale of the parent table.
Contains all cell alignment attributes.
Definition: xlstyle.hxx:488
sal_uInt8 mnTextDir
Text orientation.
Definition: xlstyle.hxx:492
SvxCellHorJustify GetScHorAlign() const
Returns the Calc horizontal alignment.
Definition: xlstyle.cxx:1558
void SetScFrameDir(SvxFrameDirection eFrameDir)
Sets the Calc frame direction.
Definition: xlstyle.cxx:1642
sal_uInt8 mnOrient
Vertical alignment.
Definition: xlstyle.hxx:491
SvxCellJustifyMethod GetScHorJustifyMethod() const
Returns horizontal justification method as Calc's attribute.
Definition: xlstyle.cxx:1576
sal_uInt8 mnVerAlign
Horizontal alignment.
Definition: xlstyle.hxx:490
XclCellAlign()
true = Shrink to fit cell size.
Definition: xlstyle.cxx:1546
sal_uInt8 mnIndent
Text rotation angle.
Definition: xlstyle.hxx:494
SvxCellVerJustify GetScVerAlign() const
Returns the Calc vertical alignment.
Definition: xlstyle.cxx:1581
SvxCellJustifyMethod GetScVerJustifyMethod() const
Returns vertical justification method as Calc's attribute.
Definition: xlstyle.cxx:1596
void SetScHorAlign(SvxCellHorJustify eHorJust)
Sets the Calc horizontal alignment.
Definition: xlstyle.cxx:1614
void SetScVerAlign(SvxCellVerJustify eVerJust)
Sets the Calc vertical alignment.
Definition: xlstyle.cxx:1629
sal_uInt8 mnRotation
CTL text direction.
Definition: xlstyle.hxx:493
SvxFrameDirection GetScFrameDir() const
Returns the Calc frame direction.
Definition: xlstyle.cxx:1601
sal_uInt8 mnHorAlign
Definition: xlstyle.hxx:489
bool mbLineBreak
Indentation.
Definition: xlstyle.hxx:495
bool mbShrink
true = Multi-line text.
Definition: xlstyle.hxx:496
Contains background colors and pattern for a cell.
Definition: xlstyle.hxx:544
XclCellArea()
Fill pattern.
Definition: xlstyle.cxx:1690
sal_uInt16 mnBackColor
Palette index to foreground color.
Definition: xlstyle.hxx:546
bool IsTransparent() const
Returns true, if the area represents transparent state.
Definition: xlstyle.cxx:1704
sal_uInt8 mnPattern
Palette index to background color.
Definition: xlstyle.hxx:547
sal_uInt16 mnForeColor
Definition: xlstyle.hxx:545
Contains color and line style for each cell border line.
Definition: xlstyle.hxx:523
XclCellBorder()
true = Bottom-left to top-right on.
Definition: xlstyle.cxx:1663
sal_uInt8 mnRightLine
Style of left line.
Definition: xlstyle.hxx:530
sal_uInt8 mnDiagLine
Style of bottom line.
Definition: xlstyle.hxx:533
sal_uInt16 mnDiagColor
Palette index for bottom line.
Definition: xlstyle.hxx:528
bool mbDiagTLtoBR
Style of diagonal line(s).
Definition: xlstyle.hxx:534
sal_uInt8 mnTopLine
Style of right line.
Definition: xlstyle.hxx:531
sal_uInt16 mnLeftColor
Definition: xlstyle.hxx:524
sal_uInt8 mnLeftLine
Palette index for diagonal line(s).
Definition: xlstyle.hxx:529
sal_uInt16 mnTopColor
Palette index for right line.
Definition: xlstyle.hxx:526
sal_uInt16 mnRightColor
Palette index for left line.
Definition: xlstyle.hxx:525
sal_uInt16 mnBottomColor
Palette index for top line.
Definition: xlstyle.hxx:527
bool mbDiagBLtoTR
true = Top-left to bottom-right on.
Definition: xlstyle.hxx:535
sal_uInt8 mnBottomLine
Style of top line.
Definition: xlstyle.hxx:532
Contains all cell protection attributes.
Definition: xlstyle.hxx:477
XclCellProt()
true = Formula is hidden.
Definition: xlstyle.cxx:1535
bool mbLocked
Definition: xlstyle.hxx:478
bool mbHidden
true = Locked against editing.
Definition: xlstyle.hxx:479
This struct helps reading and writing Excel fonts.
Definition: xlstyle.hxx:286
void SetApiEscapement(sal_Int16 nApiEscapem)
Sets the API escapement style.
Definition: xlstyle.cxx:502
void FillFromVclFont(const vcl::Font &rFont)
Fills all members (except color and escapement) from the passed font.
Definition: xlstyle.cxx:204
OUString maStyle
Font name.
Definition: xlstyle.hxx:288
sal_Int16 GetApiFontEncoding() const
Returns the API font text encoding.
Definition: xlstyle.cxx:412
Color maColor
String with styles (bold, italic).
Definition: xlstyle.hxx:289
css::awt::FontSlant GetApiPosture() const
Returns the API font posture.
Definition: xlstyle.cxx:418
sal_uInt8 mnCharSet
Windows font family.
Definition: xlstyle.hxx:294
sal_Int16 GetApiStrikeout() const
Returns the API font strike-out style.
Definition: xlstyle.cxx:452
sal_Int16 GetApiFamily() const
Returns the API font family.
Definition: xlstyle.cxx:397
void SetScHeight(sal_Int32 nTwips)
Sets the Calc font height (in twips).
Definition: xlstyle.cxx:308
sal_uInt16 mnHeight
Font color.
Definition: xlstyle.hxx:290
void SetFontEncoding(rtl_TextEncoding eFontEnc)
Sets the font text encoding.
Definition: xlstyle.cxx:330
float GetApiWeight() const
Returns the API font weight.
Definition: xlstyle.cxx:423
bool mbOutline
true = Struck out.
Definition: xlstyle.hxx:298
void SetScFamily(FontFamily eScFamily)
Sets the Calc font family.
Definition: xlstyle.cxx:313
void SetApiStrikeout(sal_Int16 nApiStrikeout)
Sets the API font strike-out style.
Definition: xlstyle.cxx:512
sal_uInt16 mnWeight
Font height in twips (1/20 of a point).
Definition: xlstyle.hxx:291
FontWeight GetScWeight() const
Returns the Calc font weight.
Definition: xlstyle.cxx:260
void SetScStrikeout(FontStrikeout eScStrikeout)
Sets the Calc strike-out style.
Definition: xlstyle.cxx:382
void SetApiWeight(float fApiWeight)
Sets the API font weight.
Definition: xlstyle.cxx:485
XclFontData()
true = Shadowed.
Definition: xlstyle.cxx:174
void SetApiPosture(css::awt::FontSlant eApiPosture)
Sets the API font posture.
Definition: xlstyle.cxx:476
float GetApiHeight() const
Returns the API font height.
Definition: xlstyle.cxx:392
void SetScPosture(FontItalic eScPosture)
Sets the Calc font posture.
Definition: xlstyle.cxx:336
FontFamily GetScFamily(rtl_TextEncoding eDefTextEnc) const
Returns the Calc font family.
Definition: xlstyle.cxx:229
sal_Int16 GetApiEscapement() const
Returns the API escapement style.
Definition: xlstyle.cxx:441
FontStrikeout GetScStrikeout() const
Returns the Calc strike-out style.
Definition: xlstyle.cxx:303
void SetApiFamily(sal_Int16 nApiFamily)
Sets the API font family.
Definition: xlstyle.cxx:462
bool mbItalic
Underline style.
Definition: xlstyle.hxx:296
void SetApiUnderline(sal_Int16 nApiUnderl)
Sets the API font underline style.
Definition: xlstyle.cxx:490
sal_uInt8 mnUnderline
Windows character set.
Definition: xlstyle.hxx:295
FontLineStyle GetScUnderline() const
Returns the Calc font underline style.
Definition: xlstyle.cxx:279
void SetScEscapement(short nScEscapem)
Sets the Calc escapement style.
Definition: xlstyle.cxx:372
bool mbStrikeout
true = Italic.
Definition: xlstyle.hxx:297
FontItalic GetScPosture() const
Returns the Calc font posture.
Definition: xlstyle.cxx:255
void SetApiHeight(float fPoint)
Sets the API font height.
Definition: xlstyle.cxx:457
void SetScWeight(FontWeight eScWeight)
Sets the Calc font weight.
Definition: xlstyle.cxx:341
void SetScUnderline(FontLineStyle eScUnderl)
Sets the Calc underline style.
Definition: xlstyle.cxx:360
sal_uInt8 mnFamily
Escapement type.
Definition: xlstyle.hxx:293
void Clear()
Resets all members to default (empty) values.
Definition: xlstyle.cxx:190
sal_uInt16 mnEscapem
Boldness: 400=normal, 700=bold.
Definition: xlstyle.hxx:292
bool mbShadow
true = Outlined.
Definition: xlstyle.hxx:299
sal_Int16 GetApiUnderline() const
Returns the API font underline style.
Definition: xlstyle.cxx:428
rtl_TextEncoding GetFontEncoding() const
Returns the font text encoding.
Definition: xlstyle.cxx:249
SvxEscapement GetScEscapement() const
Returns the Calc escapement style.
Definition: xlstyle.cxx:292
OUString maName
Definition: xlstyle.hxx:287
void FillFromSvxFont(const SvxFont &rFont)
Fills all members (except color) from the passed SVX font.
Definition: xlstyle.cxx:221
OUString maFormat
Definition: xlstyle.hxx:439
NfIndexTableOffset meOffset
Format string, may be empty (meOffset used then).
Definition: xlstyle.hxx:440
LanguageType meLanguage
SvNumberFormatter format index, if maFormat is empty.
Definition: xlstyle.hxx:441
SvxEscapement
SvxCellJustifyMethod
SvxCellHorJustify
SvxCellVerJustify
unsigned char sal_uInt8
signed char sal_Int8
const sal_uInt8 EXC_ORIENT_NONE
Definition: xlconst.hxx:133
const sal_uInt8 EXC_ROT_NONE
Text orientation: 90 deg clockwise.
Definition: xlconst.hxx:138
@ EXC_BIFF5
MS Excel 4.0.
Definition: xlconst.hxx:34
@ EXC_BIFF4
MS Excel 3.0.
Definition: xlconst.hxx:33
@ EXC_BIFF2
Definition: xlconst.hxx:31
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:35
@ EXC_BIFF3
MS Excel 2.1.
Definition: xlconst.hxx:32
#define UTF8_CS_HOUR
Definition: xlstyle.cxx:815
#define UTF8_CJ_YEAR
Definition: xlstyle.cxx:807
#define UTF8_CJ_MIN
Definition: xlstyle.cxx:811
#define UTF8_EURO
Definition: xlstyle.cxx:799
#define UTF8_KO_HOUR
Definition: xlstyle.cxx:821
const Color spnDefColorTable8[]
Default color table for BIFF8.
Definition: xlstyle.cxx:77
const Color spnDefColorTable2[]
Default color table for BIFF2.
Definition: xlstyle.cxx:50
#define UTF8_KO_SEC
Definition: xlstyle.cxx:823
#define EXC_PALETTE_EGA_COLORS_LIGHT
Standard EGA colors, bright.
Definition: xlstyle.cxx:43
#define EXC_PALETTE_EGA_COLORS_DARK
Standard EGA colors, dark.
Definition: xlstyle.cxx:46
#define EXC_NUMFMT_STRING(nXclNumFmt, pcUtf8)
Defines a literal Excel built-in number format.
Definition: xlstyle.cxx:782
#define EXC_NUMFMT_OFFSET(nXclNumFmt, eOffset)
Defines an Excel built-in number format that maps to an own built-in format.
Definition: xlstyle.cxx:786
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:519
#define UTF8_KO_YEAR
Definition: xlstyle.cxx:818
#define UTF8_WON
Definition: xlstyle.cxx:802
#define EXC_NUMFMT_ENDTABLE()
Terminates an Excel built-in number format table.
Definition: xlstyle.cxx:794
#define UTF8_CJ_MON
Definition: xlstyle.cxx:808
#define UTF8_POUND_UK
Definition: xlstyle.cxx:800
#define UTF8_CJ_DAY
Definition: xlstyle.cxx:809
#define UTF8_BAHT
Definition: xlstyle.cxx:798
#define UTF8_CJ_SEC
Definition: xlstyle.cxx:812
#define UTF8_YEN_JP
Definition: xlstyle.cxx:804
const Color spnDefColorTable5[]
Default color table for BIFF5/BIFF7.
Definition: xlstyle.cxx:64
#define UTF8_KO_MIN
Definition: xlstyle.cxx:822
#define UTF8_SHEQEL
Definition: xlstyle.cxx:801
#define EXC_NUMFMT_REUSE(nXclNumFmt, nXclReuse)
Defines an Excel built-in number format that is the same as the specified.
Definition: xlstyle.cxx:790
#define UTF8_KO_MON
Definition: xlstyle.cxx:819
#define UTF8_YEN_CS
Definition: xlstyle.cxx:803
#define UTF8_CJ_HOUR
Definition: xlstyle.cxx:810
const Color spnDefColorTable3[]
Default color table for BIFF3/BIFF4.
Definition: xlstyle.cxx:56
#define UTF8_KO_DAY
Definition: xlstyle.cxx:820
const sal_uInt8 EXC_FONTFAM_MODERN
Definition: xlstyle.hxx:88
const sal_uInt16 EXC_COLOR_NOTEBACK
Automatic frame border for series (BIFF8 charts).
Definition: xlstyle.hxx:213
const sal_uInt16 EXC_FONTWGHT_MEDIUM
Definition: xlstyle.hxx:111
const sal_uInt16 EXC_FONTWGHT_NORMAL
Definition: xlstyle.hxx:110
const sal_uInt16 EXC_XF_DEFAULTSTYLE
Arbitrary maximum number of style XFs.
Definition: xlstyle.hxx:138
const sal_uInt16 EXC_COLOR_WINDOWBACK
System window text color (>=BIFF5).
Definition: xlstyle.hxx:208
const sal_uInt8 EXC_FONTFAM_SCRIPT
Definition: xlstyle.hxx:89
const sal_uInt8 EXC_FONTFAM_SWISS
Definition: xlstyle.hxx:86
const sal_uInt16 EXC_FONTWGHT_SEMIBOLD
Definition: xlstyle.hxx:112
const sal_uInt8 EXC_XF_HOR_GENERAL
Definition: xlstyle.hxx:158
const sal_uInt8 EXC_XF_HOR_DISTRIB
Definition: xlstyle.hxx:165
const sal_uInt8 EXC_XF_TEXTDIR_LTR
Definition: xlstyle.hxx:174
const sal_uInt16 EXC_COLOR_BUTTONBACK
System window background color (>=BIFF5).
Definition: xlstyle.hxx:209
const sal_uInt16 EXC_FONTWGHT_SEMILIGHT
Definition: xlstyle.hxx:109
const sal_uInt16 EXC_FONTWGHT_ULTRABOLD
Definition: xlstyle.hxx:114
const sal_uInt16 EXC_COLOR_NOTETEXT
Note background color.
Definition: xlstyle.hxx:214
const sal_uInt8 EXC_FONTFAM_SYSTEM
Definition: xlstyle.hxx:87
const sal_uInt16 EXC_FONTESC_SUPER
Definition: xlstyle.hxx:126
const sal_uInt16 EXC_COLOR_FONTAUTO
Note text color.
Definition: xlstyle.hxx:215
const sal_uInt16 EXC_FONTWGHT_BLACK
Definition: xlstyle.hxx:115
const sal_uInt8 EXC_XF_HOR_CENTER_AS
Definition: xlstyle.hxx:164
XclFontPropSetType
Enumerates different types for objects with font settings (using different property names).
Definition: xlstyle.hxx:396
@ EXC_FONTPROPSET_CONTROL
All text objects in charts.
Definition: xlstyle.hxx:398
@ EXC_FONTPROPSET_CHART
Definition: xlstyle.hxx:397
const sal_uInt8 EXC_XF_HOR_CENTER
Definition: xlstyle.hxx:160
const sal_uInt8 EXC_FONTFAM_DONTKNOW
Definition: xlstyle.hxx:84
const sal_uInt8 EXC_XF_TEXTDIR_RTL
Definition: xlstyle.hxx:175
const sal_uInt8 EXC_FONTUNDERL_DOUBLE_ACC
Definition: xlstyle.hxx:122
const sal_uInt8 EXC_FONTFAM_DECORATIVE
Definition: xlstyle.hxx:90
const sal_uInt8 EXC_FONTUNDERL_SINGLE
Definition: xlstyle.hxx:119
const sal_uInt16 EXC_COLOR_CHBORDERAUTO
System window background color (BIFF8 charts).
Definition: xlstyle.hxx:212
const sal_uInt8 EXC_LINE_NONE
Definition: xlstyle.hxx:37
const sal_uInt16 EXC_COLOR_WINDOWTEXT
System window background color (BIFF3-BIFF4).
Definition: xlstyle.hxx:207
const sal_uInt8 EXC_FONTUNDERL_DOUBLE
Definition: xlstyle.hxx:120
const sal_uInt8 EXC_XF_VER_TOP
Definition: xlstyle.hxx:167
const sal_uInt8 EXC_XF_VER_JUSTIFY
Definition: xlstyle.hxx:170
const sal_uInt16 EXC_XF_STYLEPARENT
Definition: xlstyle.hxx:147
const sal_uInt16 EXC_FONTESC_NONE
Definition: xlstyle.hxx:125
const sal_uInt8 EXC_XF_VER_BOTTOM
Definition: xlstyle.hxx:169
const sal_uInt8 EXC_PATT_NONE
Definition: xlstyle.hxx:54
const sal_uInt8 EXC_XF_VER_CENTER
Definition: xlstyle.hxx:168
const sal_uInt8 EXC_FONTUNDERL_NONE
Definition: xlstyle.hxx:118
const sal_uInt8 EXC_XF_HOR_FILL
Definition: xlstyle.hxx:162
const sal_uInt16 EXC_FONTWGHT_ULTRALIGHT
Definition: xlstyle.hxx:107
const sal_uInt16 EXC_COLOR_WINDOWTEXT3
First user defined color.
Definition: xlstyle.hxx:205
const sal_uInt16 EXC_FONTWGHT_LIGHT
Definition: xlstyle.hxx:108
const sal_uInt16 EXC_COLOR_CHWINDOWBACK
System window text color (BIFF8 charts).
Definition: xlstyle.hxx:211
const sal_uInt8 EXC_FONTCSET_ANSI_LATIN
Definition: xlstyle.hxx:93
const sal_uInt8 EXC_XF_HOR_RIGHT
Definition: xlstyle.hxx:161
const sal_uInt16 EXC_FONTWGHT_THIN
Definition: xlstyle.hxx:106
const sal_uInt8 EXC_FONTUNDERL_SINGLE_ACC
Definition: xlstyle.hxx:121
const sal_uInt8 EXC_XF_HOR_JUSTIFY
Definition: xlstyle.hxx:163
const sal_uInt8 EXC_XF_VER_DISTRIB
Definition: xlstyle.hxx:171
const sal_uInt16 EXC_COLOR_WINDOWBACK3
System window text color (BIFF3-BIFF4).
Definition: xlstyle.hxx:206
const sal_uInt16 EXC_FORMAT_NOTFOUND
Definition: xlstyle.hxx:69
const sal_uInt16 EXC_FONTWGHT_BOLD
Definition: xlstyle.hxx:113
const sal_uInt8 EXC_XF_HOR_LEFT
Definition: xlstyle.hxx:159
const sal_uInt8 EXC_FONTFAM_ROMAN
Definition: xlstyle.hxx:85
const sal_uInt16 EXC_COLOR_CHWINDOWTEXT
System button background color (face color).
Definition: xlstyle.hxx:210
const sal_uInt8 EXC_XF_TEXTDIR_CONTEXT
Definition: xlstyle.hxx:173
const sal_uInt16 EXC_FONTESC_SUB
Definition: xlstyle.hxx:127
const sal_uInt16 EXC_FONTWGHT_DONTKNOW
Definition: xlstyle.hxx:105
#define DBG_ERROR_BIFF()
Definition: xltools.hxx:33
NfIndexTableOffset
NF_SCIENTIFIC_000E00
NF_TIME_HHMMSSAMPM
NF_DATE_SYS_DMMMYY
NF_DATE_SYS_MMYY
NF_TIME_HHMMAMPM
NF_NUMBER_DEC2
NF_DATE_SYS_DDMMM
NF_TEXT
NF_INDEX_TABLE_ENTRIES
NF_NUMBER_STANDARD
NF_NUMBER_1000DEC2
NF_PERCENT_DEC2
NF_TIME_HHMM
NF_NUMBER_INT
NF_FRACTION_1D
NF_TIME_HHMMSS
NF_PERCENT_INT
NF_DATE_SYS_DDMMYYYY
NF_NUMBER_1000INT
NF_FRACTION_2D
NF_DATETIME_SYSTEM_SHORT_HHMM