summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-10 12:38:16 +0200
committerBosdonnat Cedric <cedric.bosdonnat@free.fr>2013-07-10 12:12:56 +0000
commit59b6eaa04abd755690c2f9cd3f24bcc0d0215a2e (patch)
tree26f0c99377dd340ae0bd80d47034c8e8e553b80c /writerfilter/source
parent83c2baaa83a667a8ab616e723d5ce05f4e3cfe33 (diff)
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) Reviewed-on: https://gerrit.libreoffice.org/4807 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2625b4f21827..e2b2ea54e0a3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3366,9 +3366,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 ));