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() );