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"
36 // Structs ====================================================================
38 XclDocViewData::XclDocViewData() :
43 mnFlags( EXC_WIN1_HOR_SCROLLBAR
| EXC_WIN1_VER_SCROLLBAR
| EXC_WIN1_TABBAR
),
45 mnFirstVisXclTab( 0 ),
51 // ----------------------------------------------------------------------------
53 XclTabViewData::XclTabViewData() :
54 maFirstXclPos( ScAddress::UNINITIALIZED
),
55 maSecondXclPos( ScAddress::UNINITIALIZED
)
60 XclTabViewData::~XclTabViewData()
64 void XclTabViewData::SetDefaults()
67 maGridColor
.SetColor( COL_AUTO
);
68 maFirstXclPos
.Set( 0, 0 );
69 maSecondXclPos
.Set( 0, 0 );
70 mnSplitX
= mnSplitY
= 0;
71 mnNormalZoom
= EXC_WIN2_NORMALZOOM_DEF
;
72 mnPageZoom
= EXC_WIN2_PAGEZOOM_DEF
;
73 mnCurrentZoom
= 0; // default to mnNormalZoom or mnPageZoom
74 mnActivePane
= EXC_PANE_TOPLEFT
;
75 mbSelected
= mbDisplayed
= false;
77 mbFrozenPanes
= false;
79 mbDefGridColor
= true;
80 mbShowFormulas
= false;
81 mbShowGrid
= mbShowHeadings
= mbShowZeros
= mbShowOutline
= true;
82 maTabBgColor
.SetColor( COL_AUTO
);
85 bool XclTabViewData::IsSplit() const
87 return (mnSplitX
> 0) || (mnSplitY
> 0);
90 bool XclTabViewData::HasPane( sal_uInt8 nPaneId
) const
94 case EXC_PANE_BOTTOMRIGHT
: return (mnSplitX
> 0) && (mnSplitY
> 0);
95 case EXC_PANE_TOPRIGHT
: return mnSplitX
> 0;
96 case EXC_PANE_BOTTOMLEFT
: return mnSplitY
> 0;
97 case EXC_PANE_TOPLEFT
: return true;
99 DBG_ERRORFILE( "XclExpPane::HasPane - wrong pane ID" );
103 const XclSelectionData
* XclTabViewData::GetSelectionData( sal_uInt8 nPane
) const
105 XclSelectionMap::const_iterator aIt
= maSelMap
.find( nPane
);
106 return (aIt
== maSelMap
.end()) ? 0 : aIt
->second
.get();
109 XclSelectionData
& XclTabViewData::CreateSelectionData( sal_uInt8 nPane
)
111 XclSelectionDataRef
& rxSelData
= maSelMap
[ nPane
];
113 rxSelData
.reset( new XclSelectionData
);
117 // ============================================================================