37 struct SdXMLDataStyleNumber
50 {
XML_DAY,
false,
false,
false,
nullptr },
51 {
XML_DAY,
true,
false,
false,
nullptr },
52 {
XML_MONTH,
true,
false,
false,
nullptr },
53 {
XML_MONTH,
false,
true,
false,
nullptr },
54 {
XML_MONTH,
true,
true,
false,
nullptr },
55 {
XML_YEAR,
false,
false,
false,
nullptr },
56 {
XML_YEAR,
true,
false,
false,
nullptr },
59 {
XML_TEXT,
false,
false,
false,
"." },
60 {
XML_TEXT,
false,
false,
false,
" " },
61 {
XML_TEXT,
false,
false,
false,
", " },
62 {
XML_TEXT,
false,
false,
false,
". " },
63 {
XML_HOURS,
false,
false,
false,
nullptr },
65 {
XML_TEXT,
false,
false,
false,
":" },
66 {
XML_AM_PM,
false,
false,
false,
nullptr },
229 {
"T2",
false,
false,
239 {
"T3",
false,
false,
251 {
"T4",
false,
false,
263 {
"T5",
false,
false,
274 {
"T6",
false,
false,
287 {
"T7",
false,
false,
326 if( rElement.mbDecimal02 )
331 if( rElement.mbLong )
336 if( rElement.mbTextual )
342 if( rElement.mpText )
344 OUString sAttrValue( OUString::createFromAscii( rElement.mpText ) );
352 OUString sAttrValue = OUString::createFromAscii( pStyle->
mpName );
354 sAttrValue += OUString::createFromAscii( pStyle2->mpName );
372 SdXMLDataStyleNumber
const & rElement = aSdXMLDataStyleNumbers[
static_cast<int>(*pElements++) - 1 ];
399 int nDateStyle = nStyle & 0x0f;
400 bool bHasDate = nDateStyle != 0;
407 int nTimeStyle = (nStyle >> 4) & 0x0f;
408 bool bHasTime = nTimeStyle != 0;
421 SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nDateStyle ], aSdXMLFixedTimeFormats[ nTimeStyle ] );
444 sal_Int32 nFormat = nTimeFormat;
450 return OUString::createFromAscii(aSdXMLFixedTimeFormats[nFormat]->mpName );
460 sal_Int32 nFormat = nDateFormat;
476 return OUString::createFromAscii(aSdXMLFixedDateFormats[nFormat]->mpName );
502 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
507 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
510 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
override;
512 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
514 virtual void SAL_CALL
characters(
const OUString& rChars )
override;
521 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
526 maNumberStyle(
SvXMLImport::getNameFromToken(nElement) ),
527 mxSlaveContext( rSlaveContext )
535 switch (aIter.getToken())
555 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
557 return mxSlaveContext->createFastChildContext( nElement, xAttrList );
562 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
584 mbAutomatic(
false ),
612 if(
IsXMLToken(rNumberStyle, pStyleMember->meNumberStyle) &&
613 (pStyleMember->mbLong == bLong) &&
614 (pStyleMember->mbTextual == bTextual) &&
615 (pStyleMember->mbDecimal02 == bDecimal02) &&
616 ( ( (pStyleMember->mpText ==
nullptr) && (rText.empty()) ) ||
617 ( pStyleMember->mpText && (
o3tl::equalsAscii( rText, pStyleMember->mpText ) ) ) ) )
630 sal_Int16 nCompareIndex;
631 for( nCompareIndex = 0; nCompareIndex < 8; nIndex++, nCompareIndex++ )
653 if(
compareStyle( aSdXMLFixedTimeFormats[nFormat], nIndex ) )
666 if(
compareStyle( aSdXMLFixedDateFormats[nFormat], nIndex ) )
676 sal_Int16 nIndex2 = nIndex + 1;
677 if(
compareStyle( aSdXMLFixedTimeFormats[nTimeFormat], nIndex2 ) )
679 mnKey = (nFormat + 2) | ((nTimeFormat + 2) << 4);
693 if(
compareStyle( aSdXMLFixedTimeFormats[nFormat], nIndex ) )
695 mnKey = (nFormat + 2) << 4;
705 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const SdXMLFixedDataStyle aSdXML_TimeStyle_5
static void SdXMLExportStyle(SdXMLExport &rExport, const SdXMLFixedDataStyle *pStyle, const SdXMLFixedDataStyle *pStyle2=nullptr)
SdXMLDataStyleNumber const aSdXMLDataStyleNumbers[]
const SdXMLFixedDataStyle *const aSdXMLFixedDateFormats[SdXMLDateFormatCount]
const sal_Int16 SdXMLTimeFormatCount
const SdXMLFixedDataStyle aSdXML_TimeStyle_6
const SdXMLFixedDataStyle aSdXML_Standard_Short
SvXMLImport & GetImport()
const SdXMLFixedDataStyle aSdXML_Standard_Long
static void SdXMLExportDataStyleNumber(SdXMLExport &rExport, SdXMLDataStyleNumber const &rElement)
DataStyleNumber mpFormat[8]
static void exportDateStyle(SdXMLExport &rExport, sal_Int32 nStyle)
const SdXMLFixedDataStyle aSdXML_TimeStyle_1
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
friend class SdXMLNumberFormatMemberImportContext
const SdXMLFixedDataStyle aSdXML_DateStyle_4
bool equalsAscii(std::u16string_view s1, const char *s2)
static OUString getTimeStyleName(const sal_Int32 nTimeFormat)
const SdXMLFixedDataStyle *const aSdXMLFixedTimeFormats[SdXMLTimeFormatCount]
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
SdXMLNumberFormatMemberImportContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, SdXMLNumberFormatImportContext *pParent, const SvXMLImportContextRef &rSlaveContext)
void add(std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, std::u16string_view rText)
const SdXMLFixedDataStyle aSdXML_TimeStyle_4
const SdXMLFixedDataStyle aSdXML_DateStyle_1
static OUString getDateStyleName(const sal_Int32 nDateFormat)
const SdXMLFixedDataStyle aSdXML_TimeStyle_2
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const SdXMLFixedDataStyle aSdXML_DateStyle_2
const SdXMLFixedDataStyle aSdXML_TimeStyle_3
const SdXMLFixedDataStyle aSdXML_DateStyle_3
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
DataStyleNumber mnElements[16]
virtual ~SdXMLNumberFormatImportContext() override
SdXMLNumberFormatImportContext * mpParent
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
bool compareStyle(const SdXMLFixedDataStyle *pStyle, sal_Int16 &nIndex) const
This class deliberately does not support XWeak, to improve performance when loading large documents...
RegionData_Impl * mpParent
static void exportTimeStyle(SdXMLExport &rExport, sal_Int32 nStyle)
SdXMLNumberFormatImportContext(SdXMLImport &rImport, sal_Int32 nElement, SvXMLNumImpData *pNewData, SvXMLStylesTokens nNewType, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, SvXMLStylesContext &rStyles)
#define SAL_WARN_IF(condition, area, stream)
Handling of tokens in XML:
const sal_Int16 SdXMLDateFormatCount
const SdXMLFixedDataStyle aSdXML_DateStyle_6
SvXMLImportContextRef mxSlaveContext
#define XML_ELEMENT(prefix, name)
const SdXMLFixedDataStyle aSdXML_TimeStyle_7
XMLTokenEnum
The enumeration of all XML tokens.
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
constexpr sal_Int32 TOKEN_MASK
const SdXMLFixedDataStyle aSdXML_DateStyle_5
constexpr sal_uInt16 XML_NAMESPACE_STYLE
bool m_bDetectedRangeSegmentation false