From 216d39140d20bc87c2eb29014c489866991c99ee Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Tue, 6 Oct 2026 10:19:47 +0200 Subject: [PATCH] tdf#47890 - Remember last used position and size of the mail merge dialog Change-Id: Ibc6ba048d9f330f499d873c220f750964438c52e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211862 Tested-by: Jenkins Reviewed-by: Andreas Heinisch --- sw/source/ui/envelp/mailmrge.cxx | 10 ++++++++++ sw/uiconfig/swriter/ui/mailmerge.ui | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 1e417539b455..174101bc7700 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -203,6 +204,11 @@ SwMailMergeDlg::SwMailMergeDlg(weld::Window* pParent, SwWrtShell& rShell, }; xD->dispatch(aURL, aProperties); m_xBeamerWin->show(); + + // tdf#47890 - remember last used position and size of the mail merge dialog + SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); + if (aDlgOpt.Exists()) + m_xDialog->set_window_state(aDlgOpt.GetWindowState()); } uno::Reference xController = m_xFrame->getController(); m_pImpl->xFController.set(xController, UNO_QUERY); @@ -352,6 +358,10 @@ SwMailMergeDlg::SwMailMergeDlg(weld::Window* pParent, SwWrtShell& rShell, SwMailMergeDlg::~SwMailMergeDlg() { if(m_xFrame.is()) { + // tdf#47890 - remember last used position and size of the mail merge dialog + SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id()); + aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); + m_xFrame->setComponent(nullptr, nullptr); m_xFrame->dispose(); } diff --git a/sw/uiconfig/swriter/ui/mailmerge.ui b/sw/uiconfig/swriter/ui/mailmerge.ui index 3f0869decb3c..10683a638d30 100644 --- a/sw/uiconfig/swriter/ui/mailmerge.ui +++ b/sw/uiconfig/swriter/ui/mailmerge.ui @@ -107,7 +107,7 @@ True False True - True + False 12 @@ -826,7 +826,7 @@ - True + False True 1