[Libreoffice-commits] core.git: writerfilter/source
Charu Tyagi
charu.tyagi at ericsson.com
Tue Jul 29 06:23:21 PDT 2014
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 706f1b715c954b890a0c2515834c70a819cfa18d
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date: Fri Jul 18 14:32:10 2014 +0530
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 at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8bcce94..17cbe64 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>
@@ -2828,13 +2832,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
More information about the Libreoffice-commits
mailing list