summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/primitivetools2d.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-11-12 11:26:43 +0100
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-11-12 11:26:43 +0100
commit15dcfdd7c813c4158a18c52c7ba22c14c7dac996 (patch)
tree6d144b4da1dacfce5271bdeb76312e01841d5f10 /drawinglayer/source/primitive2d/primitivetools2d.cxx
parent95ccca996e41c0ff9fa70fb5007f06796a98bc1c (diff)
aw078 #i106541# commited in-between stable version with already advanced metafile decomposition for security reasons
Diffstat (limited to 'drawinglayer/source/primitive2d/primitivetools2d.cxx')
-rw-r--r--drawinglayer/source/primitive2d/primitivetools2d.cxx72
1 files changed, 72 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx
index 30af3a998daf..2b25590bf1f4 100644
--- a/drawinglayer/source/primitive2d/primitivetools2d.cxx
+++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx
@@ -103,4 +103,76 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current ViewTransformation
+ const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ if(!getBuffered2DDecomposition().hasElements())
+ {
+ // remember new valid ViewTransformation
+ const_cast< ViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation;
+ }
+
+ // call base implementation
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current ViewTransfromation
+ const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ // get the current ObjectTransformation
+ const basegfx::B2DHomMatrix& rObjectTransformation = rViewInformation.getObjectTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rObjectTransformation != getObjectTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ if(!getBuffered2DDecomposition().hasElements())
+ {
+ // remember new valid ViewTransformation, and ObjectTransformation
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation;
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maObjectTransformation = rObjectTransformation;
+ }
+
+ // call base implementation
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// eof