LibreOffice Module sc (master)  1
xipage.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 <xipage.hxx>
21 #include <svl/itemset.hxx>
22 #include <vcl/graph.hxx>
23 #include <scitems.hxx>
24 #include <svl/eitem.hxx>
25 #include <svl/intitem.hxx>
26 #include <svx/pageitem.hxx>
27 #include <editeng/sizeitem.hxx>
28 #include <editeng/lrspitem.hxx>
29 #include <editeng/ulspitem.hxx>
30 #include <editeng/brushitem.hxx>
31 #include <unotools/configmgr.hxx>
32 #include <document.hxx>
33 #include <stlsheet.hxx>
34 #include <attrib.hxx>
35 #include <xistream.hxx>
36 #include <xihelper.hxx>
37 #include <xiescher.hxx>
38 
39 // Page settings ==============================================================
40 
42  XclImpRoot( rRoot )
43 {
44  Initialize();
45 }
46 
48 {
50  mbValidPaper = false;
51 }
52 
54 {
56  if( GetBiff() < EXC_BIFF4 )
57  return;
58 
59  // BIFF4 - BIFF8
60  sal_uInt16 nFlags;
61  maData.mnPaperSize = rStrm.ReaduInt16();
62  maData.mnScaling = rStrm.ReaduInt16();
63  maData.mnStartPage = rStrm.ReaduInt16();
64  maData.mnFitToWidth = rStrm.ReaduInt16();
66  nFlags = rStrm.ReaduInt16();
67 
72  maData.mbManualStart = true;
73 
74  // new in BIFF5 - BIFF8
75  if( GetBiff() >= EXC_BIFF5 )
76  {
81  maData.mnCopies = rStrm.ReaduInt16();
82 
86  }
87 }
88 
90 {
91  switch( rStrm.GetRecId() )
92  {
93  case EXC_ID_LEFTMARGIN: maData.mfLeftMargin = rStrm.ReadDouble(); break;
94  case EXC_ID_RIGHTMARGIN: maData.mfRightMargin = rStrm.ReadDouble(); break;
95  case EXC_ID_TOPMARGIN: maData.mfTopMargin = rStrm.ReadDouble(); break;
96  case EXC_ID_BOTTOMMARGIN: maData.mfBottomMargin = rStrm.ReadDouble(); break;
97  default: OSL_FAIL( "XclImpPageSettings::ReadMargin - unknown record" );
98  }
99 }
100 
102 {
103  OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF3 ); // read it anyway
104  bool bCenter = (rStrm.ReaduInt16() != 0);
105  switch( rStrm.GetRecId() )
106  {
107  case EXC_ID_HCENTER: maData.mbHorCenter = bCenter; break;
108  case EXC_ID_VCENTER: maData.mbVerCenter = bCenter; break;
109  default: OSL_FAIL( "XclImpPageSettings::ReadCenter - unknown record" );
110  }
111 }
112 
114 {
115  OUString aString;
116  if( rStrm.GetRecLeft() )
117  aString = (GetBiff() <= EXC_BIFF5) ? rStrm.ReadByteString( false ) : rStrm.ReadUniString();
118 
119  switch( rStrm.GetRecId() )
120  {
121  case EXC_ID_HEADER: maData.maHeader = aString; break;
122  case EXC_ID_FOOTER: maData.maFooter = aString; break;
123  case EXC_ID_HEADER_EVEN: maData.maHeaderEven = aString; break;
124  case EXC_ID_FOOTER_EVEN: maData.maFooterEven = aString; break;
125  default: OSL_FAIL( "XclImpPageSettings::ReadHeaderFooter - unknown record" );
126  }
127 
128  if (maData.maHeader.getLength() > 10 && utl::ConfigManager::IsFuzzing())
129  maData.maHeader = maData.maHeader.copy(0, 10);
130  if (maData.maHeaderEven.getLength() > 10 && utl::ConfigManager::IsFuzzing())
131  maData.maHeaderEven = maData.maHeaderEven.copy(0, 10);
132 }
133 
135 {
136  ScfUInt16Vec* pVec = nullptr;
137  switch( rStrm.GetRecId() )
138  {
139  case EXC_ID_HORPAGEBREAKS: pVec = &maData.maHorPageBreaks; break;
140  case EXC_ID_VERPAGEBREAKS: pVec = &maData.maVerPageBreaks; break;
141  default: OSL_FAIL( "XclImpPageSettings::ReadPageBreaks - unknown record" );
142  }
143 
144  if( !pVec )
145  return;
146 
147  bool bIgnore = GetBiff() == EXC_BIFF8; // ignore start/end columns or rows in BIFF8
148 
149  sal_uInt16 nCount, nBreak;
150  nCount = rStrm.ReaduInt16();
151  pVec->clear();
152  pVec->reserve( nCount );
153 
154  while( nCount-- )
155  {
156  nBreak = rStrm.ReaduInt16();
157  if( nBreak )
158  pVec->push_back( nBreak );
159  if( bIgnore )
160  rStrm.Ignore( 4 );
161  }
162 }
163 
165 {
166  maData.mbPrintHeadings = (rStrm.ReaduInt16() != 0);
167 }
168 
170 {
171  maData.mbPrintGrid = (rStrm.ReaduInt16() != 0);
172 }
173 
175 {
176  Graphic aGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm );
177  if( aGraphic.GetType() != GraphicType::NONE )
178  maData.mxBrushItem.reset( new SvxBrushItem( aGraphic, GPOS_TILED, ATTR_BACKGROUND ) );
179 }
180 
181 void XclImpPageSettings::SetPaperSize( sal_uInt16 nXclPaperSize, bool bPortrait )
182 {
183  maData.mnPaperSize = nXclPaperSize;
184  maData.mbPortrait = bPortrait;
185  mbValidPaper = true;
186 }
187 
188 namespace {
189 
190 void lclPutMarginItem( SfxItemSet& rItemSet, sal_uInt16 nRecId, double fMarginInch )
191 {
192  sal_uInt16 nMarginTwips = XclTools::GetTwipsFromInch( fMarginInch );
193  switch( nRecId )
194  {
195  case EXC_ID_TOPMARGIN:
196  case EXC_ID_BOTTOMMARGIN:
197  {
198  SvxULSpaceItem aItem( rItemSet.Get( ATTR_ULSPACE ) );
199  if( nRecId == EXC_ID_TOPMARGIN )
200  aItem.SetUpperValue( nMarginTwips );
201  else
202  aItem.SetLowerValue( nMarginTwips );
203  rItemSet.Put( aItem );
204  }
205  break;
206  case EXC_ID_LEFTMARGIN:
207  case EXC_ID_RIGHTMARGIN:
208  {
209  SvxLRSpaceItem aItem( rItemSet.Get( ATTR_LRSPACE ) );
210  if( nRecId == EXC_ID_LEFTMARGIN )
211  aItem.SetLeftValue( nMarginTwips );
212  else
213  aItem.SetRightValue( nMarginTwips );
214  rItemSet.Put( aItem );
215  }
216  break;
217  default:
218  OSL_FAIL( "XclImpPageSettings::SetMarginItem - unknown record id" );
219  }
220 }
221 
222 } // namespace
223 
225 {
226  ScDocument& rDoc = GetDoc();
227  SCTAB nScTab = GetCurrScTab();
228 
229  // *** create page style sheet ***
230 
231  OUString aStyleName;
232  OUString aTableName;
233  if( GetDoc().GetName( nScTab, aTableName ) )
234  aStyleName = "PageStyle_" + aTableName;
235  else
236  aStyleName = "PageStyle_" + OUString::number(static_cast<sal_Int32>(nScTab+1));
237 
239  GetStyleSheetPool(), aStyleName, false);
240 
241  SfxItemSet& rItemSet = rStyleSheet.GetItemSet();
242 
243  // *** page settings ***
244 
251 
252  sal_uInt16 nStartPage = maData.mbManualStart ? maData.mnStartPage : 0;
253  ScfTools::PutItem( rItemSet, SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, nStartPage ), true );
254 
255  if( maData.mxBrushItem )
256  rItemSet.Put( *maData.mxBrushItem );
257 
258  if( mbValidPaper )
259  {
260  SvxPageItem aPageItem( rItemSet.Get( ATTR_PAGE ) );
261  aPageItem.SetLandscape( !maData.mbPortrait );
262  rItemSet.Put( aPageItem );
264  }
265 
266  if( maData.mbFitToPages )
268  else if( maData.mbValid )
270 
271  // *** margin preparations ***
272 
273  double fLeftMargin = maData.mfLeftMargin;
274  double fRightMargin = maData.mfRightMargin;
275  double fTopMargin = maData.mfTopMargin;
276  double fBottomMargin = maData.mfBottomMargin;
277  // distances between header/footer and page area
278  double fHeaderHeight = 0.0;
279  double fHeaderDist = 0.0;
280  double fFooterHeight = 0.0;
281  double fFooterDist = 0.0;
282  // in Calc, "header/footer left/right margin" is X distance between header/footer and page margin
283  double fHdrLeftMargin = maData.mfHdrLeftMargin - maData.mfLeftMargin;
284  double fHdrRightMargin = maData.mfHdrRightMargin - maData.mfRightMargin;
285  double fFtrLeftMargin = maData.mfFtrLeftMargin - maData.mfLeftMargin;
286  double fFtrRightMargin = maData.mfFtrRightMargin - maData.mfRightMargin;
287 
288  // *** header and footer ***
289 
290  XclImpHFConverter aHFConv( GetRoot() );
291 
292  // header
293  bool bHasHeader = !maData.maHeader.isEmpty();
294  SvxSetItem aHdrSetItem( rItemSet.Get( ATTR_PAGE_HEADERSET ) );
295  SfxItemSet& rHdrItemSet = aHdrSetItem.GetItemSet();
296  rHdrItemSet.Put( SfxBoolItem( ATTR_PAGE_ON, bHasHeader ) );
297  if( bHasHeader )
298  {
299  aHFConv.ParseString( maData.maHeader );
300  aHFConv.FillToItemSet( rItemSet, ATTR_PAGE_HEADERLEFT );
301  aHFConv.FillToItemSet( rItemSet, ATTR_PAGE_HEADERRIGHT );
302  // #i23296# In Calc, "top margin" is distance to header
303  fTopMargin = maData.mfHeaderMargin;
304  // Calc uses distance between header and sheet data area
305  fHeaderHeight = XclTools::GetInchFromTwips( aHFConv.GetTotalHeight() );
306  fHeaderDist = maData.mfTopMargin - maData.mfHeaderMargin - fHeaderHeight;
307  }
308  if( fHeaderDist < 0.0 )
309  {
310  /* #i23296# Header overlays sheet data:
311  -> set fixed header height to get correct sheet data position. */
312  ScfTools::PutItem( rHdrItemSet, SfxBoolItem( ATTR_PAGE_DYNAMIC, false ), true );
313  // shrink header height
314  tools::Long nHdrHeight = XclTools::GetTwipsFromInch( fHeaderHeight + fHeaderDist );
315  ScfTools::PutItem( rHdrItemSet, SvxSizeItem( ATTR_PAGE_SIZE, Size( 0, nHdrHeight ) ), true );
316  lclPutMarginItem( rHdrItemSet, EXC_ID_BOTTOMMARGIN, 0.0 );
317  }
318  else
319  {
320  // use dynamic header height
321  ScfTools::PutItem( rHdrItemSet, SfxBoolItem( ATTR_PAGE_DYNAMIC, true ), true );
322  lclPutMarginItem( rHdrItemSet, EXC_ID_BOTTOMMARGIN, fHeaderDist );
323  }
324  lclPutMarginItem( rHdrItemSet, EXC_ID_LEFTMARGIN, fHdrLeftMargin );
325  lclPutMarginItem( rHdrItemSet, EXC_ID_RIGHTMARGIN, fHdrRightMargin );
326  rItemSet.Put( aHdrSetItem );
327 
328  // footer
329  bool bHasFooter = !maData.maFooter.isEmpty();
330  SvxSetItem aFtrSetItem( rItemSet.Get( ATTR_PAGE_FOOTERSET ) );
331  SfxItemSet& rFtrItemSet = aFtrSetItem.GetItemSet();
332  rFtrItemSet.Put( SfxBoolItem( ATTR_PAGE_ON, bHasFooter ) );
333  if( bHasFooter )
334  {
335  aHFConv.ParseString( maData.maFooter );
336  aHFConv.FillToItemSet( rItemSet, ATTR_PAGE_FOOTERLEFT );
337  aHFConv.FillToItemSet( rItemSet, ATTR_PAGE_FOOTERRIGHT );
338  // #i23296# In Calc, "bottom margin" is distance to footer
339  fBottomMargin = maData.mfFooterMargin;
340  // Calc uses distance between footer and sheet data area
341  fFooterHeight = XclTools::GetInchFromTwips( aHFConv.GetTotalHeight() );
342  fFooterDist = maData.mfBottomMargin - maData.mfFooterMargin - fFooterHeight;
343  }
344  if( fFooterDist < 0.0 )
345  {
346  /* #i23296# Footer overlays sheet data:
347  -> set fixed footer height to get correct sheet data end position. */
348  ScfTools::PutItem( rFtrItemSet, SfxBoolItem( ATTR_PAGE_DYNAMIC, false ), true );
349  // shrink footer height
350  tools::Long nFtrHeight = XclTools::GetTwipsFromInch( fFooterHeight + fFooterDist );
351  ScfTools::PutItem( rFtrItemSet, SvxSizeItem( ATTR_PAGE_SIZE, Size( 0, nFtrHeight ) ), true );
352  lclPutMarginItem( rFtrItemSet, EXC_ID_TOPMARGIN, 0.0 );
353  }
354  else
355  {
356  // use dynamic footer height
357  ScfTools::PutItem( rFtrItemSet, SfxBoolItem( ATTR_PAGE_DYNAMIC, true ), true );
358  lclPutMarginItem( rFtrItemSet, EXC_ID_TOPMARGIN, fFooterDist );
359  }
360  lclPutMarginItem( rFtrItemSet, EXC_ID_LEFTMARGIN, fFtrLeftMargin );
361  lclPutMarginItem( rFtrItemSet, EXC_ID_RIGHTMARGIN, fFtrRightMargin );
362  rItemSet.Put( aFtrSetItem );
363 
364  // *** set final margins ***
365 
366  lclPutMarginItem( rItemSet, EXC_ID_LEFTMARGIN, fLeftMargin );
367  lclPutMarginItem( rItemSet, EXC_ID_RIGHTMARGIN, fRightMargin );
368  lclPutMarginItem( rItemSet, EXC_ID_TOPMARGIN, fTopMargin );
369  lclPutMarginItem( rItemSet, EXC_ID_BOTTOMMARGIN, fBottomMargin );
370 
371  // *** put style sheet into document ***
372 
373  rDoc.SetPageStyle( nScTab, rStyleSheet.GetName() );
374 
375  // *** page breaks ***
376 
377  for( const auto& rHorPageBreak : maData.maHorPageBreaks )
378  {
379  SCROW nScRow = static_cast< SCROW >( rHorPageBreak );
380  if( nScRow <= rDoc.MaxRow() )
381  rDoc.SetRowBreak(nScRow, nScTab, false, true);
382  }
383 
384  for( const auto& rVerPageBreak : maData.maVerPageBreaks )
385  {
386  SCCOL nScCol = static_cast< SCCOL >( rVerPageBreak );
387  if( nScCol <= rDoc.MaxCol() )
388  rDoc.SetColBreak(nScCol, nScTab, false, true);
389  }
390 }
391 
392 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
double mfHdrRightMargin
Left margin to header.
Definition: xlpage.hxx:119
const sal_uInt16 EXC_SETUP_STARTPAGE
Definition: xlpage.hxx:86
double mfRightMargin
Left margin in inches.
Definition: xlpage.hxx:113
double mfFtrLeftMargin
Right margin to header.
Definition: xlpage.hxx:120
void SetPaperSize(sal_uInt16 nXclPaperSize, bool bPortrait)
Overrides paper size and orientation (used in sheet-charts).
Definition: xipage.cxx:181
sal_uInt16 mnVerPrintRes
Horizontal printing resolution.
Definition: xlpage.hxx:132
void ReadPageBreaks(XclImpStream &rStrm)
Reads a HORIZONTALPAGEBREAKS or VERTICALPAGEBREAKS record.
Definition: xipage.cxx:134
void ReadCenter(XclImpStream &rStrm)
Reads a HCENTER or VCENTER record.
Definition: xipage.cxx:101
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
sal_uInt16 mnCopies
Paper Height in mm.
Definition: xlpage.hxx:126
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
bool mbManualStart
true = print notes.
Definition: xlpage.hxx:141
sal_uInt16 GetRecId() const
Returns the current record ID.
Definition: xistream.hxx:354
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(168)
bool mbVerCenter
true = centered horizontally; false = left aligned.
Definition: xlpage.hxx:144
double mfHdrLeftMargin
Margin main page to footer.
Definition: xlpage.hxx:118
long Long
void SetLandscape(bool bL)
void SetLeftValue(const tools::Long nL)
static sal_uInt16 GetTwipsFromInch(double fInches)
Returns the length in twips calculated from a length in inches.
Definition: xltools.cxx:274
const sal_uInt16 EXC_SETUP_DRAFT
Definition: xlpage.hxx:84
OUString maFooterEven
Excel header string for even pages (empty = off).
Definition: xlpage.hxx:111
sal_uInt16 mnPaperSize
Right margin to footer.
Definition: xlpage.hxx:122
const sal_uInt16 EXC_SETUP_INROWS
Definition: xlpage.hxx:80
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:276
SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual)
Definition: document.cxx:4389
bool mbPrintGrid
true = print column and row headings.
Definition: xlpage.hxx:146
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xiroot.hxx:132
static ScStyleSheet & MakePageStyleSheet(ScStyleSheetPool &rPool, const OUString &rStyleName, bool bForceName)
Creates and returns a page style sheet and inserts it into the pool.
Definition: ftools.cxx:258
const sal_uInt16 EXC_ID_VCENTER
Definition: xlpage.hxx:74
Converts an Excel header/footer string into three edit engine text objects.
Definition: xihelper.hxx:164
const sal_uInt16 EXC_ID_HEADER
Definition: xlpage.hxx:31
bool mbHorCenter
true = fit to pages; false = scale in percent.
Definition: xlpage.hxx:143
GPOS_TILED
void SetDefaults()
Sets Excel default page settings.
Definition: xlpage.cxx:176
double mfTopMargin
Right margin in inches.
Definition: xlpage.hxx:114
const OUString & GetName() const
bool mbFitToPages
true = mnStartPage valid; false = automatic.
Definition: xlpage.hxx:142
MS Excel 4.0.
Definition: xlconst.hxx:35
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
Definition: xlroot.cxx:297
static bool IsFuzzing()
int nCount
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_VERCENTER(163)
OUString maHeader
Background bitmap.
Definition: xlpage.hxx:108
void ParseString(const OUString &rHFString)
Parses the passed string and creates three new edit engine text objects.
Definition: xihelper.cxx:276
const sal_uInt16 EXC_SETUP_PRINTNOTES
Definition: xlpage.hxx:85
void Finalize()
Creates a page stylesheet from current settings and sets it at current sheet.
Definition: xipage.cxx:224
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HEADERS(169)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(178)
XclPageData maData
Definition: xipage.hxx:67
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_TOPDOWN(173)
bool mbValid
True = use maHeaderEven/maFooterEven.
Definition: xlpage.hxx:135
const sal_uInt16 EXC_ID_TOPMARGIN
Definition: xlpage.hxx:48
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:36
void ReadMargin(XclImpStream &rStrm)
Reads a ***MARGIN record (reads all 4 margin records).
Definition: xipage.cxx:89
static void PutItem(SfxItemSet &rItemSet, const SfxPoolItem &rItem, sal_uInt16 nWhichId, bool bSkipPoolDef)
Puts the item into the passed item set.
Definition: ftools.cxx:210
GraphicType GetType() const
OUString maFooter
Excel header string (empty = off).
Definition: xlpage.hxx:109
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(182)
sal_uInt16 mnStartPage
Number of copies.
Definition: xlpage.hxx:127
sal_Int16 SCCOL
Definition: types.hxx:22
SvxBrushItemPtr mxBrushItem
Vertical page breaks.
Definition: xlpage.hxx:107
double ReadDouble()
Definition: xistream.cxx:702
const sal_uInt16 EXC_ID_VERPAGEBREAKS
Definition: xlpage.hxx:41
sal_uInt16 mnScaling
Start page number.
Definition: xlpage.hxx:128
const sal_uInt16 EXC_ID_HCENTER
Definition: xlpage.hxx:73
const sal_uInt16 EXC_ID_HEADER_EVEN
Definition: xlpage.hxx:36
double mfFtrRightMargin
Left margin to footer.
Definition: xlpage.hxx:121
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HORCENTER(162)
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:73
static double GetInchFromTwips(sal_Int32 nTwips)
Returns the length in inches calculated from a length in twips.
Definition: xltools.cxx:285
MS Excel 3.0.
Definition: xlconst.hxx:34
void ReadHeaderFooter(XclImpStream &rStrm)
Reads a HEADER or FOOTER record.
Definition: xipage.cxx:113
bool mbPrintNotes
true = draft; false = default quality.
Definition: xlpage.hxx:140
bool mbValidPaper
Page settings data.
Definition: xipage.hxx:68
ScfUInt16Vec maVerPageBreaks
Horizontal page breaks.
Definition: xlpage.hxx:106
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(179)
sal_uInt16 mnFitToWidth
Scaling in percent.
Definition: xlpage.hxx:129
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
sal_uInt16 ReaduInt16()
Definition: xistream.cxx:648
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(180)
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:161
SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual)
Definition: document.cxx:4397
const sal_uInt16 EXC_SETUP_BLACKWHITE
Definition: xlpage.hxx:83
OUString maHeaderEven
Excel footer string (empty = off).
Definition: xlpage.hxx:110
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
const sal_uInt16 EXC_ID_BOTTOMMARGIN
Definition: xlpage.hxx:49
void ReadPrintHeaders(XclImpStream &rStrm)
Reads a PRINTHEADERS record.
Definition: xipage.cxx:164
bool mbDraftQuality
true = black/white; false = colors.
Definition: xlpage.hxx:139
const sal_uInt16 EXC_ID_FOOTER
Definition: xlpage.hxx:32
bool mbPortrait
false = some of the values are not valid.
Definition: xlpage.hxx:136
void ReadImgData(XclImpStream &rStrm)
Reads an IMGDATA record and creates the SvxBrushItem.
Definition: xipage.cxx:174
ScfUInt16Vec maHorPageBreaks
Definition: xlpage.hxx:105
SC_DLLPUBLIC void SetPageStyle(SCTAB nTab, const OUString &rName)
Definition: document.cxx:6180
std::size_t GetRecLeft()
Returns remaining data size of the whole record without record headers.
Definition: xistream.cxx:581
double mfBottomMargin
Top margin in inches.
Definition: xlpage.hxx:115
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const sal_uInt16 EXC_SETUP_PORTRAIT
Definition: xlpage.hxx:81
sal_Int32 SCROW
Definition: types.hxx:18
OUString ReadUniString(sal_uInt16 nChars, sal_uInt8 nFlags)
Reads ext.
Definition: xistream.cxx:886
double mfHeaderMargin
Bottom margin in inches.
Definition: xlpage.hxx:116
OUString ReadByteString(bool b16BitLen)
Reads 8/16 bit string length, character array and returns the string.
Definition: xistream.cxx:954
void SetUpperValue(const sal_uInt16 nU)
void Initialize()
Initializes the object to be used for a new sheet.
Definition: xipage.cxx:47
#define OSL_ENSURE_BIFF(c)
Definition: xltools.hxx:32
::std::vector< sal_uInt16 > ScfUInt16Vec
Definition: ftools.hxx:253
Contains the "scale to width/height" attribute in page styles.
Definition: attrib.hxx:223
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Ignore(std::size_t nBytes)
Seeks forward inside the current record.
Definition: xistream.cxx:795
const sal_uInt16 EXC_ID_HORPAGEBREAKS
Definition: xlpage.hxx:42
Size GetScPaperSize() const
Returns the real paper size (twips) from the paper size index and paper orientation.
Definition: xlpage.cxx:205
double mfFooterMargin
Margin main page to header.
Definition: xlpage.hxx:117
bool mbBlackWhite
true = in rows; false = in columns.
Definition: xlpage.hxx:138
sal_uInt16 mnHorPrintRes
Fit to number of pages in height.
Definition: xlpage.hxx:131
virtual SC_DLLPUBLIC SfxItemSet & GetItemSet() override
Definition: stlsheet.cxx:126
void FillToItemSet(SfxItemSet &rItemSet, sal_uInt16 nWhichId) const
Creates a ScPageHFItem and inserts it into the passed item set.
Definition: xihelper.cxx:473
constexpr TypedWhichId< SvxULSpaceItem > ATTR_ULSPACE(158)
void ReadPrintGridLines(XclImpStream &rStrm)
Reads a PRINTGRIDLINES record.
Definition: xipage.cxx:169
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:141
const sal_uInt16 EXC_ID_FOOTER_EVEN
Definition: xlpage.hxx:37
XclImpPageSettings(const XclImpRoot &rRoot)
Definition: xipage.cxx:41
bool mbPrintHeadings
true = centered vertically; false = top aligned.
Definition: xlpage.hxx:145
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(181)
sal_Int32 GetTotalHeight() const
Returns the total height of the converted header or footer in twips.
Definition: xihelper.cxx:485
sal_uInt16 mnFitToHeight
Fit to number of pages in width.
Definition: xlpage.hxx:130
MS Excel 2.1.
Definition: xlconst.hxx:33
This class is used to import record oriented streams.
Definition: xistream.hxx:278
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(174)
const sal_uInt16 EXC_ID_RIGHTMARGIN
Definition: xlpage.hxx:47
void ReadSetup(XclImpStream &rStrm)
Reads a SETUP record and inserts contained data.
Definition: xipage.cxx:53
Access to global data from other classes.
Definition: xiroot.hxx:126
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NOTES(167)
bool mbPrintInRows
true = portrait; false = landscape.
Definition: xlpage.hxx:137
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(177)
const sal_uInt16 EXC_SETUP_INVALID
Definition: xlpage.hxx:82
double mfLeftMargin
Excel footer string for even pages (empty = off).
Definition: xlpage.hxx:112
const sal_uInt16 EXC_ID_LEFTMARGIN
Definition: xlpage.hxx:46
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(176)
static Graphic ReadImgData(const XclImpRoot &rRoot, XclImpStream &rStrm)
Reads and returns a bitmap from the IMGDATA record.
Definition: xiescher.cxx:3924
sal_Int16 SCTAB
Definition: types.hxx:23