21 #include <document.hxx>
28 #include <oox/token/tokens.hxx>
31 using namespace ::
oox;
46 if( (0.0 <= fTabBarWidth) && (fTabBarWidth <= 1.0) )
47 mnTabBarSize =
static_cast< sal_uInt16
>( fTabBarWidth * 1000.0 + 0.5 );
62 XML_windowWidth, OString::number(0x4000),
63 XML_windowHeight, OString::number(0x2000),
75 rStrm << sal_uInt16( 0 )
77 << sal_uInt16( 0x4000 )
78 << sal_uInt16( 0x2000 )
91 maGridColor( rData.maGridColor ),
92 mnGridColorId( nGridColorId ),
94 maFirstXclPos( rData.maFirstXclPos ),
95 mnNormalZoom( rData.mnNormalZoom ),
96 mnPageZoom( rData.mnPageZoom )
148 while( (
mnNum % nFactor == 0) && (
mnDenom % nFactor == 0) )
163 mnSplitX( rData.mnSplitX ),
164 mnSplitY( rData.mnSplitY ),
165 maSecondXclPos( rData.maSecondXclPos ),
166 mnActivePane( rData.mnActivePane ),
167 mbFrozenPanes( rData.mbFrozenPanes )
169 OSL_ENSURE( rData.
IsSplit(),
"XclExpPane::XclExpPane - no PANE record for unsplit view" );
174 switch( nActivePane )
181 return "**error: lcl_GetActivePane";
187 XML_xSplit, OString::number(
mnSplitX),
188 XML_ySplit, OString::number(
mnSplitY),
197 <<
static_cast<sal_uInt16
>(
mnSplitY )
213 auto aIt = std::find_if(rXclSel.
begin(), rXclSel.
end(),
215 if (aIt != rXclSel.
end())
248 mrTabViewData( rTabViewData )
260 sal_uInt16
const rt = 0x0862;
261 sal_uInt16
const grbitFrt = 0x0000;
262 sal_uInt32 unused = 0x00000000;
263 sal_uInt32
const cb = 0x00000014;
264 sal_uInt16
const reserved = 0x0000;
265 sal_uInt16 TabBgColorIndex;
268 if (TabBgColorIndex < 8 || TabBgColorIndex > 63 )
269 TabBgColorIndex = 127;
270 rStrm << rt << grbitFrt << unused << unused << cb << TabBgColorIndex << reserved;
278 sal_uInt16 lclGetXclZoom(
tools::Long nScZoom, sal_uInt16 nDefXclZoom )
281 return (nXclZoom == nDefXclZoom) ? 0 : nXclZoom;
289 mbHasTabSettings(false)
414 return OString::number( nZoom );
421 rWorksheet->startElement(XML_sheetViews);
428 if (nPosLeft > 0 || nPosTop > 0)
430 ScAddress aLeftTop(nPosLeft, nPosTop, 0);
436 rWorksheet->startElement( XML_sheetView,
455 XML_workbookViewId,
"0"
467 rWorksheet->endElement( XML_sheetView );
469 rWorksheet->endElement( XML_sheetViews );
493 if( (rCursor.
Col() >= 0) && (rCursor.
Row() >= 0) )
505 aWindow2.
Save( rStrm );
const sal_uInt16 EXC_WIN2_FROZENNOSPLIT
void ConvertRangeList(XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn)
Converts the passed Calc cell range list to an Excel cell range list.
Represents a PANE record containing settings for split/frozen windows.
bool mbPageMode
true = Frozen panes; false = split window.
ScExtPanePos meActivePane
Active (focused) pane.
static OString ToOString(const Color &rColor)
XclAddress maFirstXclPos
Grid color.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SCL record.
sal_uInt32 mnSplitY
Split X position, or number of frozen columns.
bool IsSelectedTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is selected and will be exported.
Bottom, or bottom-left pane.
const XclExpRoot & GetRoot() const
Returns the filter root data.
This class is used to export Excel record streams.
OStringBuffer & GetStringBuf() const
Clean and return the OStringBuffer.
XclExpPane(const XclTabViewData &rData)
ScAddress maCursor
The cursor position (column/row only).
sal_uInt32 mnSplitY
Split X position, or frozen column.
const sal_uInt8 EXC_PANE_TOPRIGHT
Bottom-right pane.
void push_back(const XclRange &rRange)
bool IsSplit() const
Returns true, if the window is split in any direction.
sal_uInt16 mnFlags
Color ID of grid color (>=BIFF8).
ScAddress maSecondVis
Top-left visible cell in add. panes (column/row only).
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
bool mbShowOutline
true = Show zero value zells.
virtual void SaveXml(XclExpXmlStream &rStrm) override
sal_uInt32 mnTabBgColorId
const sal_uInt16 EXC_ID_SELECTION
const sal_uInt16 EXC_ZOOM_MIN
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SELECTION record.
const sal_uInt16 EXC_WIN2_MIRRORED
tools::Long mnNormalZoom
Zoom in percent for normal view.
const ScExtDocSettings & GetDocSettings() const
bool mbFrozenPanes
true = Mirrored (right-to-left) sheet.
const sal_uInt16 EXC_WIN2_SHOWHEADINGS
void Shorten(sal_uInt16 nFactor)
Tries to shorten numerator and denominator by the passed value.
const sal_uInt16 EXC_ID_WINDOW1
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
ScRangeList maSelection
Selected cell ranges (columns/rows only).
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW2 record.
const sal_uInt16 EXC_ID_SCL
Single, top, left, or top-left pane.
double mfTabBarWidth
Width of the tabbar, relative to frame window width (0.0 ... 1.0).
XclExpSelection(const XclTabViewData &rData, sal_uInt8 nPane)
XclRangeList maXclSelection
Cell cursor position.
sal_uInt32 mnGridColorId
All view settings for a sheet.
Represents a SELECTION record with selection data for a pane.
Access to global data from other classes.
const sal_uInt16 EXC_WIN2_PAGEZOOM_DEF
Default zoom for normal view.
sal_uInt16 GetFirstVisXclTab() const
Returns the Excel index of the first visible sheet.
bool mbSelected
Active pane (with cell cursor).
const sal_uInt8 EXC_PANE_BOTTOMRIGHT
XclSelectionData & CreateSelectionData(sal_uInt8 nPane)
Returns read/write access to the selection data of the specified pane.
sal_uInt16 mnDenom
Numerator of the zoom factor.
const sal_uInt16 EXC_WIN2_DISPLAYED
const sal_uInt16 EXC_ID_PANE
Default zoom for pagebreak preview.
XclSelectionData maSelData
void WritePane(XclExpStream &rStrm) const
virtual void SaveXml(XclExpXmlStream &rStrm) override
bool mbShowGrid
Whether or not to display gridlines.
XclAddress CreateValidAddress(const ScAddress &rScPos, bool bWarn)
Returns a valid cell address by moving it into allowed dimensions.
sal_uInt32 InsertColor(const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0)
Inserts the color into the list and updates weighting.
sax_fastparser::FSHelperPtr & GetCurrentStream()
virtual void SaveXml(XclExpXmlStream &rStrm) override
Contains all settings for a selection in a single pane of a sheet.
const sal_uInt16 EXC_ZOOM_MAX
bool IsMirroredTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is displayed in right-to-left mode.
XclRangeVector::const_iterator end() const
const sal_uInt16 EXC_WIN2_SELECTED
XclRangeVector::const_iterator begin() const
bool mbFrozenPanes
true = Frozen panes; false = Normal splits.
bool mbDefGridColor
true = Pagebreak preview; false = Normal view.
bool mbShowFormulas
true = Default grid color.
void WriteWindow2(XclExpStream &rStrm) const
MS Excel 5.0, MS Excel 7.0 (95)
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SHEETEXT record.
const sal_uInt16 EXC_WIN2_NORMALZOOM_DEF
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
void CreateSelectionData(sal_uInt8 nPane, const ScAddress &rCursor, const ScRangeList &rSelection)
Creates selection data for the specified pane.
sal_uInt16 GetColorIndex(sal_uInt32 nColorId) const
Returns the Excel palette index of the color with passed color ID.
const sal_uInt16 EXC_COLOR_WINDOWTEXT
System window background color (BIFF3-BIFF4).
ScExtDocOptions & GetExtDocOptions() const
Returns the extended document options.
const sal_uInt16 EXC_WIN2_PAGEBREAKMODE
XclExpPalette & GetPalette() const
Returns the color buffer.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW1 record.
A 2D cell range address list with Excel column and row indexes.
Stores all used colors in the document.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the PANE record.
sal_uInt16 mnPageZoom
Zoom factor for normal view.
virtual void SaveXml(XclExpXmlStream &rStrm) override
sal_uInt16 mnCursorIdx
Selected cell ranges.
virtual void Save(XclExpStream &rStrm) override
Writes all view settings records to the stream.
bool GetOption(ScViewOption eOpt) const
Stores the correct Excel sheet index for each Calc sheet.
const sal_uInt16 EXC_WIN1_TABBAR
static const char * lcl_GetActivePane(sal_uInt8 nActivePane)
Color maGridColor
Selections of all panes.
XclExpTabInfo & GetTabInfo() const
Returns the buffer for Calc->Excel sheet index conversion.
Color maGridColor
Grid color.
const sal_uInt16 EXC_WIN2_DEFGRIDCOLOR
const sal_uInt16 EXC_WIN1_VER_SCROLLBAR
const sal_uInt16 EXC_WIN2_SHOWFORMULAS
std::shared_ptr< FastSerializerHelper > FSHelperPtr
XclExpTabBgColor(const XclTabViewData &rTabViewData)
sal_uInt16 mnNormalZoom
First visible cell.
const sal_uInt16 EXC_WIN2_SHOWZEROS
Extended settings for a sheet, used in import/export filters.
bool mbShowGrid
true = Show formulas instead of results.
Color maTabBgColor
true = Show outlines.
Right, or top-right pane.
sal_uInt16 mnTabBarSize
Option flags.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
static void lcl_WriteSelection(XclExpXmlStream &rStrm, const XclTabViewData &rData, sal_uInt8 nPane)
const sal_uInt16 EXC_ID_WINDOW2
void WriteTabBgColor(XclExpStream &rStrm) const
ScAddress maFreezePos
Position of frozen panes (column/row only).
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
XclAddress maFirstXclPos
Option flags.
Represents an SCL record for the zoom factor of the current view of a sheet.
Provides functions to convert Calc cell addresses to Excel cell addresses.
void WriteSelection(XclExpStream &rStrm, sal_uInt8 nPane) const
bool mbDisplayed
true = Sheet is selected.
Contains all view settings for a single sheet.
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
bool HasPane(sal_uInt8 nPaneId) const
Returns true, if the specified pane (EXC_PANE_*) is available.
sal_uInt32 mnGridColorId
Grid color (<=BIFF5).
sal_uInt16 mnPageZoom
Zoom factor for normal view.
const sal_uInt16 EXC_WIN1_HOR_SCROLLBAR
bool mbShowHeadings
true = Show cell grid.
sal_uInt16 GetXclSelectedCount() const
Returns the number of exported selected sheets.
const sal_uInt8 EXC_PANE_BOTTOMLEFT
Right, or top-right pane.
XclExpTabViewSettings(const XclExpRoot &rRoot, SCTAB nScTab)
Creates all records containing the view settings of the specified sheet.
XclExpScl(sal_uInt16 nZoom)
bool IsDefaultTabBgColor() const
Tab Color default = (COL_AUTO )
XclExpWindow2(const XclExpRoot &rRoot, const XclTabViewData &rData, sal_uInt32 nGridColorId)
const ScAddress & GetXclMaxPos() const
Returns the highest possible cell address in an Excel document (using current BIFF version)...
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
const sal_uInt8 EXC_PANE_TOPLEFT
Bottom, or bottom-left pane.
sal_uInt8 mnActivePane
Zoom factor for current view.
const sal_uInt16 EXC_WIN2_FROZEN
Point maSplitPos
Position of split.
XclAddress maSecondXclPos
Split Y position, or frozen row.
sal_uInt16 mnSplitX
First visible cell in additional panes.
bool mbShowZeros
true = Show column/row headings.
sal_uInt16 GetDisplayedXclTab() const
Returns the Excel index of the active, displayed sheet.
const sal_uInt16 EXC_WIN2_SHOWGRID
static OString lcl_GetZoom(sal_uInt16 nZoom)
sal_uInt8 mnActivePane
First visible cell in additional panes.
bool mbHasTabSettings
Color identifier for grid color.
const XclExpRoot & GetRoot() const
Returns the filter root data.
ScAddress maFirstVis
Top-left visible cell (column/row only).
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
static sal_uInt32 GetColorIdFromIndex(sal_uInt16 nIndex)
Returns the color ID representing a fixed Excel palette index (i.e.
Single, top, left, or top-left pane.
sal_uInt8 mnPane
Selection data.
const sal_uInt16 EXC_COLOR_NOTABBG
mask for tab color
const sal_uInt16 EXC_WIN2_SHOWOUTLINE
const XclTabViewData & mrTabViewData
bool mbFrozenPanes
Active pane (with cell cursor).
const sal_uInt16 EXC_ID_SHEETEXT
const XclSelectionData * GetSelectionData(sal_uInt8 nPane) const
Returns the selection data, if available, otherwise 0.
sal_uInt16 mnCurrentZoom
Zoom factor for pagebreak preview.
tools::Long mnPageZoom
Zoom in percent for pagebreak preview.
void Write(XclExpStream &rStrm, bool bCol16Bit=true, sal_uInt16 nCountInStream=0) const
A 2D cell range address struct with Excel column and row indexes.
bool IsDisplayedTab(SCTAB nScTab) const
Returns true, if the specified Calc sheet is the displayed (active) sheet.
Represents a WINDOW2 record with general view settings for a sheet.
sal_uInt16 mnNormalZoom
Split Y position, or number of frozen rows.
bool mbPageMode
true = Pagebreak mode; false = Normal view mode.
Base class for single records with any content.
XclAddress maSecondXclPos
First visible cell.
Text color in a form control.
bool mbMirrored
true = Sheet is displayed (active).
void WriteScl(XclExpStream &rStrm) const
XclExpWindow1(const XclExpRoot &rRoot)