summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-05 08:57:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-05 14:53:33 +0200
commit94a34d6bdb41da2aafc519ffe1447d03ba99b4a6 (patch)
tree2d982a7c2b6f4b5b760e1b966695b61db1a52598 /sc/source
parent961655e7a8a925680271c7736a7d50ed62af6af4 (diff)
add boost::intrusive_ptr to list of smart points in plugins
and fix some loplugin:simplifypointertobool warnings Change-Id: I3644c390a3339a4cb8d66d6d034a0f043de9320c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/tool/address.cxx2
-rw-r--r--sc/source/core/tool/interpr1.cxx4
-rw-r--r--sc/source/core/tool/jumpmatrix.cxx2
-rw-r--r--sc/source/filter/excel/xelink.cxx31
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx2
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
8 files changed, 24 insertions, 23 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 328b881b516c..448c778c8995 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -5437,7 +5437,7 @@ void ScFormulaCell::EndListeningTo( sc::EndListeningContext& rCxt )
bool ScFormulaCell::IsShared() const
{
- return mxGroup.get() != nullptr;
+ return bool(mxGroup);
}
bool ScFormulaCell::IsSharedTop() const
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 2c7b5b07a398..0d75dfe4a816 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1397,7 +1397,7 @@ static ScRefFlags lcl_ScAddress_Parse_OOo( const sal_Unicode* p, const ScDocumen
if (pRefMgr->getSingleRefToken(nFileId, aTab,
ScAddress(nCol, nRow, 0), nullptr,
- &nTab).get())
+ &nTab))
{
rAddr.SetTab( nTab);
nRes |= ScRefFlags::TAB_VALID;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 56309d6878d7..419550d21684 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -176,7 +176,7 @@ void ScInterpreter::ScIfJump()
xNew = new ScJumpMatrixToken( pJumpMat );
GetTokenMatrixMap().emplace(pCur, xNew);
}
- if (!xNew.get())
+ if (!xNew)
{
PushIllegalArgument();
return;
@@ -481,7 +481,7 @@ void ScInterpreter::ScChooseJump()
xNew = new ScJumpMatrixToken( pJumpMat );
GetTokenMatrixMap().emplace(pCur, xNew);
}
- if (xNew.get())
+ if (xNew)
{
PushTokenRef( xNew);
// set endpoint of path for main code line
diff --git a/sc/source/core/tool/jumpmatrix.cxx b/sc/source/core/tool/jumpmatrix.cxx
index 38fd4ab82d41..f66a82abeba7 100644
--- a/sc/source/core/tool/jumpmatrix.cxx
+++ b/sc/source/core/tool/jumpmatrix.cxx
@@ -165,7 +165,7 @@ void ScJumpMatrix::SetNewResMat(SCSIZE nNewCols, SCSIZE nNewRows)
bool ScJumpMatrix::HasResultMatrix() const
{
// We now always have a matrix but caller logic may still want to check it.
- return pMat.get() != nullptr;
+ return bool(pMat);
}
ScRefList& ScJumpMatrix::GetRefList()
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index d283d7d099c3..519ceec9a8ff 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1374,21 +1374,22 @@ bool XclExpXct::BuildCrnList( XclExpCrnList& rCrnRecs )
sal_uInt32 nScNumFmt = 0;
ScExternalRefCache::TokenRef xToken = mxCacheTable->getCell( nScCol, nScRow, &nScNumFmt );
using namespace ::formula;
- if( xToken.get() ) switch( xToken->GetType() )
- {
- case svDouble:
- bValid = (rFormatter.GetType( nScNumFmt ) == SvNumFormatType::LOGICAL) ?
- rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() != 0 ) ) :
- rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() ) );
- break;
- case svString:
- // do not save empty strings (empty cells) to cache
- if( !xToken->GetString().isEmpty() )
- bValid = rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetString().getString() ) );
- break;
- default:
- break;
- }
+ if( xToken )
+ switch( xToken->GetType() )
+ {
+ case svDouble:
+ bValid = (rFormatter.GetType( nScNumFmt ) == SvNumFormatType::LOGICAL) ?
+ rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() != 0 ) ) :
+ rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() ) );
+ break;
+ case svString:
+ // do not save empty strings (empty cells) to cache
+ if( !xToken->GetString().isEmpty() )
+ bValid = rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetString().getString() ) );
+ break;
+ default:
+ break;
+ }
}
}
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index a338a2d861c5..5321f342c332 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4927,7 +4927,7 @@ void ScXMLExport::WriteExternalRefCaches()
sal_uInt32 nNumFmt = 0;
ScExternalRefCache::TokenRef pToken = pTable->getCell(nCol, nRow, &nNumFmt);
OUString aStrVal;
- if (pToken.get())
+ if (pToken)
{
sal_Int32 nIndex = GetNumberFormatStyleIndex(nNumFmt);
if (nIndex >= 0)
diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx
index 79249b78ad66..8185cf6f5821 100644
--- a/sc/source/filter/xml/xmlexternaltabi.cxx
+++ b/sc/source/filter/xml/xmlexternaltabi.cxx
@@ -210,7 +210,7 @@ void SAL_CALL ScXMLExternalRefRowContext::endFastElement( sal_Int32 /* nElement
ScExternalRefCache::TokenRef pToken = pTab->getCell(
static_cast<SCCOL>(j), static_cast<SCROW>(mrExternalRefInfo.mnRow));
- if (pToken.get())
+ if (pToken)
{
pTab->setCell(static_cast<SCCOL>(j),
static_cast<SCROW>(mrExternalRefInfo.mnRow+i), pToken);
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 9b90a5cbea36..9ba5e0b5e0cf 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2224,7 +2224,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefTokenFromSrcDoc(
ScRefCellValue aCell(*pSrcDoc, rPos);
ScExternalRefCache::TokenRef pToken(convertToToken(mpDoc, pSrcDoc, aCell));
- if (!pToken.get())
+ if (!pToken)
{
// Generate an error for unresolvable cells.
pToken.reset( new FormulaErrorToken( FormulaError::NoValue));