LibreOffice Module sc (master) 1
SparklineShell.cxx
Go to the documentation of this file.
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 */
10
11#include <scitems.hxx>
12#include <sfx2/objface.hxx>
13#include <sfx2/objsh.hxx>
14#include <sfx2/request.hxx>
15#include <svl/whiter.hxx>
16#include <vcl/EnumContext.hxx>
17
18#include <sc.hrc>
19#include <SparklineShell.hxx>
20#include <tabvwsh.hxx>
21#include <docsh.hxx>
22#include <document.hxx>
23
24#define ShellClass_SparklineShell
25#include <scslots.hxx>
26
27namespace sc
28{
29SFX_IMPL_INTERFACE(SparklineShell, SfxShell)
30
31void SparklineShell::InitInterface_Impl() { GetStaticInterface()->RegisterPopupMenu("sparkline"); }
32
34 : SfxShell(pViewShell)
35 , m_pViewShell(pViewShell)
36{
38 ScViewData& rViewData = m_pViewShell->GetViewData();
39 SfxUndoManager* pUndoManager = rViewData.GetSfxDocShell()->GetUndoManager();
40 SetUndoManager(pUndoManager);
41 if (!rViewData.GetDocument().IsUndoEnabled())
42 {
43 pUndoManager->SetMaxUndoActionCount(0);
44 }
45 SetName("Sparkline");
48}
49
51
52} // end sc namespace
53
54/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsUndoEnabled() const
Definition: document.hxx:1591
ScViewData & GetViewData()
Definition: tabview.hxx:335
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
SfxObjectShell * GetSfxDocShell() const
Definition: viewdata.hxx:358
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
SfxItemPool & GetPool() const
void SetContextName(const OUString &rsContextName)
virtual SfxUndoManager * GetUndoManager()
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
void SetMaxUndoActionCount(size_t nMaxUndoActionCount)
Shell to handle the sparkline context.
SparklineShell(ScTabViewShell *pView)
virtual ~SparklineShell() override
ScTabViewShell * m_pViewShell
static const OUString & GetContextName(const Context eContext)
CAUTION! The following defines must be in the same namespace as the respective type.
#define SFX_IMPL_INTERFACE(Class, SuperClass)