unotools/source/config/historyoptions.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 1b368909b09cd62494239faaea09bb500dc9f19d Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Tue Jun 6 23:22:37 2023 +0200 Commit: Andreas Heinisch <andreas.heini...@yahoo.de> CommitDate: Thu Jun 8 15:05:33 2023 +0200 tdf#38742 - Start Center: odb files messes up pinned documents Opening an odb file will mess up the pinned documents in the start center. To fix this issue, newly appended items will be moved to their correct position after their creation in the history vector. Change-Id: I991ae3ae1018198e054eba3477bb948d7df85b44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152689 Tested-by: Andreas Heinisch <andreas.heini...@yahoo.de> Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 7578bd190d47..0b9e4d717b83 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -273,7 +273,13 @@ void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& sFi if (oIsPinned) { xSet->setPropertyValue(s_sPinned, uno::Any(*oIsPinned)); + if (*oIsPinned) + PrependItem(xCfg, xOrderList, sURL); + else + MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); } + else + MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL); ::comphelper::ConfigurationHelper::flush(xCfg); }