2000-09-18 23:16:46 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* $RCSfile: sdpage2.cxx,v $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2007-06-27 14:37:47 +00:00
|
|
|
|
* $Revision: 1.33 $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2007-06-27 14:37:47 +00:00
|
|
|
|
* last change: $Author: hr $ $Date: 2007-06-27 15:37:47 $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
|
* =============================================
|
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* This library 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 for more details.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:14:10 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
2006-09-16 17:16:27 +00:00
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _SFXDOCFILE_HXX //autogen
|
|
|
|
|
#include <sfx2/docfile.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _OUTLINER_HXX
|
|
|
|
|
#include <svx/outliner.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVXLINK_HXX
|
|
|
|
|
#include <svx/linkmgr.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVDOTEXT_HXX //autogen
|
|
|
|
|
#include <svx/svdotext.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _URLOBJ_HXX //autogen
|
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _OUTLOBJ_HXX //autogen
|
|
|
|
|
#include <svx/outlobj.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#include <svtools/urihelper.hxx>
|
|
|
|
|
|
2001-10-12 15:19:53 +00:00
|
|
|
|
#ifndef _SVX_XMLCNITM_HXX
|
|
|
|
|
#include <svx/xmlcnitm.hxx>
|
|
|
|
|
#endif
|
2002-10-31 12:27:11 +00:00
|
|
|
|
|
|
|
|
|
#ifndef _SVDITER_HXX
|
|
|
|
|
#include <svx/svditer.hxx>
|
2001-10-12 15:19:53 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-31 12:27:11 +00:00
|
|
|
|
#ifndef _LIST_HXX
|
|
|
|
|
#include <tools/list.hxx>
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
|
#include "glob.hxx"
|
|
|
|
|
#include "glob.hrc"
|
|
|
|
|
#include "drawdoc.hxx"
|
|
|
|
|
#include "stlpool.hxx"
|
2004-11-26 18:47:40 +00:00
|
|
|
|
//#include "sdiocmpt.hxx"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#include "pglink.hxx"
|
2004-11-26 18:47:40 +00:00
|
|
|
|
//#include "strmname.h"
|
2002-10-31 12:27:11 +00:00
|
|
|
|
#include "anminfo.hxx"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
#ifdef MAC
|
|
|
|
|
#include "::ui:inc:strings.hrc"
|
2004-01-20 09:28:24 +00:00
|
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
|
|
|
#include "::ui:inc:DrawDocShell.hxx"
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#else
|
|
|
|
|
#ifdef UNX
|
|
|
|
|
#include "../ui/inc/strings.hrc"
|
2004-01-20 09:28:24 +00:00
|
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
|
|
|
#include "../ui/inc/DrawDocShell.hxx"
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#else
|
|
|
|
|
#include "..\ui\inc\cfgids.hxx"
|
|
|
|
|
#include "..\ui\inc\strings.hrc"
|
2004-01-20 09:28:24 +00:00
|
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
|
|
|
#include "..\ui\inc\DrawDocShell.hxx"
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-08-06 07:34:08 +00:00
|
|
|
|
// #90477#
|
|
|
|
|
#ifndef _TOOLS_TENCCVT_HXX
|
|
|
|
|
#include <tools/tenccvt.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-03-30 14:44:57 +00:00
|
|
|
|
using namespace ::sd;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SetPresentationLayout, setzt: Layoutnamen, Masterpage-Verkn<EFBFBD>pfung und
|
|
|
|
|
|* Vorlagen fuer Praesentationsobjekte
|
|
|
|
|
|*
|
|
|
|
|
|* Vorraussetzungen: - Die Seite muss bereits das richtige Model kennen!
|
|
|
|
|
|* - Die entsprechende Masterpage muss bereits im Model sein.
|
|
|
|
|
|* - Die entsprechenden StyleSheets muessen bereits im
|
|
|
|
|
|* im StyleSheetPool sein.
|
|
|
|
|
|*
|
|
|
|
|
|* bReplaceStyleSheets = TRUE : Benannte StyleSheets werden ausgetauscht
|
|
|
|
|
|* FALSE: Alle StyleSheets werden neu zugewiesen
|
|
|
|
|
|*
|
|
|
|
|
|* bSetMasterPage = TRUE : MasterPage suchen und zuweisen
|
|
|
|
|
|*
|
|
|
|
|
|* bReverseOrder = FALSE: MasterPages von vorn nach hinten suchen
|
|
|
|
|
|* TRUE : MasterPages von hinten nach vorn suchen (fuer Undo-Action)
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPage::SetPresentationLayout(const String& rLayoutName,
|
|
|
|
|
BOOL bReplaceStyleSheets,
|
|
|
|
|
BOOL bSetMasterPage,
|
|
|
|
|
BOOL bReverseOrder)
|
|
|
|
|
{
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
|* Layoutname der Seite
|
|
|
|
|
\********************************************************************/
|
2006-12-12 15:33:34 +00:00
|
|
|
|
String aOldLayoutName(maLayoutName); // merken
|
|
|
|
|
maLayoutName = rLayoutName;
|
|
|
|
|
maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
|
|
|
|
|
maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
|* ggf. Masterpage suchen und setzen
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
if (bSetMasterPage && !IsMasterPage())
|
|
|
|
|
{
|
|
|
|
|
SdPage* pMaster;
|
2004-08-31 12:48:34 +00:00
|
|
|
|
SdPage* pFoundMaster = 0;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
USHORT nMaster = 0;
|
|
|
|
|
USHORT nMasterCount = pModel->GetMasterPageCount();
|
|
|
|
|
|
|
|
|
|
if( !bReverseOrder )
|
|
|
|
|
{
|
|
|
|
|
for ( nMaster = 0; nMaster < nMasterCount; nMaster++ )
|
|
|
|
|
{
|
2004-08-31 12:48:34 +00:00
|
|
|
|
pMaster = static_cast<SdPage*>(pModel->GetMasterPage(nMaster));
|
2006-12-12 15:33:34 +00:00
|
|
|
|
if (pMaster->GetPageKind() == mePageKind && pMaster->GetLayoutName() == maLayoutName)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2004-08-31 12:48:34 +00:00
|
|
|
|
pFoundMaster = pMaster;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-07-12 13:56:30 +00:00
|
|
|
|
for ( nMaster = nMasterCount; nMaster > 0; nMaster-- )
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2004-08-31 12:48:34 +00:00
|
|
|
|
pMaster = static_cast<SdPage*>(pModel->GetMasterPage(nMaster - 1));
|
2006-12-12 15:33:34 +00:00
|
|
|
|
if (pMaster->GetPageKind() == mePageKind && pMaster->GetLayoutName() == maLayoutName)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2004-08-31 12:48:34 +00:00
|
|
|
|
pFoundMaster = pMaster;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-31 12:48:34 +00:00
|
|
|
|
DBG_ASSERT(pFoundMaster, "Masterpage for presentation layout not found!");
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2004-08-31 12:48:34 +00:00
|
|
|
|
// this should never happen, but we play failsafe here
|
|
|
|
|
if( pFoundMaster == 0 )
|
2006-12-12 15:33:34 +00:00
|
|
|
|
pFoundMaster = static_cast< SdDrawDocument *>(pModel)->GetSdPage( 0, mePageKind );
|
2004-08-31 12:48:34 +00:00
|
|
|
|
|
|
|
|
|
if( pFoundMaster )
|
|
|
|
|
TRG_SetMasterPage(*pFoundMaster);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
|
|* Vorlagen fuer Praesentationsobjekte
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
// Listen mit:
|
|
|
|
|
// - Vorlagenzeigern fuer Gliederungstextobjekt (alte und neue Vorlagen)
|
|
|
|
|
// -Replacedaten fuer OutlinerParaObject
|
|
|
|
|
List aOutlineStyles;
|
|
|
|
|
List aOldOutlineStyles;
|
|
|
|
|
List aReplList;
|
|
|
|
|
BOOL bListsFilled = FALSE;
|
|
|
|
|
|
|
|
|
|
ULONG nObjCount = GetObjCount();
|
|
|
|
|
|
|
|
|
|
for (ULONG nObj = 0; nObj < nObjCount; nObj++)
|
|
|
|
|
{
|
|
|
|
|
SdrTextObj* pObj = (SdrTextObj*) GetObj(nObj);
|
|
|
|
|
|
|
|
|
|
if (pObj->GetObjInventor() == SdrInventor &&
|
|
|
|
|
pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
|
|
|
|
|
{
|
|
|
|
|
if (!bListsFilled || !bReplaceStyleSheets)
|
|
|
|
|
{
|
|
|
|
|
String aFullName;
|
|
|
|
|
String aOldFullName;
|
|
|
|
|
SfxStyleSheetBase* pSheet = NULL;
|
|
|
|
|
SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
|
|
|
|
|
|
|
|
|
|
for (USHORT i = 1; i < 10; i++)
|
|
|
|
|
{
|
2006-12-12 15:33:34 +00:00
|
|
|
|
aFullName = maLayoutName;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aOldFullName = aOldLayoutName;
|
|
|
|
|
aFullName += sal_Unicode( ' ' );
|
|
|
|
|
aFullName += String::CreateFromInt32( (sal_Int32)i );
|
|
|
|
|
aOldFullName += sal_Unicode( ' ' );
|
|
|
|
|
aOldFullName += String::CreateFromInt32( (sal_Int32)i );
|
|
|
|
|
|
|
|
|
|
pSheet = pStShPool->Find(aOldFullName, SD_LT_FAMILY);
|
|
|
|
|
DBG_ASSERT(pSheet, "alte Gliederungsvorlage nicht gefunden");
|
|
|
|
|
aOldOutlineStyles.Insert(pSheet, LIST_APPEND);
|
|
|
|
|
|
|
|
|
|
pSheet = pStShPool->Find(aFullName, SD_LT_FAMILY);
|
|
|
|
|
DBG_ASSERT(pSheet, "neue Gliederungsvorlage nicht gefunden");
|
|
|
|
|
aOutlineStyles.Insert(pSheet, LIST_APPEND);
|
|
|
|
|
|
|
|
|
|
if (bReplaceStyleSheets && pSheet)
|
|
|
|
|
{
|
|
|
|
|
// Replace anstatt Set
|
|
|
|
|
StyleReplaceData* pReplData = new StyleReplaceData;
|
|
|
|
|
pReplData->nNewFamily = pSheet->GetFamily();
|
|
|
|
|
pReplData->nFamily = pSheet->GetFamily();
|
|
|
|
|
pReplData->aNewName = aFullName;
|
|
|
|
|
pReplData->aName = aOldFullName;
|
|
|
|
|
aReplList.Insert(pReplData, LIST_APPEND);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2002-07-19 07:53:08 +00:00
|
|
|
|
OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject();
|
|
|
|
|
|
|
|
|
|
if( pOPO )
|
|
|
|
|
pOPO->SetStyleSheets( i, aFullName, SD_LT_FAMILY );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bListsFilled = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SfxStyleSheet* pSheet = (SfxStyleSheet*)aOutlineStyles.First();
|
|
|
|
|
SfxStyleSheet* pOldSheet = (SfxStyleSheet*)aOldOutlineStyles.First();
|
|
|
|
|
while (pSheet)
|
|
|
|
|
{
|
|
|
|
|
if (pSheet != pOldSheet)
|
|
|
|
|
{
|
|
|
|
|
pObj->EndListening(*pOldSheet);
|
|
|
|
|
|
|
|
|
|
if (!pObj->IsListening(*pSheet))
|
|
|
|
|
pObj->StartListening(*pSheet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSheet = (SfxStyleSheet*)aOutlineStyles.Next();
|
|
|
|
|
pOldSheet = (SfxStyleSheet*)aOldOutlineStyles.Next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject();
|
|
|
|
|
if ( bReplaceStyleSheets && pOPO )
|
|
|
|
|
{
|
|
|
|
|
StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First();
|
|
|
|
|
|
|
|
|
|
while( pReplData )
|
|
|
|
|
{
|
|
|
|
|
pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily );
|
|
|
|
|
pReplData = (StyleReplaceData*) aReplList.Next();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pObj->GetObjInventor() == SdrInventor &&
|
|
|
|
|
pObj->GetObjIdentifier() == OBJ_TITLETEXT)
|
|
|
|
|
{
|
|
|
|
|
// PresObjKind nicht ueber GetPresObjKind() holen, da dort nur
|
|
|
|
|
// die PresObjListe beruecksichtigt wird. Es sollen aber alle
|
|
|
|
|
// "Titelobjekte" hier beruecksichtigt werden (Paste aus Clipboard usw.)
|
|
|
|
|
SfxStyleSheet* pSheet = GetStyleSheetForPresObj(PRESOBJ_TITLE);
|
|
|
|
|
|
|
|
|
|
if (pSheet)
|
|
|
|
|
pObj->SetStyleSheet(pSheet, TRUE);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SfxStyleSheet* pSheet = GetStyleSheetForPresObj(GetPresObjKind(pObj));
|
|
|
|
|
|
|
|
|
|
if (pSheet)
|
|
|
|
|
pObj->SetStyleSheet(pSheet, TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (ULONG i = 0; i < aReplList.Count(); i++)
|
|
|
|
|
{
|
|
|
|
|
delete (StyleReplaceData*) aReplList.GetObject(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-04-26 16:11:09 +00:00
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* das Gliederungstextobjekt bei den Vorlagen fuer die Gliederungsebenen
|
|
|
|
|
|* abmelden
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPage::EndListenOutlineText()
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pOutlineTextObj = GetPresObj(PRESOBJ_OUTLINE);
|
|
|
|
|
|
|
|
|
|
if (pOutlineTextObj)
|
|
|
|
|
{
|
|
|
|
|
SdStyleSheetPool* pSPool = (SdStyleSheetPool*)pModel->GetStyleSheetPool();
|
|
|
|
|
DBG_ASSERT(pSPool, "StyleSheetPool nicht gefunden");
|
2006-12-12 15:33:34 +00:00
|
|
|
|
String aTrueLayoutName(maLayoutName);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aTrueLayoutName.Erase( aTrueLayoutName.SearchAscii( SD_LT_SEPARATOR ));
|
|
|
|
|
List* pOutlineStyles = pSPool->CreateOutlineSheetList(aTrueLayoutName);
|
|
|
|
|
for (SfxStyleSheet* pSheet = (SfxStyleSheet*)pOutlineStyles->First();
|
|
|
|
|
pSheet;
|
|
|
|
|
pSheet = (SfxStyleSheet*)pOutlineStyles->Next())
|
|
|
|
|
{
|
|
|
|
|
pOutlineTextObj->EndListening(*pSheet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete pOutlineStyles;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-11 11:09:53 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|* Neues Model setzen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-10-22 12:36:57 +00:00
|
|
|
|
void SdPage::SetModel(SdrModel* pNewModel)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
DisconnectLink();
|
|
|
|
|
|
|
|
|
|
// Model umsetzen
|
|
|
|
|
FmFormPage::SetModel(pNewModel);
|
|
|
|
|
|
|
|
|
|
ConnectLink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Ist die Seite read-only?
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-10-22 12:36:57 +00:00
|
|
|
|
FASTBOOL SdPage::IsReadOnly() const
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:33:34 +00:00
|
|
|
|
return FALSE;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Beim LinkManager anmelden
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPage::ConnectLink()
|
|
|
|
|
{
|
|
|
|
|
SvxLinkManager* pLinkManager = pModel!=NULL ? pModel->GetLinkManager() : NULL;
|
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
if (pLinkManager && !mpPageLink && maFileName.Len() && maBookmarkName.Len() &&
|
|
|
|
|
mePageKind==PK_STANDARD && !IsMasterPage() &&
|
2000-09-18 23:16:46 +00:00
|
|
|
|
( (SdDrawDocument*) pModel)->IsNewOrLoadCompleted())
|
|
|
|
|
{
|
|
|
|
|
/**********************************************************************
|
|
|
|
|
* Anmelden
|
|
|
|
|
* Nur Standardseiten duerfen gelinkt sein
|
|
|
|
|
**********************************************************************/
|
2004-01-20 09:28:24 +00:00
|
|
|
|
::sd::DrawDocShell* pDocSh = ((SdDrawDocument*) pModel)->GetDocSh();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
if (!pDocSh || pDocSh->GetMedium()->GetOrigURL() != maFileName)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
// Keine Links auf Dokument-eigene Seiten!
|
2006-12-12 15:33:34 +00:00
|
|
|
|
mpPageLink = new SdPageLink(this, maFileName, maBookmarkName);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
String aFilterName(SdResId(STR_IMPRESS));
|
2006-12-12 15:33:34 +00:00
|
|
|
|
pLinkManager->InsertFileLink(*mpPageLink, OBJECT_CLIENT_FILE,
|
|
|
|
|
maFileName, &aFilterName, &maBookmarkName);
|
|
|
|
|
mpPageLink->Connect();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Beim LinkManager abmelden
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPage::DisconnectLink()
|
|
|
|
|
{
|
|
|
|
|
SvxLinkManager* pLinkManager = pModel!=NULL ? pModel->GetLinkManager() : NULL;
|
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
if (pLinkManager && mpPageLink)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
/**********************************************************************
|
|
|
|
|
* Abmelden
|
|
|
|
|
* (Bei Remove wird *pGraphicLink implizit deleted)
|
|
|
|
|
**********************************************************************/
|
2006-12-12 15:33:34 +00:00
|
|
|
|
pLinkManager->Remove(mpPageLink);
|
|
|
|
|
mpPageLink=NULL;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Copy-Ctor
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
SdPage::SdPage(const SdPage& rSrcPage)
|
|
|
|
|
: FmFormPage(rSrcPage)
|
|
|
|
|
, SdrObjUserCall()
|
|
|
|
|
, mpItems(NULL)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:33:34 +00:00
|
|
|
|
mePageKind = rSrcPage.mePageKind;
|
|
|
|
|
meAutoLayout = rSrcPage.meAutoLayout;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-01-10 13:26:51 +00:00
|
|
|
|
SdrObject* pObj = 0;
|
2006-12-12 15:33:34 +00:00
|
|
|
|
while((pObj = rSrcPage.maPresentationShapeList.getNextShape(pObj)) != 0)
|
2006-01-10 13:26:51 +00:00
|
|
|
|
InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
mbSelected = FALSE;
|
2004-11-26 18:47:40 +00:00
|
|
|
|
mnTransitionType = rSrcPage.mnTransitionType;
|
|
|
|
|
mnTransitionSubtype = rSrcPage.mnTransitionSubtype;
|
|
|
|
|
mbTransitionDirection = rSrcPage.mbTransitionDirection;
|
|
|
|
|
mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor;
|
|
|
|
|
mfTransitionDuration = rSrcPage.mfTransitionDuration;
|
2006-12-12 15:33:34 +00:00
|
|
|
|
mePresChange = rSrcPage.mePresChange;
|
|
|
|
|
mnTime = rSrcPage.mnTime;
|
|
|
|
|
mbSoundOn = rSrcPage.mbSoundOn;
|
|
|
|
|
mbExcluded = rSrcPage.mbExcluded;
|
|
|
|
|
|
|
|
|
|
maLayoutName = rSrcPage.maLayoutName;
|
|
|
|
|
maSoundFile = rSrcPage.maSoundFile;
|
2007-06-27 14:37:47 +00:00
|
|
|
|
mbLoopSound = rSrcPage.mbLoopSound;
|
|
|
|
|
mbStopSound = rSrcPage.mbStopSound;
|
2006-12-12 15:33:34 +00:00
|
|
|
|
maCreatedPageName = String();
|
|
|
|
|
maFileName = rSrcPage.maFileName;
|
|
|
|
|
maBookmarkName = rSrcPage.maBookmarkName;
|
|
|
|
|
mbScaleObjects = rSrcPage.mbScaleObjects;
|
|
|
|
|
mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
|
|
|
|
|
meCharSet = rSrcPage.meCharSet;
|
|
|
|
|
mnPaperBin = rSrcPage.mnPaperBin;
|
|
|
|
|
meOrientation = rSrcPage.meOrientation;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2005-07-14 09:43:59 +00:00
|
|
|
|
// header footer
|
|
|
|
|
setHeaderFooterSettings( rSrcPage.getHeaderFooterSettings() );
|
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
mpPageLink = NULL; // Wird beim Einfuegen ueber ConnectLink() gesetzt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Clone
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
SdrPage* SdPage::Clone() const
|
|
|
|
|
{
|
2006-12-12 15:33:34 +00:00
|
|
|
|
return Clone(NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SdrPage* SdPage::Clone(SdrModel* pNewModel) const
|
|
|
|
|
{
|
|
|
|
|
DBG_ASSERT( pNewModel == 0, "sd::SdPage::Clone(), new page ignored, please check code! CL" );
|
|
|
|
|
(void)pNewModel;
|
|
|
|
|
|
|
|
|
|
SdPage* pNewPage = new SdPage(*this);
|
2005-07-14 09:43:59 +00:00
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
cloneAnimations( *pNewPage );
|
2005-07-14 09:43:59 +00:00
|
|
|
|
|
2005-09-23 09:42:48 +00:00
|
|
|
|
// fix user calls for duplicated slide
|
|
|
|
|
SdrObjListIter aSourceIter( *this, IM_DEEPWITHGROUPS );
|
2006-12-12 15:33:34 +00:00
|
|
|
|
SdrObjListIter aTargetIter( *pNewPage, IM_DEEPWITHGROUPS );
|
2005-09-23 09:42:48 +00:00
|
|
|
|
|
|
|
|
|
while( aSourceIter.IsMore() && aTargetIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pSource = aSourceIter.Next();
|
|
|
|
|
SdrObject* pTarget = aTargetIter.Next();
|
|
|
|
|
|
|
|
|
|
if( pSource->GetUserCall() )
|
2006-12-12 15:33:34 +00:00
|
|
|
|
pTarget->SetUserCall( pNewPage );
|
2005-09-23 09:42:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-12-12 15:33:34 +00:00
|
|
|
|
return pNewPage;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-28 14:59:13 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* GetTextStyleSheetForObject
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
|
2001-01-28 14:59:13 +00:00
|
|
|
|
SfxStyleSheet* SdPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
|
|
|
|
|
{
|
|
|
|
|
const PresObjKind eKind = ((SdPage*)this)->GetPresObjKind(pObj);
|
|
|
|
|
if( eKind != PRESOBJ_NONE )
|
|
|
|
|
{
|
|
|
|
|
return ((SdPage*)this)->GetStyleSheetForPresObj(eKind);
|
|
|
|
|
}
|
2001-01-30 14:25:02 +00:00
|
|
|
|
|
|
|
|
|
return FmFormPage::GetTextStyleSheetForObject( pObj );
|
2001-01-28 14:59:13 +00:00
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2001-10-12 15:19:53 +00:00
|
|
|
|
SfxItemSet* SdPage::getOrCreateItems()
|
|
|
|
|
{
|
|
|
|
|
if( mpItems == NULL )
|
|
|
|
|
mpItems = new SfxItemSet( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
|
|
|
|
|
|
|
|
|
|
return mpItems;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Bool SdPage::setAlienAttributes( const com::sun::star::uno::Any& rAttributes )
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet* pSet = getOrCreateItems();
|
|
|
|
|
|
|
|
|
|
SvXMLAttrContainerItem aAlienAttributes( SDRATTR_XMLATTRIBUTES );
|
|
|
|
|
if( aAlienAttributes.PutValue( rAttributes, 0 ) )
|
|
|
|
|
{
|
|
|
|
|
pSet->Put( aAlienAttributes );
|
|
|
|
|
return sal_True;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::getAlienAttributes( com::sun::star::uno::Any& rAttributes )
|
|
|
|
|
{
|
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
|
|
|
|
|
|
if( (mpItems == NULL) || ( SFX_ITEM_SET != mpItems->GetItemState( SDRATTR_XMLATTRIBUTES, sal_False, &pItem ) ) )
|
|
|
|
|
{
|
|
|
|
|
SvXMLAttrContainerItem aAlienAttributes;
|
|
|
|
|
aAlienAttributes.QueryValue( rAttributes, 0 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
((SvXMLAttrContainerItem*)pItem)->QueryValue( rAttributes, 0 );
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-07 12:34:33 +00:00
|
|
|
|
|
2005-09-23 09:42:48 +00:00
|
|
|
|
void SdPage::RemoveEmptyPresentationObjects()
|
|
|
|
|
{
|
|
|
|
|
SdrObjListIter aShapeIter( *this, IM_DEEPWITHGROUPS );
|
2005-07-07 12:34:33 +00:00
|
|
|
|
|
2005-09-23 09:42:48 +00:00
|
|
|
|
SdrObject* pShape;
|
|
|
|
|
for( pShape = aShapeIter.Next(); pShape; pShape = aShapeIter.Next() )
|
|
|
|
|
{
|
|
|
|
|
if( pShape && pShape->IsEmptyPresObj() )
|
2006-01-10 13:26:51 +00:00
|
|
|
|
delete RemoveObject( pShape->GetOrdNum() );
|
2005-07-07 12:34:33 +00:00
|
|
|
|
|
2005-09-23 09:42:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-07 12:34:33 +00:00
|
|
|
|
|
|
|
|
|
sal_Int16 SdPage::getTransitionType (void) const
|
|
|
|
|
{
|
|
|
|
|
return mnTransitionType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::setTransitionType( sal_Int16 nTransitionType )
|
|
|
|
|
{
|
|
|
|
|
mnTransitionType = nTransitionType;
|
|
|
|
|
ActionChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sal_Int16 SdPage::getTransitionSubtype (void) const
|
|
|
|
|
{
|
|
|
|
|
return mnTransitionSubtype;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::setTransitionSubtype ( sal_Int16 nTransitionSubtype )
|
|
|
|
|
{
|
|
|
|
|
mnTransitionSubtype = nTransitionSubtype;
|
|
|
|
|
ActionChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sal_Bool SdPage::getTransitionDirection (void) const
|
|
|
|
|
{
|
|
|
|
|
return mbTransitionDirection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::setTransitionDirection ( sal_Bool bTransitionbDirection )
|
|
|
|
|
{
|
|
|
|
|
mbTransitionDirection = bTransitionbDirection;
|
|
|
|
|
ActionChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sal_Int32 SdPage::getTransitionFadeColor (void) const
|
|
|
|
|
{
|
|
|
|
|
return mnTransitionFadeColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::setTransitionFadeColor ( sal_Int32 nTransitionFadeColor )
|
|
|
|
|
{
|
|
|
|
|
mnTransitionFadeColor = nTransitionFadeColor;
|
|
|
|
|
ActionChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double SdPage::getTransitionDuration (void) const
|
|
|
|
|
{
|
|
|
|
|
return mfTransitionDuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SdPage::setTransitionDuration ( double fTranstionDuration )
|
|
|
|
|
{
|
|
|
|
|
mfTransitionDuration = fTranstionDuration;
|
|
|
|
|
ActionChanged();
|
|
|
|
|
}
|