[Libreoffice-commits] core.git: sc/inc sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu Mar 15 22:44:52 UTC 2018
sc/inc/dpobject.hxx | 2 +-
sc/inc/postit.hxx | 3 +--
sc/inc/segmenttree.hxx | 1 +
sc/inc/table.hxx | 1 +
sc/source/core/data/dpobject.cxx | 5 ++---
sc/source/core/data/postit.cxx | 5 ++---
sc/source/filter/ftools/fapihelper.cxx | 3 +--
sc/source/filter/inc/fapihelper.hxx | 9 +++++----
sc/source/ui/inc/content.hxx | 2 +-
sc/source/ui/navipi/content.cxx | 10 ++++------
10 files changed, 19 insertions(+), 22 deletions(-)
New commits:
commit 4b2d899bc079240c32b7dacd139d6d4a29ab1b11
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Jan 19 15:09:12 2018 +0200
loplugin:unused-returns in sc
Change-Id: Ic1d6cbf883fcfeb013c3a82d31c177a1a14bb7c8
Reviewed-on: https://gerrit.libreoffice.org/48193
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
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()
More information about the Libreoffice-commits
mailing list