diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-10 12:38:16 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-10 12:44:34 +0200 |
commit | 1c90902cbccd4e4f5946dfc454da351c33c24f71 (patch) | |
tree | cef44cee6e40729c80c240ad2d6866a6df173a25 /writerfilter | |
parent | Remove an un-used mode on Application::Yield. (diff) | |
download | core-1c90902cbccd4e4f5946dfc454da351c33c24f71.tar.gz core-1c90902cbccd4e4f5946dfc454da351c33c24f71.zip |
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
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f3fc0eea125d..badcb445a4ca 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3399,9 +3399,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 )); |