diff options
-rw-r--r-- | compilerplugins/clang/refcounting.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.hxx | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx index 58a9884ede0d..8957221dbb22 100644 --- a/compilerplugins/clang/refcounting.cxx +++ b/compilerplugins/clang/refcounting.cxx @@ -148,6 +148,10 @@ bool containsXInterfaceSubclass(const clang::Type* pType0) { if (isDerivedFrom(pRecordDecl, [](Decl const * decl) -> bool { return bool(loplugin::DeclCheck(decl).Class("XPropertyList").GlobalNamespace()); })) { // module svx return false; } + // tdf#114596 + if (isDerivedFrom(pRecordDecl, [](Decl const * decl) -> bool { return bool(loplugin::DeclCheck(decl).Class("OBookmarkContainer").Namespace("dbaccess").GlobalNamespace()); })) { // module dbaccess + return false; + } } if (pRecordDecl) { const ClassTemplateSpecializationDecl* pTemplate = dyn_cast<ClassTemplateSpecializationDecl>(pRecordDecl); diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index d37c5f3325c3..f4e8f204d24b 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -472,7 +472,7 @@ ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pI :ModelDependentComponent( _pImpl ) ,ODatabaseSource_Base( getMutex() ) ,OPropertySetHelper( ODatabaseSource_Base::rBHelper ) - ,m_xBookmarks( new OBookmarkContainer( *this, getMutex() ) ) + , m_Bookmarks(*this, getMutex()) ,m_aFlushListeners( getMutex() ) { // some kind of default @@ -1153,7 +1153,8 @@ Reference< XConnection > ODatabaseSource::getConnection(const OUString& user, co Reference< XNameAccess > SAL_CALL ODatabaseSource::getBookmarks( ) { ModelMethodGuard aGuard( *this ); - return static_cast< XNameContainer* >(m_xBookmarks.get()); + // tdf#114596 this may look nutty but see OBookmarkContainer::aquire() + return static_cast<XNameContainer*>(&m_Bookmarks); } Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx index c513064a2dd5..7d772d814983 100644 --- a/dbaccess/source/core/dataaccess/datasource.hxx +++ b/dbaccess/source/core/dataaccess/datasource.hxx @@ -82,7 +82,8 @@ class ODatabaseSource :public ModelDependentComponent // must be first private: using ODatabaseSource_Base::rBHelper; - rtl::Reference<OBookmarkContainer> m_xBookmarks; + // note: this thing uses the ref-count of "this", see OBookmarkContainer::acquire! + OBookmarkContainer m_Bookmarks; ::comphelper::OInterfaceContainerHelper2 m_aFlushListeners; private: |