LibreOffice Module sc (master)  1
tabvwsh.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  * 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 <svx/imapdlg.hxx>
21 #include <svx/srchdlg.hxx>
22 #include <sfx2/objface.hxx>
23 #include <sfx2/viewfrm.hxx>
24 #include <sfx2/infobar.hxx>
26 #include <sfx2/viewfac.hxx>
27 
28 #include <cellvalue.hxx>
29 
30 #include <tabvwsh.hxx>
31 #include <docsh.hxx>
32 #include <reffact.hxx>
33 #include <sc.hrc>
34 #include <spelldialog.hxx>
35 #include <formulacell.hxx>
36 #include <searchresults.hxx>
37 
38  // needed for -fsanitize=function visibility of typeinfo for functions of
39  // type void(SfxShell*,SfxRequest&) defined in scslots.hxx
40 #define ShellClass_ScTabViewShell
41 #include <scslots.hxx>
42 
43 
45 
46 void ScTabViewShell::InitInterface_Impl()
47 {
48  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS,
49  SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
50  ToolbarId::Objectbar_Tools);
51 
52  GetStaticInterface()->RegisterChildWindow(FID_INPUTLINE_STATUS);
53  GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
54 
55  GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true);
56 
57  GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
58  GetStaticInterface()->RegisterChildWindow(ScNameDlgWrapper::GetChildWindowId());
59  GetStaticInterface()->RegisterChildWindow(ScNameDefDlgWrapper::GetChildWindowId());
60  GetStaticInterface()->RegisterChildWindow(ScSolverDlgWrapper::GetChildWindowId());
61  GetStaticInterface()->RegisterChildWindow(ScOptSolverDlgWrapper::GetChildWindowId());
62  GetStaticInterface()->RegisterChildWindow(ScXMLSourceDlgWrapper::GetChildWindowId());
63  GetStaticInterface()->RegisterChildWindow(ScPivotLayoutWrapper::GetChildWindowId());
64  GetStaticInterface()->RegisterChildWindow(ScTabOpDlgWrapper::GetChildWindowId());
65  GetStaticInterface()->RegisterChildWindow(ScFilterDlgWrapper::GetChildWindowId());
66  GetStaticInterface()->RegisterChildWindow(ScSpecialFilterDlgWrapper::GetChildWindowId());
67  GetStaticInterface()->RegisterChildWindow(ScDbNameDlgWrapper::GetChildWindowId());
68  GetStaticInterface()->RegisterChildWindow(ScConsolidateDlgWrapper::GetChildWindowId());
69  GetStaticInterface()->RegisterChildWindow(ScPrintAreasDlgWrapper::GetChildWindowId());
70  GetStaticInterface()->RegisterChildWindow(ScColRowNameRangesDlgWrapper::GetChildWindowId());
71  GetStaticInterface()->RegisterChildWindow(ScFormulaDlgWrapper::GetChildWindowId());
72  GetStaticInterface()->RegisterChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
73  GetStaticInterface()->RegisterChildWindow(ScFormulaDlgWrapper::GetChildWindowId());
74  GetStaticInterface()->RegisterChildWindow(ScAcceptChgDlgWrapper::GetChildWindowId());
75  GetStaticInterface()->RegisterChildWindow(ScHighlightChgDlgWrapper::GetChildWindowId());
76  GetStaticInterface()->RegisterChildWindow(ScSimpleRefDlgWrapper::GetChildWindowId());
77  GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
78  GetStaticInterface()->RegisterChildWindow(SID_HYPERLINK_DIALOG);
79  GetStaticInterface()->RegisterChildWindow(ScSpellDialogChildWindow::GetChildWindowId());
80  GetStaticInterface()->RegisterChildWindow(ScValidityRefChildWin::GetChildWindowId());
81  GetStaticInterface()->RegisterChildWindow(sc::SearchResultsDlgWrapper::GetChildWindowId());
82 
83  GetStaticInterface()->RegisterChildWindow(ScRandomNumberGeneratorDialogWrapper::GetChildWindowId());
84  GetStaticInterface()->RegisterChildWindow(ScSamplingDialogWrapper::GetChildWindowId());
85  GetStaticInterface()->RegisterChildWindow(ScDescriptiveStatisticsDialogWrapper::GetChildWindowId());
86  GetStaticInterface()->RegisterChildWindow(ScAnalysisOfVarianceDialogWrapper::GetChildWindowId());
87  GetStaticInterface()->RegisterChildWindow(ScCorrelationDialogWrapper::GetChildWindowId());
88  GetStaticInterface()->RegisterChildWindow(ScCovarianceDialogWrapper::GetChildWindowId());
89  GetStaticInterface()->RegisterChildWindow(ScExponentialSmoothingDialogWrapper::GetChildWindowId());
90  GetStaticInterface()->RegisterChildWindow(ScMovingAverageDialogWrapper::GetChildWindowId());
91  GetStaticInterface()->RegisterChildWindow(ScRegressionDialogWrapper::GetChildWindowId());
92  GetStaticInterface()->RegisterChildWindow(ScTTestDialogWrapper::GetChildWindowId());
93  GetStaticInterface()->RegisterChildWindow(ScFTestDialogWrapper::GetChildWindowId());
94  GetStaticInterface()->RegisterChildWindow(ScZTestDialogWrapper::GetChildWindowId());
95  GetStaticInterface()->RegisterChildWindow(ScChiSquareTestDialogWrapper::GetChildWindowId());
96  GetStaticInterface()->RegisterChildWindow(ScFourierAnalysisDialogWrapper::GetChildWindowId());
97  GetStaticInterface()->RegisterChildWindow(ScCondFormatDlgWrapper::GetChildWindowId());
98 }
99 
101 {
103 }
104 
105 OUString ScTabViewShell::GetFormula(const ScAddress& rAddress)
106 {
107  OUString sFormula;
108  ScDocument& rDoc = GetViewData().GetDocument();
109  ScRefCellValue aCell(rDoc, rAddress);
110  if (!aCell.isEmpty() && aCell.meType == CELLTYPE_FORMULA)
111  {
112  aCell.mpFormula->GetFormula( sFormula);
113  }
114  return sFormula;
115 }
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SFX_IMPL_INTERFACE(Class, SuperClass)
bool isEmpty() const
Definition: cellvalue.cxx:670
void GetFormula(OUString &rFormula, const formula::FormulaGrammar::Grammar=formula::FormulaGrammar::GRAM_DEFAULT, const ScInterpreterContext *pContext=nullptr) const
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:104
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:111
ScViewData & GetViewData()
Definition: tabview.hxx:332
OUString GetFormula(const ScAddress &rAddress)
Definition: tabvwsh.cxx:105
SFX_IMPL_NAMED_VIEWFACTORY(ScTabViewShell,"Default")
Definition: tabvwsh.cxx:100
#define SFX_VIEW_REGISTRATION(DocClass)
CellType meType
Definition: cellvalue.hxx:106
#define SFX_OBJECTBAR_TOOLS
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo