summaryrefslogtreecommitdiff
path: root/cppcanvas/source/tools
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-07-17 14:26:30 +0000
committerOliver Bolte <obo@openoffice.org>2007-07-17 14:26:30 +0000
commitdb8ecd84213f788bdaf22c65c97259a421e10bc6 (patch)
treef9eeabd7d208d648ecdd428adf97e5832c5b2a94 /cppcanvas/source/tools
parent5bb8d6bf7415b173d5ec9e5441c060420fd9dfaa (diff)
INTEGRATION: CWS presfixes12 (1.8.18); FILE MERGED
2007/06/19 11:25:23 thb 1.8.18.3: #i10000# Reversed order, seems that gcc does not handle the safe bool idiom correctly here 2007/06/18 14:33:23 thb 1.8.18.2: #i10000# Avoid boost::optional::get(), which changed semantics after 1.31 (breaks the build for --with-system-boost) 2007/03/08 21:37:07 thb 1.8.18.1: #i37778# Added extra setClip() method to be able to set no clip - setting a clip with zero polygons by definition clips everything
Diffstat (limited to 'cppcanvas/source/tools')
-rw-r--r--cppcanvas/source/tools/canvasgraphichelper.cxx32
1 files changed, 14 insertions, 18 deletions
diff --git a/cppcanvas/source/tools/canvasgraphichelper.cxx b/cppcanvas/source/tools/canvasgraphichelper.cxx
index 210b97c233ab..558fb76c71cd 100644
--- a/cppcanvas/source/tools/canvasgraphichelper.cxx
+++ b/cppcanvas/source/tools/canvasgraphichelper.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: canvasgraphichelper.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: obo $ $Date: 2006-10-12 15:00:40 $
+ * last change: $Author: obo $ $Date: 2007-07-17 15:26:30 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -38,25 +38,15 @@
#include <canvasgraphichelper.hxx>
-#ifndef _COM_SUN_STAR_RENDERING_XGRAPHICDEVICE_HPP_
#include <com/sun/star/rendering/XGraphicDevice.hpp>
-#endif
-#ifndef _COM_SUN_STAR_RENDERING_XPOLYPOLYGON2D_HPP_
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
-#endif
-#ifndef _CANVAS_CANVASTOOLS_HXX
#include <canvas/canvastools.hxx>
-#endif
-#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
#include <basegfx/tools/canvastools.hxx>
-#endif
-#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
#include <basegfx/matrix/b2dhommatrix.hxx>
-#endif
#include <cppcanvas/polypolygon.hxx>
-#include <tools.hxx>
+#include "tools.hxx"
using namespace ::com::sun::star;
@@ -101,18 +91,24 @@ namespace cppcanvas
void CanvasGraphicHelper::setClip( const ::basegfx::B2DPolyPolygon& rClipPoly )
{
// TODO(T3): not thread-safe. B2DPolyPolygon employs copy-on-write
- maClipPolyPolygon = rClipPoly;
+ maClipPolyPolygon.reset( rClipPoly );
maRenderState.Clip.clear();
}
- ::basegfx::B2DPolyPolygon CanvasGraphicHelper::getClip() const
+ void CanvasGraphicHelper::setClip()
{
- return maClipPolyPolygon;
+ maClipPolyPolygon.reset();
+ maRenderState.Clip.clear();
+ }
+
+ ::basegfx::B2DPolyPolygon const* CanvasGraphicHelper::getClip() const
+ {
+ return !maClipPolyPolygon ? NULL : &(*maClipPolyPolygon);
}
const rendering::RenderState& CanvasGraphicHelper::getRenderState() const
{
- if( maClipPolyPolygon.count() && !maRenderState.Clip.is() )
+ if( maClipPolyPolygon && !maRenderState.Clip.is() )
{
uno::Reference< rendering::XCanvas > xCanvas( mpCanvas->getUNOCanvas() );
if( !xCanvas.is() )
@@ -120,7 +116,7 @@ namespace cppcanvas
maRenderState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
xCanvas->getDevice(),
- maClipPolyPolygon );
+ *maClipPolyPolygon );
}
return maRenderState;