summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-09-05 16:40:16 +0000
committerKurt Zenker <kz@openoffice.org>2007-09-05 16:40:16 +0000
commitbdfd7ed115a6f543c9c5d665e191f28e1421ae16 (patch)
treef11057faf69d4b269649d02e9d98103a3a7043f8 /svx
parent753fd43bfb0e443e3dfebdafe9c28df3e878974c (diff)
INTEGRATION: CWS impress130_SRC680 (1.17.102); FILE MERGED
2007/09/04 13:33:52 af 1.17.102.2: #i81212# Added missing includes. 2007/09/04 13:26:51 af 1.17.102.1: #i81212# In ShouldPaintObject() the paint rectangle is enlarged by one pixel to counter rounding errors.
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobj.cxx44
1 files changed, 39 insertions, 5 deletions
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 2fccbef22b63..e334cf40401b 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: viewcontactofsdrobj.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 18:46:04 $
+ * last change: $Author: kz $ $Date: 2007-09-05 17:40:16 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -76,6 +76,18 @@
#include <svx/sdr/animation/ainfoscrolltext.hxx>
#endif
+#ifndef _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
+#include <svx/sdr/contact/objectcontactofpageview.hxx>
+#endif
+
+#ifndef _SDRPAGEWINDOW_HXX
+#include <svx/sdrpagewindow.hxx>
+#endif
+
+#ifndef _SDRPAINTWINDOW_HXX
+#include <svx/sdrpaintwindow.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
namespace sdr
@@ -204,7 +216,7 @@ namespace sdr
// When ShouldPaintObject() returns sal_True, the object itself is painted and
// PaintObject() is called.
- sal_Bool ViewContactOfSdrObj::ShouldPaintObject(DisplayInfo& rDisplayInfo, const ViewObjectContact& /*rAssociatedVOC*/)
+ sal_Bool ViewContactOfSdrObj::ShouldPaintObject(DisplayInfo& rDisplayInfo, const ViewObjectContact& rAssociatedVOC)
{
// Test layer visibility
if(!rDisplayInfo.GetProcessLayers().IsSet(GetSdrObject().GetLayer()))
@@ -214,8 +226,30 @@ namespace sdr
// Test area visibility
const Region& rRedrawArea = rDisplayInfo.GetRedrawArea();
-
- if(!rRedrawArea.IsEmpty() && !rRedrawArea.IsOver(GetPaintRectangle()))
+ // Before we can test whether the paint rectangle has an
+ // intersection with the redraw area we enlarge the paint
+ // rectangle by the equivalent in logical coordinates of one
+ // pixel. This takes care of rounding errors in VCL of the
+ // redraw area (#i81212#). (The redraw area is the one which
+ // should be enlarged but it may consist of more than one
+ // rectangle and enlarging the paint rectangle leads to the same
+ // result). This can be considered a hack. Not because its
+ // there but because it is here. It belongs to VCL where
+ // internally the redraw rectangles are transformed into pixels
+ // and back again.
+ Rectangle aPaintRectangle (GetPaintRectangle());
+ ObjectContactOfPageView* pObjectContact
+ = dynamic_cast<ObjectContactOfPageView*>(&rAssociatedVOC.GetObjectContact());
+ if (pObjectContact != NULL)
+ {
+ OutputDevice& rDevice = pObjectContact->GetPageWindow().GetPaintWindow().GetOutputDevice();
+ Size aOnePixel (rDevice.PixelToLogic(Size(1,1)));
+ aPaintRectangle.Left() -= aOnePixel.Width();
+ aPaintRectangle.Right() += aOnePixel.Width();
+ aPaintRectangle.Top() -= aOnePixel.Height();
+ aPaintRectangle.Bottom() += aOnePixel.Height();
+ }
+ if(!rRedrawArea.IsEmpty() && !rRedrawArea.IsOver(aPaintRectangle))
{
return sal_False;
}