/src/libreoffice/sd/source/ui/func/fucushow.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <fucushow.hxx> |
21 | | |
22 | | #include <svx/svxids.hrc> |
23 | | |
24 | | #include <ViewShell.hxx> |
25 | | #include <Window.hxx> |
26 | | #include <drawdoc.hxx> |
27 | | #include <sfx2/dispatch.hxx> |
28 | | #include <sfx2/viewfrm.hxx> |
29 | | |
30 | | #include <sdabstdlg.hxx> |
31 | | |
32 | | namespace sd { |
33 | | |
34 | | |
35 | | FuCustomShowDlg::FuCustomShowDlg ( |
36 | | ViewShell& rViewSh, |
37 | | ::sd::Window* pWin, |
38 | | ::sd::View* pView, |
39 | | SdDrawDocument& rDoc, |
40 | | SfxRequest& rReq) |
41 | 0 | : FuPoor( rViewSh, pWin, pView, rDoc, rReq ) |
42 | 0 | { |
43 | 0 | } |
44 | | |
45 | | rtl::Reference<FuPoor> FuCustomShowDlg::Create( ViewShell& rViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument& rDoc, SfxRequest& rReq ) |
46 | 0 | { |
47 | 0 | rtl::Reference<FuPoor> xFunc( new FuCustomShowDlg( rViewSh, pWin, pView, rDoc, rReq ) ); |
48 | 0 | xFunc->DoExecute(rReq); |
49 | 0 | return xFunc; |
50 | 0 | } |
51 | | |
52 | | void FuCustomShowDlg::DoExecute( SfxRequest& ) |
53 | 0 | { |
54 | 0 | SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); |
55 | 0 | vcl::Window* pWin = mrViewShell.GetActiveWindow(); |
56 | 0 | ScopedVclPtr<AbstractSdCustomShowDlg> pDlg( pFact->CreateSdCustomShowDlg(pWin ? pWin->GetFrameWeld() : nullptr, mrDoc) ); |
57 | 0 | sal_uInt16 nRet = pDlg->Execute(); |
58 | 0 | mrDoc.SetChanged(); |
59 | 0 | sd::PresentationSettings& rSettings = mrDoc.getPresentationSettings(); |
60 | |
|
61 | 0 | if( nRet == RET_YES ) |
62 | 0 | { |
63 | | // If the custom show is not set by default |
64 | 0 | if (!rSettings.mbCustomShow) |
65 | 0 | { |
66 | 0 | rSettings.mbStartCustomShow = true; |
67 | 0 | rSettings.mbCustomShow = pDlg->IsCustomShow(); |
68 | 0 | } |
69 | |
|
70 | 0 | mrViewShell.SetStartShowWithDialog(true); |
71 | |
|
72 | 0 | mrViewShell.GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION, |
73 | 0 | SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); |
74 | 0 | } |
75 | 0 | if (nRet == RET_OK) |
76 | 0 | { |
77 | 0 | if (mrDoc.GetCustomShowList()) |
78 | 0 | { |
79 | 0 | if (!pDlg->IsCustomShow()) |
80 | 0 | { |
81 | 0 | rSettings.mbCustomShow = false; |
82 | 0 | rSettings.mbAll = true; |
83 | 0 | } |
84 | 0 | } |
85 | 0 | } |
86 | 0 | pDlg.disposeAndClear(); |
87 | 0 | } |
88 | | |
89 | | } // end of namespace |
90 | | |
91 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |