32 #include <document.hxx>
33 #include <stlsheet.hxx>
97 default: OSL_FAIL(
"XclImpPageSettings::ReadMargin - unknown record" );
109 default: OSL_FAIL(
"XclImpPageSettings::ReadCenter - unknown record" );
125 default: OSL_FAIL(
"XclImpPageSettings::ReadHeaderFooter - unknown record" );
148 default: OSL_FAIL(
"XclImpPageSettings::ReadPageBreaks - unknown record" );
156 sal_uInt16
nCount, nBreak;
159 pVec->reserve( nCount );
165 pVec->push_back( nBreak );
184 if( aGraphic.
GetType() != GraphicType::NONE )
197 void lclPutMarginItem(
SfxItemSet& rItemSet, sal_uInt16 nRecId,
double fMarginInch )
209 aItem.SetLowerValue( nMarginTwips );
210 rItemSet.
Put( aItem );
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() )
double mfHdrRightMargin
Left margin to header.
const sal_uInt16 EXC_SETUP_STARTPAGE
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERFIRST(183)
double mfRightMargin
Left margin in inches.
double mfFtrLeftMargin
Right margin to header.
void SetPaperSize(sal_uInt16 nXclPaperSize, bool bPortrait)
Overrides paper size and orientation (used in sheet-charts).
sal_uInt16 mnVerPrintRes
Horizontal printing resolution.
void ReadPageBreaks(XclImpStream &rStrm)
Reads a HORIZONTALPAGEBREAKS or VERTICALPAGEBREAKS record.
void ReadCenter(XclImpStream &rStrm)
Reads a HCENTER or VCENTER record.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
sal_uInt16 mnCopies
Paper Height in mm.
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
bool mbManualStart
true = print notes.
sal_uInt16 GetRecId() const
Returns the current record ID.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(169)
bool mbVerCenter
true = centered horizontally; false = left aligned.
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(178)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
double mfHdrLeftMargin
Margin main page to footer.
void SetLandscape(bool bL)
void SetLeftValue(const tools::Long nL)
const sal_uInt16 EXC_SETUP_DRAFT
OUString maFooterEven
Excel header string for even pages (empty = off).
sal_uInt16 mnPaperSize
Right margin to footer.
const sal_uInt16 EXC_SETUP_INROWS
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual)
bool mbPrintGrid
true = print column and row headings.
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
const sal_uInt16 EXC_ID_VCENTER
Converts an Excel header/footer string into three edit engine text objects.
const sal_uInt16 EXC_ID_HEADER
bool mbHorCenter
true = fit to pages; false = scale in percent.
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
void SetDefaults()
Sets Excel default page settings.
double mfTopMargin
Right margin in inches.
const OUString & GetName() const
bool mbFitToPages
true = mnStartPage valid; false = automatic.
SC_DLLPUBLIC SCROW MaxRow() const
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_TOPDOWN(174)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_VERCENTER(163)
OUString maHeader
Background bitmap.
void ParseString(const OUString &rHFString)
Parses the passed string and creates three new edit engine text objects.
const sal_uInt16 EXC_SETUP_PRINTNOTES
void Finalize()
Creates a page stylesheet from current settings and sets it at current sheet.
virtual OUString GetName() const override
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERFIRST(182)
bool mbValid
True = use maHeaderFirst/maFooterFirst.
const sal_uInt16 EXC_ID_TOPMARGIN
SC_DLLPUBLIC SCCOL MaxCol() const
MS Excel 5.0, MS Excel 7.0 (95)
void ReadMargin(XclImpStream &rStrm)
Reads a ***MARGIN record (reads all 4 margin records).
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(184)
GraphicType GetType() const
OUString maFooter
Excel header string (empty = off).
sal_uInt16 mnStartPage
Number of copies.
SvxBrushItemPtr mxBrushItem
Vertical page breaks.
const sal_uInt16 EXC_ID_VERPAGEBREAKS
sal_uInt16 mnScaling
Start page number.
const sal_uInt16 EXC_ID_HCENTER
const sal_uInt16 EXC_ID_HEADER_EVEN
double mfFtrRightMargin
Left margin to footer.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HORCENTER(162)
void ReadHeaderFooter(XclImpStream &rStrm)
Reads a HEADER or FOOTER record.
bool mbPrintNotes
true = draft; false = default quality.
bool mbValidPaper
Page settings data.
ScfUInt16Vec maVerPageBreaks
Horizontal page breaks.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NOTES(168)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(177)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HEADERS(170)
sal_uInt16 mnFitToWidth
Scaling in percent.
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual)
const sal_uInt16 EXC_SETUP_BLACKWHITE
OUString maHeaderEven
Excel footer string (empty = off).
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
const sal_uInt16 EXC_ID_BOTTOMMARGIN
void ReadPrintHeaders(XclImpStream &rStrm)
Reads a PRINTHEADERS record.
bool mbDraftQuality
true = black/white; false = colors.
const sal_uInt16 EXC_ID_FOOTER
bool mbPortrait
false = some of the values are not valid.
void ReadImgData(XclImpStream &rStrm)
Reads an IMGDATA record and creates the SvxBrushItem.
ScfUInt16Vec maHorPageBreaks
SC_DLLPUBLIC void SetPageStyle(SCTAB nTab, const OUString &rName)
std::size_t GetRecLeft()
Returns remaining data size of the whole record without record headers.
double mfBottomMargin
Top margin in inches.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const sal_uInt16 EXC_SETUP_PORTRAIT
OUString ReadUniString(sal_uInt16 nChars, sal_uInt8 nFlags)
Reads ext.
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(179)
double mfHeaderMargin
Bottom margin in inches.
OUString ReadByteString(bool b16BitLen)
Reads 8/16 bit string length, character array and returns the string.
void SetUpperValue(const sal_uInt16 nU)
void Initialize()
Initializes the object to be used for a new sheet.
Contains the "scale to width/height" attribute in page styles.
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Ignore(std::size_t nBytes)
Seeks forward inside the current record.
const sal_uInt16 EXC_ID_HORPAGEBREAKS
Size GetScPaperSize() const
Returns the real paper size (twips) from the paper size index and paper orientation.
double mfFooterMargin
Margin main page to header.
bool mbBlackWhite
true = in rows; false = in columns.
sal_uInt16 mnHorPrintRes
Fit to number of pages in height.
virtual SC_DLLPUBLIC SfxItemSet & GetItemSet() override
void FillToItemSet(SfxItemSet &rItemSet, sal_uInt16 nWhichId) const
Creates a ScPageHFItem and inserts it into the passed item set.
constexpr TypedWhichId< SvxULSpaceItem > ATTR_ULSPACE(158)
void ReadPrintGridLines(XclImpStream &rStrm)
Reads a PRINTGRIDLINES record.
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
const sal_uInt16 EXC_ID_FOOTER_EVEN
XclImpPageSettings(const XclImpRoot &rRoot)
bool mbPrintHeadings
true = centered vertically; false = top aligned.
sal_Int32 GetTotalHeight() const
Returns the total height of the converted header or footer in twips.
sal_uInt16 mnFitToHeight
Fit to number of pages in width.
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
This class is used to import record oriented streams.
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
const sal_uInt16 EXC_ID_RIGHTMARGIN
void ReadSetup(XclImpStream &rStrm)
Reads a SETUP record and inserts contained data.
Access to global data from other classes.
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
bool mbPrintInRows
true = portrait; false = landscape.
const sal_uInt16 EXC_SETUP_INVALID
double mfLeftMargin
Excel footer string for first page (empty = off).
const sal_uInt16 EXC_ID_LEFTMARGIN
static Graphic ReadImgData(const XclImpRoot &rRoot, XclImpStream &rStrm)
Reads and returns a bitmap from the IMGDATA record.