[Libreoffice-commits] core.git: filter/source xmloff/source

Stephan Bergmann sbergman at redhat.com
Mon Oct 24 09:20:24 UTC 2016


 filter/source/flash/swffilter.cxx  |    4 +---
 filter/source/svg/svgfilter.cxx    |    8 ++------
 xmloff/source/draw/shapeexport.cxx |   34 +++++++++++++++-------------------
 3 files changed, 18 insertions(+), 28 deletions(-)

New commits:
commit 319a07c4be1bf9712a162a970ab3b659dd3777c2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Oct 24 11:19:19 2016 +0200

    Simplify code further
    
    ...after 9ad0e56be46df46b021109acfd6ece9d17ce84f8 "fixes for >>= with rhs Any"
    
    Change-Id: Idf7b7033bd0ef5501e2884841ba897f8691a5f77

diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx
index 5ac39b8..81ec8a0 100644
--- a/filter/source/flash/swffilter.cxx
+++ b/filter/source/flash/swffilter.cxx
@@ -262,9 +262,7 @@ sal_Bool SAL_CALL FlashExportFilter::filter( const css::uno::Sequence< css::bean
 
                         if(xSelection.is())
                         {
-                            Any aSelection = xSelection->getSelection();
-                            if (aSelection.hasValue())
-                                aSelection >>= mxSelectedShapes;
+                            xSelection->getSelection() >>= mxSelectedShapes;
                         }
                     }
                 }
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index bd6dae6..c1faa06 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -235,12 +235,8 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
 
             if (xSelection.is())
             {
-                uno::Any aSelection = xSelection->getSelection();
-
-                if (aSelection.hasValue())
-                {
-                    bGotSelection = ( aSelection >>= maShapeSelection );
-                }
+                bGotSelection
+                    = ( xSelection->getSelection() >>= maShapeSelection );
             }
         }
 
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 09d6adf..a22ee35 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2583,27 +2583,23 @@ void XMLShapeExport::ImpExportConnectorShape(
         }
     }
 
+    // get PolygonBezier
     aAny = xProps->getPropertyValue("PolyPolygonBezier");
-    if( aAny.hasValue() )
+    auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny);
+    if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
     {
-        // get PolygonBezier
-        auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny);
-
-        if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
-        {
-            const basegfx::B2DPolyPolygon aPolyPolygon(
-                basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
-                    *pSourcePolyPolygon));
-            const OUString aPolygonString(
-                basegfx::tools::exportToSvgD(
-                    aPolyPolygon,
-                    true,           // bUseRelativeCoordinates
-                    false,          // bDetectQuadraticBeziers: not used in old, but maybe activated now
-                    true));         // bHandleRelativeNextPointCompatible
-
-            // write point array
-            mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString);
-        }
+        const basegfx::B2DPolyPolygon aPolyPolygon(
+            basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+                *pSourcePolyPolygon));
+        const OUString aPolygonString(
+            basegfx::tools::exportToSvgD(
+                aPolyPolygon,
+                true,           // bUseRelativeCoordinates
+                false,          // bDetectQuadraticBeziers: not used in old, but maybe activated now
+                true));         // bHandleRelativeNextPointCompatible
+
+        // write point array
+        mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString);
     }
 
     // get matrix


More information about the Libreoffice-commits mailing list