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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <osl/diagnose.h>
23 // Structs ====================================================================
25 XclDocViewData::XclDocViewData() :
30 mnFlags( EXC_WIN1_HOR_SCROLLBAR
| EXC_WIN1_VER_SCROLLBAR
| EXC_WIN1_TABBAR
),
32 mnFirstVisXclTab( 0 ),
38 XclTabViewData::XclTabViewData() :
39 maFirstXclPos( ScAddress::UNINITIALIZED
),
40 maSecondXclPos( ScAddress::UNINITIALIZED
)
45 XclTabViewData::~XclTabViewData()
49 void XclTabViewData::SetDefaults()
52 maGridColor
= COL_AUTO
;
53 maFirstXclPos
.Set( 0, 0 );
54 maSecondXclPos
.Set( 0, 0 );
55 mnSplitX
= mnSplitY
= 0;
56 mnNormalZoom
= EXC_WIN2_NORMALZOOM_DEF
;
57 mnPageZoom
= EXC_WIN2_PAGEZOOM_DEF
;
58 mnCurrentZoom
= 0; // default to mnNormalZoom or mnPageZoom
59 mnActivePane
= EXC_PANE_TOPLEFT
;
60 mbSelected
= mbDisplayed
= false;
62 mbFrozenPanes
= false;
64 mbDefGridColor
= true;
65 mbShowFormulas
= false;
66 mbShowGrid
= mbShowHeadings
= mbShowZeros
= mbShowOutline
= true;
67 maTabBgColor
= COL_AUTO
;
71 bool XclTabViewData::IsSplit() const
73 return (mnSplitX
> 0) || (mnSplitY
> 0);
76 bool XclTabViewData::HasPane( sal_uInt8 nPaneId
) const
80 case EXC_PANE_BOTTOMRIGHT
: return (mnSplitX
> 0) && (mnSplitY
> 0);
81 case EXC_PANE_TOPRIGHT
: return mnSplitX
> 0;
82 case EXC_PANE_BOTTOMLEFT
: return mnSplitY
> 0;
83 case EXC_PANE_TOPLEFT
: return true;
85 OSL_FAIL( "XclExpPane::HasPane - wrong pane ID" );
89 const XclSelectionData
* XclTabViewData::GetSelectionData( sal_uInt8 nPane
) const
91 XclSelectionMap::const_iterator aIt
= maSelMap
.find( nPane
);
92 return (aIt
== maSelMap
.end()) ? nullptr : aIt
->second
.get();
95 XclSelectionData
& XclTabViewData::CreateSelectionData( sal_uInt8 nPane
)
97 XclSelectionDataRef
& rxSelData
= maSelMap
[ nPane
];
99 rxSelData
= std::make_shared
<XclSelectionData
>();
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */