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/source/sdr | |
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/source/sdr')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 6 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 4 |
3 files changed, 7 insertions, 7 deletions
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 |