tdf#122846: Close option dialog if restart is confirmed

use the same logic as 0fa14d58457e9418ff756a0efd66e365c4403a67

Change-Id: I485cb232bb787e176918caf2eee74b0fbb360e47
Reviewed-on: https://gerrit.libreoffice.org/66691
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/66733
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index bc2510f..e13da90 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -958,9 +958,10 @@
        m_pForceOpenGL->IsValueChangedFromSaved())
    {
        SolarMutexGuard aGuard;
        svtools::executeRestartDialog(
            comphelper::getProcessComponentContext(), nullptr,
            svtools::RESTART_REASON_OPENGL);
        if( svtools::executeRestartDialog(
                comphelper::getProcessComponentContext(), nullptr,
                svtools::RESTART_REASON_OPENGL))
            GetParentDialog()->EndDialog(RET_OK);
    }

    return bModified;
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 8124c7d..4d32aea 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -803,7 +803,8 @@
    if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory())
    {
        SolarMutexGuard aGuard;
        svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, svtools::RESTART_REASON_ADDING_PATH);
        if (svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, svtools::RESTART_REASON_ADDING_PATH))
            GetParentDialog()->EndDialog(RET_OK);
    }
}