chart2/source/view/inc/ShapeFactory.hxx  |    2 +-
 chart2/source/view/main/ShapeFactory.cxx |   21 ++++++++-------------
 2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 0249e598044b12e7f82cc6e95546687cfbbdfe38
Author:     Noel Grandin <[email protected]>
AuthorDate: Sun Jan 2 11:21:01 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun Jan 2 17:58:24 2022 +0100

    use more SvxShape in chart2
    
    Change-Id: Ib973fe1eb226ca6a55166ad8f3afeeca766ec8df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127860
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/chart2/source/view/inc/ShapeFactory.hxx 
b/chart2/source/view/inc/ShapeFactory.hxx
index 42468c1dd3e9..c61e6801a5ff 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -241,7 +241,7 @@ public:
     static css::uno::Reference< css::drawing::XShapes >
          getChartRootShape( const rtl::Reference<SvxDrawPage>& xPage );
 
-    static void makeShapeInvisible( const css::uno::Reference< 
css::drawing::XShape >& xShape );
+    static void makeShapeInvisible( const rtl::Reference< SvxShape >& rShape );
 
     static void setShapeName( const css::uno::Reference< css::drawing::XShape 
>& xShape
             , const OUString& rName );
diff --git a/chart2/source/view/main/ShapeFactory.cxx 
b/chart2/source/view/main/ShapeFactory.cxx
index 7fd5249ae4d6..457045a25ac5 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2335,21 +2335,16 @@ uno::Reference< drawing::XShapes > 
ShapeFactory::getChartRootShape(
     return xRet;
 }
 
-void ShapeFactory::makeShapeInvisible( const uno::Reference< drawing::XShape 
>& xShape )
+void ShapeFactory::makeShapeInvisible( const rtl::Reference< SvxShape >& 
xShape )
 {
-    uno::Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY );
-    OSL_ENSURE(xShapeProp.is(), "created shape offers no XPropertySet");
-    if( xShapeProp.is())
+    try
     {
-        try
-        {
-            xShapeProp->setPropertyValue( "LineStyle", uno::Any( 
drawing::LineStyle_NONE ));
-            xShapeProp->setPropertyValue( "FillStyle", uno::Any( 
drawing::FillStyle_NONE ));
-        }
-        catch( const uno::Exception& )
-        {
-            TOOLS_WARN_EXCEPTION("chart2", "" );
-        }
+        xShape->setPropertyValue( "LineStyle", uno::Any( 
drawing::LineStyle_NONE ));
+        xShape->setPropertyValue( "FillStyle", uno::Any( 
drawing::FillStyle_NONE ));
+    }
+    catch( const uno::Exception& )
+    {
+        TOOLS_WARN_EXCEPTION("chart2", "" );
     }
 }
 

Reply via email to