Update ooo320-m1
[ooovba.git] / sc / source / filter / excel / xlview.cxx
blob8580d7a64a38d946a7495ccfee0e201ce82a6ad9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xlview.cxx,v $
10 * $Revision: 1.7 $
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 "xlview.hxx"
34 #include "ftools.hxx"
36 // Structs ====================================================================
38 XclDocViewData::XclDocViewData() :
39 mnWinX( 0 ),
40 mnWinY( 0 ),
41 mnWinWidth( 0 ),
42 mnWinHeight( 0 ),
43 mnFlags( EXC_WIN1_HOR_SCROLLBAR | EXC_WIN1_VER_SCROLLBAR | EXC_WIN1_TABBAR ),
44 mnDisplXclTab( 0 ),
45 mnFirstVisXclTab( 0 ),
46 mnXclSelectCnt( 1 ),
47 mnTabBarWidth( 600 )
51 // ----------------------------------------------------------------------------
53 XclTabViewData::XclTabViewData() :
54 maFirstXclPos( ScAddress::UNINITIALIZED ),
55 maSecondXclPos( ScAddress::UNINITIALIZED )
57 SetDefaults();
60 XclTabViewData::~XclTabViewData()
64 void XclTabViewData::SetDefaults()
66 maSelMap.clear();
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;
76 mbMirrored = false;
77 mbFrozenPanes = false;
78 mbPageMode = 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
92 switch( nPaneId )
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" );
100 return false;
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 ];
112 if( !rxSelData )
113 rxSelData.reset( new XclSelectionData );
114 return *rxSelData;
117 // ============================================================================