Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / func / fucushow.cxx
blobdf6e0f96cc3e3b533b0eae71102c2f748a806d9a
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 <fucushow.hxx>
22 #include <svx/svxids.hrc>
24 #include <app.hrc>
25 #include <ViewShell.hxx>
26 #include <Window.hxx>
27 #include <drawdoc.hxx>
28 #include <sdpage.hxx>
29 #include <sfx2/dispatch.hxx>
30 #include <sfx2/viewfrm.hxx>
32 #include <sdabstdlg.hxx>
33 #include <memory>
35 namespace sd {
38 FuCustomShowDlg::FuCustomShowDlg (
39 ViewShell* pViewSh,
40 ::sd::Window* pWin,
41 ::sd::View* pView,
42 SdDrawDocument* pDoc,
43 SfxRequest& rReq)
44 : FuPoor( pViewSh, pWin, pView, pDoc, rReq )
48 rtl::Reference<FuPoor> FuCustomShowDlg::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
50 rtl::Reference<FuPoor> xFunc( new FuCustomShowDlg( pViewSh, pWin, pView, pDoc, rReq ) );
51 xFunc->DoExecute(rReq);
52 return xFunc;
55 void FuCustomShowDlg::DoExecute( SfxRequest& )
57 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
58 vcl::Window* pWin = mpViewShell->GetActiveWindow();
59 ScopedVclPtr<AbstractSdCustomShowDlg> pDlg(pFact ? pFact->CreateSdCustomShowDlg(pWin ? pWin->GetFrameWeld() : nullptr, *mpDoc) : nullptr);
60 if( pDlg )
62 sal_uInt16 nRet = pDlg->Execute();
63 if( pDlg->IsModified() )
65 mpDoc->SetChanged();
66 sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings();
67 rSettings.mbCustomShow = pDlg->IsCustomShow();
69 pDlg.disposeAndClear();
71 if( nRet == RET_YES )
73 mpViewShell->SetStartShowWithDialog(true);
75 mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION,
76 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
81 } // end of namespace
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */