[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - writerfilter/source

Michael Stahl mstahl at redhat.com
Wed Jul 10 05:09:10 PDT 2013


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit e84e62f2700097bacccd34749fa453d602c5eabd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 10 12:38:16 2013 +0200

    writerfilter: not every field has a Content property
    
    ... so don't try to get it unconditionally  (but SetExpression does
    have it).
    
    (regression from c7e4264bed4e77daccf2f72063e5e00f1008c3cf)
    
    Change-Id: I14d24bd70f569ba0bc4f1e48d56ebf43c1441783
    (cherry picked from commit 1c90902cbccd4e4f5946dfc454da351c33c24f71)

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index cb15550..025ad2e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3339,9 +3339,12 @@ void DomainMapper_Impl::SetFieldResult( OUString& rResult )
                         bool bIsSetExpression = xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression");
                         // If we already have content set, then use the current presentation
                         rtl::OUString sValue;
-                        uno::Any aValue = xFieldProperties->getPropertyValue(
-                                rPropNameSupplier.GetName(PROP_CONTENT));
-                        aValue >>= sValue;
+                        if (bIsSetExpression)
+                        {   // this will throw for field types without Content
+                            uno::Any aValue(xFieldProperties->getPropertyValue(
+                                    rPropNameSupplier.GetName(PROP_CONTENT)));
+                            aValue >>= sValue;
+                        }
                         xFieldProperties->setPropertyValue(
                                 rPropNameSupplier.GetName(bIsSetExpression && sValue.isEmpty()? PROP_CONTENT : PROP_CURRENT_PRESENTATION),
                              uno::makeAny( rResult ));


More information about the Libreoffice-commits mailing list