bump product version to 6.4.0.3
[LibreOffice.git] / sd / source / core / cusshow.cxx
blob19b0635fdded36004e8202b6f8ff27109018e391
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/lang/XComponent.hpp>
22 #include <createunocustomshow.hxx>
23 #include <cusshow.hxx>
24 #include <customshowlist.hxx>
26 using namespace ::com::sun::star;
28 /*************************************************************************
30 |* Ctor
32 \************************************************************************/
33 SdCustomShow::SdCustomShow()
34 : maPages()
38 /*************************************************************************
40 |* Copy-Ctor
42 \************************************************************************/
43 SdCustomShow::SdCustomShow( const SdCustomShow& rShow )
44 : maPages(rShow.maPages)
46 aName = rShow.GetName();
49 SdCustomShow::SdCustomShow(css::uno::Reference< css::uno::XInterface > const & xShow )
50 : maPages(),
51 mxUnoCustomShow( xShow )
55 /*************************************************************************
57 |* Dtor
59 \************************************************************************/
60 SdCustomShow::~SdCustomShow()
62 uno::Reference< uno::XInterface > xShow( mxUnoCustomShow );
63 uno::Reference< lang::XComponent > xComponent( xShow, uno::UNO_QUERY );
64 if( xComponent.is() )
65 xComponent->dispose();
68 uno::Reference< uno::XInterface > SdCustomShow::getUnoCustomShow()
70 // try weak reference first
71 uno::Reference< uno::XInterface > xShow( mxUnoCustomShow );
73 if( !xShow.is() )
75 xShow = createUnoCustomShow( this );
78 return xShow;
81 void SdCustomShow::ReplacePage( const SdPage* pOldPage, const SdPage* pNewPage )
83 if( !pNewPage )
85 maPages.erase(::std::remove(maPages.begin(), maPages.end(), pOldPage), maPages.end());
87 else
89 ::std::replace(maPages.begin(), maPages.end(), pOldPage, pNewPage);
93 void SdCustomShow::SetName(const OUString& rName)
95 aName = rName;
98 void SdCustomShowList::erase(std::vector<std::unique_ptr<SdCustomShow>>::iterator it)
100 mShows.erase(it);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */