1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xlview.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
33 #include "xlsx/xladdress.hxx"
37 // Structs ====================================================================
39 XclDocViewData::XclDocViewData() :
44 mnFlags( EXC_WIN1_HOR_SCROLLBAR
| EXC_WIN1_VER_SCROLLBAR
| EXC_WIN1_TABBAR
),
46 mnFirstVisXclTab( 0 ),
52 // ----------------------------------------------------------------------------
54 XclTabViewData::XclTabViewData() :
55 maFirstXclPos( ScAddress::UNINITIALIZED
),
56 maSecondXclPos( ScAddress::UNINITIALIZED
)
61 XclTabViewData::~XclTabViewData()
65 void XclTabViewData::SetDefaults()
68 maGridColor
.SetColor( COL_AUTO
);
69 maFirstXclPos
.Set( 0, 0 );
70 maSecondXclPos
.Set( 0, 0 );
71 mnSplitX
= mnSplitY
= 0;
72 mnNormalZoom
= EXC_WIN2_NORMALZOOM_DEF
;
73 mnPageZoom
= EXC_WIN2_PAGEZOOM_DEF
;
74 mnCurrentZoom
= 0; // default to mnNormalZoom or mnPageZoom
75 mnActivePane
= EXC_PANE_TOPLEFT
;
76 mbSelected
= mbDisplayed
= false;
78 mbFrozenPanes
= false;
80 mbDefGridColor
= true;
81 mbShowFormulas
= false;
82 mbShowGrid
= mbShowHeadings
= mbShowZeros
= mbShowOutline
= true;
83 maTabBgColor
.SetColor( COL_AUTO
);
86 bool XclTabViewData::IsSplit() const
88 return (mnSplitX
> 0) || (mnSplitY
> 0);
91 bool XclTabViewData::HasPane( sal_uInt8 nPaneId
) const
95 case EXC_PANE_BOTTOMRIGHT
: return (mnSplitX
> 0) && (mnSplitY
> 0);
96 case EXC_PANE_TOPRIGHT
: return mnSplitX
> 0;
97 case EXC_PANE_BOTTOMLEFT
: return mnSplitY
> 0;
98 case EXC_PANE_TOPLEFT
: return true;
100 DBG_ERRORFILE( "XclExpPane::HasPane - wrong pane ID" );
104 const XclSelectionData
* XclTabViewData::GetSelectionData( sal_uInt8 nPane
) const
106 XclSelectionMap::const_iterator aIt
= maSelMap
.find( nPane
);
107 return (aIt
== maSelMap
.end()) ? 0 : aIt
->second
.get();
110 XclSelectionData
& XclTabViewData::CreateSelectionData( sal_uInt8 nPane
)
112 XclSelectionDataRef
& rxSelData
= maSelMap
[ nPane
];
114 rxSelData
.reset( new XclSelectionData
);
118 // ============================================================================