diff options
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 145a9e4aebbc..6255a76e6c43 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2160,6 +2160,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 ); } |