summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/view/SparklineShell.cxx
blob: 3b3c4f8399ed8f40ccbdaf85cf101d87d1369f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 */

#include <scitems.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/request.hxx>
#include <svl/whiter.hxx>
#include <vcl/EnumContext.hxx>

#include <sc.hrc>
#include <SparklineShell.hxx>
#include <tabvwsh.hxx>
#include <docsh.hxx>
#include <document.hxx>

#define ShellClass_SparklineShell
#include <scslots.hxx>

namespace sc
{
SFX_IMPL_INTERFACE(SparklineShell, SfxShell)

void SparklineShell::InitInterface_Impl() { GetStaticInterface()->RegisterPopupMenu("sparkline"); }

SparklineShell::SparklineShell(ScTabViewShell* pViewShell)
    : SfxShell(pViewShell)
    , m_pViewShell(pViewShell)
{
    SetPool(&m_pViewShell->GetPool());
    ScViewData& rViewData = m_pViewShell->GetViewData();
    SfxUndoManager* pUndoManager = rViewData.GetSfxDocShell()->GetUndoManager();
    SetUndoManager(pUndoManager);
    if (!rViewData.GetDocument().IsUndoEnabled())
    {
        pUndoManager->SetMaxUndoActionCount(0);
    }
    SetName("Sparkline");
    SfxShell::SetContextName(
        vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Sparkline));
}

SparklineShell::~SparklineShell() = default;

} // end sc namespace

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */