Kaydet (Commit) 509f0c6a authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:unusedreturntypes

and clean up the python script

Change-Id: I0a7068153290fbbb60bfeb4c8bda1c24d514500f
Reviewed-on: https://gerrit.libreoffice.org/25439Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 92d30255
......@@ -4,17 +4,27 @@ import sys
import re
import io
definitionSet = set()
publicDefinitionSet = set()
# --------------------------------------------------------------------------------------------
# globals
# --------------------------------------------------------------------------------------------
definitionSet = set() # set of tuple(return_type, name_and_params)
definitionToSourceLocationMap = dict()
callSet = set()
usedReturnSet = set()
sourceLocationSet = set()
calledFromOutsideSet = set()
# for the "unused methods" analysis
callSet = set() # set of tuple(return_type, name_and_params)
# for the "unnecessary public" analysis
publicDefinitionSet = set() # set of tuple(return_type, name_and_params)
calledFromOutsideSet = set() # set of tuple(return_type, name_and_params)
# for the "unused return types" analysis
usedReturnSet = set() # set of tuple(return_type, name_and_params)
# things we need to exclude for reasons like :
# - it's a weird template thingy that confuses the plugin
exclusionSet = set([
unusedMethodsExclusionSet = set([
"double basegfx::DoubleTraits::maxVal()",
"double basegfx::DoubleTraits::minVal()",
"double basegfx::DoubleTraits::neutral()",
......@@ -116,6 +126,10 @@ normalizeTypeParamsRegex = re.compile(r"type-parameter-\d+-\d+")
def normalizeTypeParams( line ):
return normalizeTypeParamsRegex.sub("type-parameter-?-?", line)
# --------------------------------------------------------------------------------------------
# primary input loop
# --------------------------------------------------------------------------------------------
# The parsing here is designed to avoid grabbing stuff which is mixed in from gbuild.
# I have not yet found a way of suppressing the gbuild output.
with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt:
......@@ -162,38 +176,46 @@ for k, definitions in sourceLocationToDefinitionMap.iteritems():
definitionSet.remove(d)
def isOtherConstness( d, callSet ):
clazz = d[0] + " " + d[1]
method = d[0] + " " + d[1]
# if this method is const, and there is a non-const variant of it, and the non-const variant is in use, then leave it alone
if d[0].startswith("const ") and d[1].endswith(" const"):
if ((d[0][6:],d[1][:-6]) in callSet):
return True
elif clazz.endswith(" const"):
clazz2 = clazz[:len(clazz)-6] # strip off " const"
if ((d[0],clazz2) in callSet):
elif method.endswith(" const"):
method2 = method[:len(method)-6] # strip off " const"
if ((d[0],method2) in callSet):
return True
if clazz.endswith(" const") and ("::iterator" in clazz):
clazz2 = clazz[:len(clazz)-6] # strip off " const"
clazz2 = clazz2.replace("::const_iterator", "::iterator")
if ((d[0],clazz2) in callSet):
if method.endswith(" const") and ("::iterator" in method):
method2 = method[:len(method)-6] # strip off " const"
method2 = method2.replace("::const_iterator", "::iterator")
if ((d[0],method2) in callSet):
return True
# if this method is non-const, and there is a const variant of it, and the const variant is in use, then leave it alone
if (not clazz.endswith(" const")) and ((d[0],"const " + clazz + " const") in callSet):
if (not method.endswith(" const")) and ((d[0],"const " + method + " const") in callSet):
return True
if (not clazz.endswith(" const")) and ("::iterator" in clazz):
clazz2 = clazz.replace("::iterator", "::const_iterator") + " const"
if ((d[0],clazz2) in callSet):
if (not method.endswith(" const")) and ("::iterator" in method):
method2 = method.replace("::iterator", "::const_iterator") + " const"
if ((d[0],method2) in callSet):
return True
return False
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
return [int(text) if text.isdigit() else text.lower()
for text in re.split(_nsre, s)]
def sort_set_by_natural_key(s):
return sorted(s, key=lambda v: natural_sort_key(v[1]))
# -------------------------------------------
# Do the "unused methods" part
# -------------------------------------------
# --------------------------------------------------------------------------------------------
# "unused methods" analysis
# --------------------------------------------------------------------------------------------
tmp1set = set()
tmp1set = set() # set of tuple(method, source_location)
unusedSet = set() # set of tuple(return_type, name_and_params)
for d in definitionSet:
clazz = d[0] + " " + d[1]
if clazz in exclusionSet:
method = d[0] + " " + d[1]
if method in unusedMethodsExclusionSet:
continue
if d in callSet:
continue
......@@ -249,34 +271,30 @@ for d in definitionSet:
if d[1].endswith("::CreateDefault()"):
continue
tmp1set.add((clazz, definitionToSourceLocationMap[d]))
unusedSet.add(d) # used by the "unused return types" analysis
tmp1set.add((method, definitionToSourceLocationMap[d]))
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
return [int(text) if text.isdigit() else text.lower()
for text in re.split(_nsre, s)]
# sort results by name and line number
tmp1list = sorted(tmp1set, key=lambda v: natural_sort_key(v[1]))
# print out the results
# print out the results, sorted by name and line number
with open("unused.methods", "wt") as f:
for t in tmp1list:
for t in sort_set_by_natural_key(tmp1set):
f.write(t[1] + "\n")
f.write(" " + t[0] + "\n")
# -------------------------------------------
# Do the "unused return types" part
# -------------------------------------------
# --------------------------------------------------------------------------------------------
# "unused return types" analysis
# --------------------------------------------------------------------------------------------
tmp2set = set()
for d in definitionSet:
clazz = d[0] + " " + d[1]
method = d[0] + " " + d[1]
if d in usedReturnSet:
continue
if d in unusedSet:
continue
if isOtherConstness(d, usedReturnSet):
continue
if d[0] == "void":
# ignore methods with no return type, and constructors
if d[0] == "void" or d[0] == "":
continue
# ignore bool returns, provides important documentation in the code
if d[0] == "_Bool":
......@@ -299,24 +317,22 @@ for d in definitionSet:
# ignore the SfxPoolItem CreateDefault methods for now
if d[1].endswith("::CreateDefault()"):
continue
tmp2set.add((clazz, definitionToSourceLocationMap[d]))
tmp2set.add((method, definitionToSourceLocationMap[d]))
# sort results by name and line number
tmp2list = sorted(tmp2set, key=lambda v: natural_sort_key(v[1]))
# print output, sorted by name and line number
with open("unused.returns", "wt") as f:
for t in tmp2list:
f.write(t[1])
for t in sort_set_by_natural_key(tmp2set):
f.write(t[1] + "\n")
f.write(" " + t[0] + "\n")
# -------------------------------------------
# Do the "unnecessary public" part
# -------------------------------------------
# --------------------------------------------------------------------------------------------
# "unnecessary public" analysis
# --------------------------------------------------------------------------------------------
tmp3set = set()
for d in publicDefinitionSet:
clazz = d[0] + " " + d[1]
method = d[0] + " " + d[1]
if d in calledFromOutsideSet:
continue
if isOtherConstness(d, calledFromOutsideSet):
......@@ -324,13 +340,11 @@ for d in publicDefinitionSet:
# ignore external code
if definitionToSourceLocationMap[d].startswith("external/"):
continue
tmp3set.add((clazz, definitionToSourceLocationMap[d]))
tmp3set.add((method, definitionToSourceLocationMap[d]))
# sort results by name and line number
tmp3list = sorted(tmp3set, key=lambda v: natural_sort_key(v[1]))
# print output, sorted by name and line number
with open("unused.public", "wt") as f:
for t in tmp3list:
for t in sort_set_by_natural_key(tmp3set):
f.write(t[1] + "\n")
f.write(" " + t[0] + "\n")
......
......@@ -221,7 +221,7 @@ OOperand* OPredicateCompiler::execute(OSQLParseNode* pPredicateNode)
}
OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() == 3,"OFILECursor: Fehler im Parse Tree");
......@@ -240,7 +240,7 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th
SQL_ISRULE(pPredicateNode->getChild(2),fold)) )
{
m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,nullptr);
return nullptr;
return;
}
sal_Int32 ePredicateType( SQLFilterOperator::EQUAL );
......@@ -264,12 +264,10 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th
execute(pPredicateNode->getChild(0));
execute(pPredicateNode->getChild(2));
m_aCodeList.push_back( new OOp_COMPARE(ePredicateType) );
return nullptr;
}
OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
......@@ -290,7 +288,7 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
SQL_ISRULE(pAtom,fold)) )
{
m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,nullptr);
return nullptr;
return;
}
if (pOptEscape->count() != 0)
......@@ -315,11 +313,9 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
? new OOp_NOTLIKE(cEscape)
: new OOp_LIKE(cEscape);
m_aCodeList.push_back(pOperator);
return nullptr;
}
OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
......@@ -394,11 +390,9 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
else
pBoolOp = new OOp_AND();
m_aCodeList.push_back(pBoolOp);
return nullptr;
}
OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
......@@ -414,8 +408,6 @@ OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) thro
OBoolOperator* pOperator = (ePredicateType == SQLFilterOperator::SQLNULL) ?
new OOp_ISNULL() : new OOp_ISNOTNULL();
m_aCodeList.push_back(pOperator);
return nullptr;
}
OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
......@@ -598,7 +590,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueD
delete pOperand;
}
OOperand* OPredicateCompiler::execute_Fold(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::execute_Fold(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
......@@ -612,10 +604,9 @@ OOperand* OPredicateCompiler::execute_Fold(OSQLParseNode* pPredicateNode) thro
pOperator = new OOp_Lower();
m_aCodeList.push_back(pOperator);
return nullptr;
}
OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
void OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
OOperator* pOperator = nullptr;
......@@ -900,7 +891,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
}
m_aCodeList.push_back(pOperator);
return nullptr;
}
......
......@@ -47,19 +47,18 @@ namespace connectivity
LoadProductsInfo();
}
sal_Int32 ProfileAccess::LoadProductsInfo()
void ProfileAccess::LoadProductsInfo()
{
//tdf#39279: LO should search Thunderbird first then Seamonkey and finally Firefox
//load thunderbird profiles to m_ProductProfileList
sal_Int32 count = LoadXPToolkitProfiles(MozillaProductType_Thunderbird);
LoadXPToolkitProfiles(MozillaProductType_Thunderbird);
//load SeaMonkey 2 profiles to m_ProductProfileList
count += LoadXPToolkitProfiles(MozillaProductType_Mozilla);
LoadXPToolkitProfiles(MozillaProductType_Mozilla);
//load firefox profiles to m_ProductProfileList
//firefox profile does not containt address book, but maybe others need them
count += LoadXPToolkitProfiles(MozillaProductType_Firefox);
return count;
LoadXPToolkitProfiles(MozillaProductType_Firefox);
}
//Thunderbird and firefox profiles are saved in profiles.ini
sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
......
......@@ -79,7 +79,7 @@ namespace connectivity
bool SAL_CALL getProfileExists( ::com::sun::star::mozilla::MozillaProductType product, const OUString& profileName ) throw (::com::sun::star::uno::RuntimeException);
protected:
ProductStruct m_ProductProfileList[4];
sal_Int32 LoadProductsInfo();
void LoadProductsInfo();
sal_Int32 LoadXPToolkitProfiles(MozillaProductType product);
};
......
......@@ -68,13 +68,13 @@ namespace connectivity
void setOrigColumns(const css::uno::Reference< css::container::XNameAccess>& rCols) { m_orgColumns = rCols; }
const css::uno::Reference< css::container::XNameAccess>& getOrigColumns() const { return m_orgColumns; }
protected:
OOperand* execute_COMPARE(connectivity::OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* execute_LIKE(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* execute_BETWEEN(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* execute_ISNULL(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void execute_COMPARE(connectivity::OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void execute_LIKE(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void execute_BETWEEN(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void execute_ISNULL(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* execute_Operand(connectivity::OSQLParseNode* pPredicateNode) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* execute_Fold(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
OOperand* executeFunction(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void execute_Fold(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void executeFunction(OSQLParseNode* pPredicateNode) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
};
......
......@@ -1737,12 +1737,12 @@ Size& SVGActionWriter::ImplMap( const Size& rSz, Size& rDstSz ) const
}
Rectangle& SVGActionWriter::ImplMap( const Rectangle& rRect, Rectangle& rDstRect ) const
void SVGActionWriter::ImplMap( const Rectangle& rRect, Rectangle& rDstRect ) const
{
Point aTL( rRect.TopLeft() );
Size aSz( rRect.GetSize() );
return( rDstRect = Rectangle( ImplMap( aTL, aTL ), ImplMap( aSz, aSz ) ) );
rDstRect = Rectangle( ImplMap( aTL, aTL ), ImplMap( aSz, aSz ) );
}
......
......@@ -292,7 +292,7 @@ private:
long ImplMap( sal_Int32 nVal ) const;
Point& ImplMap( const Point& rPt, Point& rDstPt ) const;
Size& ImplMap( const Size& rSz, Size& rDstSz ) const;
Rectangle& ImplMap( const Rectangle& rRect, Rectangle& rDstRect ) const;
void ImplMap( const Rectangle& rRect, Rectangle& rDstRect ) const;
tools::Polygon& ImplMap( const tools::Polygon& rPoly, tools::Polygon& rDstPoly ) const;
tools::PolyPolygon& ImplMap( const tools::PolyPolygon& rPolyPoly, tools::PolyPolygon& rDstPolyPoly ) const;
......
......@@ -73,13 +73,12 @@ public:
p->AddFirstRef();
}
T pop_back()
void pop_back()
{
T p = base_t::back();
base_t::pop_back();
if( p )
p->ReleaseRef();
return p;
}
};
......
......@@ -224,10 +224,8 @@ public:
/** Write the document properties into into the current OPC package.
@param xProperties The document properties to export.
@return *this
*/
XmlFilterBase& exportDocumentProperties( const css::uno::Reference< css::document::XDocumentProperties >& xProperties );
void exportDocumentProperties( const css::uno::Reference< css::document::XDocumentProperties >& xProperties );
void importDocumentProperties();
......
......@@ -222,7 +222,7 @@ protected:
// Interface to SdrPaintWindow
protected:
void AppendPaintWindow(SdrPaintWindow& rNew);
SdrPaintWindow* RemovePaintWindow(SdrPaintWindow& rOld);
void RemovePaintWindow(SdrPaintWindow& rOld);
void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 ) override;
public:
......
......@@ -45,10 +45,10 @@ namespace vcl
virtual ~SolarThreadExecutor();
virtual long doIt() = 0;
long execute() { return impl_execute(); }
void execute() { impl_execute(); }
private:
long impl_execute();
void impl_execute();
};
namespace solarthread {
......
......@@ -803,7 +803,7 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
pAppProps->endElement( XML_Properties );
}
XmlFilterBase& XmlFilterBase::exportDocumentProperties( const Reference< XDocumentProperties >& xProperties )
void XmlFilterBase::exportDocumentProperties( const Reference< XDocumentProperties >& xProperties )
{
if( xProperties.is() )
{
......@@ -811,7 +811,6 @@ XmlFilterBase& XmlFilterBase::exportDocumentProperties( const Reference< XDocume
writeAppProperties( *this, xProperties );
writeCustomProperties( *this, xProperties );
}
return *this;
}
// protected ------------------------------------------------------------------
......
......@@ -99,9 +99,9 @@ public:
{
Py_DECREF(used);
}
int setUsed(PyObject *key)
void setUsed(PyObject *key)
{
return PyDict_SetItem(used, key, Py_True);
PyDict_SetItem(used, key, Py_True);
}
void setInitialised(const OUString& key, sal_Int32 pos = -1)
{
......
......@@ -307,11 +307,10 @@ private:
if( pRoot )
pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteRc ) );
}
ERRTYPE WriteSrc( RscTop * pCl, ObjNode * pRoot ){
void WriteSrc( RscTop * pCl, ObjNode * pRoot ){
pClass = pCl;
if( pRoot )
pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteSrc ) );
return aError;
}
public:
void WriteRcFile( RscWriteRc & rMem, FILE * fOutput );
......
......@@ -104,7 +104,7 @@ class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
// various export filters
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) = 0;
virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest ) = 0;
virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions ) = 0;
virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
......
......@@ -95,7 +95,7 @@ public:
/** ScSingleRefOpToken with ocMatRef. */
formula::FormulaToken* AddMatrixSingleReference( const ScSingleRefData& rRef );
formula::FormulaToken* AddDoubleReference( const ScComplexRefData& rRef );
formula::FormulaToken* AddRangeName( sal_uInt16 n, sal_Int16 nSheet );
void AddRangeName( sal_uInt16 n, sal_Int16 nSheet );
formula::FormulaToken* AddDBRange( sal_uInt16 n );
formula::FormulaToken* AddExternalName( sal_uInt16 nFileId, const OUString& rName );
void AddExternalSingleReference( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef );
......
......@@ -2070,9 +2070,9 @@ FormulaToken* ScTokenArray::AddMatrix( const ScMatrixRef& p )
return Add( new ScMatrixToken( p ) );
}
FormulaToken* ScTokenArray::AddRangeName( sal_uInt16 n, sal_Int16 nSheet )
void ScTokenArray::AddRangeName( sal_uInt16 n, sal_Int16 nSheet )
{
return Add( new FormulaIndexToken( ocName, n, nSheet));
Add( new FormulaIndexToken( ocName, n, nSheet));
}
FormulaToken* ScTokenArray::AddDBRange( sal_uInt16 n )
......
......@@ -46,7 +46,7 @@ void ScFormatFilterPluginImpl::ScExportDif( SvStream& rStream, ScDocument* pDoc,
ScExportDif( rStream, pDoc, ScRange( aStart, aEnd ), eNach );
}
FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc,
void ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc,
const ScRange&rRange, const rtl_TextEncoding eCharSet )
{
OSL_ENSURE( rRange.aStart <= rRange.aEnd, "*ScExportDif(): Range not sorted!" );
......@@ -90,7 +90,6 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
const sal_Char* pNumData = "0,";
const sal_Char* pNumDataERROR = "0,0\nERROR\n";
FltError eRet = eERR_OK;
OUStringBuffer aOS;
OUString aString;
SCCOL nEndCol = rRange.aEnd.Col();
......@@ -265,8 +264,6 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
// restore original value
rOut.SetStreamCharSet( eStreamCharSet );
return eRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -289,7 +289,7 @@ public:
// various export filters
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) override;
virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest ) override;
virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) override;
virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) override;
virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions ) override;
virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) override;
......
......@@ -2230,7 +2230,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, rtl_TextEncoding ) override { return eERR_INTERN; }
virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress&, const rtl_TextEncoding ) override {}
virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) override { return eERR_INTERN; }
virtual void ScExportDif( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) override {}
virtual void ScExportHTML( SvStream&, const OUString&, ScDocument*, const ScRange&, const rtl_TextEncoding, bool,
const OUString&, OUString&, const OUString& ) override {}
virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) override {}
......
......@@ -34,13 +34,11 @@ CategoryListBox::~CategoryListBox()
{
}
sal_Int32 CategoryListBox::InsertCategory( const OUString& rStr )
void CategoryListBox::InsertCategory( const OUString& rStr )
{
sal_Int32 n = ListBox::InsertEntry( rStr );
if( n != LISTBOX_ENTRY_NOTFOUND )
ListBox::SetEntryFlags( n, ListBox::GetEntryFlags(n) | ListBoxEntryFlags::DisableSelection );
return n;
}
void CategoryListBox::UserDraw( const UserDrawEvent& rUDEvt )
......
......@@ -33,7 +33,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
sal_Int32 InsertCategory( const OUString& rStr );
void InsertCategory( const OUString& rStr );
DECL_LINK_TYPED(implDoubleClickHdl, ListBox&, void);
......
......@@ -631,7 +631,7 @@ bool ClientBox::Notify( NotifyEvent& rNEvt )
return true;
}
long ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
{
long nPos = 0;
......@@ -664,8 +664,6 @@ long ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
Invalidate();
m_bNeedsRecalc = true;
return nPos;
}
void ClientBox::clearEntries()
......
......@@ -147,7 +147,7 @@ public:
void RecalcAll();
void selectEntry( const long nPos );
long addEntry(const std::shared_ptr<ClientInfo>& pClientInfo);
void addEntry(const std::shared_ptr<ClientInfo>& pClientInfo);
void clearEntries();
OUString getPin();
......
......@@ -93,19 +93,14 @@ void SdrPaintView::AppendPaintWindow(SdrPaintWindow& rNew)
maPaintWindows.push_back(&rNew);
}
SdrPaintWindow* SdrPaintView::RemovePaintWindow(SdrPaintWindow& rOld)
void SdrPaintView::RemovePaintWindow(SdrPaintWindow& rOld)
{
SdrPaintWindow* pRetval = nullptr;
const SdrPaintWindowVector::iterator aFindResult = ::std::find(maPaintWindows.begin(), maPaintWindows.end(), &rOld);
if(aFindResult != maPaintWindows.end())
{
// remember return value, aFindResult is no longer valid after deletion
pRetval = *aFindResult;
maPaintWindows.erase(aFindResult);
}
return pRetval;
}
OutputDevice* SdrPaintView::GetFirstOutputDevice() const
......
......@@ -34,7 +34,7 @@ class IDocumentListsAccess
virtual void deleteList( const OUString& rListId ) = 0;
virtual SwList* getListByName( const OUString& rListId ) const = 0;
virtual SwList* createListForListStyle( const OUString& rListStyleName ) = 0;
virtual void createListForListStyle( const OUString& rListStyleName ) = 0;
virtual SwList* getListForListStyle( const OUString& rListStyleName ) const = 0;
virtual void deleteListForListStyle( const OUString& rListStyleName ) = 0;
virtual void deleteListsByDefaultListStyle( const OUString& rListStyleName ) = 0;
......
......@@ -451,7 +451,7 @@ public:
void ApplyAutoMark();
/// Key for managing index.
sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
void SetOutlineNumRule(const SwNumRule&);
const SwNumRule* GetOutlineNumRule() const;
......
......@@ -479,7 +479,7 @@ public:
rRect contains rect of Fly (for its highlight). */
SwChainRet Chainable( SwRect &rRect, const SwFrameFormat &rSource, const Point &rPt ) const;
SwChainRet Chain( SwFrameFormat &rSource, const Point &rPt );
SwChainRet Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest );
void Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest );
void Unchain( SwFrameFormat &rFormat );
void HideChainMarker();
void SetChainMarker();
......
......@@ -83,25 +83,25 @@ SwList* DocumentListsManager::getListByName( const OUString& sListId ) const