Unittest problem with service com.sun.star.drawing.GraphicExportFilter

Michael Stahl mst at libreoffice.org
Tue Oct 25 16:36:01 UTC 2022

On 25.10.22 18:24, Regina Henschel wrote:
> Hi all,
> this is about https://gerrit.libreoffice.org/c/core/+/141830
> tdf#83671 SmartArt: preserve pos and size for metafile
> If you try the patch, you will see, that the SmartArt is imported in 
> Calc as group object with one child object. The child is a 
> "com.sun.star.drawing.GraphicObjectShape". Copying to Draw shows, that 
> it is indeed a metafile. So the patch seems to be correct.
> But the unit test fails. It has the warning
> warn:oox.drawingml:2860:13240:oox/source/drawingml/shape.cxx:2039: 
> Shape::renderDiagramToGraphic com.sun.star.uno.DeploymentException 
> message: "component context fails to supply service 
> com.sun.star.drawing.GraphicExportFilter of type 
> com.sun.star.drawing.XGraphicExportFilter"
> The warning comes from method create() from class GraphicExportFilter, 
> where creating of "the_instance" fails. And so indeed no metafile is 
> created.
> I have no idea about the reason as in a normal running LO the import 
> works and resaving as ods or xlsx has no problems.

the unit test makefile is missing some component file.

many unit tests use the whole services.rdb but some unfortunately have a 
long list of individiual files inside a call to 

you can find the component file with a command like this:

> git grep com.sun.star.drawing.GraphicExportFilter $(git ls-files '*.component')
svx/util/svxcore.component:    <service 

then add the "svx/util/svxcore" to the gb_CppunitTest_use_components 
list in the test's CppunitTest_*.mk - don't forget the '\' must be the 
last character of the line.

More information about the LibreOffice mailing list