Kaydet (Commit) 497e40ad authored tarafından Noel Grandin's avatar Noel Grandin

improve refcounting loplugin

to find ref-counted classes being managed via other smart pointer
classes.
Hopefully prevent needing fixes like
642ae256
"ChangedUIEventListener is refcounted, mustn't be helt by unique_ptr"

Change-Id: I6b0c5f8f87ce3546a8a1104ce1000470c09459bd
Reviewed-on: https://gerrit.libreoffice.org/39378Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 71112060
...@@ -386,28 +386,67 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) { ...@@ -386,28 +386,67 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
return true; return true;
} }
std::string aParentName = fieldDecl->getParent()->getQualifiedNameAsString(); // check for dodgy code managing ref-counted stuff with shared_ptr or unique_ptr or similar stuff
QualType firstTemplateParamType;
if (auto recordType = fieldDecl->getType()->getUnqualifiedDesugaredType()->getAs<RecordType>()) {
auto recordDeclName = recordType->getDecl()->getName();
if (recordDeclName.find("unique_ptr") != StringRef::npos
|| recordDeclName.find("shared_ptr") != StringRef::npos
|| recordDeclName.find("intrusive_ptr") != StringRef::npos) // boost
{
auto templateDecl = dyn_cast<ClassTemplateSpecializationDecl>(recordType->getDecl());
if (templateDecl && templateDecl->getTemplateArgs().size() > 0)
firstTemplateParamType = templateDecl->getTemplateArgs()[0].getAsType();
}
}
if (containsSvRefBaseSubclass(fieldDecl->getType().getTypePtr())) { if (containsSvRefBaseSubclass(fieldDecl->getType().getTypePtr())) {
report( report(
DiagnosticsEngine::Warning, DiagnosticsEngine::Warning,
"SvRefBase subclass being directly heap managed, should be managed via tools::SvRef, " "SvRefBase subclass %0 being directly heap managed, should be managed via tools::SvRef, "
+ fieldDecl->getType().getAsString() ", parent is %1",
+ ", parent is " + aParentName,
fieldDecl->getLocation()) fieldDecl->getLocation())
<< fieldDecl->getSourceRange(); << fieldDecl->getType()
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
}
if (!firstTemplateParamType.isNull() && containsSvRefBaseSubclass(firstTemplateParamType.getTypePtr()))
{
report(
DiagnosticsEngine::Warning,
"SvRefBase subclass %0 being managed via smart pointer, should be managed via tools::SvRef, "
"parent is %1",
fieldDecl->getLocation())
<< firstTemplateParamType
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
} }
if (containsSalhelperReferenceObjectSubclass(fieldDecl->getType().getTypePtr())) { if (containsSalhelperReferenceObjectSubclass(fieldDecl->getType().getTypePtr())) {
report( report(
DiagnosticsEngine::Warning, DiagnosticsEngine::Warning,
"salhelper::SimpleReferenceObject subclass being directly heap managed, should be managed via rtl::Reference, " "salhelper::SimpleReferenceObject subclass %0 being directly heap managed, should be managed via rtl::Reference, "
+ fieldDecl->getType().getAsString() "parent is %1",
+ ", parent is " + aParentName, fieldDecl->getLocation())
<< fieldDecl->getType()
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
}
if (!firstTemplateParamType.isNull() && containsSalhelperReferenceObjectSubclass(firstTemplateParamType.getTypePtr()))
{
report(
DiagnosticsEngine::Warning,
"salhelper::SimpleReferenceObject subclass %0 being managed via smart pointer, should be managed via rtl::Reference, "
"parent is %1",
fieldDecl->getLocation()) fieldDecl->getLocation())
<< fieldDecl->getSourceRange(); << firstTemplateParamType
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
} }
std::string aParentName = fieldDecl->getParent()->getQualifiedNameAsString();
if ( aParentName == "com::sun::star::uno::BaseReference" if ( aParentName == "com::sun::star::uno::BaseReference"
|| aParentName == "cppu::detail::element_alias" || aParentName == "cppu::detail::element_alias"
// this is playing some kind of game to avoid circular references // this is playing some kind of game to avoid circular references
...@@ -419,11 +458,24 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) { ...@@ -419,11 +458,24 @@ bool RefCounting::VisitFieldDecl(const FieldDecl * fieldDecl) {
if (containsXInterfaceSubclass(fieldDecl->getType())) { if (containsXInterfaceSubclass(fieldDecl->getType())) {
report( report(
DiagnosticsEngine::Warning, DiagnosticsEngine::Warning,
"XInterface subclass being directly heap managed, should be managed via uno::Reference, " "XInterface subclass %0 being directly heap managed, should be managed via uno::Reference, "
+ fieldDecl->getType().getAsString() "parent is %1",
+ ", parent is " + aParentName, fieldDecl->getLocation())
<< fieldDecl->getType()
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
}
if (!firstTemplateParamType.isNull() && containsXInterfaceSubclass(firstTemplateParamType))
{
report(
DiagnosticsEngine::Warning,
"XInterface subclass %0 being managed via smart pointer, should be managed via uno::Reference, "
"parent is %1",
fieldDecl->getLocation()) fieldDecl->getLocation())
<< fieldDecl->getSourceRange(); << firstTemplateParamType
<< fieldDecl->getParent()
<< fieldDecl->getSourceRange();
} }
checkUnoReference(fieldDecl->getType(), fieldDecl, aParentName, "field"); checkUnoReference(fieldDecl->getType(), fieldDecl, aParentName, "field");
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <memory>
#include <com/sun/star/uno/XInterface.hpp>
struct Foo
{
std::unique_ptr<css::uno::XInterface> m_foo1; // expected-error {{XInterface subclass 'com::sun::star::uno::XInterface' being managed via smart pointer, should be managed via uno::Reference, parent is 'Foo' [loplugin:refcounting]}}
std::shared_ptr<css::uno::XInterface> m_foo2; // expected-error {{XInterface subclass 'com::sun::star::uno::XInterface' being managed via smart pointer, should be managed via uno::Reference, parent is 'Foo' [loplugin:refcounting]}}
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
...@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : connectivity::sdbcx::OIndex ...@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : connectivity::sdbcx::OIndex
{ {
construct(); construct();
std::vector< OUString> aVector; std::vector< OUString> aVector;
m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) ); m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
} }
OIndexHelper::OIndexHelper( OTableHelper* _pTable, OIndexHelper::OIndexHelper( OTableHelper* _pTable,
...@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns() ...@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns()
if(m_pColumns) if(m_pColumns)
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
else else
m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) ); m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
} }
......
...@@ -100,7 +100,7 @@ void OTableKeyHelper::refreshColumns() ...@@ -100,7 +100,7 @@ void OTableKeyHelper::refreshColumns()
if ( m_pColumns ) if ( m_pColumns )
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
else else
m_pColumns.reset( new OKeyColumnsHelper(this,m_aMutex,aVector) ); m_pColumns = new OKeyColumnsHelper(this,m_aMutex,aVector);
} }
......
...@@ -79,7 +79,7 @@ void OAdoGroup::refreshUsers() ...@@ -79,7 +79,7 @@ void OAdoGroup::refreshUsers()
if(m_pUsers) if(m_pUsers)
m_pUsers->reFill(aVector); m_pUsers->reFill(aVector);
else else
m_pUsers.reset( new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive()) ); m_pUsers = new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
} }
Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId() Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
......
...@@ -68,7 +68,7 @@ void OAdoIndex::refreshColumns() ...@@ -68,7 +68,7 @@ void OAdoIndex::refreshColumns()
if ( m_pColumns ) if ( m_pColumns )
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
else else
m_pColumns.reset( new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) ); m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
} }
......
...@@ -64,7 +64,7 @@ void OAdoKey::refreshColumns() ...@@ -64,7 +64,7 @@ void OAdoKey::refreshColumns()
if(m_pColumns) if(m_pColumns)
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
else else
m_pColumns.reset( new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) ); m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
} }
Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId() Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
......
...@@ -63,7 +63,7 @@ void OAdoUser::refreshGroups() ...@@ -63,7 +63,7 @@ void OAdoUser::refreshGroups()
if(m_pGroups) if(m_pGroups)
m_pGroups->reFill(aVector); m_pGroups->reFill(aVector);
else else
m_pGroups.reset( new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive()) ); m_pGroups = new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive());
} }
Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId() Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
......
...@@ -103,7 +103,7 @@ void ODbaseIndex::refreshColumns() ...@@ -103,7 +103,7 @@ void ODbaseIndex::refreshColumns()
if(m_pColumns) if(m_pColumns)
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
else else
m_pColumns.reset( new ODbaseIndexColumns(this,m_aMutex,aVector) ); m_pColumns = new ODbaseIndexColumns(this,m_aMutex,aVector);
} }
Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId() Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
......
...@@ -566,7 +566,7 @@ void ODBTableDecorator::refreshColumns() ...@@ -566,7 +566,7 @@ void ODBTableDecorator::refreshColumns()
OContainerMediator* pMediator = new OContainerMediator( pCol, m_xColumnDefinitions ); OContainerMediator* pMediator = new OContainerMediator( pCol, m_xColumnDefinitions );
m_xColumnMediator = pMediator; m_xColumnMediator = pMediator;
pCol->setMediator( pMediator ); pCol->setMediator( pMediator );
m_pColumns.reset( pCol ); m_pColumns = pCol;
} }
else else
m_pColumns->reFill(aVector); m_pColumns->reFill(aVector);
......
...@@ -74,7 +74,7 @@ namespace dbaccess ...@@ -74,7 +74,7 @@ namespace dbaccess
// <properties> // <properties>
mutable sal_Int32 m_nPrivileges; mutable sal_Int32 m_nPrivileges;
// </properties> // </properties>
std::unique_ptr<::connectivity::sdbcx::OCollection> m_pColumns; rtl::Reference<::connectivity::sdbcx::OCollection> m_pColumns;
// IColumnFactory // IColumnFactory
virtual OColumn* createColumn(const OUString& _rName) const override; virtual OColumn* createColumn(const OUString& _rName) const override;
......
...@@ -23,9 +23,10 @@ ...@@ -23,9 +23,10 @@
#include <com/sun/star/text/XNumberingFormatter.hpp> #include <com/sun/star/text/XNumberingFormatter.hpp>
#include <com/sun/star/text/XNumberingTypeInfo.hpp> #include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/i18n/XTransliteration.hpp> #include <com/sun/star/i18n/XTransliteration.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
#include <transliterationImpl.hxx> #include <transliterationImpl.hxx>
...@@ -74,7 +75,7 @@ public: ...@@ -74,7 +75,7 @@ public:
private: private:
css::uno::Reference < css::uno::XComponentContext > m_xContext; css::uno::Reference < css::uno::XComponentContext > m_xContext;
css::uno::Reference < css::container::XHierarchicalNameAccess > xHierarchicalNameAccess; css::uno::Reference < css::container::XHierarchicalNameAccess > xHierarchicalNameAccess;
std::unique_ptr<TransliterationImpl> translit; rtl::Reference<TransliterationImpl> translit;
/// @throws css::uno::RuntimeException /// @throws css::uno::RuntimeException
OUString SAL_CALL makeNumberingIdentifier( sal_Int16 index ); OUString SAL_CALL makeNumberingIdentifier( sal_Int16 index );
/// @throws css::uno::RuntimeException /// @throws css::uno::RuntimeException
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp> #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <rtl/ref.hxx>
#include <collatorImpl.hxx> #include <collatorImpl.hxx>
#include <memory> #include <memory>
...@@ -80,7 +81,7 @@ public: ...@@ -80,7 +81,7 @@ public:
protected: protected:
const sal_Char * implementationName; const sal_Char * implementationName;
bool usePhonetic; bool usePhonetic;
std::unique_ptr<CollatorImpl> rtl::Reference<CollatorImpl>
collator; collator;
css::lang::Locale aLocale; css::lang::Locale aLocale;
OUString aAlgorithm; OUString aAlgorithm;
......
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
sal_Int16 mkeys[MAX_KEYS]; sal_Int16 mkeys[MAX_KEYS];
sal_Int16 mkey_count; sal_Int16 mkey_count;
OUString skipping_chars; OUString skipping_chars;
std::unique_ptr<CollatorImpl> collator; rtl::Reference<CollatorImpl> collator;
sal_Int16 compare(sal_Unicode c1, sal_Unicode c2); sal_Int16 compare(sal_Unicode c1, sal_Unicode c2);
}; };
......
...@@ -647,7 +647,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal ...@@ -647,7 +647,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
OUString transliteration; OUString transliteration;
getPropertyByName(aProperties, "Transliteration", true) >>= transliteration; getPropertyByName(aProperties, "Transliteration", true) >>= transliteration;
if ( !translit ) if ( !translit )
translit.reset( new TransliterationImpl(m_xContext) ); translit = new TransliterationImpl(m_xContext);
translit->loadModuleByImplName(transliteration, aLocale); translit->loadModuleByImplName(transliteration, aLocale);
result += translit->transliterateString2String(tmp, 0, tmp.getLength()); result += translit->transliterateString2String(tmp, 0, tmp.getLength());
} catch (Exception& ) { } catch (Exception& ) {
......
...@@ -30,7 +30,7 @@ namespace com { namespace sun { namespace star { namespace i18n { ...@@ -30,7 +30,7 @@ namespace com { namespace sun { namespace star { namespace i18n {
IndexEntrySupplier_Common::IndexEntrySupplier_Common(const Reference < uno::XComponentContext >& rxContext) IndexEntrySupplier_Common::IndexEntrySupplier_Common(const Reference < uno::XComponentContext >& rxContext)
{ {
implementationName = "com.sun.star.i18n.IndexEntrySupplier_Common"; implementationName = "com.sun.star.i18n.IndexEntrySupplier_Common";
collator.reset( new CollatorImpl(rxContext) ); collator = new CollatorImpl(rxContext);
usePhonetic = false; usePhonetic = false;
} }
......
...@@ -56,7 +56,7 @@ namespace connectivity ...@@ -56,7 +56,7 @@ namespace connectivity
public ODescriptor public ODescriptor
{ {
protected: protected:
std::unique_ptr<OUsers> m_pUsers; rtl::Reference<OUsers> m_pUsers;
using OGroup_BASE::rBHelper; using OGroup_BASE::rBHelper;
......
...@@ -57,7 +57,7 @@ namespace connectivity ...@@ -57,7 +57,7 @@ namespace connectivity
bool m_IsPrimaryKeyIndex; bool m_IsPrimaryKeyIndex;
bool m_IsClustered; bool m_IsClustered;
std::unique_ptr<OCollection> m_pColumns; rtl::Reference<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper; using ODescriptor_BASE::rBHelper;
virtual void refreshColumns() override; virtual void refreshColumns() override;
......
...@@ -69,7 +69,7 @@ namespace connectivity ...@@ -69,7 +69,7 @@ namespace connectivity
{ {
protected: protected:
std::shared_ptr<KeyProperties> m_aProps; std::shared_ptr<KeyProperties> m_aProps;
std::unique_ptr<OCollection> m_pColumns; rtl::Reference<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper; using ODescriptor_BASE::rBHelper;
// OPropertyArrayUsageHelper // OPropertyArrayUsageHelper
......
...@@ -53,7 +53,7 @@ namespace connectivity ...@@ -53,7 +53,7 @@ namespace connectivity
public ODescriptor public ODescriptor
{ {
protected: protected:
std::unique_ptr<OGroups> m_pGroups; rtl::Reference<OGroups> m_pGroups;
using OUser_BASE::rBHelper; using OUser_BASE::rBHelper;
......
...@@ -177,7 +177,7 @@ class ScXMLChangeTextPContext : public ScXMLImportContext ...@@ -177,7 +177,7 @@ class ScXMLChangeTextPContext : public ScXMLImportContext
OUString sLName; OUString sLName;
OUStringBuffer sText; OUStringBuffer sText;
ScXMLChangeCellContext* pChangeCellContext; ScXMLChangeCellContext* pChangeCellContext;
std::unique_ptr<SvXMLImportContext> rtl::Reference<SvXMLImportContext>
pTextPContext; pTextPContext;
sal_uInt16 nPrefix; sal_uInt16 nPrefix;
...@@ -876,8 +876,8 @@ SvXMLImportContext *ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nTem ...@@ -876,8 +876,8 @@ SvXMLImportContext *ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nTem
if (!pTextPContext) if (!pTextPContext)
{ {
bWasContext = false; bWasContext = false;
pTextPContext.reset( GetScImport().GetTextImport()->CreateTextChildContext( pTextPContext= GetScImport().GetTextImport()->CreateTextChildContext(
GetScImport(), nPrefix, sLName, xAttrList) ); GetScImport(), nPrefix, sLName, xAttrList);
} }
if (pTextPContext) if (pTextPContext)
{ {
......
...@@ -23,6 +23,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \ ...@@ -23,6 +23,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/redundantcast \ compilerplugins/clang/test/redundantcast \
compilerplugins/clang/test/redundantcopy \ compilerplugins/clang/test/redundantcopy \
compilerplugins/clang/test/redundantinline \ compilerplugins/clang/test/redundantinline \
compilerplugins/clang/test/refcounting \
compilerplugins/clang/test/salbool \ compilerplugins/clang/test/salbool \
compilerplugins/clang/test/salunicodeliteral \ compilerplugins/clang/test/salunicodeliteral \
compilerplugins/clang/test/stringconstant \ compilerplugins/clang/test/stringconstant \
......
...@@ -34,7 +34,7 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox ...@@ -34,7 +34,7 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
bool bInitialized; bool bInitialized;
bool bShowColumns; bool bShowColumns;
std::unique_ptr<SwDBTreeList_Impl> pImpl; rtl::Reference<SwDBTreeList_Impl> pImpl;
DECL_DLLPRIVATE_LINK( DBCompare, const SvSortData&, sal_Int32 ); DECL_DLLPRIVATE_LINK( DBCompare, const SvSortData&, sal_Int32 );
......
...@@ -484,7 +484,7 @@ private: ...@@ -484,7 +484,7 @@ private:
bool mbTextual; bool mbTextual;
bool mbDecimal02; bool mbDecimal02;
OUString maText; OUString maText;
std::shared_ptr< SvXMLImportContext > mpSlaveContext; rtl::Reference< SvXMLImportContext > mxSlaveContext;
public: public:
...@@ -511,7 +511,7 @@ SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXM ...@@ -511,7 +511,7 @@ SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXM
: SvXMLImportContext(rImport, nPrfx, rLocalName), : SvXMLImportContext(rImport, nPrfx, rLocalName),
mpParent( pParent ), mpParent( pParent ),
maNumberStyle( rLocalName ), maNumberStyle( rLocalName ),
mpSlaveContext( pSlaveContext ) mxSlaveContext( pSlaveContext )
{ {
mbLong = false; mbLong = false;
mbTextual = false; mbTextual = false;
...@@ -548,17 +548,17 @@ SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( sa ...@@ -548,17 +548,17 @@ SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( sa
const OUString& rLocalName, const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
{ {
return mpSlaveContext->CreateChildContext( nPrefix, rLocalName, xAttrList ); return mxSlaveContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
} }
void SdXMLNumberFormatMemberImportContext::StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) void SdXMLNumberFormatMemberImportContext::StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
{ {
mpSlaveContext->StartElement( xAttrList ); mxSlaveContext->StartElement( xAttrList );
} }
void SdXMLNumberFormatMemberImportContext::EndElement() void SdXMLNumberFormatMemberImportContext::EndElement()
{ {
mpSlaveContext->EndElement(); mxSlaveContext->EndElement();
if( mpParent ) if( mpParent )
mpParent->add( maNumberStyle, mbLong, mbTextual, mbDecimal02, maText ); mpParent->add( maNumberStyle, mbLong, mbTextual, mbDecimal02, maText );
...@@ -566,7 +566,7 @@ void SdXMLNumberFormatMemberImportContext::EndElement() ...@@ -566,7 +566,7 @@ void SdXMLNumberFormatMemberImportContext::EndElement()
void SdXMLNumberFormatMemberImportContext::Characters( const OUString& rChars ) void SdXMLNumberFormatMemberImportContext::Characters( const OUString& rChars )
{ {
mpSlaveContext->Characters( rChars ); mxSlaveContext->Characters( rChars );
maText += rChars; maText += rChars;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment