diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-14 09:11:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-22 06:44:08 +0000 |
commit | cc15806b527cc02c57bd92211fda259e33963106 (patch) | |
tree | 85aa90d0f1013ccef85cbfa2c0f064f905b0c464 /svx | |
parent | 41f7878ccbc457ef0431c999d38d9d77265d5dc7 (diff) |
convert BasePrimitive2D::get2DDecomposition to use a visitor
which lets us avoid constructing the decomposition when we are only
interesting in the bounding box, e.g. for hit testing
Change-Id: Icd8d430b75d207063f1db70e5a0822d5d82a7d00
Reviewed-on: https://gerrit.libreoffice.org/30835
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
5 files changed, 9 insertions, 9 deletions
diff --git a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx index 0855f028887a..c6b22ffbbcf8 100644 --- a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx @@ -54,7 +54,7 @@ namespace drawinglayer virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; // local decomposition. - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& aViewInformation) const override; // provide unique ID DeclPrimitive2DIDBlock() diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx index 523d70f7c0f2..3da7cc1b92ea 100644 --- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -92,7 +92,7 @@ namespace drawinglayer // own get2DDecomposition to take aspect of decomposition with or without spell checker // into account - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; // transformed clone operator virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0; diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 817fb162d364..a0488a38970d 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -781,7 +781,7 @@ namespace sdr { namespace contact { protected: virtual void get2DDecomposition( - ::drawinglayer::primitive2d::Primitive2DContainer& rContainer, + ::drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor, const ::drawinglayer::geometry::ViewInformation2D& rViewInformation ) const override; @@ -1529,7 +1529,7 @@ namespace sdr { namespace contact { } - void LazyControlCreationPrimitive2D::get2DDecomposition( ::drawinglayer::primitive2d::Primitive2DContainer& rContainer, const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + void LazyControlCreationPrimitive2D::get2DDecomposition( ::drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor, const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const { #if OSL_DEBUG_LEVEL > 0 ::basegfx::B2DVector aScale, aTranslate; @@ -1538,7 +1538,7 @@ namespace sdr { namespace contact { #endif if ( m_pVOCImpl->hasControl() ) impl_positionAndZoomControl( _rViewInformation ); - BufferedDecompositionPrimitive2D::get2DDecomposition( rContainer, _rViewInformation ); + BufferedDecompositionPrimitive2D::get2DDecomposition( rVisitor, _rViewInformation ); } diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index 7fe161f3b14d..e69f009db39a 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -66,7 +66,7 @@ namespace drawinglayer return false; } - void SdrOle2Primitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*aViewInformation*/) const + void SdrOle2Primitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*aViewInformation*/) const { // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition // should happen. For the moment we only need the OLE itself @@ -170,7 +170,7 @@ namespace drawinglayer getSdrLFSTAttribute().getShadow()); } - rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end()); + rVisitor.append(aRetval); } // provide unique ID diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index ab8ca841a889..943775beed68 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -137,7 +137,7 @@ namespace drawinglayer return false; } - void SdrTextPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void SdrTextPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage; bool bCurrentlyVisualizingPageIsSet(false); @@ -234,7 +234,7 @@ namespace drawinglayer } // call parent - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer |