From 9f5040abbfdb6057fc2455cd6726398dc8ba7b9b Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Fri, 20 Oct 2023 14:33:06 +0200 Subject: [PATCH] tdf#61358 - Remember the last "insert as link" state Change-Id: I3fe88411092df159fa6dc39a8fb9eb3ab36eeb70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158254 Tested-by: Jenkins Reviewed-by: Heiko Tietze Reviewed-by: Andreas Heinisch --- sfx2/source/dialog/filedlghelper.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 9ada2fe6c2a2..07325adf3085 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -2081,10 +2082,19 @@ void FileDialogHelper_Impl::saveConfig() try { + // tdf#61358 - remember the last "insert as link" state + if (o3tl::IsRunningUITest()) + aValue <<= false; + else + aValue = xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); + bool bLink = false; + aValue >>= bLink; + OUString aUserData(GRF_CONFIG_STR); + SetToken(aUserData, 0, ' ', OUString::number(static_cast(bLink))); + aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ); bool bValue = false; aValue >>= bValue; - OUString aUserData(GRF_CONFIG_STR); SetToken( aUserData, 1, ' ', OUString::number( static_cast(bValue) ) ); INetURLObject aObj( getPath() );