sfx2/source/dialog/filedlghelper.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit 9f5040abbfdb6057fc2455cd6726398dc8ba7b9b Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Fri Oct 20 14:33:06 2023 +0200 Commit: Andreas Heinisch <andreas.heini...@yahoo.de> CommitDate: Mon Dec 9 18:46:03 2024 +0100 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 <heiko.tie...@documentfoundation.org> Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> 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 <memory> #include <optional> #include <string_view> +#include <o3tl/test_info.hxx> #include <sfx2/filedlghelper.hxx> #include <sal/types.h> @@ -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<sal_Int32>(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<sal_Int32>(bValue) ) ); INetURLObject aObj( getPath() );