cui/source/dialogs/cuihyperdlg.cxx |   13 ++++---------
 cui/source/dialogs/iconcdlg.cxx    |    4 +---
 cui/source/inc/cuihyperdlg.hxx     |    2 ++
 3 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit ebfd2f10b400ad215ccd2263267f48a79b1427ef
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Wed May 3 17:01:10 2023 +0200
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Wed May 3 18:50:33 2023 +0200

    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.heini...@yahoo.de>

diff --git a/cui/source/dialogs/cuihyperdlg.cxx 
b/cui/source/dialogs/cuihyperdlg.cxx
index 782877d438f7..86fd3c1a2c8f 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 ede5c0582b5c..4aacf0e2b50e 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 cc85db7cfe3c..8423d8c49759 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;

Reply via email to