merge the formfield patch from ooo-build
[ooovba.git] / sd / source / core / drawdoc_animations.cxx
blobc8f43c50f8714de2dafa46cd50baef11404c3730
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawdoc_animations.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #include "drawdoc.hxx"
35 #include "cusshow.hxx"
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::presentation;
40 /** replaces a slide from all custom shows with a new one or removes a slide from
41 all custom shows if pNewPage is 0.
43 void SdDrawDocument::ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage )
45 if ( mpCustomShowList )
47 for (ULONG i = 0; i < mpCustomShowList->Count(); i++)
49 SdCustomShow* pCustomShow = (SdCustomShow*) mpCustomShowList->GetObject(i);
50 if( pNewPage == 0 )
51 pCustomShow->RemovePage(pOldPage);
52 else
53 pCustomShow->ReplacePage(pOldPage,pNewPage);
58 extern Reference< XPresentation2 > CreatePresentation( const SdDrawDocument& rDocument );
60 const Reference< XPresentation2 >& SdDrawDocument::getPresentation() const
62 if( !mxPresentation.is() )
64 const_cast< SdDrawDocument* >( this )->mxPresentation = CreatePresentation(*this);
66 return mxPresentation;