bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / uiview / viewcoll.cxx
blobdaa0594b58e38d85915fde3a8d1ad66f283c4593
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 .
21 #include "cmdid.h"
22 #include "uiitems.hxx"
23 #include <vcl/window.hxx>
24 #include <sfx2/request.hxx>
25 #include <sfx2/viewfrm.hxx>
26 #include <svl/stritem.hxx>
27 #include <rsc/rscsfx.hxx>
29 #include "view.hxx"
30 #include "wrtsh.hxx"
31 #include "basesh.hxx"
33 void SwView::ExecColl(SfxRequest &rReq)
35 const SfxItemSet* pArgs = rReq.GetArgs();
36 const SfxPoolItem* pItem = 0;
37 sal_uInt16 nWhich = rReq.GetSlot();
38 switch( nWhich )
40 case FN_SET_PAGE:
42 OSL_ENSURE(!this, "Not implemented");
44 break;
45 case FN_SET_PAGE_STYLE:
47 if( pArgs )
49 if (pArgs &&
50 SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_True, &pItem ))
52 if( ((SfxStringItem*)pItem)->GetValue() !=
53 GetWrtShell().GetCurPageStyle(sal_False) )
55 SfxStringItem aName(SID_STYLE_APPLY,
56 ((SfxStringItem*)pItem)->GetValue());
57 SfxUInt16Item aFamItem( SID_STYLE_FAMILY,
58 SFX_STYLE_FAMILY_PAGE);
59 SwPtrItem aShell(FN_PARAM_WRTSHELL, GetWrtShellPtr());
60 SfxRequest aReq(SID_STYLE_APPLY, 0, GetPool());
61 aReq.AppendItem(aName);
62 aReq.AppendItem(aFamItem);
63 aReq.AppendItem(aShell);
64 GetCurShell()->ExecuteSlot(aReq);
68 else
70 SfxRequest aReq(FN_FORMAT_PAGE_DLG, 0, GetPool());
71 GetCurShell()->ExecuteSlot(aReq);
74 break;
75 default:
76 OSL_FAIL("wrong CommandProcessor for Dispatch");
77 return;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */