2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 02:04:35 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +00:00
|
|
|
* $RCSfile: svdopage.cxx,v $
|
|
|
|
* $Revision: 1.24 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +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).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:04:35 +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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 04:56:21 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2007-06-27 18:07:39 +00:00
|
|
|
#include <svx/svdopage.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "svdglob.hxx" // Stringcache
|
|
|
|
#include "svdstr.hrc" // Objektname
|
2007-06-27 18:07:39 +00:00
|
|
|
#include <svx/svdtrans.hxx>
|
|
|
|
#include <svx/svdetc.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "svdxout.hxx"
|
2007-06-27 18:07:39 +00:00
|
|
|
#include <svx/svdmodel.hxx>
|
|
|
|
#include <svx/svdpage.hxx>
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#include <svx/svdoutl.hxx>
|
2003-03-27 14:06:05 +00:00
|
|
|
#include <svtools/colorcfg.hxx>
|
2000-11-01 12:27:31 +00:00
|
|
|
#include <svtools/itemset.hxx>
|
2003-11-24 15:58:05 +00:00
|
|
|
#include <svx/sdr/properties/pageproperties.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
// #111111#
|
|
|
|
#include <svx/sdr/contact/viewcontactofpageobj.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// BaseProperties section
|
|
|
|
|
|
|
|
sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
return new sdr::properties::PageProperties(*this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DrawContact section
|
|
|
|
|
|
|
|
sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
return new sdr::contact::ViewContactOfPageObj(*this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
2004-07-12 13:48:05 +00:00
|
|
|
// this method is called form the destructor of the referenced page.
|
|
|
|
// do all necessary action to forget the page. It is not necessary to call
|
|
|
|
// RemovePageUser(), that is done form the destructor.
|
2003-11-24 15:58:05 +00:00
|
|
|
void SdrPageObj::PageInDestruction(const SdrPage& rPage)
|
2001-02-06 11:48:12 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
if(mpShownPage && mpShownPage == &rPage)
|
|
|
|
{
|
2006-01-19 12:00:19 +00:00
|
|
|
// #i58769# Do not call ActionChanged() here, because that would
|
|
|
|
// lead to the construction of a view contact object for a page that
|
|
|
|
// is being destroyed.
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
mpShownPage = 0L;
|
|
|
|
}
|
2001-02-06 11:48:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
TYPEINIT1(SdrPageObj,SdrObject);
|
|
|
|
|
|
|
|
SdrPageObj::SdrPageObj(SdrPage* pNewPage)
|
|
|
|
: mpShownPage(pNewPage)
|
2001-02-06 11:48:12 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
if(mpShownPage)
|
|
|
|
{
|
|
|
|
mpShownPage->AddPageUser(*this);
|
|
|
|
}
|
2001-02-06 11:48:12 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
SdrPageObj::SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage)
|
|
|
|
: mpShownPage(pNewPage)
|
2001-02-06 11:48:12 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
if(mpShownPage)
|
|
|
|
{
|
|
|
|
mpShownPage->AddPageUser(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
aOutRect = rRect;
|
2001-02-06 11:48:12 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
SdrPageObj::~SdrPageObj()
|
2001-05-02 11:10:24 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
// #111111#
|
|
|
|
if(mpShownPage)
|
|
|
|
{
|
|
|
|
mpShownPage->RemovePageUser(*this);
|
|
|
|
}
|
2001-05-02 11:10:24 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
// #111111#
|
|
|
|
SdrPage* SdrPageObj::GetReferencedPage() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
return mpShownPage;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
// #111111#
|
|
|
|
void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
|
|
|
|
{
|
|
|
|
if(mpShownPage != pNewPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
if(mpShownPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
mpShownPage->RemovePageUser(*this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2003-11-24 15:58:05 +00:00
|
|
|
|
|
|
|
mpShownPage = pNewPage;
|
|
|
|
|
|
|
|
if(mpShownPage)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-11-24 15:58:05 +00:00
|
|
|
mpShownPage->AddPageUser(*this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
SetChanged();
|
|
|
|
BroadcastObjectChange();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UINT16 SdrPageObj::GetObjIdentifier() const
|
|
|
|
{
|
|
|
|
return UINT16(OBJ_PAGE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
|
|
|
|
{
|
|
|
|
rInfo.bRotateFreeAllowed=FALSE;
|
|
|
|
rInfo.bRotate90Allowed =FALSE;
|
|
|
|
rInfo.bMirrorFreeAllowed=FALSE;
|
|
|
|
rInfo.bMirror45Allowed =FALSE;
|
|
|
|
rInfo.bMirror90Allowed =FALSE;
|
|
|
|
rInfo.bTransparenceAllowed = FALSE;
|
|
|
|
rInfo.bGradientAllowed = FALSE;
|
|
|
|
rInfo.bShearAllowed =FALSE;
|
2001-02-15 15:11:33 +00:00
|
|
|
rInfo.bEdgeRadiusAllowed=FALSE;
|
2000-09-18 16:07:07 +00:00
|
|
|
rInfo.bNoOrthoDesired =FALSE;
|
|
|
|
rInfo.bCanConvToPath =FALSE;
|
|
|
|
rInfo.bCanConvToPoly =FALSE;
|
|
|
|
rInfo.bCanConvToPathLineToArea=FALSE;
|
|
|
|
rInfo.bCanConvToPolyLineToArea=FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SdrPageObj::operator=(const SdrObject& rObj)
|
|
|
|
{
|
|
|
|
SdrObject::operator=(rObj);
|
2003-11-24 15:58:05 +00:00
|
|
|
SetReferencedPage(((const SdrPageObj&)rObj).GetReferencedPage());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SdrPageObj::TakeObjNameSingul(XubString& rName) const
|
|
|
|
{
|
|
|
|
rName=ImpGetResStr(STR_ObjNameSingulPAGE);
|
2002-06-07 11:08:48 +00:00
|
|
|
|
|
|
|
String aName( GetName() );
|
|
|
|
if(aName.Len())
|
|
|
|
{
|
|
|
|
rName += sal_Unicode(' ');
|
|
|
|
rName += sal_Unicode('\'');
|
|
|
|
rName += aName;
|
|
|
|
rName += sal_Unicode('\'');
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SdrPageObj::TakeObjNamePlural(XubString& rName) const
|
|
|
|
{
|
|
|
|
rName=ImpGetResStr(STR_ObjNamePluralPAGE);
|
|
|
|
}
|
|
|
|
|
2003-11-24 15:58:05 +00:00
|
|
|
// eof
|