summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-19 15:09:12 +0200
committerEike Rathke <erack@redhat.com>2018-03-15 23:44:18 +0100
commit4b2d899bc079240c32b7dacd139d6d4a29ab1b11 (patch)
treebc767288813ff506b74a091472e357758f270dad
parentfd5e480eaf78c8bd2ea4315649fcbd5b8edaa3da (diff)
loplugin:unused-returns in sc
Change-Id: Ic1d6cbf883fcfeb013c3a82d31c177a1a14bb7c8 Reviewed-on: https://gerrit.libreoffice.org/48193 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/inc/dpobject.hxx2
-rw-r--r--sc/inc/postit.hxx3
-rw-r--r--sc/inc/segmenttree.hxx1
-rw-r--r--sc/inc/table.hxx1
-rw-r--r--sc/source/core/data/dpobject.cxx5
-rw-r--r--sc/source/core/data/postit.cxx5
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx3
-rw-r--r--sc/source/filter/inc/fapihelper.hxx9
-rw-r--r--sc/source/ui/inc/content.hxx2
-rw-r--r--sc/source/ui/navipi/content.cxx10
10 files changed, 19 insertions, 22 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 39299c79ab26..897a22a9fe47 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -104,7 +104,7 @@ private:
SAL_DLLPRIVATE void CreateObjects();
SAL_DLLPRIVATE void CreateOutput();
SAL_DLLPRIVATE void ClearSource();
- SAL_DLLPRIVATE bool FillLabelDataForDimension(
+ SAL_DLLPRIVATE void FillLabelDataForDimension(
const css::uno::Reference< css::container::XIndexAccess>& xDims,
sal_Int32 nDim, ScDPLabelData& rLabelData);
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 345d1e03b22d..362a4c2352c3 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -84,9 +84,8 @@ public:
/** Forget the SdrCaptionObj pointer in this one instance.
Decrements a use count but does not destroy the object, it's up to the
caller to manage this mess..
- @returns <TRUE/> if the last reference was decremented.
*/
- bool forget();
+ void forget();
/** Flag that this instance is in Undo, so drawing layer owns it. */
void setNotOwner();
diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx
index 897b4dbf7239..53eec168a722 100644
--- a/sc/inc/segmenttree.hxx
+++ b/sc/inc/segmenttree.hxx
@@ -41,6 +41,7 @@ public:
public:
explicit ForwardIterator(ScFlatBoolRowSegments& rSegs);
+ SAL_WARN_UNUSED_RESULT
bool getValue(SCROW nPos, bool& rVal);
SCROW getLastPos() const { return mnLastPos;}
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 5a1cd564a759..b4634806069b 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -942,6 +942,7 @@ public:
void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries );
void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, ScFilterEntries& rFilterEntries );
+ SAL_WARN_UNUSED_RESULT
bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit);
bool HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index c806f05aae6e..6d40fa552e30 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2407,7 +2407,7 @@ static void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans
}
}
-bool ScDPObject::FillLabelDataForDimension(
+void ScDPObject::FillLabelDataForDimension(
const uno::Reference<container::XIndexAccess>& xDims, sal_Int32 nDim, ScDPLabelData& rLabelData)
{
uno::Reference<uno::XInterface> xIntDim =
@@ -2416,7 +2416,7 @@ bool ScDPObject::FillLabelDataForDimension(
uno::Reference<beans::XPropertySet> xDimProp( xIntDim, uno::UNO_QUERY );
if (!xDimName.is() || !xDimProp.is())
- return false;
+ return;
bool bData = ScUnoHelpFunctions::GetBoolProperty(
xDimProp, SC_UNO_DP_ISDATALAYOUT);
@@ -2466,7 +2466,6 @@ bool ScDPObject::FillLabelDataForDimension(
rLabelData.mnFlags = ScUnoHelpFunctions::GetLongProperty(
xDimProp, SC_UNO_DP_FLAGS );
}
- return true;
}
void ScDPObject::FillLabelData(sal_Int32 nDim, ScDPLabelData& rLabels)
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d9c87af47391..d70e87f528c1 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -780,13 +780,12 @@ SdrCaptionObj* ScCaptionPtr::release()
return pTmp;
}
-bool ScCaptionPtr::forget()
+void ScCaptionPtr::forget()
{
- bool bRet = decRef();
+ decRef();
removeFromList();
mpCaption = nullptr;
mbNotOwner = false;
- return bRet;
}
void ScCaptionPtr::dissolve()
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 0d09cfb5c2a5..27184bbb3cf4 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -312,12 +312,11 @@ void ScfPropSetHelper::ReadFromPropertySet( const ScfPropertySet& rPropSet )
mnNextIdx = 0;
}
-bool ScfPropSetHelper::ReadValue( Any& rAny )
+void ScfPropSetHelper::ReadValue( Any& rAny )
{
Any* pAny = GetNextAny();
if( pAny )
rAny = *pAny;
- return pAny != nullptr;
}
void ScfPropSetHelper::ReadValue( Color& rColor )
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 0648da426305..8af382f16119 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -220,9 +220,9 @@ public:
/** Reads the next value from the value sequence. */
template< typename Type >
- bool ReadValue( Type& rValue );
+ void ReadValue( Type& rValue );
/** Reads an Any from the value sequence. */
- bool ReadValue( css::uno::Any& rAny );
+ void ReadValue( css::uno::Any& rAny );
/** Reads a color value from the value sequence. */
void ReadValue( Color& rColor );
/** Reads a C++ boolean value from the value sequence. */
@@ -259,10 +259,11 @@ private:
};
template< typename Type >
-bool ScfPropSetHelper::ReadValue( Type& rValue )
+void ScfPropSetHelper::ReadValue( Type& rValue )
{
css::uno::Any* pAny = GetNextAny();
- return pAny && (*pAny >>= rValue);
+ if (pAny)
+ *pAny >>= rValue;
}
template< typename Type >
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 1c68f1950a8b..17f83be89d94 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -141,7 +141,7 @@ public:
void SetManualDoc(const OUString& rName);
bool LoadFile(const OUString& rUrl);
void SelectDoc(const OUString& rName);
- bool SelectEntryByName(const ScContentId nRoot, const OUString& rName);
+ void SelectEntryByName(const ScContentId nRoot, const OUString& rName);
const OUString& GetHiddenTitle() const { return aHiddenTitle; }
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 151918c2303e..52c3fb9b4e93 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1626,19 +1626,19 @@ void ScContentTree::SelectDoc(const OUString& rName) // rName like shown in
}
}
-bool ScContentTree::SelectEntryByName(const ScContentId nRoot, const OUString& rName)
+void ScContentTree::SelectEntryByName(const ScContentId nRoot, const OUString& rName)
{
SvTreeListEntry* pParent = pRootNodes[ nRoot ];
if( !pParent->HasChildren() )
- return false;
+ return;
SvTreeListEntry* pEntry = FirstChild( pParent );
while( pEntry )
{
if( GetEntryText( pEntry ) == rName )
{
- bool bRet = SvTreeListBox::Select( pEntry );
+ SvTreeListBox::Select( pEntry );
// Scroll to the selected item
if( SvTreeListBox::GetVScroll()->IsVisible() )
@@ -1655,12 +1655,10 @@ bool ScContentTree::SelectEntryByName(const ScContentId nRoot, const OUString& r
+ nBeforeCount );
}
- return bRet;
+ return;
}
pEntry = Next( pEntry );
}
-
- return false;
}
void ScContentTree::ApplyNavigatorSettings()