unotools/source/config/historyoptions.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 2b332cace587fadd645de375c8327e58e7ca10cb
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Tue Jun 6 23:22:37 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Jun 12 15:56:49 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>
    (cherry picked from commit 1b368909b09cd62494239faaea09bb500dc9f19d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152880
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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

Reply via email to