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 .
22 #include <osl/diagnose.h>
24 // Structs ====================================================================
26 XclDocViewData::XclDocViewData() :
31 mnFlags( EXC_WIN1_HOR_SCROLLBAR
| EXC_WIN1_VER_SCROLLBAR
| EXC_WIN1_TABBAR
),
33 mnFirstVisXclTab( 0 ),
39 XclTabViewData::XclTabViewData() :
40 maFirstXclPos( ScAddress::UNINITIALIZED
),
41 maSecondXclPos( ScAddress::UNINITIALIZED
)
46 XclTabViewData::~XclTabViewData()
50 void XclTabViewData::SetDefaults()
53 maGridColor
.SetColor( COL_AUTO
);
54 maFirstXclPos
.Set( 0, 0 );
55 maSecondXclPos
.Set( 0, 0 );
56 mnSplitX
= mnSplitY
= 0;
57 mnNormalZoom
= EXC_WIN2_NORMALZOOM_DEF
;
58 mnPageZoom
= EXC_WIN2_PAGEZOOM_DEF
;
59 mnCurrentZoom
= 0; // default to mnNormalZoom or mnPageZoom
60 mnActivePane
= EXC_PANE_TOPLEFT
;
61 mbSelected
= mbDisplayed
= false;
63 mbFrozenPanes
= false;
65 mbDefGridColor
= true;
66 mbShowFormulas
= false;
67 mbShowGrid
= mbShowHeadings
= mbShowZeros
= mbShowOutline
= true;
68 maTabBgColor
.SetColor( COL_AUTO
);
72 bool XclTabViewData::IsSplit() const
74 return (mnSplitX
> 0) || (mnSplitY
> 0);
77 bool XclTabViewData::HasPane( sal_uInt8 nPaneId
) const
81 case EXC_PANE_BOTTOMRIGHT
: return (mnSplitX
> 0) && (mnSplitY
> 0);
82 case EXC_PANE_TOPRIGHT
: return mnSplitX
> 0;
83 case EXC_PANE_BOTTOMLEFT
: return mnSplitY
> 0;
84 case EXC_PANE_TOPLEFT
: return true;
86 OSL_FAIL( "XclExpPane::HasPane - wrong pane ID" );
90 const XclSelectionData
* XclTabViewData::GetSelectionData( sal_uInt8 nPane
) const
92 XclSelectionMap::const_iterator aIt
= maSelMap
.find( nPane
);
93 return (aIt
== maSelMap
.end()) ? 0 : aIt
->second
.get();
96 XclSelectionData
& XclTabViewData::CreateSelectionData( sal_uInt8 nPane
)
98 XclSelectionDataRef
& rxSelData
= maSelMap
[ nPane
];
100 rxSelData
.reset( new XclSelectionData
);
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */