summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-06-28 19:48:59 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-07-02 18:03:44 +0200
commit36bade04d3780bc54c51b46bb0b63e69789658a5 (patch)
treec4465bf33aa2cda65511a2c094688522e9c9b43a /include
parent942f1056b51e53358d42ff8da8a1bbdce9ba5303 (diff)
tdf106792 Get rid of SvxShapePolyPolygonBezier
SvxShapePolyPolygonBezier was an implementation for the UNO Shape group of polygons with bezier parts (filled/unfilled/ closed/open), e.g. com.sun.star.drawing.OpenBezierShape. It was differing from SvxShapePolyPolygon just by supporting drawing::PolyPolygonBezierCoords instead of the simple drawing::PointSequenceSequence and some details. This leads to problems - the ShapeType *does change* e.g. when you edit a non-bezier Shape in Draw/Impress and change parts to curve (also when closing, see ShapeTypes above). This is why SvxShape::getShapeType() already detects this identifier by using thze internal ShapePolyType (e.g. OBJ_PATHLINE). So there is no reason to have two separate UNO API imple- mentations for sthe same type of SvxShape at all. Get rid of the extra one and unify this implementation detail. Also cleaned up double basegfx tooling for conversions of UNO API Poly/bezier data and B2DPolygon. Adapted test for "tdf113946.docx", see comment there. Adapted test for "tdf90097.rtf", see comment there. Also needed to use the Linux values, also check comment there. Adapted test for "tdf105127.docx", see comment there. Adapted test for "tdf85232.docx", see comment there. Had to fic a problem with test for "tdf96674.docx"- the adaption of the RotateAngle for line objects goes havoc together with the UNO API when scaling is involved. That old aGeo rotate stuff just kills the existing rotation due to numerical inprecise stuff. The UNP API - in trying not just to apply a rptation, but manipulate the existing one then goes wrong in not re-getting the current rotation value anymore. ARGH! This is the original reason for the ols tdf#96674 task - i doubt that the additional code to make a line not exactly hor/ver is needed. Checked and it is not needed, thus removed the change from tdf#96674 in shape.cxx. Change-Id: I2bb8d4cfe33fee3671f3dad60e5c18609a394f9d Reviewed-on: https://gerrit.libreoffice.org/56614 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include')
-rw-r--r--include/basegfx/utils/unotools.hxx38
-rw-r--r--include/svx/unoprov.hxx43
-rw-r--r--include/svx/unoshape.hxx34
3 files changed, 25 insertions, 90 deletions
diff --git a/include/basegfx/utils/unotools.hxx b/include/basegfx/utils/unotools.hxx
deleted file mode 100644
index 3a58a2068fd9..000000000000
--- a/include/basegfx/utils/unotools.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_BASEGFX_UTILS_UNOTOOLS_HXX
-#define INCLUDED_BASEGFX_UTILS_UNOTOOLS_HXX
-
-#include <cppuhelper/basemutex.hxx>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/rendering/FillRule.hpp>
-#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp>
-#include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-
-
-namespace basegfx
-{
-class B2DPolyPolygon;
-
-namespace unotools
-{
- /// @throws css::lang::IllegalArgumentException
- BASEGFX_DLLPUBLIC B2DPolyPolygon polyPolygonBezierToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords& rSourcePolyPolygon);
-
- BASEGFX_DLLPUBLIC void b2DPolyPolygonToPolyPolygonBezier( const B2DPolyPolygon& rPolyPoly,
- css::drawing::PolyPolygonBezierCoords& rRetval );
-}
-}
-
-#endif // INCLUDED_BASEGFX_UTILS_UNOTOOLS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx
index 8a2d7d977f51..0fa155c252e8 100644
--- a/include/svx/unoprov.hxx
+++ b/include/svx/unoprov.hxx
@@ -55,28 +55,27 @@ public:
#define SVXMAP_DIMENSIONING 2
#define SVXMAP_CIRCLE 3
#define SVXMAP_POLYPOLYGON 4
-#define SVXMAP_POLYPOLYGONBEZIER 5
-#define SVXMAP_GRAPHICOBJECT 6
-#define SVXMAP_3DSCENEOBJECT 7
-#define SVXMAP_3DCUBEOBJECT 8
-#define SVXMAP_3DSPHEREOBJECT 9
-#define SVXMAP_3DLATHEOBJECT 10
-#define SVXMAP_3DEXTRUDEOBJECT 11
-#define SVXMAP_3DPOLYGONOBJECT 12
-#define SVXMAP_ALL 13
-#define SVXMAP_GROUP 14
-#define SVXMAP_CAPTION 15
-#define SVXMAP_OLE2 16
-#define SVXMAP_PLUGIN 17
-#define SVXMAP_FRAME 18
-#define SVXMAP_APPLET 19
-#define SVXMAP_CONTROL 20
-#define SVXMAP_TEXT 21
-#define SVXMAP_CUSTOMSHAPE 22
-#define SVXMAP_MEDIA 23
-#define SVXMAP_TABLE 24
-#define SVXMAP_PAGE 25
-#define SVXMAP_END 26 // last+1 !
+#define SVXMAP_GRAPHICOBJECT 5
+#define SVXMAP_3DSCENEOBJECT 6
+#define SVXMAP_3DCUBEOBJECT 7
+#define SVXMAP_3DSPHEREOBJECT 8
+#define SVXMAP_3DLATHEOBJECT 9
+#define SVXMAP_3DEXTRUDEOBJECT 10
+#define SVXMAP_3DPOLYGONOBJECT 11
+#define SVXMAP_ALL 12
+#define SVXMAP_GROUP 13
+#define SVXMAP_CAPTION 14
+#define SVXMAP_OLE2 15
+#define SVXMAP_PLUGIN 16
+#define SVXMAP_FRAME 17
+#define SVXMAP_APPLET 18
+#define SVXMAP_CONTROL 19
+#define SVXMAP_TEXT 20
+#define SVXMAP_CUSTOMSHAPE 21
+#define SVXMAP_MEDIA 22
+#define SVXMAP_TABLE 23
+#define SVXMAP_PAGE 24
+#define SVXMAP_END 25 // last+1 !
/**
* SvxUnoPropertyMapProvider
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index d015d8f39820..bbc7740a1725 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -615,9 +615,6 @@ public:
***********************************************************************/
class SvxShapePolyPolygon : public SvxShapeText
{
-private:
- css::drawing::PolygonKind mePolygonKind;
-
protected:
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
@@ -626,10 +623,13 @@ protected:
virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
+ // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
+ css::drawing::PolygonKind GetPolygonKind() const;
+
public:
/// @throws css::lang::IllegalArgumentException
/// @throws css::beans::PropertyVetoException
- SvxShapePolyPolygon( SdrObject* pObj , css::drawing::PolygonKind eNew );
+ SvxShapePolyPolygon( SdrObject* pObj );
virtual ~SvxShapePolyPolygon() throw() override;
// Local support functions
@@ -642,32 +642,6 @@ public:
* *
***********************************************************************/
-class SvxShapePolyPolygonBezier : public SvxShapeText
-{
-private:
- css::drawing::PolygonKind mePolygonKind;
-
-protected:
- using SvxUnoTextRangeBase::setPropertyValue;
- using SvxUnoTextRangeBase::getPropertyValue;
-
-public:
- // override these for special property handling in subcasses. Return true if property is handled
- virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
- virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
-
- SvxShapePolyPolygonBezier(SdrObject* pObj, css::drawing::PolygonKind eNew);
- virtual ~SvxShapePolyPolygonBezier() throw() override;
-
- // Local support functions
- /// @throws css::uno::RuntimeException
- void SetPolygon(const basegfx::B2DPolyPolygon & rNew);
- basegfx::B2DPolyPolygon GetPolygon() const throw();
-};
-
-/***********************************************************************
-* *
-***********************************************************************/
class SvxGraphicObject : public SvxShapeText
{
protected: