Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "cmdid.h"
31 : : #include "uiitems.hxx"
32 : : #include <vcl/window.hxx>
33 : : #include <sfx2/request.hxx>
34 : : #include <sfx2/viewfrm.hxx>
35 : : #include <svl/stritem.hxx>
36 : : #include <rsc/rscsfx.hxx>
37 : :
38 : : #include "view.hxx"
39 : : #include "wrtsh.hxx"
40 : : #include "basesh.hxx"
41 : :
42 : 0 : void SwView::ExecColl(SfxRequest &rReq)
43 : : {
44 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
45 : 0 : const SfxPoolItem* pItem = 0;
46 : 0 : sal_uInt16 nWhich = rReq.GetSlot();
47 [ # # # ]: 0 : switch( nWhich )
48 : : {
49 : : case FN_SET_PAGE:
50 : : {
51 : : OSL_ENSURE(!this, "Not implemented");
52 : : }
53 : 0 : break;
54 : : case FN_SET_PAGE_STYLE:
55 : : {
56 [ # # ]: 0 : if( pArgs )
57 : : {
58 [ # # ][ # # ]: 0 : if (pArgs &&
[ # # ]
59 [ # # ]: 0 : SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_True, &pItem ))
60 : : {
61 [ # # ]: 0 : if( ((SfxStringItem*)pItem)->GetValue() !=
62 [ # # # # ]: 0 : GetWrtShell().GetCurPageStyle(sal_False) )
[ # # ]
63 : : {
64 : : SfxStringItem aName(SID_STYLE_APPLY,
65 [ # # ]: 0 : ((SfxStringItem*)pItem)->GetValue());
66 : : SfxUInt16Item aFamItem( SID_STYLE_FAMILY,
67 [ # # ]: 0 : SFX_STYLE_FAMILY_PAGE);
68 [ # # ]: 0 : SwPtrItem aShell(FN_PARAM_WRTSHELL, GetWrtShellPtr());
69 [ # # ]: 0 : SfxRequest aReq(SID_STYLE_APPLY, 0, GetPool());
70 [ # # ]: 0 : aReq.AppendItem(aName);
71 [ # # ]: 0 : aReq.AppendItem(aFamItem);
72 [ # # ]: 0 : aReq.AppendItem(aShell);
73 [ # # ][ # # ]: 0 : GetCurShell()->ExecuteSlot(aReq);
[ # # ][ # # ]
[ # # ]
74 : : }
75 : : }
76 : : }
77 : : else
78 : : {
79 [ # # ]: 0 : SfxRequest aReq(FN_FORMAT_PAGE_DLG, 0, GetPool());
80 [ # # ][ # # ]: 0 : GetCurShell()->ExecuteSlot(aReq);
81 : : }
82 : : }
83 : 0 : break;
84 : : default:
85 : : OSL_FAIL("wrong CommandProcessor for Dispatch");
86 : 0 : return;
87 : : }
88 : : }
89 : :
90 : :
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|