incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1226879 [1/2] - in /incubator/ooo/trunk/main: chart2/source/controller/chartapiwrapper/ chart2/source/controller/inc/ chart2/source/controller/main/ chart2/source/inc/ drawinglayer/ drawinglayer/inc/drawinglayer/primitive2d/ drawinglayer/s...
Date Tue, 03 Jan 2012 17:18:47 GMT
Author: alg
Date: Tue Jan  3 17:18:46 2012
New Revision: 1226879

URL: http://svn.apache.org/viewvc?rev=1226879&view=rev
Log:
fix for #118525#: Using primitives for chart sub-geometry visualisation

Added:
    incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx
    incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx
Removed:
    incubator/ooo/trunk/main/chart2/source/controller/inc/ChartRenderer.hxx
    incubator/ooo/trunk/main/chart2/source/controller/main/ChartRenderer.cxx
    incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
    incubator/ooo/trunk/main/drawinglayer/source/primitive2d/chartprimitive2d.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/helperchartrenderer.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/helperchartrenderer.hxx
Modified:
    incubator/ooo/trunk/main/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
    incubator/ooo/trunk/main/chart2/source/controller/main/makefile.mk
    incubator/ooo/trunk/main/chart2/source/inc/servicenames.hxx
    incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk
    incubator/ooo/trunk/main/drawinglayer/Package_inc.mk
    incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
    incubator/ooo/trunk/main/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/canvasprocessor.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
    incubator/ooo/trunk/main/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
    incubator/ooo/trunk/main/slideshow/source/engine/shapes/drawshape.cxx
    incubator/ooo/trunk/main/svtools/Library_svt.mk
    incubator/ooo/trunk/main/svtools/Package_inc.mk
    incubator/ooo/trunk/main/svtools/inc/svtools/chartprettypainter.hxx
    incubator/ooo/trunk/main/svtools/source/misc/chartprettypainter.cxx
    incubator/ooo/trunk/main/svx/Library_svxcore.mk
    incubator/ooo/trunk/main/svx/Package_inc.mk
    incubator/ooo/trunk/main/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
    incubator/ooo/trunk/main/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
    incubator/ooo/trunk/main/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx
    incubator/ooo/trunk/main/sw/source/core/doc/notxtfrm.cxx
    incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx
    incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx

Modified: incubator/ooo/trunk/main/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx (original)
+++ incubator/ooo/trunk/main/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx Tue Jan  3 17:18:46 2012
@@ -51,7 +51,6 @@
 #include "AreaWrapper.hxx"
 #include "WrappedAddInProperty.hxx"
 #include "WrappedIgnoreProperty.hxx"
-#include "ChartRenderer.hxx"
 #include <com/sun/star/chart2/XTitled.hpp>
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -1362,12 +1361,6 @@ uno::Reference< uno::XInterface > SAL_CA
 
         bServiceFound = true;
     }
-    else if( aServiceSpecifier.equals( CHART_RENDERER_SERVICE_IMPLEMENTATION_NAME ) )
-    {
-        Reference< lang::XUnoTunnel > xChartRenderer( new ChartRenderer( m_spChart2ModelContact->getChartModel() ) );
-        xResult.set( xChartRenderer );
-        bServiceFound = true;
-    }
     else if( aServiceSpecifier.equals( C2U("com.sun.star.comp.chart2.DataSeriesWrapper") ) )
     {
         Reference< beans::XPropertySet > xDataSeries( new DataSeriesPointWrapper( m_spChart2ModelContact ) );

Modified: incubator/ooo/trunk/main/chart2/source/controller/main/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/chart2/source/controller/main/makefile.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/chart2/source/controller/main/makefile.mk (original)
+++ incubator/ooo/trunk/main/chart2/source/controller/main/makefile.mk Tue Jan  3 17:18:46 2012
@@ -55,7 +55,6 @@ SLOFILES =  \
 			$(SLO)$/ChartController_Position.obj \
 			$(SLO)$/ChartController_Tools.obj \
 			$(SLO)$/ChartFrameloader.obj \
-			$(SLO)$/ChartRenderer.obj \
 			$(SLO)$/CommandDispatchContainer.obj \
 			$(SLO)$/CommandDispatch.obj \
 			$(SLO)$/ControllerCommandDispatch.obj \

Modified: incubator/ooo/trunk/main/chart2/source/inc/servicenames.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/chart2/source/inc/servicenames.hxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/chart2/source/inc/servicenames.hxx (original)
+++ incubator/ooo/trunk/main/chart2/source/inc/servicenames.hxx Tue Jan  3 17:18:46 2012
@@ -56,8 +56,6 @@ namespace chart
 #define CHART_ACCESSIBLE_TEXT_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.AccessibleTextComponent")
 #define CHART_ACCESSIBLE_TEXT_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.accessibility.AccessibleTextComponent")
 
-#define CHART_RENDERER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartRenderer")
-
 //.............................................................................
 } //namespace chart
 //.............................................................................

Modified: incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk (original)
+++ incubator/ooo/trunk/main/drawinglayer/Library_drawinglayer.mk Tue Jan  3 17:18:46 2012
@@ -94,7 +94,6 @@ $(eval $(call gb_Library_add_exception_o
 	drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
 	drawinglayer/source/primitive2d/bitmapprimitive2d \
 	drawinglayer/source/primitive2d/borderlineprimitive2d \
-	drawinglayer/source/primitive2d/chartprimitive2d \
 	drawinglayer/source/primitive2d/controlprimitive2d \
 	drawinglayer/source/primitive2d/cropprimitive2d \
 	drawinglayer/source/primitive2d/discretebitmapprimitive2d \
@@ -164,7 +163,6 @@ $(eval $(call gb_Library_add_exception_o
 	drawinglayer/source/processor2d/vclhelperbitmaprender \
 	drawinglayer/source/processor2d/vclhelperbufferdevice \
 	drawinglayer/source/processor2d/vclprocessor2d \
-	drawinglayer/source/processor2d/helperchartrenderer \
 	drawinglayer/source/processor2d/helperwrongspellrenderer \
 	drawinglayer/source/processor2d/vclpixelprocessor2d \
 	drawinglayer/source/processor2d/vclmetafileprocessor2d \

Modified: incubator/ooo/trunk/main/drawinglayer/Package_inc.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/Package_inc.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/Package_inc.mk (original)
+++ incubator/ooo/trunk/main/drawinglayer/Package_inc.mk Tue Jan  3 17:18:46 2012
@@ -34,7 +34,6 @@ $(eval $(call gb_Package_add_file,drawin
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/baseprimitive2d.hxx,drawinglayer/primitive2d/baseprimitive2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx,drawinglayer/primitive2d/bitmapprimitive2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx,drawinglayer/primitive2d/borderlineprimitive2d.hxx))
-$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/chartprimitive2d.hxx,drawinglayer/primitive2d/chartprimitive2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/controlprimitive2d.hxx,drawinglayer/primitive2d/controlprimitive2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/cropprimitive2d.hxx,drawinglayer/primitive2d/cropprimitive2d.hxx))
 $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx,drawinglayer/primitive2d/discretebitmapprimitive2d.hxx))

Modified: incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx Tue Jan  3 17:18:46 2012
@@ -85,26 +85,25 @@
 #define PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D		(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 46)
 #define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D		            (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47)
 #define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D		        (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48)
-#define PRIMITIVE2D_ID_CHARTPRIMITIVE2D						(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49)
-#define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D				(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
-#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D				(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
-#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
-#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D                   (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
-#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D                    (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
-#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
-#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
-#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D                  (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
-#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D    (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
-#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D     (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
-#define PRIMITIVE2D_ID_EPSPRIMITIVE2D						(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
-#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61)
-#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D            (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 62)
-#define PRIMITIVE2D_ID_SVGLINEARGRADIENTPRIMITIVE2D         (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 63)
-#define PRIMITIVE2D_ID_SVGRADIALGRADIENTPRIMITIVE2D         (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 64)
-#define PRIMITIVE2D_ID_SVGLINEARATOMPRIMITIVE2D             (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 65)
-#define PRIMITIVE2D_ID_SVGRADIALATOMPRIMITIVE2D             (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 66)
-#define PRIMITIVE2D_ID_CROPPRIMITIVE2D                      (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 67)
-#define PRIMITIVE2D_ID_PATTERNFILLPRIMITIVE2D               (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68)
+#define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D				(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49)
+#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D				(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
+#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
+#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D                   (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
+#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D                    (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
+#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
+#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
+#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D                  (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
+#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D    (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
+#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D     (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
+#define PRIMITIVE2D_ID_EPSPRIMITIVE2D						(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
+#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D			(PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
+#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D            (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61)
+#define PRIMITIVE2D_ID_SVGLINEARGRADIENTPRIMITIVE2D         (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 62)
+#define PRIMITIVE2D_ID_SVGRADIALGRADIENTPRIMITIVE2D         (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 63)
+#define PRIMITIVE2D_ID_SVGLINEARATOMPRIMITIVE2D             (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 64)
+#define PRIMITIVE2D_ID_SVGRADIALATOMPRIMITIVE2D             (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 65)
+#define PRIMITIVE2D_ID_CROPPRIMITIVE2D                      (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 66)
+#define PRIMITIVE2D_ID_PATTERNFILLPRIMITIVE2D               (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 67)
 
 //////////////////////////////////////////////////////////////////////////////
 

Modified: incubator/ooo/trunk/main/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/primitive2d/sceneprimitive2d.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/primitive2d/sceneprimitive2d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/primitive2d/sceneprimitive2d.cxx Tue Jan  3 17:18:46 2012
@@ -205,24 +205,84 @@ namespace drawinglayer
 					}
 				}
 
-				// calculate logic render size in world coordinates for usage in renderer
-				basegfx::B2DVector aLogicRenderSize(
-					aDiscreteRange.getWidth() * fReduceFactor, 
-					aDiscreteRange.getHeight() * fReduceFactor);
-				aLogicRenderSize *= rViewInformation.getInverseObjectToViewTransformation();
-
                 // determine the oversample value
                 static sal_uInt16 nDefaultOversampleValue(3);
                 const sal_uInt16 nOversampleValue(aDrawinglayerOpt.IsAntiAliasing() ? nDefaultOversampleValue : 0);
 
+                geometry::ViewInformation3D aViewInformation3D(getViewInformation3D());
+                {
+                    // calculate a transformation from DiscreteRange to evtl. rotated/sheared content.
+                    // Start with full transformation from object to discrete units
+                    basegfx::B2DHomMatrix aObjToUnit(rViewInformation.getObjectToViewTransformation() * getObjectTransformation());
+
+                    // bring to unit coordinates by applying inverse DiscreteRange
+                    aObjToUnit.translate(-aDiscreteRange.getMinX(), -aDiscreteRange.getMinY());
+                    aObjToUnit.scale(1.0 / aDiscreteRange.getWidth(), 1.0 / aDiscreteRange.getHeight());
+
+                    // calculate transformed user coordinate system
+                    const basegfx::B2DPoint aStandardNull(0.0, 0.0);
+                    const basegfx::B2DPoint aUnitRangeTopLeft(aObjToUnit * aStandardNull);
+                    const basegfx::B2DVector aStandardXAxis(1.0, 0.0);
+                    const basegfx::B2DVector aUnitRangeXAxis(aObjToUnit * aStandardXAxis);
+                    const basegfx::B2DVector aStandardYAxis(0.0, 1.0);
+                    const basegfx::B2DVector aUnitRangeYAxis(aObjToUnit * aStandardYAxis);
+
+                    if(!aUnitRangeTopLeft.equal(aStandardNull) || !aUnitRangeXAxis.equal(aStandardXAxis) || !aUnitRangeYAxis.equal(aStandardYAxis))
+                    {
+                        // build transformation from unit range to user coordinate system; the unit range
+                        // X and Y axes are the column vectors, the null point is the offset
+                        basegfx::B2DHomMatrix aUnitRangeToUser;
+
+                        aUnitRangeToUser.set3x2(
+                            aUnitRangeXAxis.getX(), aUnitRangeYAxis.getX(), aUnitRangeTopLeft.getX(),
+                            aUnitRangeXAxis.getY(), aUnitRangeYAxis.getY(), aUnitRangeTopLeft.getY());
+
+                        // decompose to allow to apply this to the 3D transformation
+                        basegfx::B2DVector aScale, aTranslate;
+                        double fRotate, fShearX;
+                        aUnitRangeToUser.decompose(aScale, aTranslate, fRotate, fShearX);
+
+                        // apply before DeviceToView and after Projection, 3D is in range [-1.0 .. 1.0] in X,Y and Z
+                        // and not yet flipped in Y
+                        basegfx::B3DHomMatrix aExtendedProjection(aViewInformation3D.getProjection());
+
+                        // bring to unit coordiantes, flip Y, leave Z unchanged
+                        aExtendedProjection.scale(0.5, -0.5, 1.0);
+                        aExtendedProjection.translate(0.5, 0.5, 0.0);
+
+                        // apply extra; Y is flipped now, go with positive shear and rotate values
+                        aExtendedProjection.scale(aScale.getX(), aScale.getY(), 1.0);
+                        aExtendedProjection.shearXZ(fShearX, 0.0);
+                        aExtendedProjection.rotate(0.0, 0.0, fRotate);
+                        aExtendedProjection.translate(aTranslate.getX(), aTranslate.getY(), 0.0);
+
+                        // back to state after projection
+                        aExtendedProjection.translate(-0.5, -0.5, 0.0);
+                        aExtendedProjection.scale(2.0, -2.0, 1.0);
+
+                        aViewInformation3D = geometry::ViewInformation3D(
+                            aViewInformation3D.getObjectTransformation(),
+                            aViewInformation3D.getOrientation(),
+                            aExtendedProjection,
+                            aViewInformation3D.getDeviceToView(),
+                            aViewInformation3D.getViewTime(),
+                            aViewInformation3D.getExtendedInformationSequence());
+                    }
+                }
+
+                // calculate logic render size in world coordinates for usage in renderer
+                const basegfx::B2DHomMatrix aInverseOToV(rViewInformation.getInverseObjectToViewTransformation());
+                const double fLogicX((aInverseOToV * basegfx::B2DVector(aDiscreteRange.getWidth() * fReduceFactor, 0.0)).getLength());
+                const double fLogicY((aInverseOToV * basegfx::B2DVector(0.0, aDiscreteRange.getHeight() * fReduceFactor)).getLength());
+
 			    // use default 3D primitive processor to create BitmapEx for aUnitVisiblePart and process
 			    processor3d::ZBufferProcessor3D aZBufferProcessor3D(
-				    getViewInformation3D(), 
+                    aViewInformation3D, 
 					rViewInformation,
 				    getSdrSceneAttribute(), 
 				    getSdrLightingAttribute(),
-				    aLogicRenderSize.getX(), 
-				    aLogicRenderSize.getY(), 
+                    fLogicX, 
+                    fLogicY, 
 				    aUnitVisibleRange,
                     nOversampleValue);
 
@@ -243,7 +303,7 @@ namespace drawinglayer
 					aNew2DTransform.set(1, 2, aVisibleDiscreteRange.getMinY());
 
 					// transform back to world coordinates for usage in primitive creation
-					aNew2DTransform *= rViewInformation.getInverseObjectToViewTransformation();
+					aNew2DTransform *= aInverseOToV;
 
 					// create bitmap primitive and add
 					const Primitive2DReference xRef(new BitmapPrimitive2D(maOldRenderedBitmap, aNew2DTransform));

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/canvasprocessor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/canvasprocessor.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/canvasprocessor.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/canvasprocessor.cxx Tue Jan  3 17:18:46 2012
@@ -61,8 +61,6 @@
 #include <com/sun/star/rendering/TexturingMode.hpp>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <vclhelperbufferdevice.hxx>
-#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-#include <helperchartrenderer.hxx>
 #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
 #include <helperwrongspellrenderer.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -2091,26 +2089,6 @@ namespace drawinglayer
 
 					break;
 				}
-				case PRIMITIVE2D_ID_CHARTPRIMITIVE2D :
-				{
-					// chart primitive in canvas renderer; restore original DrawMode during call
-					// since the evtl. used ChartPrettyPainter will use the MapMode
-					const primitive2d::ChartPrimitive2D& rChartPrimitive = static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate);
-		   			mpOutputDevice->Push(PUSH_MAPMODE);
-					mpOutputDevice->SetMapMode(maOriginalMapMode);
-					
-					if(!renderChartPrimitive2D(
-						rChartPrimitive, 
-						*mpOutputDevice,
-						getViewInformation2D()))
-					{
-						// fallback to decomposition (MetaFile)
-						process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
-					}
-
-					mpOutputDevice->Pop();
-					break;
-				}
                 case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
                 {
 					// wrong spell primitive. Handled directly here using VCL since VCL has a nice and

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Tue Jan  3 17:18:46 2012
@@ -59,7 +59,6 @@
 #include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <helperchartrenderer.hxx>
 #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
 #include <basegfx/polygon/b2dlinegeometry.hxx>
 
@@ -76,11 +75,6 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
-// for current chart PrettyPrinting support
-
-#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
 // for StructureTagPrimitive support in sd's unomodel.cxx
 
 #include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
@@ -1979,21 +1973,6 @@ namespace drawinglayer
 					RenderPointArrayPrimitive2D(static_cast< const primitive2d::PointArrayPrimitive2D& >(rCandidate));
 					break;
 				}
-				case PRIMITIVE2D_ID_CHARTPRIMITIVE2D :
-				{
-					// ChartPrimitive2D
-					const primitive2d::ChartPrimitive2D& rChartPrimitive = static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate);
-
-					if(!renderChartPrimitive2D(
-						rChartPrimitive, 
-						*mpOutputDevice,
-						getViewInformation2D()))
-					{
-						// fallback to decomposition (MetaFile)
-						process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
-					}
-					break;
-				}
 				case PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D :
 				{
 					// structured tag primitive

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx Tue Jan  3 17:18:46 2012
@@ -44,8 +44,6 @@
 #include <com/sun/star/awt/XWindow2.hpp>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-#include <helperchartrenderer.hxx>
 #include <helperwrongspellrenderer.hxx>
 #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
@@ -447,26 +445,6 @@ namespace drawinglayer
 
 					break;
 				}
-				case PRIMITIVE2D_ID_CHARTPRIMITIVE2D :
-				{
-					// chart primitive in pixel renderer; restore original DrawMode during call
-					// since the evtl. used ChartPrettyPainter will use the MapMode
-					const primitive2d::ChartPrimitive2D& rChartPrimitive = static_cast< const primitive2d::ChartPrimitive2D& >(rCandidate);
-		   			mpOutputDevice->Push(PUSH_MAPMODE);
-					mpOutputDevice->SetMapMode(maOriginalMapMode);
-					
-					if(!renderChartPrimitive2D(
-						rChartPrimitive, 
-						*mpOutputDevice,
-						getViewInformation2D()))
-					{
-						// fallback to decomposition (MetaFile)
-						process(rChartPrimitive.get2DDecomposition(getViewInformation2D()));
-					}
-		   			
-					mpOutputDevice->Pop();
-					break;
-				}
 				case PRIMITIVE2D_ID_FILLHATCHPRIMITIVE2D :
 				{
 					static bool bForceIgnoreHatchSmoothing(false);

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor3d/zbufferprocessor3d.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor3d/zbufferprocessor3d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor3d/zbufferprocessor3d.cxx Tue Jan  3 17:18:46 2012
@@ -132,7 +132,7 @@ namespace
 			aRetval = BitmapEx(aContent, aAlpha);
 
 			// #i101811# set PrefMapMode and PrefSize at newly created Bitmap
-			aRetval.SetPrefMapMode(MAP_100TH_MM);
+			aRetval.SetPrefMapMode(MAP_PIXEL);
 			aRetval.SetPrefSize(Size(nWidth, nHeight));
 		}
 

Modified: incubator/ooo/trunk/main/slideshow/source/engine/shapes/drawshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/slideshow/source/engine/shapes/drawshape.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/slideshow/source/engine/shapes/drawshape.cxx (original)
+++ incubator/ooo/trunk/main/slideshow/source/engine/shapes/drawshape.cxx Tue Jan  3 17:18:46 2012
@@ -84,130 +84,6 @@ namespace slideshow
 {
     namespace internal
     {
-        //#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
-        //metafiles are resolution dependent when bitmaps are contained with is the case for 3D scenes for example
-        //in addition a chart has resolution dependent content as it might skip points that are not visible for a given resolution (this is done for performance reasons)
-        bool local_getMetafileForChart( const uno::Reference< lang::XComponent >& 	  xSource, 
-                  const uno::Reference< drawing::XDrawPage >&     xContainingPage,
-                  GDIMetaFile&                                    rMtf )
-        {
-            //get the chart model
-            uno::Reference< beans::XPropertySet > xPropSet( xSource, uno::UNO_QUERY );
-            uno::Reference< frame::XModel > xChartModel;
-            getPropertyValue( xChartModel, xPropSet, OUSTR("Model"));
-            uno::Reference< lang::XMultiServiceFactory > xFact( xChartModel, uno::UNO_QUERY );
-            OSL_ENSURE( xFact.is(), "Chart cannot be painted pretty!\n" );
-            if(!xFact.is())
-                return false;
-
-            //get the chart view
-            uno::Reference< datatransfer::XTransferable > xChartViewTransferable(
-                xFact->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.ChartView" ) ) ), uno::UNO_QUERY );
-            uno::Reference< beans::XPropertySet > xChartViewProp( xChartViewTransferable, uno::UNO_QUERY );
-            OSL_ENSURE( xChartViewProp.is(), "Chart cannot be painted pretty!\n" );
-            if( !xChartViewProp.is() )
-                return false;
-
-            //estimate zoom and resolution (this is only a workaround, correct would be to know and use the exact zoom and resoltion during slideshow display)
-            sal_Int32 nScaleXNumerator = 100;//zoom factor -> exact values are important for the quality of the created bitmap especially for 3D charts
-            sal_Int32 nScaleYNumerator = 100;
-            sal_Int32 nScaleXDenominator = 100;
-            sal_Int32 nScaleYDenominator = 100;
-            awt::Size aPixelPerChart( 1000, 1000 );//when data points happen to be on the same pixel as their predecessor no shape is created to safe performance
-
-            Window* pActiveTopWindow( Application::GetActiveTopWindow() );
-            WorkWindow* pWorkWindow( dynamic_cast<WorkWindow*>(pActiveTopWindow));
-            if( pWorkWindow && pWorkWindow->IsPresentationMode() )
-            {
-                Size aPixScreenSize( pActiveTopWindow->GetOutputSizePixel() );
-                aPixelPerChart = awt::Size( aPixScreenSize.getWidth(), aPixScreenSize.getHeight() );//this is still to much (but costs only seldom performance), correct would be pixel per chart object
-
-                uno::Reference< beans::XPropertySet > xPageProp( xContainingPage, uno::UNO_QUERY );
-                sal_Int32 nLogicPageWidth=1;
-                sal_Int32 nLogicPageHeight=1;
-                if( getPropertyValue( nLogicPageWidth, xPageProp, OUSTR("Width")) &&
-                    getPropertyValue( nLogicPageHeight, xPageProp, OUSTR("Height")) )
-                {
-                    Size aLogicScreenSize( pActiveTopWindow->PixelToLogic( aPixScreenSize, MAP_100TH_MM ) );
-                    nScaleXNumerator = aLogicScreenSize.getWidth();
-                    nScaleYNumerator = aLogicScreenSize.getHeight();
-                    nScaleXDenominator = nLogicPageWidth;
-                    nScaleYDenominator = nLogicPageHeight;
-                }
-            }
-            else
-            {
-                long nMaxPixWidth = 0;
-                long nMaxPixHeight = 0;
-                unsigned int nScreenCount( Application::GetScreenCount() );
-                for( unsigned int nScreen=0; nScreen<nScreenCount; nScreen++ )
-                {
-                    Rectangle aCurScreenRect( Application::GetScreenPosSizePixel( nScreen ) );
-                    if( aCurScreenRect.GetWidth() > nMaxPixWidth )
-                        nMaxPixWidth = aCurScreenRect.GetWidth();
-                    if( aCurScreenRect.GetHeight() > nMaxPixHeight )
-                        nMaxPixHeight = aCurScreenRect.GetHeight();
-                }
-                if(nMaxPixWidth>1 && nMaxPixHeight>1)
-                    aPixelPerChart = awt::Size( nMaxPixWidth, nMaxPixHeight );//this is still to much (but costs only seldom performance), correct would be pixel per chart object
-            }
-            
-            try
-            {
-                uno::Sequence< beans::PropertyValue > aZoomFactors(4);
-                aZoomFactors[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleXNumerator") );
-                aZoomFactors[0].Value = uno::makeAny( nScaleXNumerator );
-                aZoomFactors[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleXDenominator") );
-                aZoomFactors[1].Value = uno::makeAny( nScaleXDenominator );
-                aZoomFactors[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleYNumerator") );
-                aZoomFactors[2].Value = uno::makeAny( nScaleYNumerator );
-                aZoomFactors[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleYDenominator") );
-                aZoomFactors[3].Value = uno::makeAny( nScaleYDenominator );
-
-                xChartViewProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ZoomFactors") ), uno::makeAny( aZoomFactors ));
-                xChartViewProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Resolution") ), uno::makeAny( aPixelPerChart ));
-            }
-            catch (uno::Exception &) 
-            {
-                OSL_ENSURE( false, rtl::OUStringToOString(
-                                comphelper::anyToString(
-                                    cppu::getCaughtException() ),
-                                RTL_TEXTENCODING_UTF8 ).getStr() );
-            }
-
-            //get a metafile from the prepared chart view
-            datatransfer::DataFlavor aDataFlavor(
-                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"") ),
-                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" ) ),
-                    ::getCppuType( (const uno::Sequence< sal_Int8 >*) 0 ) );
-            uno::Any aData( xChartViewTransferable->getTransferData( aDataFlavor ) );
-            uno::Sequence< sal_Int8 > aSeq;
-            if( aData >>= aSeq )
-            {
-		        ::std::auto_ptr< SvMemoryStream > pSrcStm( new SvMemoryStream( (char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_WRITE | STREAM_TRUNC ) );
-	            *(pSrcStm.get() ) >> rMtf;
-                return true;
-            }
-            return false;
-        }
-
-        //same as getMetafile with an exception for charts
-        //for charts a metafile with a higher resolution is created, because charts have resolution dependent content
-        bool local_getMetaFile_WithSpecialChartHandling( const uno::Reference< lang::XComponent >& 	  xSource, 
-                  const uno::Reference< drawing::XDrawPage >&     xContainingPage,
-                  GDIMetaFile&                                    rMtf,
-                  int                                             mtfLoadFlags,
-                  const uno::Reference< uno::XComponentContext >& rxContext )
-        {
-            uno::Reference<beans::XPropertySet> xProp( xSource, uno::UNO_QUERY );
-            rtl::OUString sCLSID;
-            getPropertyValue( sCLSID, xProp, OUSTR("CLSID"));
-            if( sCLSID.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("12DCAE26-281F-416F-a234-c3086127382e")) && local_getMetafileForChart( xSource, xContainingPage, rMtf ) )
-                return true;
-            return getMetaFile( xSource, xContainingPage, rMtf, mtfLoadFlags, rxContext );
-        }
-
-
         //////////////////////////////////////////////////////////////////////
         //
         // Private methods
@@ -221,7 +97,7 @@ namespace slideshow
                 // reload with added flags:
                 mpCurrMtf.reset( new GDIMetaFile );
                 mnCurrMtfLoadFlags |= MTF_LOAD_SCROLL_TEXT_MTF;
-                local_getMetaFile_WithSpecialChartHandling(
+                getMetaFile(
                     uno::Reference<lang::XComponent>(mxShape, uno::UNO_QUERY),
                     mxPage, *mpCurrMtf, mnCurrMtfLoadFlags,
                     mxComponentContext );
@@ -291,7 +167,7 @@ namespace slideshow
                 // subsetting information!
                 mpCurrMtf.reset( new GDIMetaFile );
                 mnCurrMtfLoadFlags |= MTF_LOAD_VERBOSE_COMMENTS;
-                local_getMetaFile_WithSpecialChartHandling(
+                getMetaFile(
                     uno::Reference<lang::XComponent>(mxShape, uno::UNO_QUERY),
                     mxPage, *mpCurrMtf, mnCurrMtfLoadFlags,
                     mxComponentContext );
@@ -582,7 +458,7 @@ namespace slideshow
             // must NOT be called from within initializer list, uses
             // state from mnCurrMtfLoadFlags!
             mpCurrMtf.reset( new GDIMetaFile );
-            local_getMetaFile_WithSpecialChartHandling(
+            getMetaFile(
                 uno::Reference<lang::XComponent>(xShape, uno::UNO_QUERY),
                 xContainingPage, *mpCurrMtf, mnCurrMtfLoadFlags,
                 mxComponentContext );

Modified: incubator/ooo/trunk/main/svtools/Library_svt.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/Library_svt.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/Library_svt.mk (original)
+++ incubator/ooo/trunk/main/svtools/Library_svt.mk Tue Jan  3 17:18:46 2012
@@ -212,7 +212,6 @@ $(eval $(call gb_Library_add_exception_o
 	svtools/source/java/javacontext \
 	svtools/source/java/javainteractionhandler \
 	svtools/source/misc/acceleratorexecute \
-	svtools/source/misc/chartprettypainter \
 	svtools/source/misc/cliplistener \
 	svtools/source/misc/dialogclosedlistener \
 	svtools/source/misc/dialogcontrolling \

Modified: incubator/ooo/trunk/main/svtools/Package_inc.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/Package_inc.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/Package_inc.mk (original)
+++ incubator/ooo/trunk/main/svtools/Package_inc.mk Tue Jan  3 17:18:46 2012
@@ -41,7 +41,6 @@ $(eval $(call gb_Package_add_file,svtool
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/brwbox.hxx,svtools/brwbox.hxx))
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/brwhead.hxx,svtools/brwhead.hxx))
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/calendar.hxx,svtools/calendar.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/chartprettypainter.hxx,svtools/chartprettypainter.hxx))
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/cliplistener.hxx,svtools/cliplistener.hxx))
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/colctrl.hxx,svtools/colctrl.hxx))
 $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/collatorres.hxx,svtools/collatorres.hxx))

Modified: incubator/ooo/trunk/main/svtools/inc/svtools/chartprettypainter.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/inc/svtools/chartprettypainter.hxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/inc/svtools/chartprettypainter.hxx (original)
+++ incubator/ooo/trunk/main/svtools/inc/svtools/chartprettypainter.hxx Tue Jan  3 17:18:46 2012
@@ -1,67 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#ifndef CHARTPRETTYPAINTER_HXX
-#define CHARTPRETTYPAINTER_HXX
-
-#ifndef INCLUDED_SVTDLLAPI_H
-#include "svtools/svtdllapi.h"
-#endif
-
-//#include <svtools/embedhlp.hxx>
-#include <vcl/outdev.hxx>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-// predeclarations
-namespace svt { class EmbeddedObjectRef; }
-
-/** use this class for a correct view representation of charts
-see issues #i82893#, #i75867#: charts must be painted resolution dependent!! 
-
-example usage when painting ole objects:
-if( ChartPrettyPainter::IsChart(xObjRef) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOutDev )
-    && ChartPrettyPainter::DoPrettyPaintChart( get/loadChartModel(), pOutDev, rLogicObjectRect ) )
-    return;
-else
-    use any other painting method for charts or paint other ole objects
-
-this way of usage ensures that ole objects are only loaded if necessary
-*/
-
-class SVT_DLLPUBLIC ChartPrettyPainter
-{
-public:
-    static bool IsChart( const svt::EmbeddedObjectRef& xObjRef );
-    static bool ShouldPrettyPaintChartOnThisDevice( OutputDevice* pOutDev );
-    static bool DoPrettyPaintChart( ::com::sun::star::uno::Reference<
-                    ::com::sun::star::frame::XModel > xChartModel,
-                        OutputDevice* pOutDev, const Rectangle& rLogicObjectRect );
-
-    ChartPrettyPainter();
-    virtual ~ChartPrettyPainter();
-    virtual bool DoPaint( OutputDevice* pOutDev, const Rectangle& rLogicObjectRect ) const;
-    static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
-};
-
-#endif

Modified: incubator/ooo/trunk/main/svtools/source/misc/chartprettypainter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/misc/chartprettypainter.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/misc/chartprettypainter.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/misc/chartprettypainter.cxx Tue Jan  3 17:18:46 2012
@@ -1,136 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include <svtools/chartprettypainter.hxx>
-
-#include <tools/globname.hxx>
-#include <sot/clsids.hxx>
-// header for function rtl_createUuid
-#include <rtl/uuid.h>
-#include <vcl/pdfextoutdevdata.hxx>
-
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <svtools/embedhlp.hxx>
-
-using namespace ::com::sun::star;
-
-ChartPrettyPainter::ChartPrettyPainter()
-{
-}
-
-ChartPrettyPainter::~ChartPrettyPainter()
-{
-}
-
-bool ChartPrettyPainter::DoPaint(OutputDevice* /*pOutDev*/, const Rectangle& /*rLogicObjectRect*/) const
-{
-    return false;
-}
-
-//static
-const uno::Sequence<sal_Int8>& ChartPrettyPainter::getUnoTunnelId()
-{
-    static uno::Sequence<sal_Int8> * pSeq = 0;
-	if( !pSeq )
-	{
-		osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
-		if( !pSeq )
-		{
-            static uno::Sequence< sal_Int8 > aSeq( 16 );
-			rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-			pSeq = &aSeq;
-		}
-	}
-	return *pSeq;
-}
-
-bool ChartPrettyPainter::IsChart( const svt::EmbeddedObjectRef& xObjRef )
-{
-    if ( !xObjRef.is() )
-        return false;
-
-    SvGlobalName aObjClsId( xObjRef->getClassID() );
-    if(
-        SvGlobalName(SO3_SCH_CLASSID_30) == aObjClsId
-        || SvGlobalName(SO3_SCH_CLASSID_40) == aObjClsId
-        || SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId
-        || SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId)
-    {
-        return true;
-    }
-
-	return false;
-}
-
-bool ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( OutputDevice* pOutDev )
-{
-    if( !pOutDev )
-        return false;
-    //at least the print preview in calc has a paint loop due to too much invalidate calls deep in sdr
-    //to avoid the paint loop we use the metafile replacement in this case instead of direct rendering
-    if( OUTDEV_WINDOW == pOutDev->GetOutDevType() )
-        return false;
-    if( OUTDEV_PRINTER == pOutDev->GetOutDevType() )
-        return true;
-    vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pOutDev->GetExtOutDevData() );
-    if( pPDFData )
-        return true;
-    return false;
-}
-
-bool ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel > xChartModel, OutputDevice* pOutDev, const Rectangle& rLogicObjectRect )
-{
-    //charts must be painted resolution dependent!! #i82893#, #i75867#
-    if( !xChartModel.is() || !ShouldPrettyPaintChartOnThisDevice( pOutDev ) )
-        return false;
-
-    try
-    {
-        uno::Reference< lang::XMultiServiceFactory > xFact( xChartModel, uno::UNO_QUERY );
-        OSL_ENSURE( xFact.is(), "Chart cannot be painted pretty!\n" );
-        if( xFact.is() )
-        {
-            uno::Reference< lang::XUnoTunnel > xChartRenderer( xFact->createInstance(
-                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.ChartRenderer" ) ) ), uno::UNO_QUERY );
-            OSL_ENSURE( xChartRenderer.is(), "Chart cannot be painted pretty!\n" );
-            if( xChartRenderer.is() )
-            {
-                ChartPrettyPainter* pPrettyPainter = reinterpret_cast<ChartPrettyPainter*>(
-                    xChartRenderer->getSomething( ChartPrettyPainter::getUnoTunnelId() ));
-                if( pPrettyPainter )
-                    return pPrettyPainter->DoPaint(pOutDev, rLogicObjectRect);
-            }
-        }
-    }
-    catch( uno::Exception& e )
-	{
-		(void)e;
-		DBG_ERROR( "Chart cannot be painted pretty!" );
-	}
-    return false; 
-}
-

Modified: incubator/ooo/trunk/main/svx/Library_svxcore.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/Library_svxcore.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/Library_svxcore.mk (original)
+++ incubator/ooo/trunk/main/svx/Library_svxcore.mk Tue Jan  3 17:18:46 2012
@@ -298,6 +298,7 @@ $(eval $(call gb_Library_add_exception_o
     svx/source/sdr/properties/connectorproperties \
     svx/source/sdr/properties/e3dcompoundproperties \
     svx/source/sdr/properties/oleproperties \
+    svx/source/svdraw/charthelper \
     svx/source/svdraw/clonelist \
     svx/source/svdraw/gradtrns \
     svx/source/svdraw/polypolygoneditor \

Modified: incubator/ooo/trunk/main/svx/Package_inc.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/Package_inc.mk?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/Package_inc.mk (original)
+++ incubator/ooo/trunk/main/svx/Package_inc.mk Tue Jan  3 17:18:46 2012
@@ -27,6 +27,7 @@
 
 $(eval $(call gb_Package_Package,svx_inc,$(SRCDIR)/svx/inc))
 
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/charthelper.hxx,svx/charthelper.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxsoitm.hxx,svx/sxsoitm.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdshtitm.hxx,svx/sdshtitm.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/polysc3d.hxx,svx/polysc3d.hxx))

Added: incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx?rev=1226879&view=auto
==============================================================================
--- incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx (added)
+++ incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx Tue Jan  3 17:18:46 2012
@@ -0,0 +1,55 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef CHARTHELPER_HXX
+#define CHARTHELPER_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <svx/svxdllapi.h>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+namespace svt { class EmbeddedObjectRef; }
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC ChartHelper
+{
+public:
+    // test if given reference is a chart
+    static bool IsChart(const svt::EmbeddedObjectRef& xObjRef);
+
+    // try to access rXModel in case of a chart to to get the chart content
+    // as sequence of primitives. Return range of primitives (chart size) in rRange;
+    // it will be used to embed the chart to the SdrObject transformation. This
+    // allows to define possible distances between chart and SDrObject bounds here
+    static drawinglayer::primitive2d::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
+        const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rXModel,
+        basegfx::B2DRange& rRange);
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //CHARTHELPER_HXX

Modified: incubator/ooo/trunk/main/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx (original)
+++ incubator/ooo/trunk/main/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx Tue Jan  3 17:18:46 2012
@@ -25,6 +25,7 @@
 #define _SDR_CONTACT_VIEWCONTACTOFSDROLE2OBJ_HXX
 
 #include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 // predeclarations
@@ -52,7 +53,10 @@ namespace sdr
 				return (SdrOle2Obj&)GetSdrObject();
 			}
 
-			// basic constructor, used from SdrObject.
+            /// helper to create transformation from SdrObject
+            basegfx::B2DHomMatrix createObjectTransform() const;
+
+            // basic constructor, used from SdrObject.
 			ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj);
 			virtual ~ViewContactOfSdrOle2Obj();
 

Modified: incubator/ooo/trunk/main/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx Tue Jan  3 17:18:46 2012
@@ -38,6 +38,8 @@
 #include <vcl/svapp.hxx>
 #include <svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <svx/charthelper.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -64,20 +66,29 @@ namespace sdr
 		{
 		}
 
-        drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
-            bool bHighContrast) const
+        basegfx::B2DHomMatrix ViewContactOfSdrOle2Obj::createObjectTransform() const
         {
             // take unrotated snap rect (direct model data) for position and size
-		    const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
-		    const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+            const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
+            const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
 
-		    // create object matrix
-		    const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
+            // create object matrix
+            const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
             const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
             const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
-			const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
-				aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
-				aObjectRange.getMinX(), aObjectRange.getMinY()));
+            
+            return basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+                aObjectRange.getWidth(), aObjectRange.getHeight(), 
+                fShearX, 
+                fRotate,
+                aObjectRange.getMinX(), aObjectRange.getMinY());
+        }
+
+        drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
+            bool bHighContrast) const
+        {
+            // get object transformation
+            const basegfx::B2DHomMatrix aObjectMatrix(createObjectTransform());
 
 		    // Prepare attribute settings, will be used soon anyways
 			const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
@@ -85,13 +96,44 @@ namespace sdr
 				drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
                     rItemSet, 
                     GetOle2Obj().getText(0)));
+            drawinglayer::primitive2d::Primitive2DReference xContent;
 
-            // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
-            // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
-            // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
-            // It will also take care of HighContrast and ScaleContent
-            const drawinglayer::primitive2d::Primitive2DReference xOleContent(
-                new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+            if(GetOle2Obj().IsChart())
+            {
+                // try to get chart primitives and chart range directly from xChartModel
+                basegfx::B2DRange aChartContentRange;
+                const drawinglayer::primitive2d::Primitive2DSequence aChartSequence(
+                    ChartHelper::tryToGetChartContentAsPrimitive2DSequence(
+                        GetOle2Obj().getXModel(),
+                        aChartContentRange));
+                const double fWidth(aChartContentRange.getWidth());
+                const double fHeight(aChartContentRange.getHeight());
+
+                if(aChartSequence.hasElements() 
+                    && basegfx::fTools::more(fWidth, 0.0)
+                    && basegfx::fTools::more(fHeight, 0.0))
+                {
+                    // create embedding transformation
+                    basegfx::B2DHomMatrix aEmbed(
+                        basegfx::tools::createTranslateB2DHomMatrix(
+                            -aChartContentRange.getMinX(), 
+                            -aChartContentRange.getMinY()));
+
+                    aEmbed.scale(1.0 / fWidth, 1.0 / fHeight);
+                    aEmbed = aObjectMatrix * aEmbed;
+                    xContent = new drawinglayer::primitive2d::TransformPrimitive2D(
+                        aEmbed,
+                        aChartSequence);
+                }
+            }
+
+            if(!xContent.is())
+            {
+                // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+                // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+                // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+                // It will also take care of HighContrast and ScaleContent
+                xContent = new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
                     GetOle2Obj(),
                     aObjectMatrix,
 
@@ -99,15 +141,15 @@ namespace sdr
                     // content change in the primitive later
                     GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
 
-                    bHighContrast));
-            
+                    bHighContrast);
+            }
+
             // create primitive. Use Ole2 primitive here. Prepare attribute settings, will 
 			// be used soon anyways. Always create primitives to allow the decomposition of 
 			// SdrOle2Primitive2D to create needed invisible elements for HitTest and/or BoundRect
-            const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
             const drawinglayer::primitive2d::Primitive2DReference xReference(
                 new drawinglayer::primitive2d::SdrOle2Primitive2D(
-			        xOLEContent,
+			        drawinglayer::primitive2d::Primitive2DSequence(&xContent, 1),
 			        aObjectMatrix, 
 			        aAttribute));
 

Modified: incubator/ooo/trunk/main/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx Tue Jan  3 17:18:46 2012
@@ -30,12 +30,12 @@
 #include <svx/svdoole2.hxx>
 #include <svx/sdr/contact/objectcontact.hxx>
 #include <svx/svdview.hxx>
-#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <com/sun/star/embed/EmbedMisc.hpp>
 #include <com/sun/star/embed/EmbedStates.hpp>
 #include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -70,7 +70,6 @@ namespace sdr
 
             const bool bIsOutplaceActive(nState == embed::EmbedStates::ACTIVE);
             const bool bIsInplaceActive((nState == embed::EmbedStates::INPLACE_ACTIVE) || (nState == embed::EmbedStates::UI_ACTIVE));
-            const bool bIsChart(rSdrOle2.IsChart());
             bool bDone(false);
  
             if(!bDone && bIsInplaceActive)
@@ -85,122 +84,49 @@ namespace sdr
 
             if( !bDone )
             {
-                const Rectangle& rObjectRectangle(rSdrOle2.GetGeoRect());
-		        const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
-
-		        // create object transform
-		        basegfx::B2DHomMatrix aObjectTransform;
-		        aObjectTransform.set(0, 0, aObjectRange.getWidth());
-		        aObjectTransform.set(1, 1, aObjectRange.getHeight());
-		        aObjectTransform.set(0, 2, aObjectRange.getMinX());
-		        aObjectTransform.set(1, 2, aObjectRange.getMinY());
-
-                if(bIsChart)
-		        {
-                    //charts must be painted resolution dependent!! #i82893#, #i75867#
-
-			        // for chart, to not lose the current better quality visualisation which
-			        // uses a direct paint, use a primtive wrapper for that exceptional case. The renderers
-			        // will then ATM paint it to an OutputDevice directly.
-			        // In later versions this should be replaced by getting the Primitive2DSequnce from
-			        // the chart and using it.
-			        // to be able to render something in non-VCL using renderers, the wrapper is a
-			        // GroupPrimitive2D which automatically decomposes to the already created Metafile
-			        // content.
-			        // For being completely compatible, ATM Window and VDEV PrettyPrinting is suppressed.
-			        // It works in the VCL renderers, though. So for activating again with VCL primitive
-			        // renderers, change conditions here.
-
-			        // determine if embedding and PrettyPrinting shall be done at all
-			        uno::Reference< frame::XModel > xChartModel;
-			        bool bDoChartPrettyPrinting(true);
-				    
-			        // the original ChartPrettyPainter does not do it for Window
-			        if(bDoChartPrettyPrinting && GetObjectContact().isOutputToWindow())
-			        {
-				        bDoChartPrettyPrinting = false;
-			        }
-
-			        // the original ChartPrettyPainter does not do it for VDEV
-			        if(bDoChartPrettyPrinting && GetObjectContact().isOutputToVirtualDevice())
-			        {
-				        if(GetObjectContact().isOutputToPDFFile())
-				        {
-					        // #i97982#
-					        // For PDF files, allow PrettyPrinting
-				        }
-				        else
-				        {
-					        bDoChartPrettyPrinting = false;
-				        }
-			        }
-
-			        // the chart model is needed. Check if it's available
-			        if(bDoChartPrettyPrinting)
-			        {
-				        // get chart model
-				        xChartModel = rSdrOle2.getXModel();
-
-				        if(!xChartModel.is())
-				        {
-					        bDoChartPrettyPrinting = false;
-				        }
-			        }
-
-			        if(bDoChartPrettyPrinting)
-			        {
-				        // embed MetaFile data in a specialized Wrapper Primitive which holds also the ChartModel needed
-				        // for PrettyPrinting
-				        const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ChartPrimitive2D(
-					        xChartModel, aObjectTransform, xRetval));
-				        xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
-                        bDone = true;
-			        }
-		        }
-
-                if( !bDone )
+                //old stuff that should be reworked
                 {
-                    //old stuff that should be reworked
+                    //if no replacement image is available load the OLE object
+//                    if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
+//                    {
+//	                    // try to create embedded object
+//                        rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
+//                    }
+                    const svt::EmbeddedObjectRef& xObjRef  = rSdrOle2.getEmbeddedObjectRef();
+                    if(xObjRef.is())
                     {
-                        //if no replacement image is available load the OLE object
-                        if(!rSdrOle2.GetGraphic()) //try to fetch the metafile - this can lead to the actual creation of the metafile what can be extremely expensive (e.g. for big charts)!!! #i101925#
-                        {
-	                        // try to create embedded object
-                            rSdrOle2.GetObjRef(); //this loads the OLE object if it is not loaded already
-                        }
-                        const svt::EmbeddedObjectRef& xObjRef  = rSdrOle2.getEmbeddedObjectRef();
-                        if(xObjRef.is())
-                        {
-                            const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
+                        const sal_Int64 nMiscStatus(xObjRef->getStatus(rSdrOle2.GetAspect()));
 
-                            // this hack (to change model data during PAINT argh(!)) should be reworked
-                            if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
-                            {
-	                            const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
-                            }
-
-                            SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
-	                        if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
-	                        {
-		                        // connect plugin object
-		                        pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
-	                        }
+                        // this hack (to change model data during PAINT argh(!)) should be reworked
+                        if(!rSdrOle2.IsResizeProtect() && (nMiscStatus & embed::EmbedMisc::EMBED_NEVERRESIZE))
+                        {
+	                        const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
                         }
-                    }//end old stuff to rework
 
-                    // create OLE primitive stuff directly at VC with HC as parameter
-		            const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
-                    xRetval = rVC.createPrimitive2DSequenceWithParameters(GetObjectContact().isDrawModeHighContrast());
-                }
+                        SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+	                    if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
+	                    {
+		                    // connect plugin object
+		                    pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
+	                    }
+                    }
+                }//end old stuff to rework
+
+                // create OLE primitive stuff directly at VC with HC as parameter
+		        const ViewContactOfSdrOle2Obj& rVC = static_cast< const ViewContactOfSdrOle2Obj& >(GetViewContact());
+                xRetval = rVC.createPrimitive2DSequenceWithParameters(GetObjectContact().isDrawModeHighContrast());
 
                 if(bIsOutplaceActive)
 		        {
 			        // do not shade when printing or PDF exporting
 			        if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
 			        {
-				        // shade the representation if the object is activated outplace
+                        // get object transformation
+                        const basegfx::B2DHomMatrix aObjectMatrix(static_cast< ViewContactOfSdrOle2Obj& >(GetViewContact()).createObjectTransform());
+				        
+                        // shade the representation if the object is activated outplace
 				        basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon());
-				        aObjectOutline.transform(aObjectTransform);
+				        aObjectOutline.transform(aObjectMatrix);
 
 				        // Use a FillHatchPrimitive2D with necessary attributes
 				        const drawinglayer::attribute::FillHatchAttribute aFillHatch(

Added: incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx?rev=1226879&view=auto
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx (added)
+++ incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx Tue Jan  3 17:18:46 2012
@@ -0,0 +1,143 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/charthelper.hxx>
+#include <svtools/embedhlp.hxx>
+#include <tools/globname.hxx>
+#include <sot/clsids.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//// header for function rtl_createUuid
+//#include <rtl/uuid.h>
+//#include <vcl/pdfextoutdevdata.hxx>
+//
+//#include <com/sun/star/lang/XUnoTunnel.hpp>
+//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+//#include <svtools/embedhlp.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace ::com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+bool ChartHelper::IsChart(const svt::EmbeddedObjectRef& xObjRef)
+{
+    if(!xObjRef.is())
+    {
+        return false;
+    }
+
+    const SvGlobalName aObjClsId(xObjRef->getClassID());
+
+    if(SvGlobalName(SO3_SCH_CLASSID_30) == aObjClsId
+        || SvGlobalName(SO3_SCH_CLASSID_40) == aObjClsId
+        || SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId
+        || SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId)
+    {
+        return true;
+    }
+
+    return false;
+}
+
+drawinglayer::primitive2d::Primitive2DSequence ChartHelper::tryToGetChartContentAsPrimitive2DSequence(
+    const uno::Reference< ::frame::XModel >& rXModel,
+    basegfx::B2DRange& rRange)
+{
+    drawinglayer::primitive2d::Primitive2DSequence aRetval;
+
+    if(rXModel.is())
+    {
+        try
+        {
+            const uno::Reference< lang::XMultiServiceFactory > xChartFact(rXModel, uno::UNO_QUERY_THROW);
+            const uno::Reference< lang::XUnoTunnel > xChartView(xChartFact->createInstance(::rtl::OUString::createFromAscii("com.sun.star.chart2.ChartView")), uno::UNO_QUERY_THROW);
+            const uno::Reference< util::XUpdatable > xUpdatable(xChartView, uno::UNO_QUERY_THROW);
+
+            if(xUpdatable.is())
+            {
+                xUpdatable->update();
+
+                const uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(rXModel, uno::UNO_QUERY_THROW);
+                const uno::Reference< container::XIndexAccess > xShapeAccess(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
+
+                if(xShapeAccess.is() && xShapeAccess->getCount())
+                {
+                    const sal_Int32 nShapeCount(xShapeAccess->getCount());
+                    const uno::Reference< lang::XMultiServiceFactory > xMgr(::comphelper::getProcessServiceFactory());
+                    const uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory(
+                        xMgr->createInstance(
+                            String(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.graphic.PrimitiveFactory2D" ))), 
+                            uno::UNO_QUERY);
+
+                    if(xPrimitiveFactory.is())
+                    {
+                        const uno::Sequence< beans::PropertyValue > aParams;
+                        uno::Reference< drawing::XShape > xShape;
+
+                        for(sal_Int32 a(0); a < nShapeCount; a++)
+                        {
+                            xShapeAccess->getByIndex(a) >>= xShape;
+
+                            if(xShape.is())
+                            {
+                                const drawinglayer::primitive2d::Primitive2DSequence aNew( 
+                                    xPrimitiveFactory->createPrimitivesFromXShape( 
+                                        xShape, 
+                                        aParams));
+
+                                drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(
+                                    aRetval,
+                                    aNew);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        catch(uno::Exception&)
+        {
+            OSL_ENSURE(false, "Unexpected exception!");
+        }
+
+        if(aRetval.hasElements())
+        {
+            const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+            
+            rRange = drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(aRetval, aViewInformation2D);
+        }
+    }
+
+    return aRetval;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx?rev=1226879&r1=1226878&r2=1226879&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx Tue Jan  3 17:18:46 2012
@@ -78,7 +78,7 @@
 #include <svx/svdetc.hxx>
 #include <svx/svdview.hxx>
 #include "unomlstr.hxx"
-#include <svtools/chartprettypainter.hxx>
+#include <svx/charthelper.hxx>
 #include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
 #include <svx/svdograf.hxx>
 #include <svx/sdr/properties/oleproperties.hxx>
@@ -2185,7 +2185,7 @@ sal_Bool SdrOle2Obj::IsChart() const
 {
     if ( !m_bTypeAsked )
     {
-        m_bChart = ChartPrettyPainter::IsChart(xObjRef);
+        m_bChart = ChartHelper::IsChart(xObjRef);
         m_bTypeAsked = true;
     }
     return m_bChart;



Mime
View raw message