summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-20 23:50:04 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-12 23:46:03 +0100
commita1a60f79c6ffccfd49034a6251031e1f9a0c63a0 (patch)
treecb755dcbbffba636f35c4ccce95ef4c53fec9d10
parent489c7088b4a99720d1a2839ed52b3becd7aac342 (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>
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 69847ed42692..415e8af27ad9 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -2162,7 +2162,22 @@ void SfxCustomPropertiesPage::dispose()
IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, Button*, void)
{
- m_pPropertiesCtrl->AddLine( Any() );
+ // 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(aAny);
}
bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet )