Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/sw/source/uibase/uiview/viewcoll.cxx
Line
Count
Source (jump to first uncovered line)
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 <cmdid.h>
21
#include <uiitems.hxx>
22
#include <sfx2/bindings.hxx>
23
#include <sfx2/request.hxx>
24
#include <svl/stritem.hxx>
25
#include <svl/style.hxx>
26
#include <osl/diagnose.h>
27
28
#include <view.hxx>
29
#include <wrtsh.hxx>
30
31
void SwView::ExecColl(SfxRequest const &rReq)
32
0
{
33
0
    const SfxItemSet* pArgs = rReq.GetArgs();
34
0
    const SfxPoolItem* pItem = nullptr;
35
0
    sal_uInt16 nWhich = rReq.GetSlot();
36
0
    switch( nWhich )
37
0
    {
38
0
        case FN_SET_PAGE:
39
0
        {
40
0
            OSL_ENSURE(false, "Not implemented");
41
0
        }
42
0
        break;
43
0
        case FN_SET_PAGE_STYLE:
44
0
        {
45
0
            if( pArgs )
46
0
            {
47
0
                if (SfxItemState::SET == pArgs->GetItemState( nWhich , true, &pItem ))
48
0
                {
49
0
                    if( static_cast<const SfxStringItem*>(pItem)->GetValue() !=
50
0
                                            GetWrtShell().GetCurPageStyle() )
51
0
                    {
52
0
                        SfxStringItem aName(SID_STYLE_APPLY,
53
0
                                   static_cast<const SfxStringItem*>(pItem)->GetValue());
54
0
                        SfxUInt16Item aFamItem( SID_STYLE_FAMILY,
55
0
                                            sal_uInt16(SfxStyleFamily::Page));
56
0
                        SwPtrItem aShell(FN_PARAM_WRTSHELL, GetWrtShellPtr());
57
0
                        SfxRequest aReq(SID_STYLE_APPLY, SfxCallMode::SLOT, GetPool());
58
0
                        aReq.AppendItem(aName);
59
0
                        aReq.AppendItem(aFamItem);
60
0
                        aReq.AppendItem(aShell);
61
0
                        GetCurShell()->ExecuteSlot(aReq);
62
0
                    }
63
0
                }
64
0
            }
65
0
            else
66
0
            {
67
0
                SfxRequest aReq(FN_FORMAT_PAGE_DLG, SfxCallMode::SLOT, GetPool());
68
0
                GetCurShell()->ExecuteSlot(aReq);
69
0
            }
70
0
        }
71
0
        break;
72
0
        default:
73
0
            OSL_FAIL("wrong CommandProcessor for Dispatch");
74
0
            return;
75
0
    }
76
0
}
77
78
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */