Kaydet (Commit) d39b9c29 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:simplifybool

Change-Id: I4811afde43947a51938c3b67c7f35dab473f0b08
üst 2f6497b0
...@@ -615,7 +615,7 @@ void Shell::CheckWindows() ...@@ -615,7 +615,7 @@ void Shell::CheckWindows()
void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLibName, bool bDestroy ) void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLibName, bool bDestroy )
{ {
bool bChangeCurWindow = pCurWin ? false : true; bool bChangeCurWindow = pCurWin == nullptr;
std::vector<BaseWindow*> aDeleteVec; std::vector<BaseWindow*> aDeleteVec;
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it) for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{ {
...@@ -640,7 +640,7 @@ void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLib ...@@ -640,7 +640,7 @@ void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLib
void Shell::UpdateWindows() void Shell::UpdateWindows()
{ {
// remove all windows that may not be displayed // remove all windows that may not be displayed
bool bChangeCurWindow = pCurWin ? false : true; bool bChangeCurWindow = pCurWin == nullptr;
if ( !m_aCurLibName.isEmpty() ) if ( !m_aCurLibName.isEmpty() )
{ {
std::vector<BaseWindow*> aDeleteVec; std::vector<BaseWindow*> aDeleteVec;
......
...@@ -76,7 +76,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName ) ...@@ -76,7 +76,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
aMacroName = aStdMacroText; aMacroName = aStdMacroText;
aMacroName += OUString::number( nMacro ); aMacroName += OUString::number( nMacro );
// test whether existing... // test whether existing...
bValid = pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ) ? false : true; bValid = pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ) == nullptr;
nMacro++; nMacro++;
} }
} }
......
...@@ -403,7 +403,7 @@ void MacroChooser::CheckButtons() ...@@ -403,7 +403,7 @@ void MacroChooser::CheckButtons()
if (nMode != Recording) if (nMode != Recording)
{ {
// Run... // Run...
bool bEnable = pMethod ? true : false; bool bEnable = pMethod != nullptr;
if (nMode != ChooseOnly && StarBASIC::IsRunning()) if (nMode != ChooseOnly && StarBASIC::IsRunning())
bEnable = false; bEnable = false;
EnableButton(*m_pRunButton, bEnable); EnableButton(*m_pRunButton, bEnable);
...@@ -412,10 +412,10 @@ void MacroChooser::CheckButtons() ...@@ -412,10 +412,10 @@ void MacroChooser::CheckButtons()
// organising still possible? // organising still possible?
// Assign... // Assign...
EnableButton(*m_pAssignButton, pMethod ? true : false); EnableButton(*m_pAssignButton, pMethod != nullptr);
// Edit... // Edit...
EnableButton(*m_pEditButton, pMacroEntry ? true : false); EnableButton(*m_pEditButton, pMacroEntry != nullptr);
// Organizer... // Organizer...
EnableButton(*m_pOrganizeButton, !StarBASIC::IsRunning() && nMode == All); EnableButton(*m_pOrganizeButton, !StarBASIC::IsRunning() && nMode == All);
...@@ -425,7 +425,7 @@ void MacroChooser::CheckButtons() ...@@ -425,7 +425,7 @@ void MacroChooser::CheckButtons()
bool bShare = ( aDesc.GetLocation() == LIBRARY_LOCATION_SHARE ); bool bShare = ( aDesc.GetLocation() == LIBRARY_LOCATION_SHARE );
EnableButton(*m_pDelButton, !StarBASIC::IsRunning() && nMode == All && !bProtected && !bReadOnly && !bShare); EnableButton(*m_pDelButton, !StarBASIC::IsRunning() && nMode == All && !bProtected && !bReadOnly && !bShare);
bool bPrev = bNewDelIsDel; bool bPrev = bNewDelIsDel;
bNewDelIsDel = pMethod ? true : false; bNewDelIsDel = pMethod != nullptr;
if (bPrev != bNewDelIsDel && nMode == All) if (bPrev != bNewDelIsDel && nMode == All)
{ {
OUString aBtnText( bNewDelIsDel ? IDEResId(RID_STR_BTNDEL).toString() : IDEResId(RID_STR_BTNNEW).toString() ); OUString aBtnText( bNewDelIsDel ? IDEResId(RID_STR_BTNDEL).toString() : IDEResId(RID_STR_BTNNEW).toString() );
......
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