summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-18 14:22:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-18 14:22:54 +0200
commit098b685e901974dc9d0248b6e2fd06644c954e84 (patch)
tree2ecfddbe94233692448caf0e2ddc235d515cdde4 /vcl
parent6959aff40692cc02c99efb6781091263f8a25a84 (diff)
No reason to silently misbehave when these UNO services are missing
...which e.g. made it unnecessarily hard to track down 7a23668e4f4e235c7a4e1c99e38506bd9c874be8 "Fix CppunitTest_cppcanvas_emfplus" Change-Id: I2f537fabb067b77e82b900bd2cba30fd65c275aa
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/vectorgraphicdata.cxx33
1 files changed, 13 insertions, 20 deletions
diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx
index 84673ba6a547..3bcb8fb7351a 100644
--- a/vcl/source/gdi/vectorgraphicdata.cxx
+++ b/vcl/source/gdi/vectorgraphicdata.cxx
@@ -158,33 +158,26 @@ void VectorGraphicData::ensureSequenceAndRange()
if(myInputStream.is())
{
// create Vector Graphic Data interpreter
- try
+ uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
+
+ if (VectorGraphicDataType::Emf == getVectorGraphicDataType()
+ || VectorGraphicDataType::Wmf == getVectorGraphicDataType())
{
- uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
+ const uno::Reference< graphic::XEmfParser > xEmfParser = graphic::EmfTools::create(xContext);
+ uno::Sequence< ::beans::PropertyValue > aSequence;
- if (VectorGraphicDataType::Emf == getVectorGraphicDataType()
- || VectorGraphicDataType::Wmf == getVectorGraphicDataType())
+ if (mpExternalHeader)
{
- const uno::Reference< graphic::XEmfParser > xEmfParser = graphic::EmfTools::create(xContext);
- uno::Sequence< ::beans::PropertyValue > aSequence;
-
- if (mpExternalHeader)
- {
- aSequence = mpExternalHeader->getSequence();
- }
-
- maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xEmfParser->getDecomposition(myInputStream, maPath, aSequence));
+ aSequence = mpExternalHeader->getSequence();
}
- else
- {
- const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext);
- maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xSvgParser->getDecomposition(myInputStream, maPath));
- }
+ maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xEmfParser->getDecomposition(myInputStream, maPath, aSequence));
}
- catch(const uno::Exception&)
+ else
{
- OSL_ENSURE(false, "Got no graphic::XSvgParser (!)" );
+ const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext);
+
+ maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xSvgParser->getDecomposition(myInputStream, maPath));
}
}