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

2016-10-24 Thread Stephan Bergmann
 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 
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(aAny);
+if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
 {
-// get PolygonBezier
-auto pSourcePolyPolygon = 
o3tl::tryAccess(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
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-24 Thread Jochen Nitschke
 filter/source/flash/swffilter.cxx  |7 ++-
 filter/source/svg/svgfilter.cxx|4 ++--
 xmloff/source/draw/shapeexport.cxx |3 ++-
 3 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 9ad0e56be46df46b021109acfd6ece9d17ce84f8
Author: Jochen Nitschke 
Date:   Fri Oct 21 15:59:45 2016 +0200

fixes for >>= with rhs Any

this changes behaviour because >>= always returned true

Change-Id: Ia7bbce1696e5c23f6e1e6f1a7e60b3c462cf0086
Reviewed-on: https://gerrit.libreoffice.org/30141
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/filter/source/flash/swffilter.cxx 
b/filter/source/flash/swffilter.cxx
index b3db3bc..5ac39b8 100644
--- a/filter/source/flash/swffilter.cxx
+++ b/filter/source/flash/swffilter.cxx
@@ -262,12 +262,9 @@ sal_Bool SAL_CALL FlashExportFilter::filter( const 
css::uno::Sequence< css::bean
 
 if(xSelection.is())
 {
-Any aSelection;
-
-if(xSelection->getSelection() >>= aSelection)
-{
+Any aSelection = xSelection->getSelection();
+if (aSelection.hasValue())
 aSelection >>= mxSelectedShapes;
-}
 }
 }
 }
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 7304a56..bd6dae6 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -235,9 +235,9 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< 
PropertyValue >& rDescripto
 
 if (xSelection.is())
 {
-uno::Any aSelection;
+uno::Any aSelection = xSelection->getSelection();
 
-if (xSelection->getSelection() >>= aSelection)
+if (aSelection.hasValue())
 {
 bGotSelection = ( aSelection >>= maShapeSelection );
 }
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 0fd26d7..09d6adf 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2583,7 +2583,8 @@ void XMLShapeExport::ImpExportConnectorShape(
 }
 }
 
-if( xProps->getPropertyValue("PolyPolygonBezier") >>= aAny )
+aAny = xProps->getPropertyValue("PolyPolygonBezier");
+if( aAny.hasValue() )
 {
 // get PolygonBezier
 auto pSourcePolyPolygon = 
o3tl::tryAccess(aAny);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-19 Thread Noel Grandin
 filter/source/msfilter/msdffimp.cxx|   54 +++--
 xmloff/source/draw/ximpcustomshape.cxx |  103 +++--
 xmloff/source/draw/ximpshap.cxx|8 --
 xmloff/source/style/prstylei.cxx   |   13 +---
 4 files changed, 28 insertions(+), 150 deletions(-)

New commits:
commit 49c5b9a98c45cd082e7fa6b6e399c39cd664ed66
Author: Noel Grandin 
Date:   Thu Nov 19 10:37:10 2015 +0200

use comphelper::containerToSequence

Change-Id: I223ff4af01ab2da92da0c26d32457204a5008c4a

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index f637f66..41c1e5a 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1532,7 +1533,6 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 
 // creating SdrCustomShapeGeometryItem
 
-typedef uno::Sequence< beans::PropertyValue > PropSeq;
 typedef std::vector< beans::PropertyValue > PropVec;
 typedef PropVec::iterator PropVecIter;
 PropVecIter aIter;
@@ -1861,15 +1861,8 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 rSet.Put( XSecondaryFillColorItem( OUString(), 
rManager.MSO_CLR_ToColor(
 GetPropertyValue( DFF_Prop_c3DExtrusionColor, 0 ), 
DFF_Prop_c3DExtrusionColor ) ) );
 // pushing the whole Extrusion element
-const OUString sExtrusion( "Extrusion" );
-PropSeq aExtrusionPropSeq( aExtrusionPropVec.size() );
-aIter = aExtrusionPropVec.begin();
-aEnd = aExtrusionPropVec.end();
-beans::PropertyValue* pExtrusionValues = aExtrusionPropSeq.getArray();
-while ( aIter != aEnd )
-*pExtrusionValues++ = *aIter++;
-aProp.Name = sExtrusion;
-aProp.Value <<= aExtrusionPropSeq;
+aProp.Name = "Extrusion";
+aProp.Value <<= comphelper::containerToSequence(aExtrusionPropVec);
 aPropVec.push_back( aProp );
 }
 
@@ -2088,18 +2081,11 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 }
 if ( !aHandlePropVec.empty() )
 {
-PropSeq aHandlePropSeq( aHandlePropVec.size() );
-aIter = aHandlePropVec.begin();
-aEnd = aHandlePropVec.end();
-beans::PropertyValue* pHandleValues = 
aHandlePropSeq.getArray();
-while ( aIter != aEnd )
-*pHandleValues++ = *aIter++;
-aHandles[ i ] = aHandlePropSeq;
+aHandles[ i ] = 
comphelper::containerToSequence(aHandlePropVec);
 }
 }
 // pushing the whole Handles element
-const OUString sHandles( "Handles" );
-aProp.Name = sHandles;
+aProp.Name = "Handles";
 aProp.Value <<= aHandles;
 aPropVec.push_back( aProp );
 }
@@ -2435,15 +2421,8 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 // pushing the whole Path element
 if ( !aPathPropVec.empty() )
 {
-const OUString sPath( "Path" );
-PropSeq aPathPropSeq( aPathPropVec.size() );
-aIter = aPathPropVec.begin();
-aEnd = aPathPropVec.end();
-beans::PropertyValue* pPathValues = aPathPropSeq.getArray();
-while ( aIter != aEnd )
-*pPathValues++ = *aIter++;
-aProp.Name = sPath;
-aProp.Value <<= aPathPropSeq;
+aProp.Name = "Path";
+aProp.Value <<= comphelper::containerToSequence(aPathPropVec);
 aPropVec.push_back( aProp );
 }
 }
@@ -2504,15 +2483,8 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 aTextPathPropVec.push_back( aProp );
 
 // pushing the whole TextPath element
-const OUString sTextPath( "TextPath" );
-PropSeq aTextPathPropSeq( aTextPathPropVec.size() );
-aIter = aTextPathPropVec.begin();
-aEnd = aTextPathPropVec.end();
-beans::PropertyValue* pTextPathValues = aTextPathPropSeq.getArray();
-while ( aIter != aEnd )
-*pTextPathValues++ = *aIter++;
-aProp.Name = sTextPath;
-aProp.Value <<= aTextPathPropSeq;
+aProp.Name = "TextPath";
+aProp.Value <<= comphelper::containerToSequence(aTextPathPropVec);
 aPropVec.push_back( aProp );
 }
 
@@ -2554,13 +2526,7 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 }
 
 // creating the whole property set
-PropSeq aSeq( aPropVec.size() );
-beans::PropertyValue* pValues = aSeq.getArray();
-aIter = aPropVec.begin();
-aEnd = aPropVec.end();
-while (