LibreOffice Module xmloff (master)  1
XMLNumberStyles.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 
22 #include <xmloff/xmlnmspe.hxx>
23 #include <xmloff/xmlimp.hxx>
24 #include <xmloff/nmspmap.hxx>
25 #include <xmloff/xmltoken.hxx>
26 
27 #include <sal/log.hxx>
28 
29 #include "sdxmlexp_impl.hxx"
30 #include "sdxmlimp_impl.hxx"
31 
32 using namespace ::xmloff::token;
33 
34 namespace {
35 
36 struct SdXMLDataStyleNumber
37 {
38  enum XMLTokenEnum meNumberStyle;
39  bool mbLong;
40  bool mbTextual;
41  bool mbDecimal02;
42  const char* mpText;
43 };
44 
45 }
46 
47 SdXMLDataStyleNumber const aSdXMLDataStyleNumbers[] =
48 {
49  { XML_DAY, false, false, false, nullptr },
50  { XML_DAY, true, false, false, nullptr },
51  { XML_MONTH, true, false, false, nullptr },
52  { XML_MONTH, false, true, false, nullptr },
53  { XML_MONTH, true, true, false, nullptr },
54  { XML_YEAR, false, false, false, nullptr },
55  { XML_YEAR, true, false, false, nullptr },
56  { XML_DAY_OF_WEEK, false, false, false, nullptr },
57  { XML_DAY_OF_WEEK, true, false, false, nullptr },
58  { XML_TEXT, false, false, false, "." },
59  { XML_TEXT, false, false, false, " " },
60  { XML_TEXT, false, false, false, ", " },
61  { XML_TEXT, false, false, false, ". " },
62  { XML_HOURS, false, false, false, nullptr },
63  { XML_MINUTES, false, false, false, nullptr },
64  { XML_TEXT, false, false, false, ":" },
65  { XML_AM_PM, false, false, false, nullptr },
66  { XML_SECONDS, false, false, false, nullptr },
67  { XML_SECONDS, false, false, true, nullptr },
68  { XML_TOKEN_INVALID, false, false, false, nullptr }
69 };
70 
71 // date
72 
73 #define DATA_STYLE_NUMBER_DAY 1 // <number:day/>
74 #define DATA_STYLE_NUMBER_DAY_LONG 2 // <number:day number:style="long"/>
75 #define DATA_STYLE_NUMBER_MONTH_LONG 3 // <number:month number:style="long"/>
76 #define DATA_STYLE_NUMBER_MONTH_TEXT 4 // <number:month number:textual="true"/>
77 #define DATA_STYLE_NUMBER_MONTH_LONG_TEXT 5 // <number:month number:style="long" number:textual="true"/>
78 #define DATA_STYLE_NUMBER_YEAR 6 // <number:year/>
79 #define DATA_STYLE_NUMBER_YEAR_LONG 7 // <number:year number:style="long"/>
80 #define DATA_STYLE_NUMBER_DAYOFWEEK 8 // <number:day-of-week/>
81 #define DATA_STYLE_NUMBER_DAYOFWEEK_LONG 9 // <number:day-of-week number:style="long"/>
82 #define DATA_STYLE_NUMBER_TEXT_POINT 10 // <number:text>.</number:text>
83 #define DATA_STYLE_NUMBER_TEXT_SPACE 11 // <number:text> </number:text>
84 #define DATA_STYLE_NUMBER_TEXT_COMMASPACE 12 // <number:text>, </number:text>
85 #define DATA_STYLE_NUMBER_TEXT_POINTSPACE 13 // <number:text>. </number:text>
86 #define DATA_STYLE_NUMBER_HOURS 14 // <number:hours/>
87 #define DATA_STYLE_NUMBER_MINUTES 15 // <number:minutes/>
88 #define DATA_STYLE_NUMBER_TEXT_COLON 16 // <number:text>:</number:text>
89 #define DATA_STYLE_NUMBER_AMPM 17 // <number:am-pm/>
90 #define DATA_STYLE_NUMBER_SECONDS 18 // <number:seconds/>
91 #define DATA_STYLE_NUMBER_SECONDS_02 19 // <number:seconds number:/>
92 
94 {
95  const char* mpName;
99 };
100 
102 {
103  "D1", true, true,
104  {
110  0, 0, 0
111  }
112 };
113 
115 {
116  "D2", true, true,
117  {
125  0
126  }
127 };
128 
130 {
131  "D3", false, true,
132  {
138  0, 0, 0
139  }
140 };
141 
143 {
144  "D4", false, true,
145  {
151  0, 0, 0
152  }
153 };
154 
156 {
157  "D5", false, true,
158  {
164  0, 0, 0
165  }
166 };
167 
169 {
170  "D6", false, true,
171  {
177  0, 0, 0
178  }
179 };
180 
182 {
183  "D7", false, true,
184  {
192  0
193  }
194 };
195 
197 {
198  "D8", false, true,
199  {
207  0
208  }
209 };
210 
212 { "T1", true, false,
213  {
220  0, 0,
221  }
222 };
223 
225 { "T2", false, false,
226  {
230  0, 0, 0, 0, 0
231  }
232 };
233 
235 { "T3", false, false,
236  {
242  0, 0, 0
243  }
244 };
245 
247 { "T4", false, false,
248  {
254  0, 0, 0
255  }
256 };
257 
259 { "T5", false, false,
260  {
265  0, 0, 0, 0
266  }
267 };
268 
270 { "T6", false, false,
271  {
278  0, 0
279  }
280 };
281 
283 { "T7", false, false,
284  {
291  0, 0
292  }
293 };
294 
296 {
305 };
306 
308 {
315  &aSdXML_TimeStyle_7
316 };
317 
318 // export
319 
320 static void SdXMLExportDataStyleNumber( SdXMLExport& rExport, SdXMLDataStyleNumber const & rElement )
321 {
322  if( rElement.mbDecimal02 )
323  {
325  }
326 
327  if( rElement.mbLong )
328  {
330  }
331 
332  if( rElement.mbTextual )
333  {
335  }
336 
337  SvXMLElementExport aNumberStyle( rExport, XML_NAMESPACE_NUMBER, rElement.meNumberStyle, true, false );
338  if( rElement.mpText )
339  {
340  OUString sAttrValue( OUString::createFromAscii( rElement.mpText ) );
341  rExport.GetDocHandler()->characters( sAttrValue );
342  }
343 }
344 
345 static void SdXMLExportStyle( SdXMLExport& rExport, const SdXMLFixedDataStyle* pStyle, const SdXMLFixedDataStyle* pStyle2 = nullptr )
346 {
347  // name
348  OUString sAttrValue = OUString::createFromAscii( pStyle->mpName );
349  if( pStyle2 )
350  sAttrValue += OUString::createFromAscii( pStyle2->mpName );
351 
352  rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, sAttrValue );
353 
354  if( pStyle->mbAutomatic )
355  {
357  }
358 
359  SvXMLElementExport aElement( rExport, XML_NAMESPACE_NUMBER, pStyle->mbDateStyle ? XML_DATE_STYLE : XML_TIME_STYLE, true, true );
360 
361  do
362  {
363 
364  const sal_uInt8* pElements = &pStyle->mpFormat[0];
365 
366  while( *pElements )
367  {
368  SdXMLDataStyleNumber const & rElement = aSdXMLDataStyleNumbers[ (*pElements++) - 1 ];
369  SdXMLExportDataStyleNumber( rExport, rElement );
370  }
371 
372  if( pStyle2 )
373  {
374  SdXMLDataStyleNumber const & rElement = aSdXMLDataStyleNumbers[ DATA_STYLE_NUMBER_TEXT_SPACE - 1 ];
375  SdXMLExportDataStyleNumber( rExport, rElement );
376  }
377 
378  pStyle = pStyle2;
379  pStyle2 = nullptr;
380  }
381  while( pStyle );
382 }
383 
385 {
386  SAL_WARN_IF( (nStyle < 0) || (nStyle >= SdXMLTimeFormatCount), "xmloff", "Unknown time style!" );
387  if( (nStyle >= 0) && (nStyle < SdXMLTimeFormatCount) )
388  SdXMLExportStyle( rExport, aSdXMLFixedTimeFormats[ nStyle ] );
389 }
390 
392 {
393  if( nStyle > 0x0f )
394  {
395  int nDateStyle = nStyle & 0x0f;
396  bool bHasDate = nDateStyle != 0;
397 
398  if( nDateStyle > 1 )
399  nDateStyle -= 2;
400 
401  SAL_WARN_IF(nDateStyle >= SdXMLDateFormatCount, "xmloff", "unknown date style!");
402 
403  int nTimeStyle = (nStyle >> 4) & 0x0f;
404  bool bHasTime = nTimeStyle != 0;
405 
406  if( nTimeStyle > 1 )
407  nTimeStyle -= 2;
408 
409  SAL_WARN_IF(nTimeStyle >= SdXMLTimeFormatCount, "xmloff", "Unknown time style!");
410 
411  if ((nDateStyle < SdXMLDateFormatCount) && (nTimeStyle < SdXMLTimeFormatCount))
412  {
413  if( bHasDate )
414  {
415  if( bHasTime )
416  {
417  SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nDateStyle ], aSdXMLFixedTimeFormats[ nTimeStyle ] );
418  }
419  else
420  {
421  SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nDateStyle ] );
422  }
423  }
424  else if( bHasTime )
425  {
426  SdXMLExportStyle( rExport, aSdXMLFixedTimeFormats[ nTimeStyle ] );
427  }
428  }
429  }
430  else
431  {
432  SAL_WARN_IF( (nStyle < 0) || (nStyle >= SdXMLDateFormatCount), "xmloff", "unknown date style!" );
433  if( (nStyle >= 0) && (nStyle < SdXMLDateFormatCount) )
434  SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nStyle ] );
435  }
436 }
437 
438 OUString SdXMLNumberStylesExporter::getTimeStyleName(const sal_Int32 nTimeFormat )
439 {
440  sal_Int32 nFormat = nTimeFormat;
441  if( nFormat > 1 )
442  nFormat -= 2;
443 
444  if( (nFormat >= 0) && (nFormat < SdXMLTimeFormatCount) )
445  {
446  return OUString::createFromAscii(aSdXMLFixedTimeFormats[nFormat]->mpName );
447  }
448  else
449  {
450  return OUString();
451  }
452 }
453 
454 OUString SdXMLNumberStylesExporter::getDateStyleName(const sal_Int32 nDateFormat )
455 {
456  sal_Int32 nFormat = nDateFormat;
457 
458  if( nFormat > 0x0f )
459  {
460  OUString aStr;
461  if( nFormat & 0x0f )
462  aStr = getDateStyleName( nFormat & 0x0f );
463  aStr += getTimeStyleName( (nFormat >> 4) & 0x0f );
464  return aStr;
465  }
466 
467  if( nFormat > 1 )
468  nFormat -= 2;
469 
470  if( (nFormat >= 0) && (nFormat < SdXMLDateFormatCount) )
471  {
472  return OUString::createFromAscii(aSdXMLFixedDateFormats[nFormat]->mpName );
473  }
474  else
475  {
476  return OUString();
477  }
478 }
479 
480 // import
481 
483 {
484 private:
486 
487  OUString maNumberStyle;
488  bool mbLong;
489  bool mbTextual;
491  OUString maText;
493 
494 public:
495 
497  sal_uInt16 nPrfx,
498  const OUString& rLocalName,
499  const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
501  const SvXMLImportContextRef& rSlaveContext );
502 
503  virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
504  const OUString& rLocalName,
505  const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
506 
507  virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
508 
509  virtual void EndElement() override;
510 
511  virtual void Characters( const OUString& rChars ) override;
512 };
513 
514 
515 SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, const SvXMLImportContextRef& rSlaveContext )
516 : SvXMLImportContext(rImport, nPrfx, rLocalName),
517  mpParent( pParent ),
518  maNumberStyle( rLocalName ),
519  mxSlaveContext( rSlaveContext )
520 {
521  mbLong = false;
522  mbTextual = false;
523  mbDecimal02 = false;
524 
525  const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
526  for(sal_Int16 i=0; i < nAttrCount; i++)
527  {
528  OUString sAttrName = xAttrList->getNameByIndex( i );
529  OUString aLocalName;
530  sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
531  OUString sValue = xAttrList->getValueByIndex( i );
532 
533  if( nPrefix == XML_NAMESPACE_NUMBER )
534  {
535  if( IsXMLToken( aLocalName, XML_DECIMAL_PLACES ) )
536  {
537  mbDecimal02 = IsXMLToken( sValue, XML_2 );
538  }
539  else if( IsXMLToken( aLocalName, XML_STYLE ) )
540  {
541  mbLong = IsXMLToken( sValue, XML_LONG );
542  }
543  else if( IsXMLToken( aLocalName, XML_TEXTUAL ) )
544  {
545  mbTextual = IsXMLToken( sValue, XML_TRUE );
546  }
547  }
548  }
549 
550 }
551 
553  const OUString& rLocalName,
554  const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
555 {
556  return mxSlaveContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
557 }
558 
559 void SdXMLNumberFormatMemberImportContext::StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
560 {
561  mxSlaveContext->StartElement( xAttrList );
562 }
563 
565 {
566  mxSlaveContext->EndElement();
567 
568  if( mpParent )
570 }
571 
573 {
574  mxSlaveContext->Characters( rChars );
575  maText += rChars;
576 }
577 
578 
579 SdXMLNumberFormatImportContext::SdXMLNumberFormatImportContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, SvXMLNumImpData* pNewData, sal_uInt16 nNewType, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles)
580 : SvXMLNumFormatContext(rImport, nPrfx, rLocalName, pNewData, nNewType, xAttrList, rStyles),
581  mbAutomatic( false ),
582  mnIndex(0),
583  mnKey( -1 )
584 {
585  mbTimeStyle = IsXMLToken( rLocalName, XML_TIME_STYLE );
586 
587  const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
588  for(sal_Int16 i=0; i < nAttrCount; i++)
589  {
590  OUString sAttrName = xAttrList->getNameByIndex( i );
591  OUString aLocalName;
592  sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
593  OUString sValue = xAttrList->getValueByIndex( i );
594 
595  if( nPrefix == XML_NAMESPACE_NUMBER )
596  {
597  if( IsXMLToken( aLocalName, XML_AUTOMATIC_ORDER ) )
598  {
599  mbAutomatic = IsXMLToken( sValue, XML_TRUE );
600  }
601  }
602  }
603 }
604 
606 {
607 }
608 
609 void SdXMLNumberFormatImportContext::add( OUString const & rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, OUString const & rText )
610 {
611  if (mnIndex == 16)
612  return;
613 
614  const SdXMLDataStyleNumber* pStyleMember = aSdXMLDataStyleNumbers;
615  for( sal_uInt8 nIndex = 0; pStyleMember->meNumberStyle != XML_TOKEN_INVALID; nIndex++, pStyleMember++ )
616  {
617  if( IsXMLToken(rNumberStyle, pStyleMember->meNumberStyle) &&
618  (pStyleMember->mbLong == bLong) &&
619  (pStyleMember->mbTextual == bTextual) &&
620  (pStyleMember->mbDecimal02 == bDecimal02) &&
621  ( ( (pStyleMember->mpText == nullptr) && (rText.isEmpty()) ) ||
622  ( pStyleMember->mpText && (rText.equalsAscii( pStyleMember->mpText ) ) ) ) )
623  {
624  mnElements[mnIndex++] = nIndex + 1;
625  return;
626  }
627  }
628 }
629 
630 bool SdXMLNumberFormatImportContext::compareStyle( const SdXMLFixedDataStyle* pStyle, sal_Int16& nIndex ) const
631 {
632  if( (pStyle->mbAutomatic != mbAutomatic) && (nIndex == 0))
633  return false;
634 
635  sal_Int16 nCompareIndex;
636  for( nCompareIndex = 0; nCompareIndex < 8; nIndex++, nCompareIndex++ )
637  {
638  if( pStyle->mpFormat[nCompareIndex] != mnElements[nIndex] )
639  return false;
640  }
641 
642  return true;
643 }
644 
646 {
648 
649  for( ; mnIndex < 16; mnIndex++ )
650  {
651  mnElements[mnIndex] = 0;
652  }
653 
654  if( mbTimeStyle )
655  {
656  // compare import with all time styles
657  for( sal_Int16 nFormat = 0; nFormat < SdXMLTimeFormatCount; nFormat++ )
658  {
659  sal_Int16 nIndex = 0;
660  if( compareStyle( aSdXMLFixedTimeFormats[nFormat], nIndex ) )
661  {
662  mnKey = nFormat + 2;
663  break;
664  }
665  }
666  }
667  else
668  {
669  // compare import with all date styles
670  for( sal_Int16 nFormat = 0; nFormat < SdXMLDateFormatCount; nFormat++ )
671  {
672  sal_Int16 nIndex = 0;
673  if( compareStyle( aSdXMLFixedDateFormats[nFormat], nIndex ) )
674  {
675  mnKey = nFormat + 2;
676  break;
677  }
678  else if( mnElements[nIndex] == DATA_STYLE_NUMBER_TEXT_SPACE )
679  {
680  // if it's a valid date ending with a space, see if a time style follows
681  for( sal_Int16 nTimeFormat = 0; nTimeFormat < SdXMLTimeFormatCount; nTimeFormat++ )
682  {
683  sal_Int16 nIndex2 = nIndex + 1;
684  if( compareStyle( aSdXMLFixedTimeFormats[nTimeFormat], nIndex2 ) )
685  {
686  mnKey = (nFormat + 2) | ((nTimeFormat + 2) << 4);
687  break;
688  }
689  }
690  }
691  }
692 
693  // no date style found? maybe it's an extended time style
694  if( mnKey == -1 )
695  {
696  // compare import with all time styles
697  for( sal_Int16 nFormat = 0; nFormat < SdXMLTimeFormatCount; nFormat++ )
698  {
699  sal_Int16 nIndex = 0;
700  if( compareStyle( aSdXMLFixedTimeFormats[nFormat], nIndex ) )
701  {
702  mnKey = (nFormat + 2) << 4;
703  break;
704  }
705  }
706  }
707  }
708 }
709 
710 SvXMLImportContextRef SdXMLNumberFormatImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList )
711 {
712  return new SdXMLNumberFormatMemberImportContext( GetImport(), nPrefix, rLocalName, xAttrList, this, SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) );
713 }
714 
715 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3422
constexpr sal_uInt16 XML_NAMESPACE_STYLE
Definition: xmlnmspe.hxx:30
sal_Int32 nIndex
const SdXMLFixedDataStyle aSdXML_TimeStyle_5
virtual void EndElement()
EndElement is called before a context will be destructed, but after an elements context has been pars...
Definition: xmlictxt.cxx:62
static void SdXMLExportStyle(SdXMLExport &rExport, const SdXMLFixedDataStyle *pStyle, const SdXMLFixedDataStyle *pStyle2=nullptr)
SdXMLDataStyleNumber const aSdXMLDataStyleNumbers[]
const SdXMLFixedDataStyle *const aSdXMLFixedDateFormats[SdXMLDateFormatCount]
const sal_Int16 SdXMLTimeFormatCount
#define DATA_STYLE_NUMBER_TEXT_POINT
#define DATA_STYLE_NUMBER_MONTH_LONG_TEXT
const SdXMLFixedDataStyle aSdXML_TimeStyle_6
const SdXMLFixedDataStyle aSdXML_Standard_Short
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
const SdXMLFixedDataStyle aSdXML_Standard_Long
static void SdXMLExportDataStyleNumber(SdXMLExport &rExport, SdXMLDataStyleNumber const &rElement)
#define DATA_STYLE_NUMBER_DAYOFWEEK
static void exportDateStyle(SdXMLExport &rExport, sal_Int32 nStyle)
SvXMLNamespaceMap & GetNamespaceMap()
Definition: xmlimp.hxx:397
const SdXMLFixedDataStyle aSdXML_TimeStyle_1
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
Definition: xmlexp.hxx:386
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
Definition: nmspmap.cxx:437
const SdXMLFixedDataStyle aSdXML_DateStyle_4
static OUString getTimeStyleName(const sal_Int32 nTimeFormat)
#define DATA_STYLE_NUMBER_HOURS
const SdXMLFixedDataStyle *const aSdXMLFixedTimeFormats[SdXMLTimeFormatCount]
#define DATA_STYLE_NUMBER_YEAR
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
Definition: xmlexp.cxx:926
#define DATA_STYLE_NUMBER_MONTH_TEXT
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:47
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
Definition: xmlnmspe.hxx:38
SdXMLNumberFormatImportContext(SdXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLocalName, SvXMLNumImpData *pNewData, sal_uInt16 nNewType, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, SvXMLStylesContext &rStyles)
const SdXMLFixedDataStyle aSdXML_TimeStyle_4
#define DATA_STYLE_NUMBER_TEXT_COMMASPACE
const SdXMLFixedDataStyle aSdXML_DateStyle_1
virtual void EndElement() override
EndElement is called before a context will be destructed, but after an elements context has been pars...
static OUString getDateStyleName(const sal_Int32 nDateFormat)
int i
const SdXMLFixedDataStyle aSdXML_TimeStyle_2
#define DATA_STYLE_NUMBER_TEXT_SPACE
const SdXMLFixedDataStyle aSdXML_DateStyle_2
#define DATA_STYLE_NUMBER_TEXT_POINTSPACE
#define DATA_STYLE_NUMBER_SECONDS_02
const SdXMLFixedDataStyle aSdXML_TimeStyle_3
void add(OUString const &rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, OUString const &rText)
#define DATA_STYLE_NUMBER_MONTH_LONG
const SdXMLFixedDataStyle aSdXML_DateStyle_3
#define DATA_STYLE_NUMBER_SECONDS
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
SdXMLNumberFormatMemberImportContext(SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, SdXMLNumberFormatImportContext *pParent, const SvXMLImportContextRef &rSlaveContext)
virtual ~SdXMLNumberFormatImportContext() override
virtual void Characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
virtual void EndElement() override
EndElement is called before a context will be destructed, but after an elements context has been pars...
SdXMLNumberFormatImportContext * mpParent
bool compareStyle(const SdXMLFixedDataStyle *pStyle, sal_Int16 &nIndex) const
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
RegionData_Impl * mpParent
static void exportTimeStyle(SdXMLExport &rExport, sal_Int32 nStyle)
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
Handling of tokens in XML:
const sal_Int16 SdXMLDateFormatCount
const SdXMLFixedDataStyle aSdXML_DateStyle_6
#define DATA_STYLE_NUMBER_YEAR_LONG
#define DATA_STYLE_NUMBER_DAY_LONG
const SdXMLFixedDataStyle aSdXML_TimeStyle_7
#define DATA_STYLE_NUMBER_DAYOFWEEK_LONG
#define DATA_STYLE_NUMBER_MINUTES
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
Definition: xmlnumfi.cxx:1508
#define DATA_STYLE_NUMBER_DAY
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
StartElement is called after a context has been constructed and before an elements context is parsed...
int mnIndex
const SdXMLFixedDataStyle aSdXML_DateStyle_5
#define DATA_STYLE_NUMBER_TEXT_COLON
css::uno::Any const SvXMLExport & rExport
Definition: ImageStyle.hxx:38
#define DATA_STYLE_NUMBER_AMPM
aStr
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.