sc/source/ui/condformat/condformatmgr.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit a2b4620d4981ea205788b0a786845cf9ffdbf21d
Author:     Heiko Tietze <heiko.tie...@documentfoundation.org>
AuthorDate: Wed Jun 15 12:07:31 2022 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Jun 15 19:54:56 2022 +0200

    Related tdf#101285 - Remember position of conditional format dialog
    
    Change-Id: I4094fb46bb6130f4befcc25136424a45b90b9d92
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135897
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/condformat/condformatmgr.cxx 
b/sc/source/ui/condformat/condformatmgr.cxx
index 06954a7f65d1..d4a2980a6dfa 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -13,6 +13,7 @@
 #include <document.hxx>
 #include <conditio.hxx>
 #include <o3tl/safeint.hxx>
+#include <unotools/viewoptions.hxx>
 
 ScCondFormatManagerWindow::ScCondFormatManagerWindow(weld::TreeView& rTreeView,
     ScDocument& rDoc, ScConditionalFormatList* pFormatList)
@@ -99,11 +100,20 @@ 
ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument
     m_xBtnAdd->connect_clicked(LINK(this, ScCondFormatManagerDlg, AddBtnHdl));
     m_xTreeView->connect_row_activated(LINK(this, ScCondFormatManagerDlg, 
EditBtnHdl));
 
+    SvtViewOptions aDlgOpt(EViewType::Dialog, "CondFormatDialog");
+    if (aDlgOpt.Exists())
+        m_xDialog->set_window_state(aDlgOpt.GetWindowState().toUtf8());
+
     UpdateButtonSensitivity();
 }
 
 ScCondFormatManagerDlg::~ScCondFormatManagerDlg()
 {
+   // tdf#101285 - Remember position of dialog
+    SvtViewOptions aDlgOpt(EViewType::Dialog, "CondFormatDialog");
+    OString sWindowState
+        = m_xDialog->get_window_state(vcl::WindowDataMask::Pos);
+    aDlgOpt.SetWindowState(OUString::fromUtf8(sWindowState));
 }
 
 std::unique_ptr<ScConditionalFormatList> 
ScCondFormatManagerDlg::GetConditionalFormatList()

Reply via email to