summaryrefslogtreecommitdiff
path: root/sw/source/core/draw/dflyobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/draw/dflyobj.cxx')
-rw-r--r--sw/source/core/draw/dflyobj.cxx52
1 files changed, 25 insertions, 27 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index f1108db65c..b5a446c457 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -68,10 +68,8 @@ using namespace ::com::sun::star;
// AW: For VCOfDrawVirtObj and stuff
#include <svx/sdr/contact/viewcontactofvirtobj.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <sw_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
using namespace ::com::sun::star;
@@ -243,20 +241,15 @@ namespace drawinglayer
if(!getOuterRange().isEmpty())
{
// currently this SW object has no primitive representation. As long as this is the case,
- // create an invisible HitTestPrimitive to allow hitting the object. Use a filled primitive
- // to get a HitTest which uses 'inside' as default object hit. The special cases from
+ // create invisible geometry to allow corfect HitTest and BoundRect calculations for the
+ // object. Use a filled primitive to get 'inside' as default object hit. The special cases from
// the old SwVirtFlyDrawObj::CheckHit implementation are handled now in SwDrawView::PickObj;
- // this removed the 'hack' to get a view from inside model data or to react on noll-tolerance
+ // this removed the 'hack' to get a view from inside model data or to react on null-tolerance
// as it was done in the old implementation
- const basegfx::B2DPolygon aOuterRangePolygon(basegfx::tools::createPolygonFromRect(getOuterRange()));
- const basegfx::BColor aColor(0.0, 0.0, 0.0);
- const Primitive2DReference aContentReference(
- new PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(aOuterRangePolygon),
- aColor));
const Primitive2DReference aHitTestReference(
- new HitTestPrimitive2D(
- Primitive2DSequence(&aContentReference, 1)));
+ createHiddenGeometryPrimitives2D(
+ true,
+ getOuterRange()));
aRetval = Primitive2DSequence(&aHitTestReference, 1);
}
@@ -302,9 +295,9 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////////////
-// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
-// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
-// For paint, that offset is used by setting at the OutputDevice; for primitives this is
+// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
+// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
+// For paint, that offset is used by setting at the OutputDevice; for primitives this is
// not possible since we have no OutputDevice, but define the geometry itself.
namespace sdr
@@ -325,7 +318,7 @@ namespace sdr
{
}
virtual ~VCOfSwVirtFlyDrawObj();
-
+
// access to SwVirtFlyDrawObj
SwVirtFlyDrawObj& GetSwVirtFlyDrawObj() const
{
@@ -354,7 +347,7 @@ namespace sdr
{
const drawinglayer::primitive2d::Primitive2DReference xPrimitive(
new drawinglayer::primitive2d::SwVirtFlyDrawObjPrimitive(
- GetSwVirtFlyDrawObj(),
+ GetSwVirtFlyDrawObj(),
aOuterRange));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPrimitive, 1);
@@ -385,8 +378,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getOuterBound() const
{
const Rectangle aOuterRectangle(pFlyFrame->Frm().Pos(), pFlyFrame->Frm().SSize());
- if(!aOuterRectangle.IsEmpty()
- && RECT_EMPTY != aOuterRectangle.Right()
+ if(!aOuterRectangle.IsEmpty()
+ && RECT_EMPTY != aOuterRectangle.Right()
&& RECT_EMPTY != aOuterRectangle.Bottom())
{
aOuterRange.expand(basegfx::B2DTuple(aOuterRectangle.Left(), aOuterRectangle.Top()));
@@ -411,8 +404,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getInnerBound() const
{
const Rectangle aInnerRectangle(pFlyFrame->Frm().Pos() + pFlyFrame->Prt().Pos(), pFlyFrame->Prt().SSize());
- if(!aInnerRectangle.IsEmpty()
- && RECT_EMPTY != aInnerRectangle.Right()
+ if(!aInnerRectangle.IsEmpty()
+ && RECT_EMPTY != aInnerRectangle.Right()
&& RECT_EMPTY != aInnerRectangle.Bottom())
{
aInnerRange.expand(basegfx::B2DTuple(aInnerRectangle.Left(), aInnerRectangle.Top()));
@@ -498,7 +491,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
if(bDrawObject)
{
- if(!pFlyFrm->IsFlyInCntFrm())
+ if(!pFlyFrm->IsFlyInCntFrm())
{
// it is also necessary to restore the VCL MapMode from ViewInformation since e.g.
// the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this
@@ -507,10 +500,10 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
pOut->Push(PUSH_MAPMODE);
pOut->SetMapMode(pShell->getPrePostMapMode());
-
+
// paint the FlyFrame (use standard VCL-Paint)
pFlyFrm->Paint(GetFlyFrm()->Frm());
-
+
pOut->Pop();
}
}
@@ -563,6 +556,11 @@ const Rectangle& __EXPORT SwVirtFlyDrawObj::GetCurrentBoundRect() const
return aOutRect;
}
+const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const
+{
+ return GetCurrentBoundRect();
+}
+
void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect()
{