2004-07-13 13:28:00 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* $RCSfile: SlsPageObjectViewContact.cxx,v $
|
|
|
|
* $Revision: 1.9 $
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
2008-04-10 21:16:48 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-07-13 13:28:00 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 18:11:14 +00:00
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
#include "view/SlsPageObjectViewContact.hxx"
|
|
|
|
|
|
|
|
#include "model/SlsPageDescriptor.hxx"
|
|
|
|
#include "controller/SlsPageObjectFactory.hxx"
|
|
|
|
|
|
|
|
#include <svx/svdopage.hxx>
|
2006-11-14 13:36:35 +00:00
|
|
|
#include <tools/debug.hxx>
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
using namespace ::sdr::contact;
|
|
|
|
|
|
|
|
namespace sd { namespace slidesorter { namespace view {
|
|
|
|
|
|
|
|
|
|
|
|
PageObjectViewContact::PageObjectViewContact (
|
|
|
|
SdrPageObj& rPageObj,
|
2008-04-03 13:44:38 +00:00
|
|
|
const model::SharedPageDescriptor& rpDescriptor)
|
2004-07-13 13:28:00 +00:00
|
|
|
: ViewContactOfPageObj (rPageObj),
|
|
|
|
mbIsValid(true),
|
2008-04-03 13:44:38 +00:00
|
|
|
mpDescriptor(rpDescriptor)
|
2004-07-13 13:28:00 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-19 11:54:53 +00:00
|
|
|
PageObjectViewContact::~PageObjectViewContact (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
ViewObjectContact&
|
|
|
|
PageObjectViewContact::CreateObjectSpecificViewObjectContact(
|
|
|
|
ObjectContact& rObjectContact)
|
|
|
|
{
|
2008-04-03 13:44:38 +00:00
|
|
|
OSL_ASSERT(mpDescriptor.get()!=NULL);
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
ViewObjectContact* pResult
|
2008-04-03 13:44:38 +00:00
|
|
|
= mpDescriptor->GetPageObjectFactory().CreateViewObjectContact (
|
2004-07-13 13:28:00 +00:00
|
|
|
rObjectContact,
|
|
|
|
*this);
|
|
|
|
DBG_ASSERT (pResult!=NULL,
|
|
|
|
"PageObjectViewContact::CreateObjectSpecificViewObjectContact() was not able to create object.");
|
|
|
|
return *pResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SdrPage* PageObjectViewContact::GetPage (void) const
|
|
|
|
{
|
|
|
|
if (mbIsValid)
|
|
|
|
return GetReferencedPage();
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PageObjectViewContact::CalcPaintRectangle (void)
|
|
|
|
{
|
|
|
|
ViewContactOfPageObj::CalcPaintRectangle();
|
|
|
|
if (mbIsValid)
|
|
|
|
{
|
2008-04-03 13:44:38 +00:00
|
|
|
OSL_ASSERT(mpDescriptor.get()!=NULL);
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
maPageObjectBoundingBox = maPaintRectangle;
|
2008-04-03 13:44:38 +00:00
|
|
|
SvBorder aBorder (mpDescriptor->GetModelBorder());
|
2004-07-13 13:28:00 +00:00
|
|
|
maPaintRectangle.Left() -= aBorder.Left();
|
|
|
|
maPaintRectangle.Right() += aBorder.Right();
|
|
|
|
maPaintRectangle.Top() -= aBorder.Top();
|
|
|
|
maPaintRectangle.Bottom() += aBorder.Bottom();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle PageObjectViewContact::GetPageRectangle (void)
|
|
|
|
{
|
|
|
|
return GetPageObj().GetCurrentBoundRect();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-03 15:19:16 +00:00
|
|
|
void PageObjectViewContact::ActionChanged (void)
|
|
|
|
{
|
|
|
|
ViewContactOfPageObj::ActionChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 13:28:00 +00:00
|
|
|
Rectangle PageObjectViewContact::GetPageObjectBoundingBox (void) const
|
|
|
|
{
|
|
|
|
return maPageObjectBoundingBox;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SdrPageObj& PageObjectViewContact::GetPageObject (void) const
|
|
|
|
{
|
|
|
|
return ViewContactOfPageObj::GetPageObj();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PageObjectViewContact::PrepareDelete (void)
|
|
|
|
{
|
|
|
|
mbIsValid = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} } } // end of namespace ::sd::slidesorter::view
|