32#include <oox/token/tokens.hxx>
34#include <document.hxx>
47using ::std::numeric_limits;
55 maHdrString(
std::move( aHdrString ))
70 default: nElement = XML_oddFooter;
72 rWorksheet->startElement(nElement);
74 rWorksheet->endElement( nElement );
116 pAttrList->add( XML_orientation,
mrData.
mbPortrait ?
"portrait" :
"landscape" );
120 pAttrList->add( XML_usePrinterDefaults, ToPsz( !
mrData.
mbValid ) );
136 rStrm.GetCurrentStream()->singleElement( XML_pageSetup, pAttrList );
143 sal_uInt16 nFlags = 0;
172 mrPageBreaks( rPageBreaks ),
190 rStrm << static_cast< sal_uInt16 >(
mrPageBreaks.size() );
206 OString sNumPageBreaks = OString::number(
mrPageBreaks.size() );
207 pWorksheet->startElement( nElement,
208 XML_count, sNumPageBreaks,
209 XML_manualBreakCount, sNumPageBreaks );
212 pWorksheet->singleElement( XML_brk,
213 XML_id, OString::number(rPageBreak),
220 pWorksheet->endElement( nElement );
233 const SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
324 static_cast< sal_Int32
>( rHdrItemSet.
Get(
ATTR_PAGE_SIZE ).GetSize().Height() );
363 static_cast< sal_Int32
>( rFtrItemSet.
Get(
ATTR_PAGE_SIZE ).GetSize().Height() );
371 set<SCROW> aRowBreaks;
374 SCROW const nMaxRow = numeric_limits<sal_uInt16>::max();
375 for (
const SCROW nRow : aRowBreaks)
387 ::std::advance(itr, 1026);
391 set<SCCOL> aColBreaks;
393 for (
const auto& rColBreak : aColBreaks)
402 explicit XclExpXmlStartHeaderFooterElementRecord(sal_Int32
const nElement,
bool const bDifferentOddEven =
false,
bool const bDifferentFirst =
false)
403 :
XclExpXmlElementRecord(nElement), mbDifferentOddEven(bDifferentOddEven), mbDifferentFirst(bDifferentFirst) {}
407 bool mbDifferentOddEven;
408 bool mbDifferentFirst;
413void XclExpXmlStartHeaderFooterElementRecord::SaveXml(
XclExpXmlStream& rStrm)
418 rStream->startElement( mnElement,
420 XML_differentFirst, mbDifferentFirst ?
"true" :
"false",
421 XML_differentOddEven, mbDifferentOddEven ?
"true" :
"false"
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
SC_DLLPUBLIC void GetAllColBreaks(std::set< SCCOL > &rBreaks, SCTAB nTab, bool bPage, bool bManual) const
SC_DLLPUBLIC bool NeedPageResetAfterTab(SCTAB nTab) const
SC_DLLPUBLIC void GetAllRowBreaks(std::set< SCROW > &rBreaks, SCTAB nTab, bool bPage, bool bManual) const
const EditTextObject * GetCenterArea() const
const EditTextObject * GetLeftArea() const
const EditTextObject * GetRightArea() const
Contains the "scale to width/height" attribute in page styles.
sal_uInt16 GetHeight() const
sal_uInt16 GetWidth() const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
tools::Long GetRight() const
tools::Long GetLeft() const
const Size & GetSize() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
Record which contains a Boolean value.
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes all page settings records to the stream.
XclExpChartPageSettings(const XclExpRoot &rRoot)
Creates all records containing the current page settings.
Converts edit engine text objects to an Excel header/footer string.
sal_Int32 GetTotalHeight() const
Returns the total height of the last generated header/footer in twips.
void GenerateString(const EditTextObject *pLeftObj, const EditTextObject *pCenterObj, const EditTextObject *pRightObj)
Generates the header/footer string from the passed edit engine text objects.
const OUString & GetHFString() const
Returns the last generated header/footer string.
Provides export of bitmap data to an IMGDATA record.
virtual void Save(XclExpStream &rStrm) override
Writes the BITMAP record.
Stores an array of manual page breaks for columns or rows.
XclExpPageBreaks(sal_uInt16 nRecId, const ScfUInt16Vec &rPageBreaks, sal_uInt16 nMaxPos)
sal_uInt16 mnMaxPos
Page settings data of current sheet.
virtual void Save(XclExpStream &rStrm) override
Writes the record, if the list is not empty.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the page break list.
const ScfUInt16Vec & mrPageBreaks
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes all page settings records to the stream.
XclExpImgData * getGraphicExport()
virtual void SaveXml(XclExpXmlStream &rStrm) override
XclExpPageSettings(const XclExpRoot &rRoot)
Creates all records containing the current page settings.
virtual void SaveXml(XclExpXmlStream &rStrm)
Base class for single records with any content.
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
sal_uInt16 GetRecId() const
Returns the current record ID.
void SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
Access to global data from other classes.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Represents a SETUP record that contains common page settings.
XclExpSetup(const XclPageData &rPageData)
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SETUP record.
const XclPageData & mrData
This class is used to export Excel record streams.
This class stores an unformatted or formatted string for Excel export.
void AssignByte(std::u16string_view rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF2-BIFF7 byte string.
void Assign(const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the element nElement.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Ends the single element nElement.
virtual void SaveXml(XclExpXmlStream &rStrm) override
Starts the single element nElement.
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
const ScAddress & GetXclMaxPos() const
Returns the highest possible cell address in an Excel document (using current BIFF version).
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
static rtl::Reference< FastAttributeList > createAttrList()
std::shared_ptr< FastSerializerHelper > FSHelperPtr
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED(166)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(179)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(178)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HORCENTER(162)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_VERCENTER(163)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HEADERS(170)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(184)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
constexpr TypedWhichId< SvxULSpaceItem > ATTR_ULSPACE(158)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(169)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_TOPDOWN(174)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(177)
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NOTES(168)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERFIRST(182)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERFIRST(183)
constexpr TypedWhichId< ScPageScaleToItem > ATTR_PAGE_SCALETO(188)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED_FIRST(167)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALETOPAGES(176)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
Contains all page (print) settings for a single sheet.
sal_uInt16 mnPaperSize
Right margin to footer.
sal_uInt16 mnVerPrintRes
Horizontal printing resolution.
double mfHeaderMargin
Bottom margin in inches.
sal_uInt16 mnScaling
Start page number.
bool mbBlackWhite
true = in rows; false = in columns.
SvxBrushItemPtr mxBrushItem
Vertical page breaks.
OUString maFooterFirst
Excel header string for first page (empty = off).
sal_uInt16 mnPaperHeight
Paper Width in mm.
bool mbUseEvenHF
Vertical printing resolution.
bool mbPrintHeadings
true = centered vertically; false = top aligned.
bool mbManualStart
true = print notes.
ScfUInt16Vec maHorPageBreaks
OUString maFooterEven
Excel header string for even pages (empty = off).
sal_uInt16 mnFitToHeight
Fit to number of pages in width.
double mfRightMargin
Left margin in inches.
bool mbPortrait
false = some of the values are not valid.
bool mbVerCenter
true = centered horizontally; false = left aligned.
sal_uInt16 mnStrictPaperSize
Index into paper size table.
double mfFooterMargin
Margin main page to header.
bool mbValid
True = use maHeaderFirst/maFooterFirst.
OUString maHeaderFirst
Excel footer string for even pages (empty = off).
bool mbDraftQuality
true = black/white; false = colors.
OUString maFooter
Excel header string (empty = off).
bool mbPrintGrid
true = print column and row headings.
sal_uInt16 mnFitToWidth
Scaling in percent.
bool mbUseFirstHF
True = use maHeaderEven/maFooterEven.
sal_uInt16 mnPaperWidth
Same as papersize - but for ooxml (considering stricter dimensions)
OUString maHeaderEven
Excel footer string (empty = off).
void SetScPaperSize(const Size &rSize, bool bPortrait, bool bStrict=false)
Sets the Excel paper size index and paper orientation from Calc paper size (twips).
sal_uInt16 mnCopies
Paper Height in mm.
double mfBottomMargin
Top margin in inches.
bool mbHorCenter
true = fit to pages; false = scale in percent.
sal_uInt16 mnHorPrintRes
Fit to number of pages in height.
bool mbPrintNotes
true = draft; false = default quality.
ScfUInt16Vec maVerPageBreaks
Horizontal page breaks.
double mfTopMargin
Right margin in inches.
bool mbFitToPages
true = mnStartPage valid; false = automatic.
bool mbPrintInRows
true = portrait; false = landscape.
OUString maHeader
Background bitmap.
sal_uInt16 mnStartPage
Number of copies.
double mfLeftMargin
Excel footer string for first page (empty = off).
XclExpValueRecord< double > XclExpDoubleRecord
A record containing a double value.
XclExpValueRecord< sal_uInt16 > XclExpUInt16Record
A record containing an unsigned 16-bit value.
XclBiff
An enumeration for all Excel file format types (BIFF types).
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
const sal_uInt16 EXC_ID8_IMGDATA
const sal_uInt16 EXC_ID_FOOTER
const sal_uInt16 EXC_ID_HEADER_FIRST
const sal_uInt16 EXC_ID_PRINTHEADERS
Left/right footer default margin in 1/100mm.
const sal_uInt16 EXC_ID_VCENTER
const sal_uInt16 EXC_ID_PRINTSIZE
const sal_uInt16 EXC_SETUP_BLACKWHITE
const sal_uInt16 EXC_SETUP_PRINTNOTES
const sal_uInt16 EXC_PRINTSIZE_FULL
const sal_uInt16 EXC_SETUP_DRAFT
const sal_uInt16 EXC_ID_RIGHTMARGIN
const sal_uInt16 EXC_ID_LEFTMARGIN
const sal_uInt16 EXC_SETUP_NOTES_END
const sal_uInt16 EXC_SETUP_STARTPAGE
const sal_uInt16 EXC_ID_SETUP
const sal_uInt16 EXC_ID_TOPMARGIN
const sal_uInt16 EXC_PAPERSIZE_USER
const sal_uInt16 EXC_ID_GRIDSET
const sal_uInt16 EXC_ID_HEADER
const sal_uInt16 EXC_ID_FOOTER_FIRST
const sal_uInt16 EXC_ID_HEADER_EVEN
const sal_uInt16 EXC_SETUP_INVALID
const sal_uInt16 EXC_ID_HORPAGEBREAKS
const sal_uInt16 EXC_ID_FOOTER_EVEN
const sal_uInt16 EXC_ID_VERPAGEBREAKS
const sal_uInt16 EXC_SETUP_INROWS
const sal_uInt16 EXC_ID_PRINTGRIDLINES
const sal_uInt16 EXC_SETUP_PORTRAIT
const sal_uInt16 EXC_ID_BOTTOMMARGIN
const sal_uInt16 EXC_ID_HCENTER
@ EightBitLength
Always use UCS-2 characters (default: try to compress). BIFF8 only.