diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-02 14:35:31 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-04 12:30:41 -0500 |
commit | 28bf1a3a1408df042d7e767c3760e47faf2d077e (patch) | |
tree | c4e3534682b14ae33f6e24a3cadd8f9c58fc4644 /svx/source/sdr/contact/viewobjectcontact.cxx | |
parent | f281d2d24c2a368c58d32b1b50acf83e0f056d90 (diff) |
Avoid re-constructing chart shapes when it's not in visible range.
The re-construction will be deferred until it becomes visible again.
Change-Id: I364ea8d38d48078dfd803b0e5bb20bfc8a2913ba
Diffstat (limited to 'svx/source/sdr/contact/viewobjectcontact.cxx')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontact.cxx | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 140c5c8ba6fe..664f5b1fbded 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -206,15 +206,23 @@ const basegfx::B2DRange& ViewObjectContact::getObjectRange() const { if(maObjectRange.isEmpty()) { - // if range is not computed (new or LazyInvalidate objects), force it - const DisplayInfo aDisplayInfo; - const drawinglayer::primitive2d::Primitive2DSequence xSequence(getPrimitive2DSequence(aDisplayInfo)); - - if(xSequence.hasElements()) + const drawinglayer::geometry::ViewInformation2D& rViewInfo2D = GetObjectContact().getViewInformation2D(); + basegfx::B2DRange aTempRange = GetViewContact().getRange(rViewInfo2D); + if (!aTempRange.isEmpty()) { - const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D()); - const_cast< ViewObjectContact* >(this)->maObjectRange = - drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSequence, rViewInformation2D); + const_cast< ViewObjectContact* >(this)->maObjectRange = aTempRange; + } + else + { + // if range is not computed (new or LazyInvalidate objects), force it + const DisplayInfo aDisplayInfo; + const drawinglayer::primitive2d::Primitive2DSequence xSequence(getPrimitive2DSequence(aDisplayInfo)); + + if(xSequence.hasElements()) + { + const_cast< ViewObjectContact* >(this)->maObjectRange = + drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSequence, rViewInfo2D); + } } } @@ -257,7 +265,7 @@ void ViewObjectContact::triggerLazyInvalidate() // drawn by the drawinglayer ViewContactOfSdrOle2Obj* pViewContact = dynamic_cast<ViewContactOfSdrOle2Obj*>(&GetViewContact()); if (pViewContact && pViewContact->GetOle2Obj().IsReal3DChart()) - ChartHelper::updateChart(pViewContact->GetOle2Obj().getXModel()); + ChartHelper::updateChart(pViewContact->GetOle2Obj().getXModel(), false); #endif // force ObjectRange @@ -415,7 +423,8 @@ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2D const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport()); // check geometrical visibility - if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange)) + bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(aObjectRange); + if(!bVisible) { // not visible, release xRetval.realloc(0); |