LibreOffice Module sc (master) 1
xeview.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <xeview.hxx>
21#include <document.hxx>
22#include <scextopt.hxx>
23#include <viewopti.hxx>
24#include <xelink.hxx>
25#include <xestyle.hxx>
26#include <xehelper.hxx>
27#include <xltools.hxx>
28#include <oox/token/tokens.hxx>
29#include <oox/export/utils.hxx>
30
31using namespace ::oox;
32
33// Workbook view settings records =============================================
34
37 , mnFlags(0)
38 , mnTabBarSize(600)
39{
40 const ScViewOptions& rViewOpt = rRoot.GetDoc().GetViewOptions();
44
45 double fTabBarWidth = rRoot.GetExtDocOptions().GetDocSettings().mfTabBarWidth;
46 if( (0.0 <= fTabBarWidth) && (fTabBarWidth <= 1.0) )
47 mnTabBarSize = static_cast< sal_uInt16 >( fTabBarWidth * 1000.0 + 0.5 );
48}
49
51{
52 const XclExpTabInfo& rTabInfo = rStrm.GetRoot().GetTabInfo();
53
54 rStrm.GetCurrentStream()->singleElement( XML_workbookView,
55 // OOXTODO: XML_visibility, // ST_visibility
56 // OOXTODO: XML_minimized, // bool
57 XML_showHorizontalScroll, ToPsz( ::get_flag( mnFlags, EXC_WIN1_HOR_SCROLLBAR ) ),
58 XML_showVerticalScroll, ToPsz( ::get_flag( mnFlags, EXC_WIN1_VER_SCROLLBAR ) ),
59 XML_showSheetTabs, ToPsz( ::get_flag( mnFlags, EXC_WIN1_TABBAR ) ),
60 XML_xWindow, "0",
61 XML_yWindow, "0",
62 XML_windowWidth, OString::number(0x4000),
63 XML_windowHeight, OString::number(0x2000),
64 XML_tabRatio, OString::number(mnTabBarSize),
65 XML_firstSheet, OString::number(rTabInfo.GetFirstVisXclTab()),
66 XML_activeTab, OString::number(rTabInfo.GetDisplayedXclTab())
67 // OOXTODO: XML_autoFilterDateGrouping, // bool; AUTOFILTER12? 87Eh
68 );
69}
70
72{
73 const XclExpTabInfo& rTabInfo = rStrm.GetRoot().GetTabInfo();
74
75 rStrm << sal_uInt16( 0 ) // X position of the window
76 << sal_uInt16( 0 ) // Y position of the window
77 << sal_uInt16( 0x4000 ) // width of the window
78 << sal_uInt16( 0x2000 ) // height of the window
79 << mnFlags
80 << rTabInfo.GetDisplayedXclTab()
81 << rTabInfo.GetFirstVisXclTab()
82 << rTabInfo.GetXclSelectedCount()
83 << mnTabBarSize;
84}
85
86// Sheet view settings records ================================================
87
89 const XclTabViewData& rData, sal_uInt32 nGridColorId ) :
90 XclExpRecord( EXC_ID_WINDOW2, (rRoot.GetBiff() == EXC_BIFF8) ? 18 : 10 ),
91 maGridColor( rData.maGridColor ),
92 mnGridColorId( nGridColorId ),
93 mnFlags( 0 ),
94 maFirstXclPos( rData.maFirstXclPos ),
95 mnNormalZoom( rData.mnNormalZoom ),
96 mnPageZoom( rData.mnPageZoom )
97{
110}
111
113{
114 const XclExpRoot& rRoot = rStrm.GetRoot();
115
116 rStrm << mnFlags
117 << maFirstXclPos;
118
119 switch( rRoot.GetBiff() )
120 {
121 case EXC_BIFF3:
122 case EXC_BIFF4:
123 case EXC_BIFF5:
125 break;
126 case EXC_BIFF8:
128 << sal_uInt16( 0 )
129 << mnPageZoom
130 << mnNormalZoom
131 << sal_uInt32( 0 );
132 break;
133 default: DBG_ERROR_BIFF();
134 }
135}
136
137XclExpScl::XclExpScl( sal_uInt16 nZoom ) :
139 mnNum( nZoom ),
140 mnDenom( 100 )
141{
142 Shorten( 2 );
143 Shorten( 5 );
144}
145
146void XclExpScl::Shorten( sal_uInt16 nFactor )
147{
148 while( (mnNum % nFactor == 0) && (mnDenom % nFactor == 0) )
149 {
150 mnNum = mnNum / nFactor;
151 mnDenom = mnDenom / nFactor;
152 }
153}
154
156{
157 OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF4 );
158 rStrm << mnNum << mnDenom;
159}
160
163 mnSplitX( rData.mnSplitX ),
164 mnSplitY( rData.mnSplitY ),
165 maSecondXclPos( rData.maSecondXclPos ),
166 mnActivePane( rData.mnActivePane ),
167 mbFrozenPanes( rData.mbFrozenPanes )
168{
169 OSL_ENSURE( rData.IsSplit(), "XclExpPane::XclExpPane - no PANE record for unsplit view" );
170}
171
172static const char* lcl_GetActivePane( sal_uInt8 nActivePane )
173{
174 switch( nActivePane )
175 {
176 case EXC_PANE_TOPLEFT: return "topLeft";
177 case EXC_PANE_TOPRIGHT: return "topRight";
178 case EXC_PANE_BOTTOMLEFT: return "bottomLeft";
179 case EXC_PANE_BOTTOMRIGHT: return "bottomRight";
180 }
181 return "**error: lcl_GetActivePane";
182}
183
185{
186 rStrm.GetCurrentStream()->singleElement( XML_pane,
187 XML_xSplit, OString::number(mnSplitX),
188 XML_ySplit, OString::number(mnSplitY),
189 XML_topLeftCell, XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), maSecondXclPos ).getStr(),
190 XML_activePane, lcl_GetActivePane( mnActivePane ),
191 XML_state, mbFrozenPanes ? "frozen" : "split" );
192}
193
195{
196 rStrm << mnSplitX
197 << static_cast<sal_uInt16>( mnSplitY )
199 << mnActivePane;
200 if( rStrm.GetRoot().GetBiff() >= EXC_BIFF5 )
201 rStrm << sal_uInt8( 0 );
202}
203
206 mnPane( nPane )
207{
208 if( const XclSelectionData* pSelData = rData.GetSelectionData( nPane ) )
209 maSelData = *pSelData;
210
211 // find the cursor position in the selection list (or add it)
213 auto aIt = std::find_if(rXclSel.begin(), rXclSel.end(),
214 [this](const XclRange& rRange) { return rRange.Contains(maSelData.maXclCursor); });
215 if (aIt != rXclSel.end())
216 {
217 maSelData.mnCursorIdx = static_cast< sal_uInt16 >( std::distance(rXclSel.begin(), aIt) );
218 }
219 else
220 {
221 /* Cursor cell not found in list? (e.g. inactive pane, or removed in
222 ConvertRangeList(), because Calc cursor on invalid pos)
223 -> insert the valid Excel cursor. */
224 maSelData.mnCursorIdx = static_cast< sal_uInt16 >( rXclSel.size() );
226 }
227}
228
230{
231 rStrm.GetCurrentStream()->singleElement( XML_selection,
232 XML_pane, lcl_GetActivePane( mnPane ),
233 XML_activeCell, XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), maSelData.maXclCursor ).getStr(),
234 XML_activeCellId, OString::number(maSelData.mnCursorIdx),
235 XML_sqref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), maSelData.maXclSelection) );
236}
237
239{
240 rStrm << mnPane // pane for this selection
241 << maSelData.maXclCursor // cell cursor
242 << maSelData.mnCursorIdx; // index to range containing cursor
244}
245
248 mrTabViewData( rTabViewData )
249{
250}
251//TODO Fix savexml...
252/*void XclExpTabBgColor::SaveXml( XclExpXmlStream& rStrm )
253{
254}*/
255
257{
259 return;
260 sal_uInt16 const rt = 0x0862; //rt
261 sal_uInt16 const grbitFrt = 0x0000; //grbit must be set to 0
262 sal_uInt32 unused = 0x00000000; //Use twice...
263 sal_uInt32 const cb = 0x00000014; // Record Size, may be larger in future...
264 sal_uInt16 const reserved = 0x0000; //trailing bits are 0
265 sal_uInt16 TabBgColorIndex;
266 XclExpPalette& rPal = rStrm.GetRoot().GetPalette();
267 TabBgColorIndex = rPal.GetColorIndex(mrTabViewData.mnTabBgColorId);
268 if (TabBgColorIndex < 8 || TabBgColorIndex > 63 ) // only numbers 8 - 63 are valid numbers
269 TabBgColorIndex = 127; //Excel specs: 127 makes excel ignore tab color information.
270 rStrm << rt << grbitFrt << unused << unused << cb << TabBgColorIndex << reserved;
271}
272
273// Sheet view settings ========================================================
274
275namespace {
276
278sal_uInt16 lclGetXclZoom( tools::Long nScZoom, sal_uInt16 nDefXclZoom )
279{
280 sal_uInt16 nXclZoom = limit_cast< sal_uInt16 >( nScZoom, EXC_ZOOM_MIN, EXC_ZOOM_MAX );
281 return (nXclZoom == nDefXclZoom) ? 0 : nXclZoom;
282}
283
284} // namespace
285
287 XclExpRoot( rRoot ),
288 mnGridColorId( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) ),
289 mbHasTabSettings(false)
290{
291 // *** sheet flags ***
292
293 const XclExpTabInfo& rTabInfo = GetTabInfo();
294 maData.mbSelected = rTabInfo.IsSelectedTab( nScTab );
295 maData.mbDisplayed = rTabInfo.IsDisplayedTab( nScTab );
296 maData.mbMirrored = rTabInfo.IsMirroredTab( nScTab );
297
298 const ScViewOptions& rViewOpt = GetDoc().GetViewOptions();
303
304 // *** sheet options: cursor, selection, splits, grid color, zoom ***
305
306 if( const ScExtTabSettings* pTabSett = GetExtDocOptions().GetTabSettings( nScTab ) )
307 {
308 mbHasTabSettings = true;
309 const ScExtTabSettings& rTabSett = *pTabSett;
311
312 // first visible cell in top-left pane
313 if( (rTabSett.maFirstVis.Col() >= 0) && (rTabSett.maFirstVis.Row() >= 0) )
314 maData.maFirstXclPos = rAddrConv.CreateValidAddress( rTabSett.maFirstVis, false );
315
316 // first visible cell in additional pane(s)
317 if( (rTabSett.maSecondVis.Col() >= 0) && (rTabSett.maSecondVis.Row() >= 0) )
318 maData.maSecondXclPos = rAddrConv.CreateValidAddress( rTabSett.maSecondVis, false );
319
320 // active pane
321 switch( rTabSett.meActivePane )
322 {
327 }
328
329 // freeze/split position
332 {
333 /* Frozen panes: handle split position as row/column positions.
334 #i35812# Excel uses number of visible rows/columns, Calc uses position of freeze. */
335 SCCOL nFreezeScCol = rTabSett.maFreezePos.Col();
336 if( (0 < nFreezeScCol) && (nFreezeScCol <= GetXclMaxPos().Col()) )
337 maData.mnSplitX = static_cast< sal_uInt16 >( nFreezeScCol ) - maData.maFirstXclPos.mnCol;
338 SCROW nFreezeScRow = rTabSett.maFreezePos.Row();
339 if( (0 < nFreezeScRow) && (nFreezeScRow <= GetXclMaxPos().Row()) )
340 maData.mnSplitY = static_cast< sal_uInt32 >( nFreezeScRow ) - maData.maFirstXclPos.mnRow;
341 // if both splits are left out (address overflow), remove the frozen flag
343
344 // #i20671# frozen panes: mostright/mostbottom pane is active regardless of cursor position
347 else if( maData.HasPane( EXC_PANE_TOPRIGHT ) )
351 }
352 else
353 {
354 // split window: position is in twips
355 maData.mnSplitX = static_cast<sal_uInt16>(rTabSett.maSplitPos.X());
356 maData.mnSplitY = static_cast<sal_uInt32>(rTabSett.maSplitPos.Y());
357 }
358
359 // selection
364
365 // grid color
366 const Color& rGridColor = rTabSett.maGridColor;
367 maData.mbDefGridColor = rGridColor == COL_AUTO;
369 {
370 if( GetBiff() == EXC_BIFF8 )
372 else
373 maData.maGridColor = rGridColor;
374 }
375 maData.mbShowGrid = rTabSett.mbShowGrid;
376
377 // view mode and zoom
378 maData.mbPageMode = (GetBiff() == EXC_BIFF8) && rTabSett.mbPageMode;
379 maData.mnNormalZoom = lclGetXclZoom( rTabSett.mnNormalZoom, EXC_WIN2_NORMALZOOM_DEF );
380 maData.mnPageZoom = lclGetXclZoom( rTabSett.mnPageZoom, EXC_WIN2_PAGEZOOM_DEF );
382 }
383
384 // Tab Bg Color
385 if ( GetBiff() == EXC_BIFF8 && !GetDoc().IsDefaultTabBgColor(nScTab) )
386 {
387 XclExpPalette& rPal = GetPalette();
390 }
391}
392
394{
396 WriteScl( rStrm );
397 WritePane( rStrm );
403}
404
405static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rData, sal_uInt8 nPane )
406{
407 if( rData.HasPane( nPane ) )
408 XclExpSelection( rData, nPane ).SaveXml( rStrm );
409}
410
411static OString lcl_GetZoom( sal_uInt16 nZoom )
412{
413 if( nZoom )
414 return OString::number( nZoom );
415 return "100";
416}
417
419{
420 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
421 rWorksheet->startElement(XML_sheetViews);
422
423 // handle missing viewdata at embedded XLSX OLE objects
425 {
426 SCCOL nPosLeft = rStrm.GetRoot().GetDoc().GetPosLeft();
427 SCROW nPosTop = rStrm.GetRoot().GetDoc().GetPosTop();
428 if (nPosLeft > 0 || nPosTop > 0)
429 {
430 ScAddress aLeftTop(nPosLeft, nPosTop, 0);
432 maData.maFirstXclPos = rAddrConv.CreateValidAddress( aLeftTop, false );
433 }
434 }
435
436 rWorksheet->startElement( XML_sheetView,
437 // OOXTODO: XML_windowProtection,
438 XML_showFormulas, ToPsz( maData.mbShowFormulas ),
439 XML_showGridLines, ToPsz( maData.mbShowGrid ),
440 XML_showRowColHeaders, ToPsz( maData.mbShowHeadings ),
441 XML_showZeros, ToPsz( maData.mbShowZeros ),
442 XML_rightToLeft, ToPsz( maData.mbMirrored ),
443 XML_tabSelected, ToPsz( maData.mbSelected ),
444 // OOXTODO: XML_showRuler,
445 XML_showOutlineSymbols, ToPsz( maData.mbShowOutline ),
446 XML_defaultGridColor, mnGridColorId == XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) ? "true" : "false",
447 // OOXTODO: XML_showWhiteSpace,
448 XML_view, maData.mbPageMode ? "pageBreakPreview" : "normal", // OOXTODO: pageLayout
449 XML_topLeftCell, XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), maData.maFirstXclPos ).getStr(),
450 XML_colorId, OString::number(rStrm.GetRoot().GetPalette().GetColorIndex(mnGridColorId)),
451 XML_zoomScale, lcl_GetZoom(maData.mnCurrentZoom),
452 XML_zoomScaleNormal, lcl_GetZoom(maData.mnNormalZoom),
453 // OOXTODO: XML_zoomScaleSheetLayoutView,
454 XML_zoomScalePageLayoutView, lcl_GetZoom(maData.mnPageZoom),
455 XML_workbookViewId, "0" // OOXTODO? 0-based index of document(xl/workbook.xml)/workbook/bookviews/workbookView
456 // should always be 0, as we only generate 1 such element.
457 );
458 if( maData.IsSplit() )
459 {
460 XclExpPane aPane( maData );
461 aPane.SaveXml( rStrm );
462 }
467 rWorksheet->endElement( XML_sheetView );
468 // OOXTODO: XML_extLst
469 rWorksheet->endElement( XML_sheetViews );
470}
471
472// private --------------------------------------------------------------------
473
475 const ScAddress& rCursor, const ScRangeList& rSelection )
476{
477 if( !maData.HasPane( nPane ) )
478 return;
479
480 XclSelectionData& rSelData = maData.CreateSelectionData( nPane );
481
482 // first step: use top-left visible cell as cursor
483 rSelData.maXclCursor.mnCol = ((nPane == EXC_PANE_TOPLEFT) || (nPane == EXC_PANE_BOTTOMLEFT)) ?
485 rSelData.maXclCursor.mnRow = ((nPane == EXC_PANE_TOPLEFT) || (nPane == EXC_PANE_TOPRIGHT)) ?
487
488 // second step, active pane: create actual selection data with current cursor position
489 if( nPane == maData.mnActivePane )
490 {
492 // cursor position (keep top-left pane position from above, if rCursor is invalid)
493 if( (rCursor.Col() >= 0) && (rCursor.Row() >= 0) )
494 rSelData.maXclCursor = rAddrConv.CreateValidAddress( rCursor, false );
495 // selection
496 rAddrConv.ConvertRangeList( rSelData.maXclSelection, rSelection, false );
497 }
498}
499
501{
502// #i43553# GCC 3.3 parse error
503// XclExpWindow2( GetRoot(), maData, mnGridColorId ).Save( rStrm );
505 aWindow2.Save( rStrm );
506}
507
509{
510 if( maData.mnCurrentZoom != 0 )
512}
513
515{
516 if( maData.IsSplit() )
517// #i43553# GCC 3.3 parse error
518// XclExpPane( GetRoot(), maData ).Save( rStrm );
519 {
520 XclExpPane aPane( maData );
521 aPane.Save( rStrm );
522 }
523}
524
526{
527 if( maData.HasPane( nPane ) )
528 XclExpSelection( maData, nPane ).Save( rStrm );
529}
530
532{
535}
536
537/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr tools::Long Y() const
constexpr tools::Long X() const
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:449
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
Definition: documen3.cxx:1951
const ScExtDocSettings & GetDocSettings() const
Definition: scextopt.cxx:170
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:86
Provides functions to convert Calc cell addresses to Excel cell addresses.
Definition: xehelper.hxx:82
XclAddress CreateValidAddress(const ScAddress &rScPos, bool bWarn)
Returns a valid cell address by moving it into allowed dimensions.
Definition: xehelper.cxx:201
void ConvertRangeList(XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn)
Converts the passed Calc cell range list to an Excel cell range list.
Definition: xehelper.cxx:271
Stores all used colors in the document.
Definition: xestyle.hxx:77
sal_uInt32 InsertColor(const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0)
Inserts the color into the list and updates weighting.
Definition: xestyle.cxx:768
sal_uInt16 GetColorIndex(sal_uInt32 nColorId) const
Returns the Excel palette index of the color with passed color ID.
Definition: xestyle.cxx:783
static sal_uInt32 GetColorIdFromIndex(sal_uInt16 nIndex)
Returns the color ID representing a fixed Excel palette index (i.e.
Definition: xestyle.cxx:773
Represents a PANE record containing settings for split/frozen windows.
Definition: xeview.hxx:86
XclExpPane(const XclTabViewData &rData)
Definition: xeview.cxx:161
sal_uInt32 mnSplitY
Split X position, or frozen column.
Definition: xeview.hxx:98
sal_uInt16 mnSplitX
Definition: xeview.hxx:97
sal_uInt8 mnActivePane
First visible cell in additional panes.
Definition: xeview.hxx:100
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the PANE record.
Definition: xeview.cxx:194
bool mbFrozenPanes
Active pane (with cell cursor).
Definition: xeview.hxx:101
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:184
XclAddress maSecondXclPos
Split Y position, or frozen row.
Definition: xeview.hxx:99
Base class for single records with any content.
Definition: xerecord.hxx:143
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xerecord.cxx:150
Access to global data from other classes.
Definition: xeroot.hxx:113
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xeroot.cxx:82
XclExpTabInfo & GetTabInfo() const
Returns the buffer for Calc->Excel sheet index conversion.
Definition: xeroot.cxx:76
XclExpPalette & GetPalette() const
Returns the color buffer.
Definition: xeroot.cxx:106
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:118
Represents an SCL record for the zoom factor of the current view of a sheet.
Definition: xeview.hxx:69
XclExpScl(sal_uInt16 nZoom)
Definition: xeview.cxx:137
sal_uInt16 mnNum
Definition: xeview.hxx:80
sal_uInt16 mnDenom
Numerator of the zoom factor.
Definition: xeview.hxx:81
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SCL record.
Definition: xeview.cxx:155
void Shorten(sal_uInt16 nFactor)
Tries to shorten numerator and denominator by the passed value.
Definition: xeview.cxx:146
Represents a SELECTION record with selection data for a pane.
Definition: xeview.hxx:106
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:229
XclExpSelection(const XclTabViewData &rData, sal_uInt8 nPane)
Definition: xeview.cxx:204
sal_uInt8 mnPane
Selection data.
Definition: xeview.hxx:117
XclSelectionData maSelData
Definition: xeview.hxx:116
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SELECTION record.
Definition: xeview.cxx:238
This class is used to export Excel record streams.
Definition: xestream.hxx:73
XclExpTabBgColor(const XclTabViewData &rTabViewData)
Definition: xeview.cxx:246
const XclTabViewData & mrTabViewData
Definition: xeview.hxx:131
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SHEETEXT record.
Definition: xeview.cxx:256
Stores the correct Excel sheet index for each Calc sheet.
Definition: xelink.hxx:62
bool IsMirroredTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is displayed in right-to-left mode.
Definition: xelink.cxx:803
sal_uInt16 GetFirstVisXclTab() const
Returns the Excel index of the first visible sheet.
Definition: xelink.hxx:101
bool IsDisplayedTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is the displayed (active) sheet.
Definition: xelink.cxx:797
sal_uInt16 GetXclSelectedCount() const
Returns the number of exported selected sheets.
Definition: xelink.hxx:96
bool IsSelectedTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is selected and will be exported.
Definition: xelink.cxx:792
sal_uInt16 GetDisplayedXclTab() const
Returns the Excel index of the active, displayed sheet.
Definition: xelink.hxx:99
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:418
void WriteSelection(XclExpStream &rStrm, sal_uInt8 nPane) const
Definition: xeview.cxx:525
virtual void Save(XclExpStream &rStrm) override
Writes all view settings records to the stream.
Definition: xeview.cxx:393
void WriteScl(XclExpStream &rStrm) const
Definition: xeview.cxx:508
void WriteWindow2(XclExpStream &rStrm) const
Definition: xeview.cxx:500
sal_uInt32 mnGridColorId
All view settings for a sheet.
Definition: xeview.hxx:160
void WritePane(XclExpStream &rStrm) const
Definition: xeview.cxx:514
void CreateSelectionData(sal_uInt8 nPane, const ScAddress &rCursor, const ScRangeList &rSelection)
Creates selection data for the specified pane.
Definition: xeview.cxx:474
void WriteTabBgColor(XclExpStream &rStrm) const
Definition: xeview.cxx:531
XclTabViewData maData
Definition: xeview.hxx:159
XclExpTabViewSettings(const XclExpRoot &rRoot, SCTAB nScTab)
Creates all records containing the view settings of the specified sheet.
Definition: xeview.cxx:286
bool mbHasTabSettings
Color identifier for grid color.
Definition: xeview.hxx:161
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:50
sal_uInt16 mnTabBarSize
Option flags.
Definition: xeview.hxx:42
sal_uInt16 mnFlags
Definition: xeview.hxx:41
XclExpWindow1(const XclExpRoot &rRoot)
Definition: xeview.cxx:35
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW1 record.
Definition: xeview.cxx:71
Represents a WINDOW2 record with general view settings for a sheet.
Definition: xeview.hxx:49
sal_uInt16 mnPageZoom
Zoom factor for normal view.
Definition: xeview.hxx:64
XclExpWindow2(const XclExpRoot &rRoot, const XclTabViewData &rData, sal_uInt32 nGridColorId)
Definition: xeview.cxx:88
sal_uInt16 mnFlags
Color ID of grid color (>=BIFF8).
Definition: xeview.hxx:61
sal_uInt32 mnGridColorId
Grid color (<=BIFF5).
Definition: xeview.hxx:60
XclAddress maFirstXclPos
Option flags.
Definition: xeview.hxx:62
sal_uInt16 mnNormalZoom
First visible cell.
Definition: xeview.hxx:63
Color maGridColor
Definition: xeview.hxx:59
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW2 record.
Definition: xeview.cxx:112
A 2D cell range address list with Excel column and row indexes.
Definition: xladdress.hxx:102
XclRangeVector::const_iterator begin() const
Definition: xladdress.hxx:111
void push_back(const XclRange &rRange)
Definition: xladdress.hxx:114
void Write(XclExpStream &rStrm, bool bCol16Bit=true, sal_uInt16 nCountInStream=0) const
Definition: xladdress.cxx:114
XclRangeVector::const_iterator end() const
Definition: xladdress.hxx:112
size_t size() const
Definition: xladdress.hxx:109
ScExtDocOptions & GetExtDocOptions() const
Returns the extended document options.
Definition: xlroot.cxx:429
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:141
const ScAddress & GetXclMaxPos() const
Returns the highest possible cell address in an Excel document (using current BIFF version).
Definition: xlroot.hxx:246
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:285
static OString ToOString(const Color &rColor)
Definition: xestream.cxx:712
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
FuncFlags mnFlags
Information about all parameters.
bool get_flag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
Definition: ftools.hxx:75
void set_flag(Type &rnBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in rnBitField.
Definition: ftools.hxx:95
void SvStream & rStrm
std::shared_ptr< FastSerializerHelper > FSHelperPtr
long Long
@ SCEXT_PANE_BOTTOMLEFT
Bottom, or bottom-left pane.
Definition: scextopt.hxx:42
@ SCEXT_PANE_BOTTOMRIGHT
Bottom-right pane.
Definition: scextopt.hxx:43
@ SCEXT_PANE_TOPLEFT
Single, top, left, or top-left pane.
Definition: scextopt.hxx:40
@ SCEXT_PANE_TOPRIGHT
Right, or top-right pane.
Definition: scextopt.hxx:41
double mfTabBarWidth
Width of the tabbar, relative to frame window width (0.0 ... 1.0).
Definition: scextopt.hxx:30
Extended settings for a sheet, used in import/export filters.
Definition: scextopt.hxx:48
Point maSplitPos
Position of split.
Definition: scextopt.hxx:55
bool mbFrozenPanes
true = Frozen panes; false = Normal splits.
Definition: scextopt.hxx:61
ScAddress maSecondVis
Top-left visible cell in add. panes (column/row only).
Definition: scextopt.hxx:53
Color maGridColor
Grid color.
Definition: scextopt.hxx:57
ScAddress maCursor
The cursor position (column/row only).
Definition: scextopt.hxx:51
bool mbShowGrid
Whether or not to display gridlines.
Definition: scextopt.hxx:63
ScExtPanePos meActivePane
Active (focused) pane.
Definition: scextopt.hxx:56
ScRangeList maSelection
Selected cell ranges (columns/rows only).
Definition: scextopt.hxx:50
ScAddress maFirstVis
Top-left visible cell (column/row only).
Definition: scextopt.hxx:52
tools::Long mnPageZoom
Zoom in percent for pagebreak preview.
Definition: scextopt.hxx:59
bool mbPageMode
true = Pagebreak mode; false = Normal view mode.
Definition: scextopt.hxx:62
ScAddress maFreezePos
Position of frozen panes (column/row only).
Definition: scextopt.hxx:54
tools::Long mnNormalZoom
Zoom in percent for normal view.
Definition: scextopt.hxx:58
sal_uInt16 mnCol
Definition: xladdress.hxx:31
sal_uInt32 mnRow
Definition: xladdress.hxx:32
A 2D cell range address struct with Excel column and row indexes.
Definition: xladdress.hxx:59
Contains all settings for a selection in a single pane of a sheet.
Definition: xlview.hxx:105
sal_uInt16 mnCursorIdx
Selected cell ranges.
Definition: xlview.hxx:108
XclAddress maXclCursor
Definition: xlview.hxx:106
XclRangeList maXclSelection
Cell cursor position.
Definition: xlview.hxx:107
Contains all view settings for a single sheet.
Definition: xlview.hxx:117
sal_uInt32 mnSplitY
Split X position, or number of frozen columns.
Definition: xlview.hxx:125
bool IsDefaultTabBgColor() const
Tab Color default = (COL_AUTO )
Definition: xlview.hxx:142
XclSelectionData & CreateSelectionData(sal_uInt8 nPane)
Returns read/write access to the selection data of the specified pane.
Definition: xlview.cxx:95
bool mbShowHeadings
true = Show cell grid.
Definition: xlview.hxx:138
XclAddress maSecondXclPos
First visible cell.
Definition: xlview.hxx:123
bool mbMirrored
true = Sheet is displayed (active).
Definition: xlview.hxx:132
sal_uInt16 mnSplitX
First visible cell in additional panes.
Definition: xlview.hxx:124
bool mbDefGridColor
true = Pagebreak preview; false = Normal view.
Definition: xlview.hxx:135
bool mbShowFormulas
true = Default grid color.
Definition: xlview.hxx:136
Color maTabBgColor
true = Show outlines.
Definition: xlview.hxx:141
bool mbFrozenPanes
true = Mirrored (right-to-left) sheet.
Definition: xlview.hxx:133
bool mbSelected
Active pane (with cell cursor).
Definition: xlview.hxx:130
bool IsSplit() const
Returns true, if the window is split in any direction.
Definition: xlview.cxx:71
XclAddress maFirstXclPos
Grid color.
Definition: xlview.hxx:122
sal_uInt16 mnNormalZoom
Split Y position, or number of frozen rows.
Definition: xlview.hxx:126
bool mbShowGrid
true = Show formulas instead of results.
Definition: xlview.hxx:137
sal_uInt32 mnTabBgColorId
Definition: xlview.hxx:142
bool mbShowOutline
true = Show zero value zells.
Definition: xlview.hxx:140
sal_uInt16 mnCurrentZoom
Zoom factor for pagebreak preview.
Definition: xlview.hxx:128
bool mbShowZeros
true = Show column/row headings.
Definition: xlview.hxx:139
const XclSelectionData * GetSelectionData(sal_uInt8 nPane) const
Returns the selection data, if available, otherwise 0.
Definition: xlview.cxx:89
bool HasPane(sal_uInt8 nPaneId) const
Returns true, if the specified pane (EXC_PANE_*) is available.
Definition: xlview.cxx:76
sal_uInt16 mnPageZoom
Zoom factor for normal view.
Definition: xlview.hxx:127
Color maGridColor
Selections of all panes.
Definition: xlview.hxx:121
bool mbPageMode
true = Frozen panes; false = split window.
Definition: xlview.hxx:134
bool mbDisplayed
true = Sheet is selected.
Definition: xlview.hxx:131
sal_uInt8 mnActivePane
Zoom factor for current view.
Definition: xlview.hxx:129
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
@ VOPT_TABCONTROLS
Definition: viewopti.hxx:39
@ VOPT_NULLVALS
Definition: viewopti.hxx:33
@ VOPT_HSCROLL
Definition: viewopti.hxx:38
@ VOPT_OUTLINER
Definition: viewopti.hxx:40
@ VOPT_FORMULAS
Definition: viewopti.hxx:32
@ VOPT_HEADER
Definition: viewopti.hxx:41
@ VOPT_VSCROLL
Definition: viewopti.hxx:37
@ EXC_COLOR_GRID
Text color in a form control.
Definition: xestyle.hxx:56
@ EXC_COLOR_TABBG
Spreadsheet grid color.
Definition: xestyle.hxx:57
static OString lcl_GetZoom(sal_uInt16 nZoom)
Definition: xeview.cxx:411
static const char * lcl_GetActivePane(sal_uInt8 nActivePane)
Definition: xeview.cxx:172
static void lcl_WriteSelection(XclExpXmlStream &rStrm, const XclTabViewData &rData, sal_uInt8 nPane)
Definition: xeview.cxx:405
@ EXC_BIFF5
MS Excel 4.0.
Definition: xlconst.hxx:34
@ EXC_BIFF4
MS Excel 3.0.
Definition: xlconst.hxx:33
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:35
@ EXC_BIFF3
MS Excel 2.1.
Definition: xlconst.hxx:32
const sal_uInt16 EXC_COLOR_WINDOWTEXT
System window background color (BIFF3-BIFF4).
Definition: xlstyle.hxx:208
#define OSL_ENSURE_BIFF(c)
Definition: xltools.hxx:34
#define DBG_ERROR_BIFF()
Definition: xltools.hxx:33
const sal_uInt16 EXC_WIN2_SHOWOUTLINE
Definition: xlview.hxx:58
const sal_uInt8 EXC_PANE_BOTTOMLEFT
Right, or top-right pane.
Definition: xlview.hxx:73
const sal_uInt16 EXC_WIN2_MIRRORED
Definition: xlview.hxx:57
const sal_uInt16 EXC_WIN2_PAGEZOOM_DEF
Default zoom for normal view.
Definition: xlview.hxx:65
const sal_uInt16 EXC_ID_SCL
Single, top, left, or top-left pane.
Definition: xlview.hxx:78
const sal_uInt8 EXC_PANE_TOPLEFT
Bottom, or bottom-left pane.
Definition: xlview.hxx:74
const sal_uInt16 EXC_WIN2_NORMALZOOM_DEF
Definition: xlview.hxx:64
const sal_uInt16 EXC_WIN1_TABBAR
Definition: xlview.hxx:44
const sal_uInt16 EXC_WIN2_SHOWGRID
Definition: xlview.hxx:52
const sal_uInt16 EXC_WIN1_VER_SCROLLBAR
Definition: xlview.hxx:43
const sal_uInt16 EXC_WIN2_DEFGRIDCOLOR
Definition: xlview.hxx:56
const sal_uInt16 EXC_WIN2_SHOWFORMULAS
Definition: xlview.hxx:51
const sal_uInt8 EXC_PANE_TOPRIGHT
Bottom-right pane.
Definition: xlview.hxx:72
const sal_uInt16 EXC_WIN2_PAGEBREAKMODE
Definition: xlview.hxx:62
const sal_uInt16 EXC_WIN2_FROZENNOSPLIT
Definition: xlview.hxx:59
const sal_uInt16 EXC_ZOOM_MAX
Definition: xlview.hxx:30
const sal_uInt16 EXC_ID_WINDOW2
Definition: xlview.hxx:49
const sal_uInt16 EXC_WIN2_SELECTED
Definition: xlview.hxx:60
const sal_uInt16 EXC_ID_PANE
Default zoom for pagebreak preview.
Definition: xlview.hxx:69
const sal_uInt16 EXC_WIN2_SHOWHEADINGS
Definition: xlview.hxx:53
const sal_uInt16 EXC_WIN2_FROZEN
Definition: xlview.hxx:54
const sal_uInt16 EXC_ID_SELECTION
Definition: xlview.hxx:34
const sal_uInt16 EXC_ZOOM_MIN
Definition: xlview.hxx:29
const sal_uInt16 EXC_WIN2_DISPLAYED
Definition: xlview.hxx:61
const sal_uInt16 EXC_COLOR_NOTABBG
mask for tab color
Definition: xlview.hxx:84
const sal_uInt16 EXC_ID_WINDOW1
Definition: xlview.hxx:38
const sal_uInt16 EXC_WIN1_HOR_SCROLLBAR
Definition: xlview.hxx:42
const sal_uInt8 EXC_PANE_BOTTOMRIGHT
Definition: xlview.hxx:71
const sal_uInt16 EXC_WIN2_SHOWZEROS
Definition: xlview.hxx:55
const sal_uInt16 EXC_ID_SHEETEXT
Definition: xlview.hxx:82