cui/source/dialogs/hlmarkwn.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit bf927cb4513f8ef2a5205e98fbcf1ff02c344b4a
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Fri Nov 3 14:07:34 2023 +0100
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Mon Nov 6 22:39:33 2023 +0100

    tdf#149935 - Hyperlink Target Dialog: remember last used position and size
    
    Change-Id: I87fdf78b6ec4963eb4450d937dd86209e03865a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158879
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index 7eb2ced02489..cf90450450ad 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -79,11 +79,19 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd(weld::Window* 
pParentDialog, SvxHyperlink
     mxBtApply->connect_clicked( LINK ( this, SvxHlinkDlgMarkWnd, 
ClickApplyHdl_Impl ) );
     mxBtClose->connect_clicked( LINK ( this, SvxHlinkDlgMarkWnd, 
ClickCloseHdl_Impl ) );
     mxLbTree->connect_row_activated( LINK ( this, SvxHlinkDlgMarkWnd, 
DoubleClickApplyHdl_Impl ) );
+
+    // tdf#149935 - remember last used position and size
+    SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id());
+    if (aDlgOpt.Exists())
+        m_xDialog->set_window_state(aDlgOpt.GetWindowState());
 }
 
 SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
 {
     ClearTree();
+    // tdf#149935 - remember last used position and size
+    SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id());
+    
aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize));
 }
 
 void SvxHlinkDlgMarkWnd::ErrorChanged()
@@ -126,7 +134,12 @@ sal_uInt16 SvxHlinkDlgMarkWnd::SetError( sal_uInt16 nError)
 // Move window
 void SvxHlinkDlgMarkWnd::MoveTo(const Point& rNewPos)
 {
-    m_xDialog->window_move(rNewPos.X(), rNewPos.Y());
+    // tdf#149935 - remember last used position and size
+    SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id());
+    if (aDlgOpt.Exists())
+        m_xDialog->set_window_state(aDlgOpt.GetWindowState());
+    else
+        m_xDialog->window_move(rNewPos.X(), rNewPos.Y());
 }
 
 namespace

Reply via email to