diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-05-28 08:26:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-05-28 09:48:09 +0200 |
commit | e84d05483cc5f30161dc5b15f93fb3bf71ed636e (patch) | |
tree | 2a343319cb4c1e06060b632de4fc840ba96bb70f /writerfilter/source | |
parent | 412ff42bf0a6d078b9a6fd1daa8d0eb0b9a78c4a (diff) |
Make loplugin:simplifypointertobool handle parenthesized expressions
...as discussed as an open TODO in the commit message of
fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for
libstdc++ std::shared_ptr". The necessary changes across the code base have
been done fully automatically with the rewriting plugin on Linux. (All those
changes apparently involve uses of macro arguments wrapped in parentheses in the
macro body, but always in conditionally-converted-to-bool contexts. In other
contexts, such automatic rewriting would add the "bool" to the macro body, which
would be wrong in general, but we apparently get away with that sloppy coding
for now.)
The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had
introduced to treat such (then-undetected, it had turned out) parenthesized
cases now turns out to not be needed after all.
Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 60e32fd8aa05..475e7d9b5f77 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1261,7 +1261,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) break; } - OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!"); + OSL_ENSURE(rContext, "PropertyMap has to be valid!"); if(!rContext) return ; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 155105c466df..a88e50876b5c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1369,7 +1369,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con #endif const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( GetCurrentParaStyleName() ); - OSL_ENSURE( pEntry.get(), "no style sheet found" ); + OSL_ENSURE( pEntry, "no style sheet found" ); const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : nullptr); bool isNumberingViaStyle(false); bool isNumberingViaRule = pParaContext && pParaContext->GetListId() > -1; @@ -3860,7 +3860,7 @@ void DomainMapper_Impl::AppendFieldCommand(OUString const & rPartOfCommand) #endif FieldContextPtr pContext = m_aFieldStack.back(); - OSL_ENSURE( pContext.get(), "no field context available"); + OSL_ENSURE( pContext, "no field context available"); if( pContext ) { pContext->AppendCommand( rPartOfCommand ); @@ -4832,7 +4832,7 @@ void DomainMapper_Impl::CloseFieldCommand() FieldContextPtr pContext; if(!m_aFieldStack.empty()) pContext = m_aFieldStack.back(); - OSL_ENSURE( pContext.get(), "no field context available"); + OSL_ENSURE( pContext, "no field context available"); if( pContext ) { m_bSetUserFieldContent = false; @@ -5640,7 +5640,7 @@ bool DomainMapper_Impl::IsFieldResultAsString() bool bRet = false; OSL_ENSURE( !m_aFieldStack.empty(), "field stack empty?"); FieldContextPtr pContext = m_aFieldStack.back(); - OSL_ENSURE( pContext.get(), "no field context available"); + OSL_ENSURE( pContext, "no field context available"); if( pContext ) { bRet = pContext->GetTextField().is() @@ -5716,7 +5716,7 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult) #endif FieldContextPtr pContext = m_aFieldStack.back(); - OSL_ENSURE( pContext.get(), "no field context available"); + OSL_ENSURE( pContext, "no field context available"); if (m_aFieldStack.size() > 1) { @@ -5882,7 +5882,7 @@ void DomainMapper_Impl::PopFieldContext() return; FieldContextPtr pContext = m_aFieldStack.back(); - OSL_ENSURE( pContext.get(), "no field context available"); + OSL_ENSURE( pContext, "no field context available"); if( pContext ) { if( !pContext->IsCommandCompleted() ) diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 762bd623a1d3..59fb4f8c2123 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -664,7 +664,7 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal ) if (nName != NS_ooxml::LN_CT_NumPicBullet_numPicBulletId) { - OSL_ENSURE( m_pCurrentDefinition.get(), "current entry has to be set here"); + OSL_ENSURE( m_pCurrentDefinition, "current entry has to be set here"); if(!m_pCurrentDefinition) return ; pCurrentLvl = m_pCurrentDefinition->GetCurrentLevel( ); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 1624b023ff34..481c8fd9db75 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2667,7 +2667,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) = new RTFReferenceProperties(aObjAttributes, aObjSprms); uno::Reference<drawing::XShape> xShape; RTFValue::Pointer_t pShape = m_aObjectAttributes.find(NS_ooxml::LN_shape); - OSL_ASSERT(pShape.get()); + OSL_ASSERT(pShape); if (pShape) pShape->getAny() >>= xShape; if (xShape.is()) |