1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <sfx2/objface.hxx>
12 #include <sfx2/objsh.hxx>
13 #include <vcl/EnumContext.hxx>
15 #include <SparklineShell.hxx>
16 #include <tabvwsh.hxx>
17 #include <document.hxx>
19 #define ShellClass_SparklineShell
20 #include <scslots.hxx>
24 SFX_IMPL_INTERFACE(SparklineShell
, SfxShell
)
26 void SparklineShell::InitInterface_Impl()
28 GetStaticInterface()->RegisterPopupMenu(u
"sparkline"_ustr
);
31 SparklineShell::SparklineShell(ScTabViewShell
* pViewShell
)
32 : SfxShell(pViewShell
)
33 , m_pViewShell(pViewShell
)
35 SetPool(&m_pViewShell
->GetPool());
36 ScViewData
& rViewData
= m_pViewShell
->GetViewData();
37 SfxUndoManager
* pUndoManager
= rViewData
.GetSfxDocShell()->GetUndoManager();
38 SetUndoManager(pUndoManager
);
39 if (!rViewData
.GetDocument().IsUndoEnabled())
41 pUndoManager
->SetMaxUndoActionCount(0);
43 SetName(u
"Sparkline"_ustr
);
44 SfxShell::SetContextName(
45 vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Sparkline
));
48 SparklineShell::~SparklineShell() = default;
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */