28#include <osl/diagnose.h>
33using ::com::sun::star::uno::Reference;
41 const OUString& rQName,
46 const OUString& rLocalName,
47 const OUString& rQName,
48 const Reference< xml::sax::XAttributeList >& xAttrList )
override;
50 virtual void StartElement(
const Reference< xml::sax::XAttributeList >& rAttrList )
override;
55 bool m_bHasCategories;
60XMLAxisOASISContext::XMLAxisOASISContext(
62 const OUString& rQName,
65 m_rCategoriesContext( rOutCategoriesContext ),
66 m_bHasCategories( false )
71 const OUString& rLocalName,
72 const OUString& rQName,
73 const Reference< xml::sax::XAttributeList >& xAttrList )
82 m_bHasCategories =
true;
83 pContext = m_rCategoriesContext.get();
88 nPrefix, rLocalName, rQName, xAttrList );
94void XMLAxisOASISContext::StartElement(
95 const Reference< xml::sax::XAttributeList >& rAttrList )
97 Reference< xml::sax::XAttributeList > xAttrList( rAttrList );
99 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
100 for( sal_Int16 i=0;
i < nAttrCount;
i++ )
102 const OUString& rAttrName = xAttrList->getNameByIndex( i );
105 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
110 if( !pMutableAttrList )
113 xAttrList = pMutableAttrList;
116 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
135 OSL_FAIL(
"ChartAxis: Invalid attribute value" );
140 OUString aNewAttrQName(
141 GetTransformer().GetNamespaceMap().GetQNameByKey(
143 pMutableAttrList->RenameAttributeByIndex( i, aNewAttrQName );
153void XMLAxisOASISContext::EndElement()
156 if( m_bHasCategories &&
157 m_rCategoriesContext.is() )
159 OSL_ENSURE( GetAttrList().is(),
"Invalid attribute list" );
162 OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey(
164 sal_Int16
nIndex = pMutableAttrList->GetIndexByName( aAttrQName );
167 OSL_ENSURE(
IsXMLToken( pMutableAttrList->getValueByIndex( nIndex ),
168 XML_DOMAIN ),
"Axis Dimension: invalid former value" );
170 OSL_ENSURE(
IsXMLToken( pMutableAttrList->getValueByIndex( nIndex ),
174 GetTransformer().GetDocHandler()->startElement(
176 Reference< xml::sax::XAttributeList >( pMutableAttrList ));
178 GetTransformer().GetDocHandler()->endElement( GetExportQName());
196 const OUString& rLocalName,
197 const OUString& rQName,
198 const uno::Reference< xml::sax::XAttributeList >& xAttrList )
213 nPrefix, rLocalName, rQName, xAttrList );
virtual void EndElement() override
virtual ~XMLChartPlotAreaOASISTContext() override
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
XMLChartPlotAreaOASISTContext(XMLTransformerBase &rTransformer, const OUString &rQName)
::rtl::Reference< XMLPersAttrListTContext > m_rCategoriesContext
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void EndElement() override
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void EndElement() override
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
XMLTransformerBase & GetTransformer()
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
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr sal_uInt16 XML_NAMESPACE_CHART