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

loplugin:returnconstant

Change-Id: I5b859de6ccd908eee4356acbe1f12b441ab36df3
Reviewed-on: https://gerrit.libreoffice.org/62539
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 034a4624
......@@ -593,7 +593,7 @@ void ModulWindow::ManageBreakPoints()
rBrkWin.Invalidate();
}
bool ModulWindow::BasicErrorHdl( StarBASIC const * pBasic )
void ModulWindow::BasicErrorHdl( StarBASIC const * pBasic )
{
GetShell()->GetViewFrame()->ToTop();
......@@ -630,11 +630,11 @@ bool ModulWindow::BasicErrorHdl( StarBASIC const * pBasic )
// #i47002#
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( !pWindow )
return false;
return;
if ( bMarkError )
m_aXEditorWindow->GetBrkWindow().SetNoMarker();
return false;
return;
}
BasicDebugFlags ModulWindow::BasicBreakHdl()
......
......@@ -199,7 +199,6 @@ class WatchTreeListBox final : public SvHeaderTabListBox
virtual bool EditingEntry( SvTreeListEntry* pEntry, Selection& rSel ) override;
virtual bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) override;
bool ImplBasicEntryEdited( SvTreeListEntry* pEntry, const OUString& rResult );
SbxBase* ImplGetSBXForEntry( SvTreeListEntry* pEntry, bool& rbArrayElement );
public:
......@@ -352,7 +351,7 @@ public:
void UpdateBreakPoint( const BreakPoint& rBrk );
void BasicAddWatch();
bool BasicErrorHdl( StarBASIC const * pBasic );
void BasicErrorHdl( StarBASIC const * pBasic );
BasicDebugFlags BasicBreakHdl();
void AssertValidEditEngine();
......
......@@ -2278,11 +2278,9 @@ bool WatchTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNe
if( cFirst == '\"' && cLast == '\"' )
aResult = aResult.copy( 1, nResultLen - 2 );
return aResult != aEditingRes && ImplBasicEntryEdited(pEntry, aResult);
}
if (aResult == aEditingRes)
return false;
bool WatchTreeListBox::ImplBasicEntryEdited( SvTreeListEntry* pEntry, const OUString& rResult )
{
bool bArrayElement;
SbxBase* pSBX = ImplGetSBXForEntry( pEntry, bArrayElement );
......@@ -2294,7 +2292,7 @@ bool WatchTreeListBox::ImplBasicEntryEdited( SvTreeListEntry* pEntry, const OUSt
{
// If the type is variable, the conversion of the SBX does not matter,
// else the string is converted.
pVar->PutStringExt( rResult );
pVar->PutStringExt( aResult );
}
}
......
......@@ -1242,11 +1242,10 @@ VclPtr<BaseWindow> Shell::FindWindow(
bool Shell::CallBasicErrorHdl( StarBASIC const * pBasic )
{
bool bRet = false;
VclPtr<ModulWindow> pModWin = ShowActiveModuleWindow( pBasic );
if ( pModWin )
bRet = pModWin->BasicErrorHdl( pBasic );
return bRet;
pModWin->BasicErrorHdl( pBasic );
return false;
}
BasicDebugFlags Shell::CallBasicBreakHdl( StarBASIC const * pBasic )
......
......@@ -273,8 +273,7 @@ namespace oglcanvas
if( !bIsVisible || !mxContext->isInitialized() || !mpSpriteCanvas )
return false;
if( !activateWindowContext() )
return false;
mxContext->makeCurrent();
SystemChildWindow* pChildWindow = mxContext->getChildWindow();
const ::Size& rOutputSize = pChildWindow->GetSizePixel();
......@@ -503,12 +502,6 @@ namespace oglcanvas
setupUniforms(mnRectangularTwoColorGradientProgram, pColors[0], pColors[1], rTexTransform);
}
bool SpriteDeviceHelper::activateWindowContext()
{
mxContext->makeCurrent();
return true;
}
namespace
{
......
......@@ -112,8 +112,6 @@ namespace oglcanvas
/// Get instance of internal texture cache
TextureCache& getTextureCache() const;
bool activateWindowContext();
private:
/// Pointer to sprite canvas (owner of this helper), needed to create bitmaps
SpriteCanvas* mpSpriteCanvas;
......
......@@ -321,7 +321,7 @@ namespace vclcanvas
return maText;
}
bool TextLayout::draw( OutputDevice& rOutDev,
void TextLayout::draw( OutputDevice& rOutDev,
const Point& rOutpos,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) const
......@@ -352,8 +352,6 @@ namespace vclcanvas
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
return true;
}
namespace
......
......@@ -82,7 +82,7 @@ namespace vclcanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
bool draw( OutputDevice& rOutDev,
void draw( OutputDevice& rOutDev,
const Point& rOutpos,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
......
......@@ -326,7 +326,7 @@ private:
DECL_LINK(NewDelActionHdl, AutoCorrEdit&, bool);
DECL_LINK(SelectHdl, ListBox&, void);
DECL_LINK(ModifyHdl, Edit&, void);
bool NewDelHdl(void const *);
void NewDelHdl(void const *);
/// Box filled with new language
void RefillReplaceBoxes(bool bFromReset,
LanguageType eOldLanguage,
......
......@@ -42,7 +42,7 @@ class SfxMacroTabPage final : public SfxTabPage
DECL_LINK( AssignDeleteHdl_Impl, SvTreeListBox*, bool );
DECL_LINK( AssignDeleteClickHdl_Impl, Button *, void );
bool AssignDeleteHdl(Control const *);
void AssignDeleteHdl(Control const *);
DECL_LINK( TimeOut_Impl, Timer*, void );
std::unique_ptr<SfxMacroTabPage_Impl> mpImpl;
......
......@@ -1652,10 +1652,11 @@ IMPL_LINK(OfaAutocorrExceptPage, NewDelButtonHdl, Button*, pBtn, void)
IMPL_LINK(OfaAutocorrExceptPage, NewDelActionHdl, AutoCorrEdit&, rEdit, bool)
{
return NewDelHdl(&rEdit);
NewDelHdl(&rEdit);
return false;
}
bool OfaAutocorrExceptPage::NewDelHdl(void const * pBtn)
void OfaAutocorrExceptPage::NewDelHdl(void const * pBtn)
{
if((pBtn == m_pNewAbbrevPB || pBtn == m_pAbbrevED.get() )
&& !m_pAbbrevED->GetText().isEmpty())
......@@ -1679,7 +1680,6 @@ bool OfaAutocorrExceptPage::NewDelHdl(void const * pBtn)
m_pDoubleCapsLB->RemoveEntry(m_pDoubleCapsED->GetText());
ModifyHdl(*m_pDoubleCapsED);
}
return false;
}
IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, ListBox&, rBox, void)
......
......@@ -307,17 +307,18 @@ IMPL_LINK( SfxMacroTabPage, AssignDeleteClickHdl_Impl, Button*, pBtn, void )
IMPL_LINK( SfxMacroTabPage, AssignDeleteHdl_Impl, SvTreeListBox*, pBtn, bool )
{
return AssignDeleteHdl(pBtn);
AssignDeleteHdl(pBtn);
return false;
}
bool SfxMacroTabPage::AssignDeleteHdl(Control const * pBtn)
void SfxMacroTabPage::AssignDeleteHdl(Control const * pBtn)
{
SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
SvTreeListEntry* pE = rListBox.FirstSelected();
if( !pE || LISTBOX_ENTRY_NOTFOUND == rListBox.GetModel()->GetAbsPos( pE ) )
{
DBG_ASSERT( pE, "Where does the empty entry come from?" );
return false;
return;
}
const bool bAssEnabled = pBtn != mpImpl->pDeletePB && mpImpl->pAssignPB->IsEnabled();
......@@ -351,7 +352,6 @@ bool SfxMacroTabPage::AssignDeleteHdl(Control const * pBtn)
rListBox.SetUpdateMode( true );
EnableButtons();
return false;
}
IMPL_LINK( SfxMacroTabPage, TimeOut_Impl, Timer*,, void )
......
......@@ -114,7 +114,7 @@ namespace dbaui
void adjustFormat();
void eraseTokens();
void insertValueIntoColumn();
bool createRowSet();
void createRowSet();
void showErrorDialog(const css::sdbc::SQLException& e);
void ensureFormatter();
......
......@@ -670,10 +670,9 @@ void ODatabaseExport::CreateDefaultColumn(const OUString& _rColumnName)
m_vDestVector.emplace_back(m_aDestColumns.emplace(aAlias,pField).first);
}
bool ODatabaseExport::createRowSet()
void ODatabaseExport::createRowSet()
{
m_pUpdateHelper.reset(new OParameterUpdateHelper(createPreparedStatment(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions)));
return true;
}
bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTextColor, const FontDescriptor& _rFont)
......@@ -725,7 +724,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
bError = true;
if(!bError)
bError = !createRowSet();
createRowSet();
}
catch( const SQLException&)
{
......
......@@ -559,7 +559,7 @@ public:
return nType;
}
bool setNumberFormat( const OUString& rFormat )
void setNumberFormat( const OUString& rFormat )
{
// #163288# treat "General" as "Standard" format
sal_Int32 nNewIndex = 0;
......@@ -573,7 +573,6 @@ public:
nNewIndex = mxFormats->addNew( rFormat, aLocale );
}
mxRangeProps->setPropertyValue( "NumberFormat", uno::makeAny( nNewIndex ) );
return true;
}
void setNumberFormat( sal_Int16 nType )
......
......@@ -817,12 +817,10 @@ namespace slideshow
nYBorder );
}
bool ViewShape::enterAnimationMode()
void ViewShape::enterAnimationMode()
{
mbForceUpdate = true;
mbAnimationMode = true;
return true;
}
void ViewShape::leaveAnimationMode()
......
......@@ -99,10 +99,8 @@ namespace slideshow
This method enters animation mode on the associate
target view. The shape can be animated in parallel on
different views.
@return whether the mode change finished successfully.
*/
bool enterAnimationMode();
void enterAnimationMode();
/** Notify the ViewShape that it is no longer animated
......
......@@ -621,10 +621,8 @@ public:
/// Apply ViewOptions with Start-/EndAction.
virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
/** Query text within selection.
@returns FALSE, if selected range is too large to be copied
into string buffer or if other errors occur. */
bool GetSelectedText( OUString &rBuf,
/** Query text within selection. */
void GetSelectedText( OUString &rBuf,
ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
/** @return graphic, if CurrentCursor->Point() points to a SwGrfNode
......
......@@ -117,7 +117,8 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
pCursor->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() );
OUString sBuf;
if( GetSelectedText( sBuf, ParaBreakType::ToOnlyCR ) && !sBuf.isEmpty() )
GetSelectedText( sBuf, ParaBreakType::ToOnlyCR );
if( !sBuf.isEmpty() )
nRet = rBlock.PutText( rShortName, rName, sBuf );
}
else
......@@ -248,10 +249,8 @@ bool SwEditShell::CopySelToDoc( SwDoc* pInsDoc )
}
/** Get text in a Selection
*
* @return false if the selected area is too big for being copied into the string buffer
*/
bool SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
void SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
{
GetCursor(); // creates all cursors if needed
if( IsSelOnePara() )
......@@ -328,8 +327,6 @@ bool SwEditShell::GetSelectedText( OUString &rBuf, ParaBreakType nHndlParaBrk )
}
}
}
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -306,12 +306,7 @@ bool SwGlossaryHdl::NewGlossary(const OUString& rName, const OUString& rShortNam
OUString* pOnlyText = nullptr;
if( bNoAttr )
{
if( !pWrtShell->GetSelectedText( sOnlyText, ParaBreakType::ToOnlyCR ))
{
if (!pCurGrp)
delete pTmp;
return false;
}
pWrtShell->GetSelectedText( sOnlyText, ParaBreakType::ToOnlyCR );
pOnlyText = &sOnlyText;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment