tdf#120703 PVS: V581 ifs with identical conditions

V581 The conditional expressions of the 'if' statements situated
     alongside each other are identical.

Change-Id: I18562d60e33c7ecff14807976dde4cbcae3f665b
Reviewed-on: https://gerrit.libreoffice.org/70731
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 66a12ef..015224a 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -390,10 +390,11 @@
        case OBJECTTYPE_AXIS:
        {
            if( m_pParameter->HasScaleProperties() )
            {
                AddTabPage("scale", SchResId(STR_PAGE_SCALE), ScaleTabPage::Create);

            if( m_pParameter->HasScaleProperties() )//no positioning page for z axes so far as the tickmarks are not shown so far
                //no positioning page for z axes so far as the tickmarks are not shown so far
                AddTabPage("axispos", SchResId(STR_PAGE_POSITIONING), AxisPositionsTabPage::Create);
            }
            AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
            AddTabPage("axislabel", SchResId(STR_OBJECT_LABEL), SchAxisLabelTabPage::Create);
            if( m_pParameter->HasNumberProperties() )
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index dce277b..cfd3b30 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1565,10 +1565,7 @@
    if (bSuccess)
    {
        ++nPos;
    }

    if (bSuccess)
    {
        bSuccess = readDateTimeComponent(string, nPos, nMonth, 2, true);
        if (!bIgnoreInvalidOrMissingDate)
        {
@@ -1584,10 +1581,7 @@
    if (bSuccess)
    {
        ++nPos;
    }

    if (bSuccess)
    {
        bSuccess = readDateTimeComponent(string, nPos, nDay, 2, true);
        if (!bIgnoreInvalidOrMissingDate)
        {
@@ -1662,10 +1656,7 @@
        if (bSuccess)
        {
            ++nPos;
        }

        if (bSuccess)
        {
            bSuccess = readDateTimeComponent(string, nPos, nMinutes, 2, true);
            bSuccess &= (0 <= nMinutes) && (nMinutes < 60);
            bSuccess &= (nPos < string.getLength()); // not last token
@@ -1677,10 +1668,7 @@
        if (bSuccess)
        {
            ++nPos;
        }

        if (bSuccess)
        {
            bSuccess = readDateTimeComponent(string, nPos, nSeconds, 2, true);
            bSuccess &= (0 <= nSeconds) && (nSeconds < 60);
        }
@@ -1758,9 +1746,7 @@
        if (bSuccess)
        {
            ++nPos;
        }
        if (bSuccess)
        {

            bSuccess = readDateTimeComponent(
                        string, nPos, nTimezoneMinutes, 2, true);
            bSuccess &= (0 <= nTimezoneMinutes) && (nTimezoneMinutes < 60);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index e859750..a7b20ce 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1869,23 +1869,15 @@
                                  beans::PropertyState_DIRECT_VALUE );
    }

    // DataRowSource (calculated before)
    if( bRowSourceDetected )
    {
        // DataRowSource (calculated before)
        aResult.emplace_back( "DataRowSource", -1,
                                  uno::makeAny( eRowSource ), beans::PropertyState_DIRECT_VALUE );
    }

    // HasCategories
    if( bRowSourceDetected )
    {
        // HasCategories
        aResult.emplace_back( "HasCategories", -1,
                                  uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE );
    }

    // FirstCellAsLabel
    if( bRowSourceDetected )
    {
        // FirstCellAsLabel
        aResult.emplace_back( "FirstCellAsLabel", -1,
                                  uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE );
    }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 674af1c..3e4f6e3 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3703,10 +3703,9 @@
                }
            }
            if (!nRet)
                DrawMarkDropObj( nullptr );

            if (!nRet)
            {
                DrawMarkDropObj(nullptr);

                switch ( nMyAction )
                {
                    case DND_ACTION_COPY:
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 2bd0c59..17ac70d 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1764,11 +1764,9 @@
            for (const auto& a : aCreatedStyles)
                aUndoInsert.emplace_back(a.get(), true);
            pUndoMgr->AddUndoAction(std::make_unique<SdMoveStyleSheetsUndoAction>(this, aUndoInsert, true));
        }

        // Generate new master pages and register them with the document
        if( bUndo )
            // Generate new master pages and register them with the document
            BegUndo();
        }

        pMaster = AllocSdPage(true);
        pMaster->SetSize(pSelectedPage->GetSize());
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index a27e6ad..c07ed5b 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2767,10 +2767,9 @@
        }
        else if( !nPos1 )
            return;
    }

    if( !pHead )
        InitPredecessors();
    }

    if( !pPredecessor && pHead == pEntry )
        return; // is already the first one
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 162a5eb..9398f1d 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3562,8 +3562,7 @@

    // if we have an async load operation pending for the 0-th page for this view,
    // we need to cancel this
    FmFormPage* pPage = _rCurrentView.GetCurPage();
    if ( pPage )
    if (FmFormPage* pPage = _rCurrentView.GetCurPage())
    {
        // move all events from our queue to a new one, omit the events for the deactivated
        // page
@@ -3582,11 +3581,8 @@
            }
        }
        m_aLoadingPages = aNewEvents;
    }

    // remove callbacks at the page
    if ( pPage )
    {
        // remove callbacks at the page
        pPage->GetImpl().SetFormsCreationHdl( Link<FmFormPageImpl&,void>() );
    }
    UpdateForms_Lock(true);
diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx
index 6173518..f75ac0e 100644
--- a/svx/source/svdraw/charthelper.cxx
+++ b/svx/source/svdraw/charthelper.cxx
@@ -124,15 +124,13 @@

        try
        {
            // set background to transparent (none)
            uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground());
            if( xPageProp.is())
                xPageProp->setPropertyValue( "FillStyle",
                                             uno::makeAny( drawing::FillStyle_NONE ));
            // set no border
            if( xPageProp.is())
                xPageProp->setPropertyValue( "LineStyle",
                                             uno::makeAny( drawing::LineStyle_NONE ));
            if (uno::Reference< beans::XPropertySet > xPageProp = xChartDoc->getPageBackground())
            {
                // set background to transparent (none)
                xPageProp->setPropertyValue("FillStyle", uno::makeAny(drawing::FillStyle_NONE));
                // set no border
                xPageProp->setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_NONE));
            }
        }
        catch( const uno::Exception & )
        {
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index f53edaa..609ca2e 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -68,15 +68,14 @@

    const SwViewShell *pVSh = GetMap()->GetShell();
    assert(pVSh);
    bool bSelectable =  dynamic_cast<const SwFEShell*>( pVSh) !=  nullptr;

    // SELECTABLE
    if( bSelectable )
        rStateSet.AddState( AccessibleStateType::SELECTABLE );

    // FOCUSABLE
    if( bSelectable )
        rStateSet.AddState( AccessibleStateType::FOCUSABLE );
    if (dynamic_cast<const SwFEShell*>(pVSh))
    {
        // SELECTABLE
        rStateSet.AddState(AccessibleStateType::SELECTABLE);
        // FOCUSABLE
        rStateSet.AddState(AccessibleStateType::FOCUSABLE);
    }

    // SELECTED and FOCUSED
    if( IsSelected() )
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 3504588..dc2938a 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -226,14 +226,13 @@
    // MULTILINE
    rStateSet.AddState( AccessibleStateType::MULTI_LINE );

    // MULTISELECTABLE
    SwCursorShell *pCursorSh = GetCursorShell();
    if( pCursorSh )
        rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );

    // FOCUSABLE
    if( pCursorSh )
        rStateSet.AddState( AccessibleStateType::FOCUSABLE );
    if (GetCursorShell())
    {
        // MULTISELECTABLE
        rStateSet.AddState(AccessibleStateType::MULTI_SELECTABLE);
        // FOCUSABLE
        rStateSet.AddState(AccessibleStateType::FOCUSABLE);
    }

    // FOCUSED (simulates node index of cursor)
    SwPaM* pCaret = GetCursor( false ); // #i27301# - consider adjusted method signature
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index f02549e..7929b5a 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -224,14 +224,13 @@
    SwAddPrinterItem aAddPrinterItem(*pOpt );
    pRet->Put(aAddPrinterItem);

    // Options for Web background
    // Options for Web
    if(!bTextDialog)
    {
        pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
        pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
    }

    if(!bTextDialog)
        pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
    return pRet;
}

diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 9bc12925..ebd0e71 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -731,9 +731,6 @@
        return;
    }

    if( sSym.isEmpty() )
        return;

    // do not flicker
    pOLV->HideCursor();
    SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx b/writerperfect/source/writer/EPUBExportDialog.cxx
index f359098..c26516d 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -139,19 +139,13 @@
    if (xDPS.is())
        xDP = xDPS->getDocumentProperties();
    if (xDP.is())
    {
        m_xTitle->set_text(xDP->getTitle());

    if (xDP.is())
        m_xInitialCreator->set_text(xDP->getAuthor());

    if (xDP.is())
    {
        OUString aLanguage(LanguageTag::convertToBcp47(xDP->getLanguage(), false));
        m_xLanguage->set_text(aLanguage);
    }

    if (xDP.is())
    {
        OUStringBuffer aBuffer;
        util::DateTime aDate(xDP->getModificationDate());
        sax::Converter::convertDateTime(aBuffer, aDate, nullptr, true);