Skip to content

Commit be4fadf

Browse files
quikeevmiklos
authored andcommitted
sc: move SheetViewManager into own header file, describe methods.
No other functional change was made, just simplification. Change-Id: I9d34f1525470f6517b315be48f519f6a6e1b62f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189857 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> (cherry picked from commit eb514bd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191084 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]>
1 parent 8c03c98 commit be4fadf

File tree

8 files changed

+56
-27
lines changed

8 files changed

+56
-27
lines changed

sc/inc/SheetView.hxx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
*/
99

1010
#pragma once
11-
#include <vector>
12-
#include "SheetViewTypes.hxx"
1311
#include "types.hxx"
1412

1513
class ScTable;
@@ -36,26 +34,6 @@ public:
3634
/** A sheet view is valid if the pointer to the table is set */
3735
bool isValid() const;
3836
};
39-
40-
/** Manager and the holder of the sheet views for a sheet. */
41-
class SheetViewManager
42-
{
43-
private:
44-
std::vector<SheetView> maViews;
45-
46-
public:
47-
SheetViewManager();
48-
49-
/** Creates a new sheet view. */
50-
SheetViewID create(ScTable* pSheetViewTable);
51-
52-
/** Returns a sheet view for the ID. */
53-
SheetView get(SheetViewID nID) const;
54-
bool isEmpty() const { return maViews.empty(); }
55-
bool remove(SheetViewID nID);
56-
std::vector<SheetView> const& getSheetViews() const { return maViews; }
57-
SheetViewID getNextSheetView(SheetViewID nID);
58-
};
5937
}
6038

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

sc/inc/SheetViewManager.hxx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
#pragma once
11+
#include "SheetViewTypes.hxx"
12+
#include "SheetView.hxx"
13+
#include "types.hxx"
14+
15+
#include <vector>
16+
17+
class ScTable;
18+
19+
namespace sc
20+
{
21+
/** Manager and the holder of the sheet views for a sheet. */
22+
class SheetViewManager
23+
{
24+
private:
25+
std::vector<SheetView> maViews;
26+
27+
public:
28+
SheetViewManager();
29+
30+
/** Creates a new sheet view. */
31+
SheetViewID create(ScTable* pSheetViewTable);
32+
33+
/** Returns a sheet view for the ID. */
34+
SheetView get(SheetViewID nID) const;
35+
36+
/** True if there are no sheet views. */
37+
bool isEmpty() const { return maViews.empty(); }
38+
39+
/** Remove the sheet view with the ID. True if successful. */
40+
bool remove(SheetViewID nID);
41+
42+
/** Return the list of sheet views. */
43+
std::vector<SheetView> const& getSheetViews() const { return maViews; }
44+
45+
/** Calculate the next sheet view ID from the current ID. */
46+
SheetViewID getNextSheetView(SheetViewID nID);
47+
};
48+
}
49+
50+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

sc/qa/unit/tiledrendering/SheetViewTest.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <sctestviewcallback.hxx>
1818
#include <docuno.hxx>
1919
#include <SheetView.hxx>
20+
#include <SheetViewManager.hxx>
2021

2122
using namespace css;
2223

sc/source/core/data/SheetViewManager.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
88
*/
99

10-
#include <SheetView.hxx>
10+
#include <SheetViewManager.hxx>
1111
#include <table.hxx>
1212

1313
namespace sc

sc/source/core/data/document10.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <docsh.hxx>
2929
#include <bcaslot.hxx>
3030
#include <broadcast.hxx>
31-
#include <SheetView.hxx>
31+
#include <SheetViewManager.hxx>
3232

3333
// Add totally brand-new methods to this source file.
3434

sc/source/core/data/table1.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include <rowheightcontext.hxx>
5454
#include <compressedarray.hxx>
5555
#include <tabvwsh.hxx>
56-
#include <SheetView.hxx>
56+
#include <SheetViewManager.hxx>
5757
#include <vcl/svapp.hxx>
5858

5959
#include <formula/vectortoken.hxx>

sc/source/ui/view/viewfun3.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#include <cliputil.hxx>
6464
#include <clipoptions.hxx>
6565
#include <gridwin.hxx>
66-
#include <SheetView.hxx>
66+
#include <SheetViewManager.hxx>
6767
#include <uiitems.hxx>
6868
#include <com/sun/star/util/XCloneable.hpp>
6969

sc/source/ui/view/viewfunc.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#include <columnspanset.hxx>
7878
#include <stringutil.hxx>
7979
#include <SparklineList.hxx>
80-
#include <SheetView.hxx>
80+
#include <SheetViewManager.hxx>
8181

8282
#include <memory>
8383

0 commit comments

Comments
 (0)