LibreOffice Module xmloff (master) 1
|
#include <namespacemap.hxx>
Public Types | |
enum class | QNameMode { AttrNameCached , AttrValue } |
Public Member Functions | |
SvXMLNamespaceMap () | |
~SvXMLNamespaceMap () | |
SvXMLNamespaceMap (const SvXMLNamespaceMap &) | |
SvXMLNamespaceMap & | operator= (const SvXMLNamespaceMap &rCmp) |
bool | operator== (const SvXMLNamespaceMap &rCmp) const |
sal_uInt16 | Add (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN) |
sal_uInt16 | AddIfKnown (const OUString &rPrefix, const OUString &rName) |
sal_uInt16 | GetKeyByName (const OUString &rName) const |
const OUString & | GetNameByKey (sal_uInt16 nKey) const |
sal_uInt16 | GetKeyByPrefix (const OUString &rPrefix) const |
const OUString & | GetPrefixByKey (sal_uInt16 nKey) const |
OUString | GetQNameByKey (sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const |
OUString | GetAttrNameByKey (sal_uInt16 nKey) const |
sal_uInt16 | GetKeyByQName (const OUString &rQName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace, QNameMode eMode) const |
sal_uInt16 | GetKeyByAttrValueQName (const OUString &rAttrName, OUString *pLocalName) const |
sal_uInt16 | GetFirstKey () const |
sal_uInt16 | GetNextKey (sal_uInt16 nOldKey) const |
const NameSpaceHash & | GetAllEntries () const |
void | Clear () |
void | AddAtIndex (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey) |
sal_uInt16 | GetIndexByPrefix (const OUString &rPrefix) const |
sal_uInt16 | GetFirstIndex () const |
sal_uInt16 | GetNextIndex (sal_uInt16 nOldIdx) const |
const OUString & | GetPrefixByIndex (sal_uInt16 nIdx) const |
const OUString & | GetNameByIndex (sal_uInt16 nIdx) const |
OUString | GetAttrNameByIndex (sal_uInt16 nIdx) const |
sal_uInt16 | GetKeyByAttrName (const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const |
sal_uInt16 | GetKeyByAttrName (const OUString &rAttrName, OUString *pLocalName=nullptr) const |
Static Public Member Functions | |
static bool | NormalizeOasisURN (OUString &rName) |
static bool | NormalizeW3URI (OUString &rName) |
static bool | NormalizeURI (OUString &rName) |
static sal_uInt16 | GetIndexByKey (sal_uInt16 nKey) |
Private Member Functions | |
SAL_DLLPRIVATE sal_uInt16 | Add_ (const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey) |
Private Attributes | |
OUString | m_sXMLNS |
NameSpaceHash | m_aNameHash |
NameSpaceHash | m_aNameCache |
KeyToNameSpaceMap | maKeyToNamespaceMap |
QNameCache | m_aQNameCache |
Definition at line 83 of file namespacemap.hxx.
|
strong |
Enumerator | |
---|---|
AttrNameCached | |
AttrValue |
Definition at line 121 of file namespacemap.hxx.
SvXMLNamespaceMap::SvXMLNamespaceMap | ( | ) |
Definition at line 52 of file namespacemap.cxx.
References m_aNameHash, and maKeyToNamespaceMap.
SvXMLNamespaceMap::~SvXMLNamespaceMap | ( | ) |
Definition at line 74 of file namespacemap.cxx.
SvXMLNamespaceMap::SvXMLNamespaceMap | ( | const SvXMLNamespaceMap & | rMap | ) |
Definition at line 60 of file namespacemap.cxx.
References m_aNameHash, and maKeyToNamespaceMap.
sal_uInt16 SvXMLNamespaceMap::Add | ( | const OUString & | rPrefix, |
const OUString & | rName, | ||
sal_uInt16 | nKey = XML_NAMESPACE_UNKNOWN |
||
) |
Definition at line 112 of file namespacemap.cxx.
References Add_(), GetKeyByName(), m_aNameHash, XML_NAMESPACE_NONE, and XML_NAMESPACE_UNKNOWN.
Referenced by SvXMLExportPropertyMapper::_exportXML(), SvXMLAttrCollection::AddAttr(), Oasis2OOoTransformer::Oasis2OOoTransformer(), SchXMLExport::SchXMLExport(), SvXMLAttrCollection::SetAt(), SvXMLExport::setSourceDocument(), and SdXMLExport::setSourceDocument().
|
private |
Definition at line 92 of file namespacemap.cxx.
References m_aNameHash, maKeyToNamespaceMap, XML_NAMESPACE_UNKNOWN, and XML_NAMESPACE_UNKNOWN_FLAG.
Referenced by Add(), AddAtIndex(), and AddIfKnown().
void SvXMLNamespaceMap::AddAtIndex | ( | const OUString & | rPrefix, |
const OUString & | rName, | ||
sal_uInt16 | nKey | ||
) |
Definition at line 384 of file namespacemap.cxx.
References Add_(), GetKeyByName(), m_aNameHash, XML_NAMESPACE_NONE, and XML_NAMESPACE_UNKNOWN.
Referenced by XMLVersionListExport::XMLVersionListExport().
sal_uInt16 SvXMLNamespaceMap::AddIfKnown | ( | const OUString & | rPrefix, |
const OUString & | rName | ||
) |
Definition at line 131 of file namespacemap.cxx.
References Add_(), GetKeyByName(), m_aNameHash, XML_NAMESPACE_NONE, and XML_NAMESPACE_UNKNOWN.
void SvXMLNamespaceMap::Clear | ( | ) |
Definition at line 78 of file namespacemap.cxx.
References m_aNameCache, m_aNameHash, m_aQNameCache, and maKeyToNamespaceMap.
|
inline |
Definition at line 137 of file namespacemap.hxx.
OUString SvXMLNamespaceMap::GetAttrNameByIndex | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 397 of file namespacemap.cxx.
References GetAttrNameByKey().
OUString SvXMLNamespaceMap::GetAttrNameByKey | ( | sal_uInt16 | nKey | ) | const |
Definition at line 183 of file namespacemap.cxx.
References m_sXMLNS, maKeyToNamespaceMap, and prefix.
Referenced by SvXMLMetaExport::Export(), XMLMetaExportComponent::exportDoc(), GetAttrNameByIndex(), and SvXMLMetaExport::startElement().
sal_uInt16 SvXMLNamespaceMap::GetFirstIndex | ( | ) | const |
Definition at line 373 of file namespacemap.cxx.
References first, and maKeyToNamespaceMap.
Referenced by SvXMLAttrCollection::GetFirstNamespaceIndex().
sal_uInt16 SvXMLNamespaceMap::GetFirstKey | ( | ) | const |
Definition at line 355 of file namespacemap.cxx.
References first, and maKeyToNamespaceMap.
Referenced by SvXMLMetaExport::Export(), XMLMetaExportComponent::exportDoc(), and SvXMLMetaExport::startElement().
|
static |
Definition at line 369 of file namespacemap.cxx.
Referenced by XMLVersionListExport::exportDoc().
sal_uInt16 SvXMLNamespaceMap::GetIndexByPrefix | ( | const OUString & | rPrefix | ) | const |
Definition at line 414 of file namespacemap.cxx.
References m_aNameHash.
Referenced by SvXMLAttrCollection::AddAttr(), and SvXMLAttrCollection::SetAt().
sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName | ( | const OUString & | rAttrName, |
OUString * | pLocalName = nullptr |
||
) | const |
Definition at line 419 of file namespacemap.cxx.
References AttrNameCached, and GetKeyByQName().
sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName | ( | const OUString & | rAttrName, |
OUString * | pPrefix, | ||
OUString * | pLocalName, | ||
OUString * | pNamespace | ||
) | const |
Definition at line 426 of file namespacemap.cxx.
References AttrNameCached, and GetKeyByQName().
Referenced by XMLChartPlotAreaOOoTContext::CreateChildContext(), Oasis2OOoTransformer::GetEventName(), XMLTransformerContext::HasNamespace(), XMLTransformerContext::HasQName(), SvXMLImportPropertyMapper::importXMLAttribute(), XMLFrameOASISTransformerContext::IsLinkedEmbeddedObject(), XMLTransformerBase::ProcessAttrList(), XMLChartOASISTransformerContext::StartElement(), XMLChartOOoTransformerContext::StartElement(), XMLControlOASISTransformerContext::StartElement(), XMLCreateElemTransformerContext::StartElement(), XMLDlgOASISTransformerContext::StartElement(), XMLDocumentTransformerContext::StartElement(), XMLEventOASISTransformerContext::StartElement(), XMLEventOOoTransformerContext::StartElement(), XMLFormPropOASISTransformerContext::StartElement(), XMLFormPropValueTContext_Impl::StartElement(), XMLFormPropOOoTransformerContext::StartElement(), XMLFrameOASISTransformerContext::StartElement(), XMLFrameOOoTransformerContext::StartElement(), XMLMergeElemTransformerContext::StartElement(), XMLNotesTransformerContext::StartElement(), XMLPropertiesTContext_Impl::StartElement(), XMLStyleOASISTContext::StartElement(), XMLStyleOOoTContext::StartElement(), and XMLAxisOOoContext::StartElement().
sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrValueQName | ( | const OUString & | rAttrName, |
OUString * | pLocalName | ||
) | const |
Definition at line 261 of file namespacemap.cxx.
References AttrValue, and GetKeyByQName().
Referenced by XMLTransformerBase::RemoveNamespacePrefix(), xforms_getTypeClass(), and xforms_getTypeName().
sal_uInt16 SvXMLNamespaceMap::GetKeyByName | ( | const OUString & | rName | ) | const |
Definition at line 159 of file namespacemap.cxx.
References m_aNameHash, and XML_NAMESPACE_UNKNOWN.
Referenced by SvXMLExportPropertyMapper::_exportXML(), Add(), AddAtIndex(), and AddIfKnown().
sal_uInt16 SvXMLNamespaceMap::GetKeyByPrefix | ( | const OUString & | rPrefix | ) | const |
Definition at line 153 of file namespacemap.cxx.
References m_aNameHash.
Referenced by SvXMLExportPropertyMapper::_exportXML(), SvXMLExport::EnsureNamespace(), exportXFormsBinding(), and SvXMLImportPropertyMapper::importXML().
sal_uInt16 SvXMLNamespaceMap::GetKeyByQName | ( | const OUString & | rQName, |
OUString * | pPrefix, | ||
OUString * | pLocalName, | ||
OUString * | pNamespace, | ||
QNameMode | eMode | ||
) | const |
rQName | either attribute name or qualified/namespaced attribute value |
bCacheAttrName | true: rQName is element or attribute name, cache it false: rQName is attribute value, may contain extra ':', don't cache it |
Definition at line 273 of file namespacemap.cxx.
References AttrNameCached, eMode, m_aNameCache, m_aNameHash, NameSpaceEntry::m_nKey, NameSpaceEntry::m_sName, NameSpaceEntry::m_sPrefix, m_sXMLNS, maKeyToNamespaceMap, SAL_INFO, XML_NAMESPACE_NONE, XML_NAMESPACE_UNKNOWN, and XML_NAMESPACE_XMLNS.
Referenced by GetKeyByAttrName(), and GetKeyByAttrValueQName().
const OUString & SvXMLNamespaceMap::GetNameByIndex | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 408 of file namespacemap.cxx.
References maKeyToNamespaceMap, and sEmpty.
Referenced by SvXMLAttrCollection::GetAttrNamespace(), and SvXMLAttrCollection::GetNamespace().
const OUString & SvXMLNamespaceMap::GetNameByKey | ( | sal_uInt16 | nKey | ) | const |
Definition at line 177 of file namespacemap.cxx.
References maKeyToNamespaceMap, and sEmpty.
Referenced by SvXMLExportPropertyMapper::_exportXML(), SvXMLMetaExport::Export(), XMLMetaExportComponent::exportDoc(), exportXFormsBinding(), and XMLTransformerBase::startElement().
sal_uInt16 SvXMLNamespaceMap::GetNextIndex | ( | sal_uInt16 | nOldIdx | ) | const |
Definition at line 378 of file namespacemap.cxx.
References maKeyToNamespaceMap.
Referenced by SvXMLAttrCollection::GetNextNamespaceIndex().
sal_uInt16 SvXMLNamespaceMap::GetNextKey | ( | sal_uInt16 | nOldKey | ) | const |
Definition at line 360 of file namespacemap.cxx.
References maKeyToNamespaceMap.
Referenced by SvXMLMetaExport::Export(), XMLMetaExportComponent::exportDoc(), and SvXMLMetaExport::startElement().
const OUString & SvXMLNamespaceMap::GetPrefixByIndex | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 402 of file namespacemap.cxx.
References maKeyToNamespaceMap, and sEmpty.
Referenced by SvXMLAttrCollection::GetAttrPrefix(), and SvXMLAttrCollection::GetPrefix().
const OUString & SvXMLNamespaceMap::GetPrefixByKey | ( | sal_uInt16 | nKey | ) | const |
Definition at line 171 of file namespacemap.cxx.
References maKeyToNamespaceMap, and sEmpty.
Referenced by SvXMLExportPropertyMapper::_exportXML(), and SvXMLExport::EnsureNamespace().
OUString SvXMLNamespaceMap::GetQNameByKey | ( | sal_uInt16 | nKey, |
const OUString & | rLocalName, | ||
bool | bCache = true |
||
) | const |
Definition at line 196 of file namespacemap.cxx.
References xmloff::token::GetXMLToken(), m_aQNameCache, m_sXMLNS, maKeyToNamespaceMap, prefix, SAL_WARN, XML_NAMESPACE_NONE, XML_NAMESPACE_UNKNOWN, XML_NAMESPACE_XML, XML_NAMESPACE_XMLNS, and xmloff::token::XML_XML.
Referenced by SvXMLExportPropertyMapper::_exportXML(), XMLTransformerBase::AddNamespacePrefix(), XMLMetaTransformerContext::EndElement(), XMLScriptExportHandler::Export(), XMLStarBasicExportHandler::Export(), XMLEventExport::ExportEvent(), XMLSectionExport::ExportRegularSectionStart(), SchXMLExportHelper_Impl::exportSeries(), xmloff::OElementExport::exportServiceNameAttribute(), xmloff::OColumnExport::exportServiceNameAttribute(), OOo2OasisTransformer::GetEventName(), XMLChartExportPropertyMapper::handleSpecialItem(), XMLTextExportPropertySetMapper::handleSpecialItem(), XMLShapeExport::ImpExportEvents(), SvXMLExport::ImplExportSettings(), lcl_getXSDType(), SchXMLExportHelper_Impl::parseDocument(), XMLFormPropOOoTransformerContext::StartElement(), SvXMLElementExport::StartElement(), XMLNumberFormatAttributesExportHelper::WriteAttributes(), and XMLTextCharStyleNamesElementExport::XMLTextCharStyleNamesElementExport().
|
static |
Definition at line 467 of file namespacemap.cxx.
References xmloff::token::GetXMLToken(), xmloff::token::IsXMLToken(), nPos, and o3tl::starts_with().
Referenced by NormalizeURI(), and XMLTransformerBase::startElement().
|
static |
Definition at line 434 of file namespacemap.cxx.
References NormalizeOasisURN(), and NormalizeW3URI().
|
static |
Definition at line 443 of file namespacemap.cxx.
References xmloff::token::GetXMLToken().
Referenced by NormalizeURI().
SvXMLNamespaceMap & SvXMLNamespaceMap::operator= | ( | const SvXMLNamespaceMap & | rCmp | ) |
Definition at line 67 of file namespacemap.cxx.
References m_aNameHash, and maKeyToNamespaceMap.
bool SvXMLNamespaceMap::operator== | ( | const SvXMLNamespaceMap & | rCmp | ) | const |
Definition at line 87 of file namespacemap.cxx.
References m_aNameHash.
|
mutableprivate |
Definition at line 88 of file namespacemap.hxx.
Referenced by Clear(), and GetKeyByQName().
|
private |
Definition at line 87 of file namespacemap.hxx.
Referenced by Add(), Add_(), AddAtIndex(), AddIfKnown(), Clear(), GetIndexByPrefix(), GetKeyByName(), GetKeyByPrefix(), GetKeyByQName(), operator=(), operator==(), and SvXMLNamespaceMap().
|
mutableprivate |
Definition at line 90 of file namespacemap.hxx.
Referenced by Clear(), and GetQNameByKey().
|
private |
Definition at line 85 of file namespacemap.hxx.
Referenced by GetAttrNameByKey(), GetKeyByQName(), and GetQNameByKey().
|
private |
Definition at line 89 of file namespacemap.hxx.
Referenced by Add_(), Clear(), GetAttrNameByKey(), GetFirstIndex(), GetFirstKey(), GetKeyByQName(), GetNameByIndex(), GetNameByKey(), GetNextIndex(), GetNextKey(), GetPrefixByIndex(), GetPrefixByKey(), GetQNameByKey(), operator=(), and SvXMLNamespaceMap().