Kaydet (Commit) be8c4145 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unusedmethods also check for functions returning bool

we were previously excluding them

Change-Id: I48a68799b0de60b4995fae541eb363e043d4dd11
Reviewed-on: https://gerrit.libreoffice.org/48167Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst be94207e
......@@ -51,16 +51,13 @@ namespace wrapper
void setWindow( intptr_t id );
bool takeSnapshot(const rtl::OUString& file);
void takeSnapshot(const rtl::OUString& file);
bool hasVout() const;
void setScale( float factor );
void setVideoSize( unsigned width, unsigned height );
unsigned getWidth() const;
unsigned getHeight() const;
operator libvlc_media_player_t*()
{
return mPlayer;
......
......@@ -180,20 +180,6 @@ namespace wrapper
libvlc_video_set_scale( mPlayer, factor );
}
unsigned Player::getWidth() const
{
unsigned width, height;
libvlc_video_get_size( mPlayer, 0, &width, &height );
return width;
}
unsigned Player::getHeight() const
{
unsigned width, height;
libvlc_video_get_size( mPlayer, 0, &width, &height );
return height;
}
void Player::setMouseHandling(bool flag)
{
libvlc_video_set_mouse_input( mPlayer, flag );
......@@ -243,11 +229,11 @@ namespace wrapper
#endif
}
bool Player::takeSnapshot( const rtl::OUString& file )
void Player::takeSnapshot( const rtl::OUString& file )
{
rtl::OString dest;
file.convertToString( &dest, RTL_TEXTENCODING_UTF8, 0 );
return libvlc_video_take_snapshot( mPlayer, 0, dest.getStr(), 480, 360 ) == 0;
libvlc_video_take_snapshot( mPlayer, 0, dest.getStr(), 480, 360 );
}
bool Player::hasVout() const
......
......@@ -62,9 +62,6 @@ public:
protected:
explicit ChartType( const ChartType & rOther );
const css::uno::Reference< css::uno::XComponentContext >&
GetComponentContext() const { return m_xContext;}
// ____ XChartType ____
// still abstract ! implement !
virtual OUString SAL_CALL getChartType() override = 0;
......
......@@ -162,7 +162,7 @@ public:
void dump(CppuOptions const & options);
bool dumpFile(
void dumpFile(
OUString const & uri, OUString const & name, bool hpp,
CppuOptions const & options);
......@@ -410,7 +410,7 @@ void CppuType::dump(CppuOptions const & options)
options.isValid("-O") ? b2u(options.getOption("-O")) : "", options);
}
bool CppuType::dumpFile(
void CppuType::dumpFile(
OUString const & uri, OUString const & name, bool hpp,
CppuOptions const & options)
{
......@@ -422,7 +422,7 @@ bool CppuType::dumpFile(
}
bool exists = fileExists(u2b(fileUri));
if (exists && options.isValid("-G")) {
return false;
return;
}
FileStream out;
out.createTempFile(getTempDir(u2b(fileUri)));
......@@ -449,7 +449,7 @@ bool CppuType::dumpFile(
throw;
}
out.close();
return makeValidTypeFile(
makeValidTypeFile(
u2b(fileUri), u2b(tmpUri), exists && options.isValid("-Gc"));
}
......
......@@ -1433,7 +1433,7 @@ namespace
}
}
bool flush()
void flush()
{
bool bRetval(true);
......@@ -1543,8 +1543,6 @@ namespace
// delete temp file (in all cases - it may be moved already)
osl::File::remove(aTempURL);
}
return bRetval;
}
bool tryPush(FileSharedPtr const & rFileCandidate, bool bCompress)
......
......@@ -209,9 +209,6 @@ for d in definitionSet:
# 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":
continue
# ignore UNO constructor method entrypoints
if "_get_implementation" in d[1] or "_getFactory" in d[1]:
continue
......
......@@ -221,7 +221,7 @@ namespace cppcanvas
css::rendering::XCanvasFont > createFont( double& o_rFontRotation,
const vcl::Font& rFont,
const ActionFactoryParameters& rParms );
bool createActions( GDIMetaFile& rMtf,
void createActions( GDIMetaFile& rMtf,
const ActionFactoryParameters& rParms,
bool bSubsettableActions );
bool createFillAndStroke( const ::basegfx::B2DPolyPolygon& rPolyPoly,
......
......@@ -1183,7 +1183,7 @@ namespace cppcanvas
}
}
bool ImplRenderer::createActions( GDIMetaFile& rMtf,
void ImplRenderer::createActions( GDIMetaFile& rMtf,
const ActionFactoryParameters& rFactoryParms,
bool bSubsettableActions )
{
......@@ -2594,8 +2594,6 @@ namespace cppcanvas
// correction for the unconditional increment here).
++io_rCurrActionIndex;
}
return true;
}
......
......@@ -2607,9 +2607,8 @@ void SbaXDataBrowserController::addColumnListeners(const Reference< css::awt::XC
}
}
bool SbaXDataBrowserController::InitializeGridModel(const Reference< css::form::XFormComponent > & /*xGrid*/)
void SbaXDataBrowserController::InitializeGridModel(const Reference< css::form::XFormComponent > & /*xGrid*/)
{
return true;
}
} // namespace dbaui
......
......@@ -576,7 +576,7 @@ void SbaTableQueryBrowser::initializePreviewMode()
}
}
bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XFormComponent > & xGrid)
void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XFormComponent > & xGrid)
{
try
{
......@@ -599,7 +599,7 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData());
OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeGridModel: No table available!" );
if ( !pData->xObjectProperties.is() )
return false;
return;
OUString* pStringIter = aProperties.getArray();
Any* pValueIter = aValues.getArray();
......@@ -803,10 +803,7 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
catch(const Exception&)
{
DBG_UNHANDLED_EXCEPTION();
return false;
}
return true;
}
Reference<XPropertySet> getColumnHelper(SvTreeListEntry const * _pCurrentlyDisplayed, const Reference<XPropertySet>& _rxSource)
......
......@@ -72,7 +72,7 @@ namespace dbaui
void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable);
void setNoneVisbleRow(sal_Int32 _nRows);
void SaveUIConfig();
bool reset();
void reset();
void GrabFocus();
// returns the add table dialog from the design view
......
......@@ -236,7 +236,7 @@ namespace dbaui
// do any initialization (data source etc.) here. the form should be fully functional after that.
// return sal_False if you didn't succeed (don't throw exceptions, they won't be caught)
virtual bool InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid);
virtual void InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid);
css::uno::Reference< css::form::XFormComponent > CreateGridModel();
// our default implementation simply instantiates a stardiv.one.form.component.Grid service
......
......@@ -205,7 +205,7 @@ namespace dbaui
private:
// SbaXDataBrowserController overridables
virtual bool InitializeForm( const css::uno::Reference< css::beans::XPropertySet >& i_formProperties ) override;
virtual bool InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid) override;
virtual void InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid) override;
virtual bool preReloadForm() override;
virtual void postReloadForm() override;
......
......@@ -277,16 +277,13 @@ Reference< XComponentContext > const & OQueryViewSwitch::getORB() const
return m_pDesignView->getORB();
}
bool OQueryViewSwitch::reset()
void OQueryViewSwitch::reset()
{
m_pDesignView->reset();
if ( !m_pDesignView->initByParseIterator( nullptr ) )
return false;
return;
if ( switchView( nullptr ) )
return false;
return true;
switchView( nullptr );
}
void OQueryViewSwitch::setNoneVisbleRow(sal_Int32 _nRows)
......
......@@ -602,53 +602,49 @@ bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
return ( RET_OK == aInfo->Execute() );
}
bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
void ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
bool bEnable )
{
if ( !xPackage.is() )
return false;
return;
if ( bEnable )
{
if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_ENABLE_SHARED_EXTENSION, m_bEnableWarning ) )
return false;
return;
}
else
{
if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_DISABLE_SHARED_EXTENSION, m_bDisableWarning ) )
return false;
return;
}
m_pManager->getCmdQueue()->enableExtension( xPackage, bEnable );
return true;
}
bool ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > &xPackage )
void ExtMgrDialog::removePackage( const uno::Reference< deployment::XPackage > &xPackage )
{
if ( !xPackage.is() )
return false;
return;
if ( !IsSharedPkgMgr( xPackage ) || m_bDeleteWarning )
{
if ( ! removeExtensionWarn( xPackage->getDisplayName() ) )
return false;
return;
}
if ( ! continueOnSharedExtension( xPackage, this, RID_STR_WARNING_REMOVE_SHARED_EXTENSION, m_bDeleteWarning ) )
return false;
return;
m_pManager->getCmdQueue()->removeExtension( xPackage );
return true;
}
bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > &xPackage )
void ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > &xPackage )
{
if ( !xPackage.is() )
return false;
return;
// get the extension with highest version
uno::Sequence<uno::Reference<deployment::XPackage> > seqExtensions =
......@@ -661,8 +657,6 @@ bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > &
vEntries.push_back(extension);
m_pManager->getCmdQueue()->checkForUpdates( vEntries );
return true;
}
......
......@@ -164,10 +164,10 @@ public:
void setGetExtensionsURL( const OUString &rURL );
virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &,
bool bLicenseMissing = false ) override;
bool enablePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage,
void enablePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage,
bool bEnable );
bool removePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage );
bool updatePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage );
void removePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage );
void updatePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage );
bool acceptLicense(const css::uno::Reference< css::deployment::XPackage > &xPackage );
TheExtensionManager* getExtensionManager() const { return m_pManager; }
......
......@@ -70,7 +70,7 @@ CommandImageResolver::~CommandImageResolver()
{
}
bool CommandImageResolver::registerCommands(Sequence<OUString>& aCommandSequence)
void CommandImageResolver::registerCommands(Sequence<OUString>& aCommandSequence)
{
sal_Int32 nSequenceSize = aCommandSequence.getLength();
......@@ -109,7 +109,6 @@ bool CommandImageResolver::registerCommands(Sequence<OUString>& aCommandSequence
m_aImageNameVector[i] = aImageName;
m_aCommandToImageNameMap[aCommandName] = aImageName;
}
return true;
}
bool CommandImageResolver::hasImage(const OUString& rCommandURL)
......
......@@ -43,7 +43,7 @@ public:
CommandImageResolver();
~CommandImageResolver();
bool registerCommands(css::uno::Sequence<OUString>& aCommandSequence);
void registerCommands(css::uno::Sequence<OUString>& aCommandSequence);
Image getImageFromCommandURL(ImageType nImageType, const OUString& rCommandURL);
std::vector<OUString>& getCommandNames()
......
......@@ -173,7 +173,7 @@ private:
sal_Int32 nTokenType = 0xffffffff );
/// Setup International class, new'ed only if different from existing.
bool setupInternational( const css::lang::Locale& rLocale );
void setupInternational( const css::lang::Locale& rLocale );
/// Implementation of getCharacterType() for one single character
static sal_Int32 getCharType( const OUString& Text, sal_Int32 *nPos, sal_Int32 increment);
......
......@@ -368,7 +368,7 @@ sal_Int32 cclass_Unicode::getParseTokensType(sal_uInt32 const c, bool const isFi
}
}
bool cclass_Unicode::setupInternational( const Locale& rLocale )
void cclass_Unicode::setupInternational( const Locale& rLocale )
{
bool bChanged = (aParserLocale.Language != rLocale.Language
|| aParserLocale.Country != rLocale.Country
......@@ -383,7 +383,6 @@ bool cclass_Unicode::setupInternational( const Locale& rLocale )
{
mxLocaleData.set( LocaleData2::create(m_xContext) );
}
return bChanged;
}
......
......@@ -56,7 +56,7 @@ public:
void setString(const OString& rStr) { m_aStr = rStr; }
const OString& getString() const { return m_aStr; }
bool ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm );
void ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm );
bool IsSet() const
{
return !m_aStr.isEmpty() || nValue != 0;
......
......@@ -187,16 +187,14 @@ public:
return false;
}
bool ReadIfDelimiter()
void ReadIfDelimiter()
{
if( GetToken().IsChar()
&& (';' == GetToken().GetChar()
|| ',' == GetToken().GetChar()) )
{
GetToken_Next();
return true;
}
return false;
}
sal_uInt32 Tell() const { return pCurToken-aTokList.begin(); }
......
......@@ -57,7 +57,7 @@ public:
SvMetaType* ReadKnownType();
void Read(char cChar);
bool ReadIfBoolAttribute( SvBOOL&, SvStringHashEntry const * pName);
bool ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName );
void ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName );
bool ReadIf(char cChar);
void ReadDelimiter();
bool ReadIfDelimiter();
......
......@@ -49,7 +49,7 @@ bool SvBOOL::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm
return false;
}
bool SvIdentifier::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm )
void SvIdentifier::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......@@ -70,10 +70,9 @@ bool SvIdentifier::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & r
bOk = rInStm.ReadIf( ')' );
}
if( bOk )
return true;
return;
}
rInStm.Seek( nTokPos );
return false;
}
void SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
......
......@@ -499,7 +499,7 @@ bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry const *
return false;
}
bool SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName )
void SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName )
{