summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-20 23:50:04 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2018-04-11 23:44:27 +0200
commitc522b4017915b3a12203ac39f48a75ae6f4a5bc0 (patch)
tree59aebf0938b97c41c1da6b7f7447ace265663b54
parent4bb50524e385803fddc50474667777fcf7ce19e1 (diff)
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@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-on: https://gerrit.libreoffice.org/52349 Reviewed-by: Jean-Baptiste Faure <jbfaure@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx14
1 files changed, 14 insertions, 0 deletions
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 );
}