path: root/connectivity/source/commontools
diff options
authorStephan Bergmann <>2020-05-26 20:42:08 +0200
committerStephan Bergmann <>2020-05-26 22:33:02 +0200
commitfe6cce01c88d045a1fcf09acf049c34c22299b02 (patch)
treec118594a43386096bca55179f31b2b61e64dfa48 /connectivity/source/commontools
parentb894a3d7f991dd248dfd8935b31da8bccfd130b2 (diff)
Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr
...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: Reviewed-by: Noel Grandin <> Reviewed-by: Stephan Bergmann <> Tested-by: Jenkins
Diffstat (limited to 'connectivity/source/commontools')
1 files changed, 3 insertions, 3 deletions
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index e22740144316..e86af9673052 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -371,7 +371,7 @@ void OTableHelper::refreshForeignKeys(::std::vector< OUString>& _rNames)
if ( sOldFKName != sFkName )
- if ( pKeyProps.get() )
+ if ( pKeyProps )
const OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,false,::dbtools::EComposeRule::InDataManipulation);
@@ -387,13 +387,13 @@ void OTableHelper::refreshForeignKeys(::std::vector< OUString>& _rNames)
} // if ( m_pTables->hasByName(sReferencedName) )
sOldFKName = sFkName;
} // if ( sOldFKName != sFkName )
- else if ( pKeyProps.get() )
+ else if ( pKeyProps )
} // while( xResult->next() )
- if ( pKeyProps.get() )
+ if ( pKeyProps )