diff options
author | Charu Tyagi <charu.tyagi@ericsson.com> | 2014-07-18 14:32:10 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-15 08:09:05 +0000 |
commit | 00f68a3375e39d293d5397375e257daf7e433bca (patch) | |
tree | 02b16c11070c1bff06857694f97d44f7203d4b5f | |
parent | bea74d73f4782b17f5286327f15db60ab3ae85de (diff) |
fdo#81486:custom property with the same name as Document Property not imported
Change-Id: Ieb9cba7b8969787140d6db3b77765e3a15bf89e1
Reviewed-on: https://gerrit.libreoffice.org/10381
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/11960
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ffa4bae80dfd..41d12af13f53 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertyContainer.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> #include <DomainMapper_Impl.hxx> #include <ConversionHelper.hxx> #include <SdtHelper.hxx> @@ -2856,13 +2860,18 @@ void DomainMapper_Impl::handleAuthor //Lines, Manager, NameofApplication, ODMADocId, Pages, //Security, }; + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(m_xTextDocument, uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); + const uno::Reference< beans::XPropertyContainer > xUserProps = xDocumentProperties->getUserDefinedProperties(); + uno::Reference<beans::XPropertySet> xUserDefinedProps(xDocumentProperties->getUserDefinedProperties(), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xUserDefinedProps->getPropertySetInfo(); //search for a field mapping OUString sFieldServiceName; sal_uInt16 nMap = 0; for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap); ++nMap ) { - if (rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) + if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && (!xPropertySetInfo->hasPropertyByName(rFirstParam))) { sFieldServiceName = OUString::createFromAscii |