38struct SdXMLDataStyleNumber
51 {
XML_DAY,
false,
false,
false,
nullptr },
52 {
XML_DAY,
true,
false,
false,
nullptr },
53 {
XML_MONTH,
true,
false,
false,
nullptr },
54 {
XML_MONTH,
false,
true,
false,
nullptr },
55 {
XML_MONTH,
true,
true,
false,
nullptr },
56 {
XML_YEAR,
false,
false,
false,
nullptr },
57 {
XML_YEAR,
true,
false,
false,
nullptr },
60 {
XML_TEXT,
false,
false,
false,
"." },
61 {
XML_TEXT,
false,
false,
false,
" " },
62 {
XML_TEXT,
false,
false,
false,
", " },
63 {
XML_TEXT,
false,
false,
false,
". " },
64 {
XML_HOURS,
false,
false,
false,
nullptr },
66 {
XML_TEXT,
false,
false,
false,
":" },
67 {
XML_AM_PM,
false,
false,
false,
nullptr },
327 if( rElement.mbDecimal02 )
332 if( rElement.mbLong )
337 if( rElement.mbTextual )
343 if( rElement.mpText )
345 OUString sAttrValue( OUString::createFromAscii( rElement.mpText ) );
353 OUString sAttrValue = OUString::createFromAscii( pStyle->
mpName );
355 sAttrValue += OUString::createFromAscii( pStyle2->mpName );
400 int nDateStyle = nStyle & 0x0f;
401 bool bHasDate = nDateStyle != 0;
408 int nTimeStyle = (nStyle >> 4) & 0x0f;
409 bool bHasTime = nTimeStyle != 0;
445 sal_Int32 nFormat = nTimeFormat;
461 sal_Int32 nFormat = nDateFormat;
503 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
508 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
511 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
override;
513 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
515 virtual void SAL_CALL
characters(
const OUString& rChars )
override;
520 SvXMLImport& rImport,
522 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
527 maNumberStyle( SvXMLImport::getNameFromToken(nElement) ),
528 mxSlaveContext(
std::move( xSlaveContext ))
536 switch (aIter.getToken())
556 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
558 return mxSlaveContext->createFastChildContext( nElement, xAttrList );
563 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
585 mbAutomatic( false ),
613 if(
IsXMLToken(rNumberStyle, pStyleMember->meNumberStyle) &&
614 (pStyleMember->mbLong == bLong) &&
615 (pStyleMember->mbTextual == bTextual) &&
616 (pStyleMember->mbDecimal02 == bDecimal02) &&
617 ( ( (pStyleMember->mpText ==
nullptr) && (rText.empty()) ) ||
618 ( pStyleMember->mpText && (
o3tl::equalsAscii( rText, pStyleMember->mpText ) ) ) ) )
631 sal_Int16 nCompareIndex;
632 for( nCompareIndex = 0; nCompareIndex < 8;
nIndex++, nCompareIndex++ )
677 sal_Int16 nIndex2 =
nIndex + 1;
680 mnKey = (nFormat + 2) | ((nTimeFormat + 2) << 4);
696 mnKey = (nFormat + 2) << 4;
706 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
const sal_Int16 SdXMLDateFormatCount
const sal_Int16 SdXMLTimeFormatCount
const SdXMLFixedDataStyle aSdXML_TimeStyle_1
const SdXMLFixedDataStyle aSdXML_DateStyle_6
static void SdXMLExportDataStyleNumber(SdXMLExport &rExport, SdXMLDataStyleNumber const &rElement)
const SdXMLFixedDataStyle aSdXML_TimeStyle_5
const SdXMLFixedDataStyle *const aSdXMLFixedTimeFormats[SdXMLTimeFormatCount]
const SdXMLFixedDataStyle aSdXML_TimeStyle_7
SdXMLDataStyleNumber const aSdXMLDataStyleNumbers[]
const SdXMLFixedDataStyle aSdXML_DateStyle_1
const SdXMLFixedDataStyle aSdXML_TimeStyle_2
const SdXMLFixedDataStyle aSdXML_Standard_Short
const SdXMLFixedDataStyle aSdXML_TimeStyle_3
const SdXMLFixedDataStyle aSdXML_DateStyle_4
const SdXMLFixedDataStyle aSdXML_DateStyle_2
const SdXMLFixedDataStyle aSdXML_Standard_Long
static void SdXMLExportStyle(SdXMLExport &rExport, const SdXMLFixedDataStyle *pStyle, const SdXMLFixedDataStyle *pStyle2=nullptr)
const SdXMLFixedDataStyle aSdXML_TimeStyle_6
const SdXMLFixedDataStyle aSdXML_DateStyle_5
const SdXMLFixedDataStyle *const aSdXMLFixedDateFormats[SdXMLDateFormatCount]
const SdXMLFixedDataStyle aSdXML_TimeStyle_4
const SdXMLFixedDataStyle aSdXML_DateStyle_3
void add(std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, std::u16string_view rText)
friend class SdXMLNumberFormatMemberImportContext
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
bool compareStyle(const SdXMLFixedDataStyle *pStyle, sal_Int16 &nIndex) const
SdXMLNumberFormatImportContext(SdXMLImport &rImport, sal_Int32 nElement, SvXMLNumImpData *pNewData, SvXMLStylesTokens nNewType, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, SvXMLStylesContext &rStyles)
virtual ~SdXMLNumberFormatImportContext() override
DataStyleNumber mnElements[16]
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
SdXMLNumberFormatMemberImportContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, SdXMLNumberFormatImportContext *pParent, SvXMLImportContextRef xSlaveContext)
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
SdXMLNumberFormatImportContext * mpParent
SvXMLImportContextRef mxSlaveContext
static void exportTimeStyle(SdXMLExport &rExport, sal_Int32 nStyle)
static void exportDateStyle(SdXMLExport &rExport, sal_Int32 nStyle)
static OUString getDateStyleName(const sal_Int32 nDateFormat)
static OUString getTimeStyleName(const sal_Int32 nTimeFormat)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
RegionData_Impl * mpParent
#define SAL_WARN_IF(condition, area, stream)
bool equalsAscii(std::u16string_view s1, std::string_view s2)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
DataStyleNumber mpFormat[8]
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_NUMBER