diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-03-09 16:40:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-03-09 17:37:31 +0100 |
commit | eb6c840922b4af0b30bf6e0d691afddb467177b7 (patch) | |
tree | 26e6789922843151c67a28ac3c639e78ee2b05d8 /sc | |
parent | 7750df3d615fde25d005fc56a14e4ae4d50b2d6a (diff) |
Use std::array
...so standard libraries in debug mode can catch out-of-bounds element acces
Change-Id: I519795f5fcb51f243312e5d0247998eff6ceb151
Reviewed-on: https://gerrit.libreoffice.org/51008
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index e50d488c1d12..e9034d248057 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -19,6 +19,9 @@ #ifndef INCLUDED_SC_SOURCE_UI_INC_TABVIEW_HXX #define INCLUDED_SC_SOURCE_UI_INC_TABVIEW_HXX +#include <sal/config.h> + +#include <array> #include <memory> #include <vcl/scrbar.hxx> #include <vcl/help.hxx> @@ -92,7 +95,7 @@ private: enum ModifierTagType { Adder, Remover }; public: - ScExtraEditViewManager(ScTabViewShell* pThisViewShell, VclPtr<ScGridWindow>* pGridWin) + ScExtraEditViewManager(ScTabViewShell* pThisViewShell, std::array<VclPtr<ScGridWindow>, 4> const & pGridWin) : mpThisViewShell(pThisViewShell) , mpGridWin(pGridWin) , mpOtherEditView(nullptr) @@ -120,7 +123,7 @@ private: private: ScTabViewShell* mpThisViewShell; - VclPtr<ScGridWindow>* mpGridWin; + std::array<VclPtr<ScGridWindow>, 4> const & mpGridWin; EditView* mpOtherEditView; int nTotalWindows; }; @@ -147,11 +150,11 @@ private: FuPoor* pDrawActual; FuPoor* pDrawOld; - VclPtr<ScGridWindow> pGridWin[4]; - VclPtr<ScColBar> pColBar[2]; - VclPtr<ScRowBar> pRowBar[2]; - VclPtr<ScOutlineWindow> pColOutline[2]; - VclPtr<ScOutlineWindow> pRowOutline[2]; + std::array<VclPtr<ScGridWindow>, 4> pGridWin; + std::array<VclPtr<ScColBar>, 2> pColBar; + std::array<VclPtr<ScRowBar>, 2> pRowBar; + std::array<VclPtr<ScOutlineWindow>, 2> pColOutline; + std::array<VclPtr<ScOutlineWindow>, 2> pRowOutline; VclPtr<ScTabSplitter> pHSplitter; VclPtr<ScTabSplitter> pVSplitter; VclPtr<ScTabControl> pTabControl; |