tdf#90496 - Remember last used view in hyperlink dialog

Changed remembered last used view in hyperlink dialog from user
configuration to session.

Change-Id: Ifd04fc92d8ca8880d85c6cb52a7e364cff54a82e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151331
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 782877d..86fd3c1 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -79,6 +79,9 @@ void SvxHlinkCtrl::StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState e
    }
}

// tdf#90496 - remember last used view in hyperlink dialog
OUString SvxHpLinkDlg::msRememberedPageId("internet");

//#                                                                      #
//# Hyperlink - Dialog                                                   #
//#                                                                      #
@@ -135,15 +138,7 @@ SvxHpLinkDlg::SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld:
    }

    // tdf#90496 - remember last used view in hyperlink dialog
    OUString sPageId("internet");
    SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name());
    if (aViewOpt.Exists())
    {
        const OUString sSavedPageId = aViewOpt.GetPageID();
        if (GetPageData(sSavedPageId))
            sPageId = sSavedPageId;
    }
    SetCurPageId(sPageId);
    SetCurPageId(msRememberedPageId);

    // Init Dialog
    Start();
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index ede5c05..4aacf0e 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -23,7 +23,6 @@
#include <cassert>
#include <sal/log.hxx>
#include <vcl/svapp.hxx>
#include <unotools/viewoptions.hxx>

/**********************************************************************
|
@@ -150,8 +149,7 @@ void SvxHpLinkDlg::ActivatePageImpl()
    m_xDialog->set_help_id(pData->xPage->GetHelpId());

    // tdf#90496 - remember last used view in hyperlink dialog
    SvtViewOptions aViewOpt(EViewType::TabDialog, m_xDialog->get_accessible_name());
    aViewOpt.SetPageID(msCurrentPageId);
    msRememberedPageId = msCurrentPageId;

    m_xResetBtn->show();
}
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index cc85db7..8423d8c 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -68,6 +68,8 @@ private:
    std::vector< std::unique_ptr<IconChoicePageData> > maPageList;

    OUString msCurrentPageId;
    // tdf#90496 - remember last used view in hyperlink dialog
    static OUString msRememberedPageId;

    const SfxItemSet*       pSet;
    std::unique_ptr<SfxItemSet>     pOutSet;