summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/rtftok')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5e93fc27e6df..769191b45241 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4006,11 +4006,16 @@ int RTFDocumentImpl::popState()
case DESTINATION_COMPANY:
{
OUString aName = aState.nDestinationState == DESTINATION_OPERATOR ? OUString("Operator") : OUString("Company");
+ uno::Any aValue = uno::makeAny(m_aStates.top().aDestinationText.makeStringAndClear());
if (m_xDocumentProperties.is())
{
uno::Reference<beans::XPropertyContainer> xUserDefinedProperties = m_xDocumentProperties->getUserDefinedProperties();
- xUserDefinedProperties->addProperty(aName, beans::PropertyAttribute::REMOVABLE,
- uno::makeAny(m_aStates.top().aDestinationText.makeStringAndClear()));
+ uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
+ if (xPropertySetInfo->hasPropertyByName(aName))
+ xPropertySet->setPropertyValue(aName, aValue);
+ else
+ xUserDefinedProperties->addProperty(aName, beans::PropertyAttribute::REMOVABLE, aValue);
}
}
break;