chart2/source/view/main/ShapeFactory.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit d1568521a0205ca557d7c4bb488d5a8ccc72c442
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Feb 9 18:33:22 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 10 07:49:36 2022 +0100

    can avoid UNO_QUERY here
    
    Change-Id: Ie43759ab2771a40a0553eb61847766932cac2e47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129736
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/view/main/ShapeFactory.cxx 
b/chart2/source/view/main/ShapeFactory.cxx
index f9fde5fcae69..c327ea08024c 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -120,8 +120,8 @@ rtl::Reference<SvxShapeGroupAnyD> 
ShapeFactory::getOrCreateChartRootShape(
     // shape is identified by having the name com.sun.star.chart2.shapes.
     rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, 
nullptr);
     xShapeGroup->setShapeKind(SdrObjKind::Group);
-    uno::Reference<drawing::XShape> 
xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY);
-    xDrawPage->addBottom(xShape);
+    // cast to resolve ambiguity in converting to XShape
+    xDrawPage->addBottom(static_cast<SvxShape*>(xShapeGroup.get()));
 
     setShapeName(xShapeGroup, "com.sun.star.chart2.shapes");
     xShapeGroup->setSize(awt::Size(0,0));
@@ -1731,8 +1731,8 @@ rtl::Reference< SvxShapeGroup >
         //create and add to target
         rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, 
nullptr);
         xShapeGroup->setShapeKind(SdrObjKind::Group);
-        uno::Reference< drawing::XShape > 
xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), 
uno::UNO_QUERY_THROW);
-        xTarget->add(xShape);
+        // cast to resolve ambiguity in converting to XShape
+        xTarget->add(static_cast<SvxShape*>(xShapeGroup.get()));
 
         //set name
         if(!aName.isEmpty())
@@ -1763,8 +1763,8 @@ rtl::Reference< SvxShapeGroup >
         //create and add to target
         rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, 
nullptr);
         xShapeGroup->setShapeKind(SdrObjKind::Group);
-        uno::Reference< drawing::XShape > 
xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), 
uno::UNO_QUERY_THROW);
-        xTarget->add(xShape);
+        // cast to resolve ambiguity in converting to XShape
+        xTarget->add(static_cast<SvxShape*>(xShapeGroup.get()));
 
         //set name
         if(!aName.isEmpty())

Reply via email to