sw: prefix members of SvXMLAttrContainerData, XMLDashStyleExport, ...

... XMLDashStyleImport and XMLEventExport

See tdf#94879 for motivation.

Change-Id: I203cc1c789a1a33721b27754412da35c3ca8a56a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151755
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna 2023-05-15 08:10:09 +02:00
parent f5a9b83cf9
commit d75f4673ac
6 changed files with 63 additions and 63 deletions

View File

@ -34,7 +34,7 @@ namespace com::sun::star {
class XMLOFF_DLLPUBLIC XMLDashStyleImport class XMLOFF_DLLPUBLIC XMLDashStyleImport
{ {
SvXMLImport& rImport; SvXMLImport& m_rImport;
public: public:
XMLDashStyleImport( SvXMLImport& rImport ); XMLDashStyleImport( SvXMLImport& rImport );
@ -48,7 +48,7 @@ public:
class XMLOFF_DLLPUBLIC XMLDashStyleExport class XMLOFF_DLLPUBLIC XMLDashStyleExport
{ {
SvXMLExport& rExport; SvXMLExport& m_rExport;
public: public:
XMLDashStyleExport( SvXMLExport& rExport ); XMLDashStyleExport( SvXMLExport& rExport );

View File

@ -60,12 +60,12 @@ typedef ::std::map< OUString, XMLEventName > NameMap;
*/ */
class XMLOFF_DLLPUBLIC XMLEventExport class XMLOFF_DLLPUBLIC XMLEventExport
{ {
SvXMLExport& rExport; SvXMLExport& m_rExport;
HandlerMap aHandlerMap; HandlerMap m_aHandlerMap;
NameMap aNameTranslationMap; NameMap m_aNameTranslationMap;
bool bExtNamespace; bool m_bExtNamespace;
public: public:
XMLEventExport(SvXMLExport& rExport); XMLEventExport(SvXMLExport& rExport);

View File

@ -30,7 +30,7 @@ class SvXMLAttrCollection;
class XMLOFF_DLLPUBLIC SvXMLAttrContainerData class XMLOFF_DLLPUBLIC SvXMLAttrContainerData
{ {
private: private:
std::unique_ptr<SvXMLAttrCollection> pimpl; std::unique_ptr<SvXMLAttrCollection> m_pImpl;
public: public:
SvXMLAttrContainerData(); SvXMLAttrContainerData();

View File

@ -21,24 +21,24 @@
#include <xmloff/xmlcnimp.hxx> #include <xmloff/xmlcnimp.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
SvXMLAttrContainerData::SvXMLAttrContainerData() : pimpl( new SvXMLAttrCollection ) SvXMLAttrContainerData::SvXMLAttrContainerData() : m_pImpl( new SvXMLAttrCollection )
{ {
} }
SvXMLAttrContainerData::SvXMLAttrContainerData(const SvXMLAttrContainerData &rCopy) : SvXMLAttrContainerData::SvXMLAttrContainerData(const SvXMLAttrContainerData &rCopy) :
pimpl( new SvXMLAttrCollection( *(rCopy.pimpl) ) ) m_pImpl( new SvXMLAttrCollection( *(rCopy.m_pImpl) ) )
{ {
} }
SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(const SvXMLAttrContainerData &rCopy) SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(const SvXMLAttrContainerData &rCopy)
{ {
pimpl.reset( new SvXMLAttrCollection( *rCopy.pimpl ) ); m_pImpl.reset( new SvXMLAttrCollection( *rCopy.m_pImpl ) );
return *this; return *this;
} }
SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(SvXMLAttrContainerData&& rCopy) noexcept SvXMLAttrContainerData& SvXMLAttrContainerData::operator=(SvXMLAttrContainerData&& rCopy) noexcept
{ {
pimpl = std::move( rCopy.pimpl ); m_pImpl = std::move( rCopy.m_pImpl );
return *this; return *this;
} }
@ -50,7 +50,7 @@ SvXMLAttrContainerData::~SvXMLAttrContainerData()
bool SvXMLAttrContainerData::operator ==( const SvXMLAttrContainerData& rCmp ) const bool SvXMLAttrContainerData::operator ==( const SvXMLAttrContainerData& rCmp ) const
{ {
return ( *(rCmp.pimpl) == *pimpl ); return ( *(rCmp.m_pImpl) == *m_pImpl );
} }
bool SvXMLAttrContainerData::AddAttr( const OUString& rLName, bool SvXMLAttrContainerData::AddAttr( const OUString& rLName,
@ -58,7 +58,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rLName,
{ {
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->AddAttr(rLName, rValue); return m_pImpl->AddAttr(rLName, rValue);
} }
bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
@ -69,7 +69,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rPrefix.indexOf(':') == -1 && "colon in prefix?"); assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->AddAttr(rPrefix, rNamespace, rLName, rValue); return m_pImpl->AddAttr(rPrefix, rNamespace, rLName, rValue);
} }
bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix, bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
@ -79,7 +79,7 @@ bool SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rPrefix.indexOf(':') == -1 && "colon in prefix?"); assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->AddAttr(rPrefix, rLName, rValue); return m_pImpl->AddAttr(rPrefix, rLName, rValue);
} }
bool SvXMLAttrContainerData::SetAt( size_t i, bool SvXMLAttrContainerData::SetAt( size_t i,
@ -88,7 +88,7 @@ bool SvXMLAttrContainerData::SetAt( size_t i,
{ {
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->SetAt(i, rLName, rValue); return m_pImpl->SetAt(i, rLName, rValue);
} }
bool SvXMLAttrContainerData::SetAt( size_t i, bool SvXMLAttrContainerData::SetAt( size_t i,
@ -100,7 +100,7 @@ bool SvXMLAttrContainerData::SetAt( size_t i,
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rPrefix.indexOf(':') == -1 && "colon in prefix?"); assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->SetAt(i, rPrefix, rNamespace, rLName, rValue); return m_pImpl->SetAt(i, rPrefix, rNamespace, rLName, rValue);
} }
bool SvXMLAttrContainerData::SetAt( size_t i, bool SvXMLAttrContainerData::SetAt( size_t i,
@ -111,57 +111,57 @@ bool SvXMLAttrContainerData::SetAt( size_t i,
assert( !rLName.isEmpty() && "empty attribute name is invalid"); assert( !rLName.isEmpty() && "empty attribute name is invalid");
assert( rPrefix.indexOf(':') == -1 && "colon in prefix?"); assert( rPrefix.indexOf(':') == -1 && "colon in prefix?");
assert( rLName.indexOf(':') == -1 && "colon in name?"); assert( rLName.indexOf(':') == -1 && "colon in name?");
return pimpl->SetAt(i, rPrefix, rLName, rValue); return m_pImpl->SetAt(i, rPrefix, rLName, rValue);
} }
void SvXMLAttrContainerData::Remove( size_t i ) void SvXMLAttrContainerData::Remove( size_t i )
{ {
pimpl->Remove(i); m_pImpl->Remove(i);
} }
size_t SvXMLAttrContainerData::GetAttrCount() const size_t SvXMLAttrContainerData::GetAttrCount() const
{ {
return pimpl->GetAttrCount(); return m_pImpl->GetAttrCount();
} }
const OUString& SvXMLAttrContainerData::GetAttrLName(size_t i) const const OUString& SvXMLAttrContainerData::GetAttrLName(size_t i) const
{ {
return pimpl->GetAttrLName(i); return m_pImpl->GetAttrLName(i);
} }
const OUString& SvXMLAttrContainerData::GetAttrValue(size_t i) const const OUString& SvXMLAttrContainerData::GetAttrValue(size_t i) const
{ {
return pimpl->GetAttrValue(i); return m_pImpl->GetAttrValue(i);
} }
OUString SvXMLAttrContainerData::GetAttrNamespace( size_t i ) const OUString SvXMLAttrContainerData::GetAttrNamespace( size_t i ) const
{ {
return pimpl->GetAttrNamespace(i); return m_pImpl->GetAttrNamespace(i);
} }
OUString SvXMLAttrContainerData::GetAttrPrefix( size_t i ) const OUString SvXMLAttrContainerData::GetAttrPrefix( size_t i ) const
{ {
return pimpl->GetAttrPrefix(i); return m_pImpl->GetAttrPrefix(i);
} }
const OUString& SvXMLAttrContainerData::GetNamespace( sal_uInt16 i ) const const OUString& SvXMLAttrContainerData::GetNamespace( sal_uInt16 i ) const
{ {
return pimpl->GetNamespace(i); return m_pImpl->GetNamespace(i);
} }
const OUString& SvXMLAttrContainerData::GetPrefix( sal_uInt16 i ) const const OUString& SvXMLAttrContainerData::GetPrefix( sal_uInt16 i ) const
{ {
return pimpl->GetPrefix(i); return m_pImpl->GetPrefix(i);
} }
sal_uInt16 SvXMLAttrContainerData::GetFirstNamespaceIndex() const sal_uInt16 SvXMLAttrContainerData::GetFirstNamespaceIndex() const
{ {
return pimpl->GetFirstNamespaceIndex(); return m_pImpl->GetFirstNamespaceIndex();
} }
sal_uInt16 SvXMLAttrContainerData::GetNextNamespaceIndex( sal_uInt16 nIdx ) const sal_uInt16 SvXMLAttrContainerData::GetNextNamespaceIndex( sal_uInt16 nIdx ) const
{ {
return pimpl->GetNextNamespaceIndex( nIdx ); return m_pImpl->GetNextNamespaceIndex( nIdx );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -43,22 +43,22 @@ using ::xmloff::token::XML_EVENT_LISTENERS;
constexpr OUStringLiteral gsEventType(u"EventType"); constexpr OUStringLiteral gsEventType(u"EventType");
XMLEventExport::XMLEventExport(SvXMLExport& rExp) : XMLEventExport::XMLEventExport(SvXMLExport& rExp) :
rExport(rExp), m_rExport(rExp),
bExtNamespace(false) m_bExtNamespace(false)
{ {
} }
XMLEventExport::~XMLEventExport() XMLEventExport::~XMLEventExport()
{ {
// delete all handlers // delete all handlers
aHandlerMap.clear(); m_aHandlerMap.clear();
} }
void XMLEventExport::AddHandler( const OUString& rName, void XMLEventExport::AddHandler( const OUString& rName,
std::unique_ptr<XMLEventExportHandler> pHandler ) std::unique_ptr<XMLEventExportHandler> pHandler )
{ {
assert(pHandler); assert(pHandler);
aHandlerMap[rName] = std::move(pHandler); m_aHandlerMap[rName] = std::move(pHandler);
} }
void XMLEventExport::AddTranslationTable( void XMLEventExport::AddTranslationTable(
@ -71,7 +71,7 @@ void XMLEventExport::AddTranslationTable(
pTrans->sAPIName != nullptr; pTrans->sAPIName != nullptr;
pTrans++) pTrans++)
{ {
aNameTranslationMap[OUString::createFromAscii(pTrans->sAPIName)] = m_aNameTranslationMap[OUString::createFromAscii(pTrans->sAPIName)] =
XMLEventName(pTrans->nPrefix, pTrans->sXMLName); XMLEventName(pTrans->nPrefix, pTrans->sXMLName);
} }
} }
@ -112,8 +112,8 @@ void XMLEventExport::Export( Reference<XNameAccess> const & rAccess,
for(const auto& rName : aNames) for(const auto& rName : aNames)
{ {
// translate name // translate name
NameMap::iterator aIter = aNameTranslationMap.find(rName); NameMap::iterator aIter = m_aNameTranslationMap.find(rName);
if (aIter != aNameTranslationMap.end()) if (aIter != m_aNameTranslationMap.end())
{ {
const XMLEventName& rXmlName = aIter->second; const XMLEventName& rXmlName = aIter->second;
@ -143,9 +143,9 @@ void XMLEventExport::ExportExt( Reference<XNameAccess> const & rAccess )
{ {
// set bExtNamespace flag to use XML_NAMESPACE_OFFICE_EXT namespace // set bExtNamespace flag to use XML_NAMESPACE_OFFICE_EXT namespace
// for events element (not for child elements) // for events element (not for child elements)
bExtNamespace = true; m_bExtNamespace = true;
Export(rAccess); Export(rAccess);
bExtNamespace = false; // reset for future Export calls m_bExtNamespace = false; // reset for future Export calls
} }
/// export a singular event and write <office:events> container /// export a singular event and write <office:events> container
@ -155,8 +155,8 @@ void XMLEventExport::ExportSingleEvent(
bool bUseWhitespace ) bool bUseWhitespace )
{ {
// translate the name // translate the name
NameMap::iterator aIter = aNameTranslationMap.find(rApiEventName); NameMap::iterator aIter = m_aNameTranslationMap.find(rApiEventName);
if (aIter != aNameTranslationMap.end()) if (aIter != m_aNameTranslationMap.end())
{ {
const XMLEventName& rXmlName = aIter->second; const XMLEventName& rXmlName = aIter->second;
@ -196,7 +196,7 @@ void XMLEventExport::ExportEvent(
OUString sType; OUString sType;
pValue->Value >>= sType; pValue->Value >>= sType;
if (aHandlerMap.count(sType)) if (m_aHandlerMap.count(sType))
{ {
if (! rExported) if (! rExported)
{ {
@ -207,11 +207,11 @@ void XMLEventExport::ExportEvent(
} }
OUString aEventQName( OUString aEventQName(
rExport.GetNamespaceMap().GetQNameByKey( m_rExport.GetNamespaceMap().GetQNameByKey(
rXmlEventName.m_nPrefix, rXmlEventName.m_aName ) ); rXmlEventName.m_nPrefix, rXmlEventName.m_aName ) );
// delegate to proper ExportEventHandler // delegate to proper ExportEventHandler
aHandlerMap[sType]->Export(rExport, aEventQName, m_aHandlerMap[sType]->Export(m_rExport, aEventQName,
rEventValues, bUseWhitespace); rEventValues, bUseWhitespace);
} }
else else
@ -230,22 +230,22 @@ void XMLEventExport::StartElement(bool bWhitespace)
{ {
if (bWhitespace) if (bWhitespace)
{ {
rExport.IgnorableWhitespace(); m_rExport.IgnorableWhitespace();
} }
sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT sal_uInt16 nNamespace = m_bExtNamespace ? XML_NAMESPACE_OFFICE_EXT
: XML_NAMESPACE_OFFICE; : XML_NAMESPACE_OFFICE;
rExport.StartElement( nNamespace, XML_EVENT_LISTENERS, m_rExport.StartElement( nNamespace, XML_EVENT_LISTENERS,
bWhitespace); bWhitespace);
} }
void XMLEventExport::EndElement(bool bWhitespace) void XMLEventExport::EndElement(bool bWhitespace)
{ {
sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT sal_uInt16 nNamespace = m_bExtNamespace ? XML_NAMESPACE_OFFICE_EXT
: XML_NAMESPACE_OFFICE; : XML_NAMESPACE_OFFICE;
rExport.EndElement(nNamespace, XML_EVENT_LISTENERS, bWhitespace); m_rExport.EndElement(nNamespace, XML_EVENT_LISTENERS, bWhitespace);
if (bWhitespace) if (bWhitespace)
{ {
rExport.IgnorableWhitespace(); m_rExport.IgnorableWhitespace();
} }
} }

View File

@ -50,7 +50,7 @@ SvXMLEnumMapEntry<drawing::DashStyle> const pXML_DashStyle_Enum[] =
// Import // Import
XMLDashStyleImport::XMLDashStyleImport( SvXMLImport& rImp ) XMLDashStyleImport::XMLDashStyleImport( SvXMLImport& rImp )
: rImport(rImp) : m_rImport(rImp)
{ {
} }
@ -70,7 +70,7 @@ void XMLDashStyleImport::importXML(
bool bIsRel = false; bool bIsRel = false;
SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter(); SvXMLUnitConverter& rUnitConverter = m_rImport.GetMM100UnitConverter();
for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
{ {
@ -163,7 +163,7 @@ void XMLDashStyleImport::importXML(
if( !aDisplayName.isEmpty() ) if( !aDisplayName.isEmpty() )
{ {
rImport.AddStyleDisplayName( XmlStyleFamily::SD_STROKE_DASH_ID, m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_STROKE_DASH_ID,
rStrName, aDisplayName ); rStrName, aDisplayName );
rStrName = aDisplayName; rStrName = aDisplayName;
} }
@ -172,7 +172,7 @@ void XMLDashStyleImport::importXML(
// Export // Export
XMLDashStyleExport::XMLDashStyleExport( SvXMLExport& rExp ) XMLDashStyleExport::XMLDashStyleExport( SvXMLExport& rExp )
: rExport(rExp) : m_rExport(rExp)
{ {
} }
@ -180,7 +180,7 @@ void XMLDashStyleExport::exportXML(
const OUString& rStrName, const OUString& rStrName,
const uno::Any& rValue ) const uno::Any& rValue )
{ {
SvXMLUnitConverter & rUnitConverter = rExport.GetMM100UnitConverter(); SvXMLUnitConverter & rUnitConverter = m_rExport.GetMM100UnitConverter();
drawing::LineDash aLineDash; drawing::LineDash aLineDash;
@ -197,22 +197,22 @@ void XMLDashStyleExport::exportXML(
// Name // Name
bool bEncoded = false; bool bEncoded = false;
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
rExport.EncodeStyleName( rStrName, m_rExport.EncodeStyleName( rStrName,
&bEncoded ) ); &bEncoded ) );
if( bEncoded ) if( bEncoded )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
rStrName ); rStrName );
// Style // Style
SvXMLUnitConverter::convertEnum( aOut, aLineDash.Style, pXML_DashStyle_Enum ); SvXMLUnitConverter::convertEnum( aOut, aLineDash.Style, pXML_DashStyle_Enum );
aStrValue = aOut.makeStringAndClear(); aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
// dots // dots
if( aLineDash.Dots ) if( aLineDash.Dots )
{ {
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1, OUString::number( aLineDash.Dots ) ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1, OUString::number( aLineDash.Dots ) );
if( aLineDash.DotLen ) if( aLineDash.DotLen )
{ {
@ -227,14 +227,14 @@ void XMLDashStyleExport::exportXML(
aLineDash.DotLen ); aLineDash.DotLen );
} }
aStrValue = aOut.makeStringAndClear(); aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1_LENGTH, aStrValue ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1_LENGTH, aStrValue );
} }
} }
// dashes // dashes
if( aLineDash.Dashes ) if( aLineDash.Dashes )
{ {
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2, OUString::number( aLineDash.Dashes ) ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2, OUString::number( aLineDash.Dashes ) );
if( aLineDash.DashLen ) if( aLineDash.DashLen )
{ {
@ -249,7 +249,7 @@ void XMLDashStyleExport::exportXML(
aLineDash.DashLen ); aLineDash.DashLen );
} }
aStrValue = aOut.makeStringAndClear(); aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2_LENGTH, aStrValue ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2_LENGTH, aStrValue );
} }
} }
@ -264,10 +264,10 @@ void XMLDashStyleExport::exportXML(
aLineDash.Distance ); aLineDash.Distance );
} }
aStrValue = aOut.makeStringAndClear(); aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue ); m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
// do Write // do Write
SvXMLElementExport rElem( rExport, SvXMLElementExport rElem( m_rExport,
XML_NAMESPACE_DRAW, XML_STROKE_DASH, XML_NAMESPACE_DRAW, XML_STROKE_DASH,
true, false ); true, false );
} }