diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 23:19:25 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 23:19:25 +0000 |
commit | a628c45deff70f16afc187c1f1cad575a9091e28 (patch) | |
tree | a4eba6bb5eb51376c5929cbadf9c0d3804259e1b /sd/source/ui/slidesorter/view | |
parent | a5a4749d60eb2cd7109181f262482a472b528019 (diff) |
INTEGRATION: CWS aw033 (1.7.46); FILE MERGED
2008/07/10 12:56:27 aw 1.7.46.7: #i39532# XOutputDevice removed, PrepareDelete removed
2008/06/24 15:34:31 aw 1.7.46.6: #i39532# corrections
2008/05/27 15:18:03 aw 1.7.46.5: #i39532# changes DEV300 m12 resync corrections
2008/05/16 13:06:05 aw 1.7.46.4: adaptions after resync
2008/05/14 14:51:19 aw 1.7.46.3: RESYNC: (1.7-1.9); FILE MERGED
2008/01/29 10:34:21 aw 1.7.46.2: updated refresh for ActionChanged(), diverse removals
2008/01/22 12:16:42 aw 1.7.46.1: adaptions and 1st stripping
Diffstat (limited to 'sd/source/ui/slidesorter/view')
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsPageObjectViewContact.cxx | 93 |
1 files changed, 42 insertions, 51 deletions
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectViewContact.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectViewContact.cxx index e0a9dedfe865..5849140f8327 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectViewContact.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectViewContact.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: SlsPageObjectViewContact.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.10 $ * * This file is part of OpenOffice.org. * @@ -38,6 +38,9 @@ #include <svx/svdopage.hxx> #include <tools/debug.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> + using namespace ::sdr::contact; namespace sd { namespace slidesorter { namespace view { @@ -47,21 +50,19 @@ PageObjectViewContact::PageObjectViewContact ( SdrPageObj& rPageObj, const model::SharedPageDescriptor& rpDescriptor) : ViewContactOfPageObj (rPageObj), - mbIsValid(true), + mbInDestructor(false), mpDescriptor(rpDescriptor) { } - - - PageObjectViewContact::~PageObjectViewContact (void) { + // remember that this instance is in destruction + mbInDestructor = true; } - ViewObjectContact& PageObjectViewContact::CreateObjectSpecificViewObjectContact( ObjectContact& rObjectContact) @@ -77,76 +78,66 @@ ViewObjectContact& return *pResult; } - - - const SdrPage* PageObjectViewContact::GetPage (void) const { - if (mbIsValid) + // when this instance itself is in destruction, do no longer + // provide the referenced page to VOC childs of this OC. This + // happens e.g. in destructor which destroys all child-VOCs which + // may in their implementation still reference their VC from + // their own destructor + if (!mbInDestructor) return GetReferencedPage(); else return NULL; } - - - -void PageObjectViewContact::CalcPaintRectangle (void) -{ - ViewContactOfPageObj::CalcPaintRectangle(); - if (mbIsValid) - { - OSL_ASSERT(mpDescriptor.get()!=NULL); - - maPageObjectBoundingBox = maPaintRectangle; - SvBorder aBorder (mpDescriptor->GetModelBorder()); - maPaintRectangle.Left() -= aBorder.Left(); - maPaintRectangle.Right() += aBorder.Right(); - maPaintRectangle.Top() -= aBorder.Top(); - maPaintRectangle.Bottom() += aBorder.Bottom(); - } -} - - - - -Rectangle PageObjectViewContact::GetPageRectangle (void) -{ - return GetPageObj().GetCurrentBoundRect(); -} - - - - void PageObjectViewContact::ActionChanged (void) { ViewContactOfPageObj::ActionChanged(); } - - - Rectangle PageObjectViewContact::GetPageObjectBoundingBox (void) const { - return maPageObjectBoundingBox; -} - + // use model data directly here + OSL_ASSERT(mpDescriptor.get()!=NULL); + Rectangle aRetval(GetPageObject().GetLastBoundRect()); + const SvBorder aPageDescriptorBorder(mpDescriptor->GetModelBorder()); + aRetval.Left() -= aPageDescriptorBorder.Left(); + aRetval.Top() -= aPageDescriptorBorder.Top(); + aRetval.Right() += aPageDescriptorBorder.Right(); + aRetval.Bottom() += aPageDescriptorBorder.Bottom(); + return aRetval; +} SdrPageObj& PageObjectViewContact::GetPageObject (void) const { return ViewContactOfPageObj::GetPageObj(); } +drawinglayer::primitive2d::Primitive2DSequence PageObjectViewContact::createViewIndependentPrimitive2DSequence() const +{ + // ceate graphical visualisation data. Since this is the view-independent version which should not be used, + // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly + // which is aOutRect for SdrPageObj. + OSL_ASSERT(mpDescriptor.get()!=NULL); + Rectangle aModelRectangle(GetPageObj().GetLastBoundRect()); + const SvBorder aBorder(mpDescriptor->GetModelBorder()); + aModelRectangle.Left() -= aBorder.Left(); + aModelRectangle.Right() += aBorder.Right(); + aModelRectangle.Top() -= aBorder.Top(); + aModelRectangle.Bottom() += aBorder.Bottom(); + const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom()); + const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aModelRange)); + const basegfx::BColor aYellow(1.0, 1.0, 0.0); + const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow)); -void PageObjectViewContact::PrepareDelete (void) -{ - mbIsValid = false; + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } - - } } } // end of namespace ::sd::slidesorter::view + +// eof |