[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sfx2/source

Julien Nabet serval2412 at yahoo.fr
Wed Apr 11 21:45:27 UTC 2018


 sfx2/source/dialog/dinfdlg.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit c522b4017915b3a12203ac39f48a75ae6f4a5bc0
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 20 23:50:04 2018 +0100

    tdf#115853: save current custom property when adding line
    
    by reloading current lines before adding a brand new one
    indeed the info are deleted by ClearCustomProperties
    each time SfxDocumentInfoItem destructor is called
    
    Change-Id: Id1e2e652e90c720f00b8612aa9afbfa91b784d1d
    Reviewed-on: https://gerrit.libreoffice.org/50070
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Reviewed-on: https://gerrit.libreoffice.org/52349
    Reviewed-by: Jean-Baptiste Faure <jbfaure at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 0fef104c23d0..06fbcb353ddd 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -2119,6 +2119,20 @@ void SfxCustomPropertiesPage::dispose()
 
 IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, Button*, void)
 {
+    // tdf#115853: reload current lines before adding a brand new one
+    // indeed the info are deleted by ClearCustomProperties
+    // each time SfxDocumentInfoItem destructor is called
+    SfxDocumentInfoItem pInfo;
+    Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCustomProperties();
+    sal_Int32 i = 0, nCount = aPropertySeq.getLength();
+    for ( ; i < nCount; ++i )
+    {
+        if ( !aPropertySeq[i].Name.isEmpty() )
+        {
+            pInfo.AddCustomProperty( aPropertySeq[i].Name, aPropertySeq[i].Value );
+        }
+    }
+
     Any aAny;
     m_pPropertiesCtrl->AddLine( OUString(), aAny, true );
 }


More information about the Libreoffice-commits mailing list