Update to m13
[ooovba.git] / sc / source / filter / xlsx / xlsx-xlview.cxx
blob78d07ed8bb6f9498e57e638642840b123ba951ac
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 "xlsx/xladdress.hxx"
34 #include "xlview.hxx"
35 #include "ftools.hxx"
37 // Structs ====================================================================
39 XclDocViewData::XclDocViewData() :
40 mnWinX( 0 ),
41 mnWinY( 0 ),
42 mnWinWidth( 0 ),
43 mnWinHeight( 0 ),
44 mnFlags( EXC_WIN1_HOR_SCROLLBAR | EXC_WIN1_VER_SCROLLBAR | EXC_WIN1_TABBAR ),
45 mnDisplXclTab( 0 ),
46 mnFirstVisXclTab( 0 ),
47 mnXclSelectCnt( 1 ),
48 mnTabBarWidth( 600 )
52 // ----------------------------------------------------------------------------
54 XclTabViewData::XclTabViewData() :
55 maFirstXclPos( ScAddress::UNINITIALIZED ),
56 maSecondXclPos( ScAddress::UNINITIALIZED )
58 SetDefaults();
61 XclTabViewData::~XclTabViewData()
65 void XclTabViewData::SetDefaults()
67 maSelMap.clear();
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;
77 mbMirrored = false;
78 mbFrozenPanes = false;
79 mbPageMode = 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
93 switch( nPaneId )
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" );
101 return false;
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 ];
113 if( !rxSelData )
114 rxSelData.reset( new XclSelectionData );
115 return *rxSelData;
118 // ============================================================================