32#include <document.hxx>
33#include <stlsheet.hxx>
66 nFlags =
rStrm.ReaduInt16();
91 switch(
rStrm.GetRecId() )
97 default: OSL_FAIL(
"XclImpPageSettings::ReadMargin - unknown record" );
104 bool bCenter = (
rStrm.ReaduInt16() != 0);
105 switch(
rStrm.GetRecId() )
109 default: OSL_FAIL(
"XclImpPageSettings::ReadCenter - unknown record" );
116 if(
rStrm.GetRecLeft() )
119 switch(
rStrm.GetRecId() )
125 default: OSL_FAIL(
"XclImpPageSettings::ReadHeaderFooter - unknown record" );
144 switch(
rStrm.GetRecId() )
148 default: OSL_FAIL(
"XclImpPageSettings::ReadPageBreaks - unknown record" );
156 sal_uInt16
nCount, nBreak;
163 nBreak =
rStrm.ReaduInt16();
165 pVec->push_back( nBreak );
184 if( aGraphic.
GetType() != GraphicType::NONE )
197void lclPutMarginItem(
SfxItemSet& rItemSet, sal_uInt16 nRecId,
double fMarginInch )
207 aItem.SetUpperValue( nMarginTwips );
209 aItem.SetLowerValue( nMarginTwips );
210 rItemSet.
Put( aItem );
218 aItem.SetLeftValue( nMarginTwips );
220 aItem.SetRightValue( nMarginTwips );
221 rItemSet.
Put( aItem );
225 OSL_FAIL(
"XclImpPageSettings::SetMarginItem - unknown record id" );
241 aStyleName =
"PageStyle_" + aTableName;
243 aStyleName =
"PageStyle_" + OUString::number(
static_cast<sal_Int32
>(nScTab+1));
269 rItemSet.
Put( aPageItem );
285 double fHeaderHeight = 0.0;
286 double fHeaderDist = 0.0;
287 double fFooterHeight = 0.0;
288 double fFooterDist = 0.0;
302 SfxItemSet& rHdrItemSet = aHdrSetItem.GetItemSet();
316 if( fHeaderDist < 0.0 )
334 rItemSet.
Put( aHdrSetItem );
339 SfxItemSet& rFtrItemSet = aFtrSetItem.GetItemSet();
353 if( fFooterDist < 0.0 )
371 rItemSet.
Put( aFtrSetItem );
388 SCROW nScRow =
static_cast< SCROW >( rHorPageBreak );
389 if( nScRow <= rDoc.
MaxRow() )
395 SCCOL nScCol =
static_cast< SCCOL >( rVerPageBreak );
396 if( nScCol <= rDoc.
MaxCol() )
GraphicType GetType() const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual)
SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual)
SC_DLLPUBLIC void SetPageStyle(SCTAB nTab, const OUString &rName)
Contains the "scale to width/height" attribute in page styles.
virtual SC_DLLPUBLIC SfxItemSet & GetItemSet() override
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const OUString & GetName() const
SvStream & ReadDouble(double &rDouble)
void SetLandscape(bool bL)
static Graphic ReadImgData(const XclImpRoot &rRoot, XclImpStream &rStrm)
Reads and returns a bitmap from the IMGDATA record.
Converts an Excel header/footer string into three edit engine text objects.
void ParseString(const OUString &rHFString)
Parses the passed string and creates three new edit engine text objects.
void FillToItemSet(SfxItemSet &rItemSet, sal_uInt16 nWhichId) const
Creates a ScPageHFItem and inserts it into the passed item set.
sal_Int32 GetTotalHeight() const
Returns the total height of the converted header or footer in twips.
void ReadPrintHeaders(XclImpStream &rStrm)
Reads a PRINTHEADERS record.
void ReadSetup(XclImpStream &rStrm)
Reads a SETUP record and inserts contained data.
void ReadCenter(XclImpStream &rStrm)
Reads a HCENTER or VCENTER record.
XclImpPageSettings(const XclImpRoot &rRoot)
void ReadPrintGridLines(XclImpStream &rStrm)
Reads a PRINTGRIDLINES record.
void SetPaperSize(sal_uInt16 nXclPaperSize, bool bPortrait)
Overrides paper size and orientation (used in sheet-charts).
bool mbValidPaper
Page settings data.
void Initialize()
Initializes the object to be used for a new sheet.
void Finalize()
Creates a page stylesheet from current settings and sets it at current sheet.
void ReadMargin(XclImpStream &rStrm)
Reads a ***MARGIN record (reads all 4 margin records).
void ReadImgData(XclImpStream &rStrm)
Reads an IMGDATA record and creates the SvxBrushItem.
void ReadPageBreaks(XclImpStream &rStrm)
Reads a HORIZONTALPAGEBREAKS or VERTICALPAGEBREAKS record.
void ReadHeaderFooter(XclImpStream &rStrm)
Reads a HEADER or FOOTER record.
Access to global data from other classes.
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
This class is used to import record oriented streams.
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.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
virtual OUString GetName() const override
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
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< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
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.
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.
void SetDefaults()
Sets Excel default page settings.
double mfFooterMargin
Margin main page to header.
bool mbValid
True = use maHeaderFirst/maFooterFirst.
double mfFtrRightMargin
Left margin to footer.
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.
double mfHdrRightMargin
Left margin to header.
OUString maHeaderEven
Excel footer string (empty = off).
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.
double mfHdrLeftMargin
Margin main page to footer.
ScfUInt16Vec maVerPageBreaks
Horizontal page breaks.
Size GetScPaperSize() const
Returns the real paper size (twips) from the paper size index and paper orientation.
double mfTopMargin
Right margin in inches.
double mfFtrLeftMargin
Right margin to header.
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).
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
const sal_uInt16 EXC_ID_FOOTER
const sal_uInt16 EXC_ID_VCENTER
const sal_uInt16 EXC_SETUP_BLACKWHITE
const sal_uInt16 EXC_SETUP_PRINTNOTES
const sal_uInt16 EXC_SETUP_DRAFT
const sal_uInt16 EXC_ID_RIGHTMARGIN
const sal_uInt16 EXC_ID_LEFTMARGIN
const sal_uInt16 EXC_SETUP_STARTPAGE
const sal_uInt16 EXC_ID_TOPMARGIN
const sal_uInt16 EXC_ID_HEADER
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_SETUP_PORTRAIT
const sal_uInt16 EXC_ID_BOTTOMMARGIN
const sal_uInt16 EXC_ID_HCENTER