LibreOffice Module sc (master)  1
impop.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 <memory>
21 #include <imp_op.hxx>
22 
24 
25 #include <scitems.hxx>
26 
27 #include <o3tl/safeint.hxx>
28 #include <sfx2/docfile.hxx>
29 #include <svx/svxids.hrc>
30 #include <svl/zforlist.hxx>
31 #include <unotools/configmgr.hxx>
32 #include <sal/log.hxx>
33 
34 #include <sfx2/objsh.hxx>
35 #include <tools/urlobj.hxx>
36 #include <docuno.hxx>
37 
38 #include <formulacell.hxx>
39 #include <document.hxx>
40 #include <globstr.hrc>
41 #include <scresid.hxx>
42 #include <global.hxx>
43 #include <olinetab.hxx>
44 #include <stlpool.hxx>
45 #include <viewopti.hxx>
46 #include <docoptio.hxx>
47 #include <scextopt.hxx>
48 #include <unonames.hxx>
49 #include <paramisc.hxx>
50 #include <colrowst.hxx>
51 #include <otlnbuff.hxx>
52 #include <xistyle.hxx>
53 
54 #include <namebuff.hxx>
55 #include <xltools.hxx>
56 #include <xltable.hxx>
57 #include <xltracer.hxx>
58 #include <xihelper.hxx>
59 #include <xipage.hxx>
60 #include <xiview.hxx>
61 #include <xiescher.hxx>
62 #include <xicontent.hxx>
63 
64 #include <excform.hxx>
65 #include <documentimport.hxx>
66 
67 #if defined(_WIN32)
68 #include <math.h>
69 #endif
70 
71 using namespace ::com::sun::star;
72 
73 const double ImportExcel::fExcToTwips = TWIPS_PER_CHAR / 256.0;
74 
75 ImportTyp::ImportTyp( ScDocument* pDoc, rtl_TextEncoding eQ )
76 {
77  eQuellChar = eQ;
78  pD = pDoc;
79 }
80 
82 {
83 }
84 
86  ImportTyp( &rImpData.mrDoc, rImpData.meTextEnc ),
87  XclImpRoot( rImpData ),
88  maStrm( rStrm, GetRoot() ),
89  aIn( maStrm ),
90  maScOleSize( ScAddress::INITIALIZE_INVALID ),
91  pColOutlineBuff(nullptr),
92  pRowOutlineBuff(nullptr),
93  pColRowBuff(nullptr),
94  mpLastFormula(nullptr),
95  mnLastRefIdx( 0 ),
96  mnIxfeIndex( 0 ),
97  mnLastRecId(0),
98  mbBiff2HasXfs(false),
99  mbBiff2HasXfsValid(false)
100 {
101  nBdshtTab = 0;
102 
103  // fill in root data - after new's without root as parameter
104  pExcRoot = &GetOldRoot();
105  pExcRoot->pIR = this; // ExcRoot -> XclImpRoot
107  pExcRoot->pExtSheetBuff.reset( new ExtSheetBuffer( pExcRoot ) ); //&aExtSheetBuff;
108  pExcRoot->pShrfmlaBuff.reset( new SharedFormulaBuffer( pExcRoot ) ); //&aShrfrmlaBuff;
109  pExcRoot->pExtNameBuff.reset( new ExtNameBuff ( *this ) );
110 
112 
113  // from Biff8 on
114  pFormConv.reset(new ExcelToSc( GetRoot() ));
116 
117  bTabTruncated = false;
118 
119  // Excel document per Default on 31.12.1899, accords to Excel settings with 1.1.1900
120  ScDocOptions aOpt = pD->GetDocOptions();
121  aOpt.SetDate( 30, 12, 1899 );
122  pD->SetDocOptions( aOpt );
123  pD->GetFormatTable()->ChangeNullDate( 30, 12, 1899 );
124 
125  ScDocOptions aDocOpt( pD->GetDocOptions() );
126  aDocOpt.SetIgnoreCase( true ); // always in Excel
127  aDocOpt.SetFormulaRegexEnabled( false ); // regular expressions? what's that?
128  aDocOpt.SetFormulaWildcardsEnabled( true ); // Excel uses wildcard expressions
129  aDocOpt.SetLookUpColRowNames( false ); // default: no natural language refs
130  pD->SetDocOptions( aDocOpt );
131 }
132 
134 {
136 
137  pOutlineListBuffer.reset();
138 
139  pFormConv.reset();
140 }
141 
142 void ImportExcel::SetLastFormula( SCCOL nCol, SCROW nRow, double fVal, sal_uInt16 nXF, ScFormulaCell* pCell )
143 {
144  LastFormulaMapType::iterator it = maLastFormulaCells.find(nCol);
145  if (it == maLastFormulaCells.end())
146  {
147  std::pair<LastFormulaMapType::iterator, bool> r =
148  maLastFormulaCells.emplace(nCol, LastFormula());
149  it = r.first;
150  }
151 
152  it->second.mnCol = nCol;
153  it->second.mnRow = nRow;
154  it->second.mpCell = pCell;
155  it->second.mfValue = fVal;
156  it->second.mnXF = nXF;
157 
158  mpLastFormula = &it->second;
159 }
160 
162 {
163  sal_uInt16 nRecommendReadOnly, nPasswordHash;
164  nRecommendReadOnly = maStrm.ReaduInt16();
165  nPasswordHash = maStrm.ReaduInt16();
166 
167  if((nRecommendReadOnly == 0) && (nPasswordHash == 0))
168  return;
169 
170  if( SfxItemSet* pItemSet = GetMedium().GetItemSet() )
171  pItemSet->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
172 
173  if( SfxObjectShell* pShell = GetDocShell() )
174  {
175  if( nRecommendReadOnly != 0 )
176  pShell->SetLoadReadonly( true );
177  if( nPasswordHash != 0 )
178  pShell->SetModifyPasswordHash( nPasswordHash );
179  }
180 }
181 
182 sal_uInt16 ImportExcel::ReadXFIndex( const ScAddress& rScPos, bool bBiff2 )
183 {
184  sal_uInt16 nXFIdx = 0;
185  if( bBiff2 )
186  {
187  /* #i71453# On first call, check if the file contains XF records (by
188  trying to access the first XF with index 0). If there are no XFs,
189  the explicit formatting information contained in each cell record
190  will be used instead. */
191  if( !mbBiff2HasXfsValid )
192  {
193  mbBiff2HasXfsValid = true;
194  mbBiff2HasXfs = GetXFBuffer().GetXF( 0 ) != nullptr;
195  }
196  // read formatting information (includes the XF identifier)
197  sal_uInt8 nFlags1, nFlags2, nFlags3;
198  nFlags1 = maStrm.ReaduInt8();
199  nFlags2 = maStrm.ReaduInt8();
200  nFlags3 = maStrm.ReaduInt8();
201  /* If the file contains XFs, extract and set the XF identifier,
202  otherwise get the explicit formatting. */
203  if( mbBiff2HasXfs )
204  {
205  nXFIdx = ::extract_value< sal_uInt16 >( nFlags1, 0, 6 );
206  /* If the identifier is equal to 63, then the real identifier is
207  contained in the preceding IXFE record (stored in mnBiff2XfId). */
208  if( nXFIdx == 63 )
209  nXFIdx = mnIxfeIndex;
210  }
211  else
212  {
213  /* Let the XclImpXF class do the conversion of the imported
214  formatting. The XF buffer is empty, therefore will not do any
215  conversion based on the XF index later on. */
216  XclImpXF::ApplyPatternForBiff2CellFormat( GetRoot(), rScPos, nFlags1, nFlags2, nFlags3 );
217  }
218  }
219  else
220  nXFIdx = aIn.ReaduInt16();
221  return nXFIdx;
222 }
223 
225 {
226  XclRange aXclUsedArea;
227  if( (maStrm.GetRecId() == EXC_ID2_DIMENSIONS) || (GetBiff() <= EXC_BIFF5) )
228  {
229  maStrm >> aXclUsedArea;
230  if( (aXclUsedArea.GetColCount() > 1) && (aXclUsedArea.GetRowCount() > 1) )
231  {
232  // Excel stores first unused row/column index
233  --aXclUsedArea.maLast.mnCol;
234  --aXclUsedArea.maLast.mnRow;
235  // create the Calc range
236  SCTAB nScTab = GetCurrScTab();
237  ScRange& rScUsedArea = GetExtDocOptions().GetOrCreateTabSettings( nScTab ).maUsedArea;
238  GetAddressConverter().ConvertRange( rScUsedArea, aXclUsedArea, nScTab, nScTab, false );
239  // if any error occurs in ConvertRange(), rScUsedArea keeps untouched
240  }
241  }
242  else
243  {
244  sal_uInt32 nXclRow1 = 0, nXclRow2 = 0;
245  nXclRow1 = maStrm.ReaduInt32();
246  nXclRow2 = maStrm.ReaduInt32();
247  aXclUsedArea.maFirst.mnCol = maStrm.ReaduInt16();
248  aXclUsedArea.maLast.mnCol = maStrm.ReaduInt16();
249  if( (nXclRow1 < nXclRow2) && (aXclUsedArea.GetColCount() > 1) &&
250  (nXclRow1 <= o3tl::make_unsigned( GetScMaxPos().Row() )) )
251  {
252  // Excel stores first unused row/column index
253  --nXclRow2;
254  --aXclUsedArea.maLast.mnCol;
255  // convert row indexes to 16-bit values
256  aXclUsedArea.maFirst.mnRow = static_cast< sal_uInt16 >( nXclRow1 );
257  aXclUsedArea.maLast.mnRow = limit_cast< sal_uInt16 >( nXclRow2, aXclUsedArea.maFirst.mnRow, SAL_MAX_UINT16 );
258  // create the Calc range
259  SCTAB nScTab = GetCurrScTab();
260  ScRange& rScUsedArea = GetExtDocOptions().GetOrCreateTabSettings( nScTab ).maUsedArea;
261  GetAddressConverter().ConvertRange( rScUsedArea, aXclUsedArea, nScTab, nScTab, false );
262  // if any error occurs in ConvertRange(), rScUsedArea keeps untouched
263  }
264  }
265 }
266 
268 {
269  XclAddress aXclPos;
270  aIn >> aXclPos;
271 
273  if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
274  {
275  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_BLANK );
276 
277  GetXFRangeBuffer().SetBlankXF( aScPos, nXFIdx );
278  }
279 }
280 
282 {
283  XclAddress aXclPos;
284  maStrm >> aXclPos;
285 
287  if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
288  {
289  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, true );
290  sal_uInt16 nValue;
291  nValue = maStrm.ReaduInt16();
292 
293  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
294  GetDocImport().setNumericCell(aScPos, nValue);
295  }
296 }
297 
299 {
300  XclAddress aXclPos;
301  maStrm >> aXclPos;
302 
304  if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
305  {
306  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_NUMBER );
307  double fValue;
308  fValue = maStrm.ReadDouble();
309 
310  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
311  GetDocImport().setNumericCell(aScPos, fValue);
312  }
313 }
314 
316 {
317  XclAddress aXclPos;
318  maStrm >> aXclPos;
319 
321  if( !GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
322  return;
323 
324  /* Record ID BIFF XF type String type
325  0x0004 2-7 3 byte 8-bit length, byte string
326  0x0004 8 3 byte 16-bit length, unicode string
327  0x0204 2-7 2 byte 16-bit length, byte string
328  0x0204 8 2 byte 16-bit length, unicode string */
329  bool bBiff2 = maStrm.GetRecId() == EXC_ID2_LABEL;
330  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, bBiff2 );
332  XclImpString aString;
333 
334  // #i63105# use text encoding from FONT record
335  rtl_TextEncoding eOldTextEnc = GetTextEncoding();
336  if( const XclImpFont* pFont = GetXFBuffer().GetFont( nXFIdx ) )
337  SetTextEncoding( pFont->GetFontEncoding() );
338  aString.Read( maStrm, nFlags );
339  SetTextEncoding( eOldTextEnc );
340 
341  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
342  XclImpStringHelper::SetToDocument(GetDocImport(), aScPos, GetRoot(), aString, nXFIdx);
343 }
344 
346 {
347  XclAddress aXclPos;
348  maStrm >> aXclPos;
349 
351  if( !GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
352  return;
353 
354  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_BOOLERR );
356  nValue = maStrm.ReaduInt8();
357  nType = maStrm.ReaduInt8();
358 
359  if( nType == EXC_BOOLERR_BOOL )
360  GetXFRangeBuffer().SetBoolXF( aScPos, nXFIdx );
361  else
362  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
363 
364  double fValue;
365  std::unique_ptr<ScTokenArray> pScTokArr = ErrorToFormula( nType != EXC_BOOLERR_BOOL, nValue, fValue );
366  ScFormulaCell* pCell = pScTokArr
367  ? new ScFormulaCell(pD, aScPos, std::move(pScTokArr))
368  : new ScFormulaCell(pD, aScPos);
369  pCell->SetHybridDouble( fValue );
370  GetDocImport().setFormulaCell(aScPos, pCell);
371 }
372 
374 {
375  XclAddress aXclPos;
376  maStrm >> aXclPos;
377 
379  if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
380  {
381  sal_uInt16 nXFIdx = ReadXFIndex( aScPos, false );
382  sal_Int32 nRk;
383  nRk = maStrm.ReadInt32();
384 
385  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
387  }
388 }
389 
391 {
393 }
394 
396 {
397  sal_uInt16 nRow, nRowHeight;
398 
399  nRow = aIn.ReaduInt16();
400  aIn.Ignore( 4 );
401 
402  if( !GetRoot().GetDoc().ValidRow( nRow ) )
403  return;
404 
405  nRowHeight = aIn.ReaduInt16(); // specify direct in Twips
406  aIn.Ignore( 2 );
407 
408  if( GetBiff() == EXC_BIFF2 )
409  {// -------------------- BIFF2
410  pColRowBuff->SetHeight( nRow, nRowHeight );
411  }
412  else
413  {// -------------------- BIFF5
414  sal_uInt16 nGrbit;
415 
416  aIn.Ignore( 2 ); // reserved
417  nGrbit = aIn.ReaduInt16();
418 
419  sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
420  pRowOutlineBuff->SetLevel( nRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) );
421  pColRowBuff->SetRowSettings( nRow, nRowHeight, nGrbit );
422  }
423 }
424 
426 {
427  sal_uInt16 nSubType;
429  maStrm.Ignore( 2 );
430  nSubType = maStrm.ReaduInt16();
431 
432  if( nSubType == 0x0020 ) // Chart
434  else if( nSubType == 0x0040 ) // Macro
436  else // #i51490# Excel interprets invalid indexes as worksheet
438 }
439 
441 {
442  // POST: cannot be called after an invalid table!
443  EndSheet();
444  IncCurrScTab();
445 }
446 
448 {
449  if (GetRoot().GetBiff() != EXC_BIFF8)
450  return;
451 
453 }
454 
456 {
457  OUString aUrl, aTabName;
458  bool bSameWorkBook;
459  OUString aEncodedUrl( aIn.ReadByteString( false ) );
460  XclImpUrlHelper::DecodeUrl( aUrl, aTabName, bSameWorkBook, *pExcRoot->pIR, aEncodedUrl );
461  mnLastRefIdx = pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
462 }
463 
465 {
466  if (GetRoot().GetBiff() != EXC_BIFF8)
467  return;
468 
470 }
471 
473 {// Default Cell Attributes
474  sal_uInt16 nColMic, nColMac;
475  sal_uInt8 nOpt0;
476 
477  nColMic = aIn.ReaduInt16();
478  nColMac = aIn.ReaduInt16();
479 
480  OSL_ENSURE( aIn.GetRecLeft() == static_cast<std::size_t>(nColMac - nColMic) * 3 + 2,
481  "ImportExcel::Columndefault - wrong record size" );
482 
483  nColMac--;
484 
485  if( nColMac > pD->MaxCol() )
486  nColMac = static_cast<sal_uInt16>(pD->MaxCol());
487 
488  for( sal_uInt16 nCol = nColMic ; nCol <= nColMac ; nCol++ )
489  {
490  nOpt0 = aIn.ReaduInt8();
491  aIn.Ignore( 2 ); // only 0. Attribut-Byte used
492 
493  if( nOpt0 & 0x80 ) // Col hidden?
494  pColRowBuff->HideCol( nCol );
495  }
496 }
497 
499 {
500  sal_uInt16 nFormLen;
501  sal_uInt16 nFirstRow = aIn.ReaduInt16();
502  sal_uInt16 nLastRow = aIn.ReaduInt16();
503  sal_uInt8 nFirstCol = aIn.ReaduInt8();
504  sal_uInt8 nLastCol = aIn.ReaduInt8();
505 
506  if( GetBiff() == EXC_BIFF2 )
507  {// BIFF2
508  aIn.Ignore( 1 );
509  nFormLen = aIn.ReaduInt8();
510  }
511  else
512  {// BIFF5
513  aIn.Ignore( 6 );
514  nFormLen = aIn.ReaduInt16();
515  }
516 
517  std::unique_ptr<ScTokenArray> pResult;
518 
519  if (GetRoot().GetDoc().ValidColRow(nLastCol, nLastRow))
520  {
521  // the read mark is now on the formula, length in nFormLen
522 
523  pFormConv->Reset( ScAddress( static_cast<SCCOL>(nFirstCol),
524  static_cast<SCROW>(nFirstRow), GetCurrScTab() ) );
525  pFormConv->Convert(pResult, maStrm, nFormLen, true);
526 
527  SAL_WARN_IF(!pResult, "sc", "*ImportExcel::Array25(): ScTokenArray is NULL!");
528  }
529 
530  if (pResult)
531  {
532  ScDocumentImport& rDoc = GetDocImport();
533  ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab());
534  rDoc.setMatrixCells(aArrayRange, *pResult, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
535  }
536 }
537 
539 {
540  sal_uInt16 n1904;
541 
542  n1904 = aIn.ReaduInt16();
543 
544  if( n1904 )
545  {// 1904 date system
546  ScDocOptions aOpt = pD->GetDocOptions();
547  aOpt.SetDate( 1, 1, 1904 );
548  pD->SetDocOptions( aOpt );
549  pD->GetFormatTable()->ChangeNullDate( 1, 1, 1904 );
550  }
551 }
552 
554 {
555  sal_uInt32 nRes;
556  sal_uInt16 nOpt;
557 
558  nOpt = aIn.ReaduInt16();
559  nRes = aIn.ReaduInt32();
560 
561  aIn.ReadByteString( false ); // name
562 
563  if( ( nOpt & 0x0001 ) || ( ( nOpt & 0xFFFE ) == 0x0000 ) )
564  {// external name
565  pExcRoot->pExtNameBuff->AddName( mnLastRefIdx );
566  }
567  else if( nOpt & 0x0010 )
568  {// ole link
569  pExcRoot->pExtNameBuff->AddOLE( mnLastRefIdx, nRes ); // nRes is storage ID
570  }
571  else
572  {// dde link
573  pExcRoot->pExtNameBuff->AddDDE( mnLastRefIdx );
574  }
575 }
576 
578 {// Column Width
579  sal_uInt8 nColFirst, nColLast;
580  sal_uInt16 nColWidth;
581 
582  nColFirst = aIn.ReaduInt8();
583  nColLast = aIn.ReaduInt8();
584  nColWidth = aIn.ReaduInt16();
585 
586 //TODO: add a check for the unlikely case of changed MAXCOL (-> XclImpAddressConverter)
587 // if( nColLast > pD->MaxCol() )
588 // nColLast = static_cast<sal_uInt16>(pD->MaxCol());
589 
590  sal_uInt16 nScWidth = XclTools::GetScColumnWidth( nColWidth, GetCharWidth() );
591  pColRowBuff->SetWidthRange( nColFirst, nColLast, nScWidth );
592 }
593 
595 {
596  sal_uInt16 nDefHeight;
597  nDefHeight = maStrm.ReaduInt16();
598  nDefHeight &= 0x7FFF;
600 }
601 
603 {
604  if (GetRoot().GetBiff() != EXC_BIFF8)
605  return;
606 
608 }
609 
611 {
612  if (GetRoot().GetBiff() != EXC_BIFF8)
613  return;
614 
616 }
617 
619 {
620  if (GetRoot().GetBiff() != EXC_BIFF8)
621  return;
622 
624 }
625 
627 {
629 }
630 
632 {
634 }
635 
637 {
638  // stored as entire characters -> convert to 1/256 of characters (as in COLINFO)
639  double fDefWidth = 256.0 * maStrm.ReaduInt16();
640 
641  if (!pColRowBuff)
642  {
643  SAL_WARN("sc", "*ImportExcel::DefColWidth(): pColRowBuff is NULL!");
644  return;
645  }
646 
647  // #i3006# additional space for default width - Excel adds space depending on font size
648  long nFontHt = GetFontBuffer().GetAppFontData().mnHeight;
649  fDefWidth += XclTools::GetXclDefColWidthCorrection( nFontHt );
650 
651  sal_uInt16 nScWidth = XclTools::GetScColumnWidth( limit_cast< sal_uInt16 >( fDefWidth ), GetCharWidth() );
652  pColRowBuff->SetDefWidth( nScWidth );
653 }
654 
656 {// Column Formatting Information
657  sal_uInt16 nColFirst, nColLast, nColWidth, nXF;
658  sal_uInt16 nOpt;
659 
660  nColFirst = aIn.ReaduInt16();
661  nColLast = aIn.ReaduInt16();
662  nColWidth = aIn.ReaduInt16();
663  nXF = aIn.ReaduInt16();
664  nOpt = aIn.ReaduInt16();
665 
666  if( nColFirst > pD->MaxCol() )
667  return;
668 
669  if( nColLast > pD->MaxCol() )
670  nColLast = static_cast<sal_uInt16>(pD->MaxCol());
671 
672  bool bHidden = ::get_flag( nOpt, EXC_COLINFO_HIDDEN );
673  bool bCollapsed = ::get_flag( nOpt, EXC_COLINFO_COLLAPSED );
674  sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nOpt, 8, 3 );
675  pColOutlineBuff->SetLevelRange( nColFirst, nColLast, nLevel, bCollapsed );
676 
677  if( bHidden )
678  pColRowBuff->HideColRange( nColFirst, nColLast );
679 
680  sal_uInt16 nScWidth = XclTools::GetScColumnWidth( nColWidth, GetCharWidth() );
681  pColRowBuff->SetWidthRange( nColFirst, nColLast, nScWidth );
682  pColRowBuff->SetDefaultXF( nColFirst, nColLast, nXF );
683 }
684 
686 {
687  sal_uInt16 nFlags;
688  nFlags = aIn.ReaduInt16();
689 
692 
694 }
695 
697 {
698  sal_uInt16 nGrbit = 0;
699 
700  if( GetBiff() == EXC_BIFF5 )
701  {
703  maSheetOffsets.push_back( aIn.ReaduInt32() );
705  nGrbit = aIn.ReaduInt16();
706  }
707 
708  OUString aName( aIn.ReadByteString( false ) );
709 
710  SCTAB nScTab = nBdshtTab;
711  if( nScTab > 0 )
712  {
713  OSL_ENSURE( !pD->HasTable( nScTab ), "ImportExcel::Boundsheet - sheet exists already" );
714  pD->MakeTable( nScTab );
715  }
716 
717  if( ( nGrbit & 0x0001 ) || ( nGrbit & 0x0002 ) )
718  pD->SetVisible( nScTab, false );
719 
720  if( !pD->RenameTab( nScTab, aName ) )
721  {
723  pD->RenameTab( nScTab, aName );
724  }
725 
726  nBdshtTab++;
727 }
728 
730 {
731  sal_uInt16 nUICountry, nDocCountry;
732  nUICountry = maStrm.ReaduInt16();
733  nDocCountry = maStrm.ReaduInt16();
734 
735  // Store system language in XclRoot
736  LanguageType eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nDocCountry ) );
737  if( eLanguage != LANGUAGE_DONTKNOW )
738  SetDocLanguage( eLanguage );
739 
740  // Set Excel UI language in add-in name translator
741  eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nUICountry ) );
742  if( eLanguage != LANGUAGE_DONTKNOW )
743  SetUILanguage( eLanguage );
744 }
745 
747 {
748  if( maStrm.ReaduInt16() != 0 )
749  {
750  ScDocOptions aDocOpt = GetDoc().GetDocOptions();
751  aDocOpt.SetLookUpColRowNames( true );
752  GetDoc().SetDocOptions( aDocOpt );
753  }
754 }
755 
757 {
758  sal_uInt16 nHide;
759  ScVObjMode eOle, eChart, eDraw;
760 
761  nHide = aIn.ReaduInt16();
762 
763  ScViewOptions aOpts( pD->GetViewOptions() );
764 
765  switch( nHide )
766  {
767  case 1: // Placeholders
768  eOle = VOBJ_MODE_SHOW; // in Excel 97 only charts as place holder are displayed
769  eChart = VOBJ_MODE_SHOW; //#i80528# VOBJ_MODE_DUMMY replaced by VOBJ_MODE_SHOW now
770  eDraw = VOBJ_MODE_SHOW;
771  break;
772  case 2: // Hide all
773  eOle = VOBJ_MODE_HIDE;
774  eChart = VOBJ_MODE_HIDE;
775  eDraw = VOBJ_MODE_HIDE;
776  break;
777  default: // Show all
778  eOle = VOBJ_MODE_SHOW;
779  eChart = VOBJ_MODE_SHOW;
780  eDraw = VOBJ_MODE_SHOW;
781  break;
782  }
783 
784  aOpts.SetObjMode( VOBJ_TYPE_OLE, eOle );
785  aOpts.SetObjMode( VOBJ_TYPE_CHART, eChart );
786  aOpts.SetObjMode( VOBJ_TYPE_DRAW, eDraw );
787 
788  pD->SetViewOptions( aOpts );
789 }
790 
792 {
793  sal_uInt16 nScWidth = XclTools::GetScColumnWidth( maStrm.ReaduInt16(), GetCharWidth() );
794  if (!pColRowBuff)
795  {
796  SAL_WARN("sc", "*ImportExcel::Standardwidth(): pColRowBuff is NULL!");
797  return;
798  }
799  pColRowBuff->SetDefWidth( nScWidth, true );
800 }
801 
803 {
804  switch (mnLastRecId)
805  {
806  case EXC_ID2_FORMULA:
807  case EXC_ID3_FORMULA:
808  case EXC_ID4_FORMULA:
809  // This record MUST immediately follow a FORMULA record.
810  break;
811  default:
812  return;
813  }
814 
815  if (!mpLastFormula)
816  // The last FORMULA record should have left this data.
817  return;
818 
819  aIn.Ignore( 8 );
820  sal_uInt16 nLenExpr = aIn.ReaduInt16();
821 
822  // read mark is now on the formula
823 
824  std::unique_ptr<ScTokenArray> pResult;
825 
826  // The shared range in this record is erroneous more than half the time.
827  // Don't ever rely on it. Use the one from the formula cell above.
828  SCCOL nCol1 = mpLastFormula->mnCol;
829  SCROW nRow1 = mpLastFormula->mnRow;
830 
831  ScAddress aPos(nCol1, nRow1, GetCurrScTab());
832  pFormConv->Reset(aPos);
833  pFormConv->Convert( pResult, maStrm, nLenExpr, true, FT_SharedFormula );
834 
835  if (!pResult)
836  {
837  SAL_WARN("sc", "+ImportExcel::Shrfmla(): ScTokenArray is NULL!");
838  return;
839  }
840 
841  pExcRoot->pShrfmlaBuff->Store(aPos, *pResult);
842 
843  // Create formula cell for the last formula record.
844 
845  ScDocumentImport& rDoc = GetDocImport();
846 
847  ScFormulaCell* pCell = new ScFormulaCell(pD, aPos, std::move(pResult));
848  pCell->GetCode()->WrapReference(aPos, EXC_MAXCOL8, EXC_MAXROW8);
849  rDoc.getDoc().CheckLinkFormulaNeedingCheck( *pCell->GetCode());
850  rDoc.getDoc().EnsureTable(aPos.Tab());
851  rDoc.setFormulaCell(aPos, pCell);
852  pCell->SetNeedNumberFormat(false);
853  if (std::isfinite(mpLastFormula->mfValue))
855 
857  mpLastFormula->mpCell = pCell;
858 }
859 
861 {
862  XclAddress aXclPos;
863  sal_uInt16 nXF;
864  sal_Int32 nRkNum;
865 
866  aIn >> aXclPos;
867 
868  for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol )
869  {
870  nXF = aIn.ReaduInt16();
871  nRkNum = aIn.ReadInt32();
872 
874  if( GetAddressConverter().ConvertAddress( aScPos, aCurrXclPos, GetCurrScTab(), true ) )
875  {
876  GetXFRangeBuffer().SetXF( aScPos, nXF );
878  }
879  }
880 }
881 
883 {
884  XclAddress aXclPos;
885  sal_uInt16 nXF;
886 
887  aIn >> aXclPos;
888 
889  for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol )
890  {
891  nXF = aIn.ReaduInt16();
892 
894  if( GetAddressConverter().ConvertAddress( aScPos, aCurrXclPos, GetCurrScTab(), true ) )
895  GetXFRangeBuffer().SetBlankXF( aScPos, nXF );
896  }
897 }
898 
900 {
901  XclAddress aXclPos;
902  sal_uInt16 nXFIdx;
903  aIn >> aXclPos;
904  nXFIdx = aIn.ReaduInt16();
905 
907  if( !GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
908  return;
909 
910  // unformatted Unicode string with separate formatting information
911  XclImpString aString;
912  aString.Read( maStrm );
913 
914  // character formatting runs
915  if( !aString.IsRich() )
916  aString.ReadFormats( maStrm );
917 
918  GetXFRangeBuffer().SetXF( aScPos, nXFIdx );
919  XclImpStringHelper::SetToDocument(GetDocImport(), aScPos, *this, aString, nXFIdx);
920 }
921 
923 {
925  SCTAB nScTab = GetCurrScTab();
926 
927  sal_uInt16 nCount;
928  nCount = maStrm.ReaduInt16();
929  for( sal_uInt16 nIdx = 0; (nIdx < nCount) && (maStrm.GetRecLeft() >= 8); ++nIdx )
930  {
931  XclRange aXclRange;
932  maStrm >> aXclRange; // 16-bit rows and columns
933  ScRange aScRange( ScAddress::UNINITIALIZED );
934  if( rAddrConv.ConvertRange( aScRange, aXclRange, nScTab, nScTab, true ) )
935  GetXFRangeBuffer().SetMerge( aScRange.aStart.Col(), aScRange.aStart.Row(), aScRange.aEnd.Col(), aScRange.aEnd.Row() );
936  }
937 }
938 
940 {
941  XclRange aXclOleSize( ScAddress::UNINITIALIZED );
942  maStrm.Ignore( 2 );
943  aXclOleSize.Read( maStrm, false );
944 
945  SCTAB nScTab = GetCurrScTab();
946  GetAddressConverter().ConvertRange( maScOleSize, aXclOleSize, nScTab, nScTab, false );
947 }
948 
950 {
951  sal_uInt16 nRow, nRowHeight, nGrbit, nXF;
952 
953  nRow = aIn.ReaduInt16();
954  aIn.Ignore( 4 );
955 
956  SCROW nScRow = static_cast< SCROW >( nRow );
957 
958  if( !GetRoot().GetDoc().ValidRow( nScRow ) )
959  return;
960 
961  nRowHeight = aIn.ReaduInt16(); // specify direct in Twips
962  aIn.Ignore( 4 );
963 
964  nRowHeight = nRowHeight & 0x7FFF; // Bit 15: Row Height not changed manually
965  if( !nRowHeight )
966  nRowHeight = (GetBiff() == EXC_BIFF2) ? 0x25 : 0x225;
967 
968  nGrbit = aIn.ReaduInt16();
969  nXF = aIn.ReaduInt16();
970 
971  sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
972  pRowOutlineBuff->SetLevel( nScRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) );
973  pColRowBuff->SetRowSettings( nScRow, nRowHeight, nGrbit );
974 
975  if( nGrbit & EXC_ROW_USEDEFXF )
976  GetXFRangeBuffer().SetRowDefXF( nScRow, nXF & EXC_ROW_XFMASK );
977 }
978 
980 {
981  sal_uInt16 nSubType;
983  maStrm.Ignore( 2 );
984  nSubType = maStrm.ReaduInt16();
985 
986  OSL_ENSURE( nSubType != 0x0100, "*ImportExcel::Bof3(): Biff3 as Workbook?!" );
987  if( nSubType == 0x0100 ) // Book
989  else if( nSubType == 0x0020 ) // Chart
991  else if( nSubType == 0x0040 ) // Macro
993  else // #i51490# Excel interprets invalid indexes as worksheet
995 }
996 
998 {
999  sal_uInt16 nFirstRow, nLastRow, nFormLen;
1000  sal_uInt8 nFirstCol, nLastCol;
1001 
1002  nFirstRow = aIn.ReaduInt16();
1003  nLastRow = aIn.ReaduInt16();
1004  nFirstCol = aIn.ReaduInt8();
1005  nLastCol = aIn.ReaduInt8();
1006  aIn.Ignore( (GetBiff() >= EXC_BIFF5) ? 6 : 2 );
1007  nFormLen = aIn.ReaduInt16();
1008 
1009  std::unique_ptr<ScTokenArray> pResult;
1010 
1011  if( GetRoot().GetDoc().ValidColRow( nLastCol, nLastRow ) )
1012  {
1013  // the read mark is now on the formula, length in nFormLen
1014 
1015  pFormConv->Reset( ScAddress( static_cast<SCCOL>(nFirstCol),
1016  static_cast<SCROW>(nFirstRow), GetCurrScTab() ) );
1017  pFormConv->Convert( pResult, maStrm, nFormLen, true );
1018 
1019  SAL_WARN_IF(!pResult, "sc", "+ImportExcel::Array34(): ScTokenArray is NULL!");
1020  }
1021 
1022  if (pResult)
1023  {
1024  ScDocumentImport& rDoc = GetDocImport();
1025  ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab());
1026  rDoc.setMatrixCells(aArrayRange, *pResult, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
1027  }
1028 }
1029 
1031 {
1032  sal_uInt16 nFlags, nDefHeight;
1033  nFlags = maStrm.ReaduInt16();
1034  nDefHeight = maStrm.ReaduInt16();
1035 
1036  if (!pColRowBuff)
1037  {
1038  SAL_WARN("sc", "*ImportExcel::Defrowheight345(): pColRowBuff is NULL!");
1039  return;
1040  }
1041 
1042  pColRowBuff->SetDefHeight( nDefHeight, nFlags );
1043 }
1044 
1046 {
1047  sal_uInt16 nFirstRow, nLastRow;
1048  sal_uInt8 nFirstCol, nLastCol;
1049  sal_uInt16 nGrbit;
1050  sal_uInt16 nInpRow, nInpCol, nInpRow2, nInpCol2;
1051 
1052  nFirstRow = aIn.ReaduInt16();
1053  nLastRow = aIn.ReaduInt16();
1054  nFirstCol = aIn.ReaduInt8();
1055  nLastCol = aIn.ReaduInt8();
1056  nGrbit = aIn.ReaduInt16();
1057  nInpRow = aIn.ReaduInt16();
1058  nInpCol = aIn.ReaduInt16();
1059  nInpRow2 = aIn.ReaduInt16();
1060  nInpCol2 = aIn.ReaduInt16();
1061 
1063  {
1064  //shrink to smallish arbitrary value to not timeout
1065  nLastRow = std::min<sal_uInt16>(nLastRow, MAXROW_30);
1066  }
1067 
1068  if( GetRoot().GetDoc().ValidColRow( nLastCol, nLastRow ) )
1069  {
1070  if( nFirstCol && nFirstRow )
1071  {
1072  ScTabOpParam aTabOpParam;
1074  sal_uInt16 nCol = nFirstCol - 1;
1075  sal_uInt16 nRow = nFirstRow - 1;
1076  SCTAB nTab = GetCurrScTab();
1077  switch (aTabOpParam.meMode)
1078  {
1079  case ScTabOpParam::Column:
1080  aTabOpParam.aRefFormulaCell.Set(
1081  static_cast<SCCOL>(nFirstCol),
1082  static_cast<SCROW>(nFirstRow - 1), nTab, false,
1083  false, false );
1084  aTabOpParam.aRefFormulaEnd.Set(
1085  static_cast<SCCOL>(nLastCol),
1086  static_cast<SCROW>(nFirstRow - 1), nTab, false,
1087  false, false );
1088  aTabOpParam.aRefColCell.Set( static_cast<SCCOL>(nInpCol),
1089  static_cast<SCROW>(nInpRow), nTab, false, false,
1090  false );
1091  nRow++;
1092  break;
1093  case ScTabOpParam::Row:
1094  aTabOpParam.aRefFormulaCell.Set(
1095  static_cast<SCCOL>(nFirstCol - 1),
1096  static_cast<SCROW>(nFirstRow), nTab, false, false,
1097  false );
1098  aTabOpParam.aRefFormulaEnd.Set(
1099  static_cast<SCCOL>(nFirstCol - 1),
1100  static_cast<SCROW>(nLastRow), nTab, false, false,
1101  false );
1102  aTabOpParam.aRefRowCell.Set( static_cast<SCCOL>(nInpCol),
1103  static_cast<SCROW>(nInpRow), nTab, false, false,
1104  false );
1105  nCol++;
1106  break;
1107  case ScTabOpParam::Both: // TWO-INPUT
1108  aTabOpParam.aRefFormulaCell.Set(
1109  static_cast<SCCOL>(nFirstCol - 1),
1110  static_cast<SCROW>(nFirstRow - 1), nTab, false,
1111  false, false );
1112  aTabOpParam.aRefRowCell.Set( static_cast<SCCOL>(nInpCol),
1113  static_cast<SCROW>(nInpRow), nTab, false, false,
1114  false );
1115  aTabOpParam.aRefColCell.Set( static_cast<SCCOL>(nInpCol2),
1116  static_cast<SCROW>(nInpRow2), nTab, false, false,
1117  false );
1118  break;
1119  }
1120 
1121  ScDocumentImport& rDoc = GetDocImport();
1122  ScRange aTabOpRange(nCol, nRow, nTab, nLastCol, nLastRow, nTab);
1123  rDoc.setTableOpCells(aTabOpRange, aTabOpParam);
1124  }
1125  }
1126  else
1127  {
1128  bTabTruncated = true;
1129  GetTracer().TraceInvalidRow(nLastRow, pD->MaxRow());
1130  }
1131 }
1132 
1134 {
1135  sal_uInt16 nSubType;
1137  maStrm.Ignore( 2 );
1138  nSubType = maStrm.ReaduInt16();
1139 
1140  if( nSubType == 0x0100 ) // Book
1142  else if( nSubType == 0x0020 ) // Chart
1144  else if( nSubType == 0x0040 ) // Macro
1146  else // #i51490# Excel interprets invalid indexes as worksheet
1148 }
1149 
1151 {
1152  //POST: eDateiTyp = Type of the file to be read
1153  sal_uInt16 nSubType, nVers;
1154  BiffTyp eDatei;
1155 
1157  nVers = maStrm.ReaduInt16();
1158  nSubType = maStrm.ReaduInt16( );
1159 
1160  switch( nSubType )
1161  {
1162  case 0x0005: eDatei = Biff5W; break; // workbook globals
1163  case 0x0006: eDatei = Biff5V; break; // VB module
1164  case 0x0010: eDatei = Biff5; break; // worksheet
1165  case 0x0020: eDatei = Biff5C; break; // chart
1166  case 0x0040: eDatei = Biff5M4; break; // macro sheet
1167  default:
1169  return;
1170  }
1171 
1172  if( nVers == 0x0600 && (GetBiff() == EXC_BIFF8) )
1173  eDatei = static_cast<BiffTyp>( eDatei - Biff5 + Biff8 );
1174 
1175  pExcRoot->eDateiTyp = eDatei;
1176 }
1177 
1179 {
1180  pExcRoot->pExtSheetBuff->Reset();
1181 
1182  if( GetBiff() <= EXC_BIFF5 )
1183  {
1184  pExcRoot->pExtNameBuff->Reset();
1185  mnLastRefIdx = 0;
1186  }
1187 
1188  FinalizeTable();
1189 }
1190 
1192 {
1193  SCTAB nTab = GetCurrScTab();
1194  if( nTab > 0 && !pD->HasTable( nTab ) )
1195  pD->MakeTable( nTab );
1196 
1197  if (nTab == 0 && GetBiff() == EXC_BIFF2)
1198  {
1199  // For Excel 2.1 Worksheet file, we need to set the file name as the
1200  // sheet name.
1202  pD->RenameTab(0, aURL.getBase());
1203  }
1204 
1205  pExcRoot->pShrfmlaBuff->Clear();
1206  maLastFormulaCells.clear();
1207  mpLastFormula = nullptr;
1208 
1209  InitializeTable( nTab );
1210 
1211  XclImpOutlineDataBuffer* pNewItem = new XclImpOutlineDataBuffer( GetRoot(), nTab );
1212  pOutlineListBuffer->push_back( std::unique_ptr<XclImpOutlineDataBuffer>(pNewItem) );
1213  pExcRoot->pColRowBuff = pColRowBuff = pNewItem->GetColRowBuff();
1214  pColOutlineBuff = pNewItem->GetColOutline();
1215  pRowOutlineBuff = pNewItem->GetRowOutline();
1216 }
1217 
1218 std::unique_ptr<ScTokenArray> ImportExcel::ErrorToFormula( bool bErrOrVal, sal_uInt8 nError, double& rVal )
1219 {
1220  return pFormConv->GetBoolErr( XclTools::ErrorToEnum( rVal, bErrOrVal, nError ) );
1221 }
1222 
1224 {
1225  /* Speed up chart import: import all sheets without charts, then
1226  update row heights (here), last load all charts -> do not any longer
1227  update inside of ScDocShell::ConvertFrom() (causes update of existing
1228  charts during each and every change of row height). */
1229  if( ScModelObj* pDocObj = GetDocModelObj() )
1230  pDocObj->UpdateAllRowHeights();
1231 }
1232 
1234 {
1235  /* Set automatic page numbering in Default page style (default is "page number = 1").
1236  Otherwise hidden tables (i.e. for scenarios) which have Default page style will
1237  break automatic page numbering. */
1238  if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( ScResId( STR_STYLENAME_STANDARD_PAGE ), SfxStyleFamily::Page ) )
1239  pStyleSheet->GetItemSet().Put( SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 0 ) );
1240 
1241  // outlines for all sheets, sets hidden rows and columns (#i11776# after filtered ranges)
1242  for (auto& rxBuffer : *pOutlineListBuffer)
1243  rxBuffer->Convert();
1244 
1245  // document view settings (before visible OLE area)
1247 
1248  // process all drawing objects (including OLE, charts, controls; after hiding rows/columns; before visible OLE area)
1250 
1251  // visible area (used if this document is an embedded OLE object)
1252  if( SfxObjectShell* pDocShell = GetDocShell() )
1253  {
1254  // visible area if embedded
1255  const ScExtDocSettings& rDocSett = GetExtDocOptions().GetDocSettings();
1256  SCTAB nDisplScTab = rDocSett.mnDisplTab;
1257 
1258  /* #i44077# If a new OLE object is inserted from file, there is no
1259  OLESIZE record in the Excel file. Calculate used area from file
1260  contents (used cells and drawing objects). */
1261  if( !maScOleSize.IsValid() )
1262  {
1263  // used area of displayed sheet (cell contents)
1264  if( const ScExtTabSettings* pTabSett = GetExtDocOptions().GetTabSettings( nDisplScTab ) )
1265  maScOleSize = pTabSett->maUsedArea;
1266  // add all valid drawing objects
1267  ScRange aScObjArea = GetObjectManager().GetUsedArea( nDisplScTab );
1268  if( aScObjArea.IsValid() )
1269  maScOleSize.ExtendTo( aScObjArea );
1270  }
1271 
1272  // valid size found - set it at the document
1273  if( maScOleSize.IsValid() )
1274  {
1275  pDocShell->SetVisArea( GetDoc().GetMMRect(
1277  maScOleSize.aEnd.Col(), maScOleSize.aEnd.Row(), nDisplScTab ) );
1278  GetDoc().SetVisibleTab( nDisplScTab );
1279  }
1280  }
1281 
1282  // open forms in alive mode (has no effect, if no controls in document)
1283  if( ScModelObj* pDocObj = GetDocModelObj() )
1284  pDocObj->setPropertyValue( SC_UNO_APPLYFMDES, uno::Any( false ) );
1285 
1286  // enables extended options to be set to the view after import
1287  GetExtDocOptions().SetChanged( true );
1288 
1289  // root data owns the extended document options -> create a new object
1290  GetDoc().SetExtDocOptions( std::make_unique<ScExtDocOptions>( GetExtDocOptions() ) );
1291 
1292  const SCTAB nLast = pD->GetTableCount();
1293  const ScRange* p;
1294 
1295  if( pExcRoot->pPrintRanges->HasRanges() )
1296  {
1297  for( SCTAB n = 0 ; n < nLast ; n++ )
1298  {
1299  p = pExcRoot->pPrintRanges->First(n);
1300  if( p )
1301  {
1302  pD->ClearPrintRanges( n );
1303  while( p )
1304  {
1305  pD->AddPrintRange( n, *p );
1306  p = pExcRoot->pPrintRanges->Next();
1307  }
1308  }
1309  else
1310  {
1311  // #i4063# no print ranges -> print entire sheet
1312  pD->SetPrintEntireSheet( n );
1313  }
1314  }
1316  }
1317 
1318  if( !pExcRoot->pPrintTitles->HasRanges() )
1319  return;
1320 
1321  for( SCTAB n = 0 ; n < nLast ; n++ )
1322  {
1323  p = pExcRoot->pPrintTitles->First(n);
1324  if( p )
1325  {
1326  bool bRowVirgin = true;
1327  bool bColVirgin = true;
1328 
1329  while( p )
1330  {
1331  if( p->aStart.Col() == 0 && p->aEnd.Col() == pD->MaxCol() && bRowVirgin )
1332  {
1333  pD->SetRepeatRowRange( n, std::unique_ptr<ScRange>(new ScRange(*p)) );
1334  bRowVirgin = false;
1335  }
1336 
1337  if( p->aStart.Row() == 0 && p->aEnd.Row() == pD->MaxRow() && bColVirgin )
1338  {
1339  pD->SetRepeatColRange( n, std::unique_ptr<ScRange>(new ScRange(*p)) );
1340  bColVirgin = false;
1341  }
1342 
1343  p = pExcRoot->pPrintTitles->Next();
1344  }
1345  }
1346  }
1347 }
1348 
1350  XclImpRoot( rRoot ),
1351  mxColOutlineBuff( std::make_shared<XclImpOutlineBuffer>( rRoot.GetXclMaxPos().Col() + 1 ) ),
1352  mxRowOutlineBuff( std::make_shared<XclImpOutlineBuffer>( rRoot.GetXclMaxPos().Row() + 1 ) ),
1353  mxColRowBuff( std::make_shared<XclImpColRowSettings>( rRoot ) ),
1354  mnScTab( nScTab )
1355 {
1356 }
1357 
1359 {
1360 }
1361 
1363 {
1364  mxColOutlineBuff->SetOutlineArray( &GetDoc().GetOutlineTable( mnScTab, true )->GetColArray() );
1365  mxColOutlineBuff->MakeScOutline();
1366 
1367  mxRowOutlineBuff->SetOutlineArray( &GetDoc().GetOutlineTable( mnScTab, true )->GetRowArray() );
1368  mxRowOutlineBuff->MakeScOutline();
1369 
1370  mxColRowBuff->ConvertHiddenFlags( mnScTab );
1371 }
1372 
1373 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetChanged(bool bChanged)
If set to true, the data will be copied to the view data after import.
Definition: scextopt.cxx:165
RootData * pExcRoot
Definition: imp_op.hxx:90
void Set(const ScAddress &rAdr, bool bNewRelCol, bool bNewRelRow, bool bNewRelTab)
Definition: address.hxx:921
void AdjustRowHeight()
Definition: impop.cxx:1223
XclImpColRowSettings * GetColRowBuff() const
Definition: imp_op.hxx:60
virtual ~ImportExcel() override
Definition: impop.cxx:133
const sal_uInt16 EXC_TABLEOP_BOTH
Definition: xltable.hxx:130
const sal_uInt16 EXC_ID3_FORMULA
Definition: xltable.hxx:62
const sal_uInt16 EXC_ID2_DIMENSIONS
Definition: xltable.hxx:33
void SheetProtect()
Definition: impop.cxx:602
URL aURL
XclImpStream maStrm
Definition: imp_op.hxx:92
ScDocumentImport & GetDocImport()
Definition: xiroot.cxx:292
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
Definition: xlroot.hxx:146
ScAddress aStart
Definition: address.hxx:500
void ReadFormats(XclImpStream &rStrm)
Reads and appends the formatting information (run count and runs) from stream.
Definition: xistring.hxx:47
sal_Int32 ReadInt32()
Definition: xistream.cxx:666
void SetDefHeight(sal_uInt16 nDefHeight, sal_uInt16 nFlags)
Definition: colrowst.cxx:100
static XclBoolError ErrorToEnum(double &rfDblValue, bool bErrOrBool, sal_uInt8 nValue)
Gets a translated error code or Boolean value from Excel error codes.
Definition: xltools.cxx:244
const SCROW MAXROW_30
Definition: address.hxx:91
void ReadProtect(XclImpStream &rStrm, SCTAB nTab)
Definition: xicontent.cxx:1327
void ReadUsesElfs()
Definition: impop.cxx:746
std::unique_ptr< SharedFormulaBuffer > pShrfmlaBuff
Definition: root.hxx:51
sal_uInt16 GetRecId() const
Returns the current record ID.
Definition: xistream.hxx:354
SCROW Row() const
Definition: address.hxx:262
void Columndefault()
Definition: impop.cxx:472
std::unique_ptr< ScRangeListTabs > pPrintRanges
Definition: root.hxx:58
Stores all data of an Excel font and provides import of FONT records.
Definition: xistyle.hxx:71
static double GetXclDefColWidthCorrection(long nXclDefFontHeight)
Returns a correction value to convert column widths from/to default column widths.
Definition: xltools.cxx:317
const sal_uInt16 EXC_ID2_LABEL
Definition: xltable.hxx:48
XclStrFlags
Flags used to specify import/export mode of strings.
Definition: xlstring.hxx:29
Stores global buffers and data needed for Excel import filter.
Definition: xiroot.hxx:64
void Externsheet()
Definition: impop.cxx:455
std::unique_ptr< ScTokenArray > ErrorToFormula(bool bErrOrVal, sal_uInt8 nError, double &rVal)
Definition: impop.cxx:1218
void Row34()
Definition: impop.cxx:949
XclImpOutlineBuffer * GetRowOutline() const
Definition: imp_op.hxx:62
void SetRowSettings(SCROW nRow, sal_uInt16 nHeight, sal_uInt16 nFlags)
Definition: colrowst.cxx:133
std::vector< std::unique_ptr< XclImpOutlineDataBuffer > > XclImpOutlineListBuffer
Definition: imp_op.hxx:104
void Standardwidth()
Definition: impop.cxx:791
OUString getBase(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
#define SC_UNO_APPLYFMDES
Definition: unonames.hxx:531
const sal_uInt16 EXC_ID2_FORMULA
Definition: xltable.hxx:61
ScTokenArray * GetCode()
const sal_uInt16 EXC_ROW_USEDEFXF
Definition: xltable.hxx:86
SC_DLLPUBLIC void ExtendTo(const ScRange &rRange)
Definition: address.cxx:1599
const sal_uInt16 EXC_DEFROW_UNSYNCED
Definition: xltable.hxx:115
SC_DLLPUBLIC void ClearPrintRanges(SCTAB nTab)
Removes all print ranges.
Definition: document.cxx:6306
sal_Int64 n
void Country()
Definition: impop.cxx:729
void Bof2()
Definition: impop.cxx:425
XclImpXFRangeBuffer & GetXFRangeBuffer() const
Returns the buffer of XF index ranges for a sheet.
Definition: xiroot.cxx:161
void Read(XclImpStream &rStrm, XclStrFlags nFlags=XclStrFlags::NONE)
Reads a complete string from the passed stream.
Definition: xistring.cxx:41
ScRange maUsedArea
Used area in the sheet (columns/rows only).
Definition: scextopt.hxx:50
void Boundsheet()
Definition: impop.cxx:696
void ConvertObjects()
Inserts all objects into the Calc document.
Definition: xiescher.cxx:4343
sal_uInt16 mnHeight
Font color.
Definition: xlstyle.hxx:291
const ScExtDocSettings & GetDocSettings() const
Definition: scextopt.cxx:170
void Colwidth()
Definition: impop.cxx:577
SC_DLLPUBLIC void SetRepeatColRange(SCTAB nTab, std::unique_ptr< ScRange > pNew)
Definition: document.cxx:6324
void Row25()
Definition: impop.cxx:395
ScAddress aEnd
Definition: address.hxx:501
ScRange GetUsedArea(SCTAB nScTab) const
Returns the used area in the sheet with the passed index.
Definition: xiescher.cxx:4374
XclAddress maLast
Definition: xladdress.hxx:61
sal_uInt32 mnRow
Definition: xladdress.hxx:33
LastFormula * mpLastFormula
Definition: imp_op.hxx:108
ReturnType limit_cast(Type nValue, ReturnType nMin, ReturnType nMax)
Returns the value, if it is not less than nMin and not greater than nMax, otherwise one of the limits...
Definition: ftools.hxx:61
bool IsRich() const
Returns true, if the string contains formatting information.
Definition: xistring.hxx:57
void SetLevel(SCSIZE nIndex, sal_uInt8 nVal, bool bCollapsed)
Definition: exctools.cxx:75
XclAddress maFirst
Definition: xladdress.hxx:60
void Defrowheight2()
Definition: impop.cxx:594
std::shared_ptr< T > make_shared(Args &&...args)
XclImpObjectManager & GetObjectManager() const
Returns the drawing object manager.
Definition: xiroot.cxx:194
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:278
void Ixfe()
Definition: impop.cxx:631
SCTAB nBdshtTab
Definition: imp_op.hxx:114
void HideColRange(SCCOL nCol1, SCCOL nCol2)
Definition: colrowst.cxx:91
RootData & GetOldRoot() const
Returns old RootData struct.
Definition: xlroot.hxx:137
Accessor class to ScDocument.
ScfUInt32Vec maSheetOffsets
Definition: imp_op.hxx:95
static void SetToDocument(ScDocumentImport &rDoc, const ScAddress &rPos, const XclImpRoot &rRoot, const XclImpString &rString, sal_uInt16 nXFIndex)
Definition: xihelper.cxx:223
XclImpColRowSettings * pColRowBuff
Definition: imp_op.hxx:102
#define TWIPS_PER_CHAR
Definition: global.hxx:89
void Olesize()
Definition: impop.cxx:939
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
Definition: document.cxx:901
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xiroot.hxx:132
void ReadNumber()
Definition: impop.cxx:298
void DocProtect()
Definition: impop.cxx:610
void SetMerge(SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2)
Inserts a complete merged cell range.
Definition: xistyle.cxx:1973
void SetButtonMode(bool bRightOrUnder)
Definition: exctools.cxx:147
void Externname25()
Definition: impop.cxx:553
static void ApplyPatternForBiff2CellFormat(const XclImpRoot &rRoot, const ScAddress &rScPos, sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3)
Converts formatting information from BIFF2 cell record data directly.
Definition: xistyle.cxx:1423
BiffTyp
Definition: flttypes.hxx:23
virtual ~ImportTyp()
Definition: impop.cxx:81
XclImpPageSettings & GetPageSettings() const
Returns the page settings of the current sheet.
Definition: xiroot.cxx:248
Provides functions to convert Excel cell addresses to Calc cell addresses.
Definition: xihelper.hxx:42
void Array25()
Definition: impop.cxx:498
void ReadWinProtect(XclImpStream &rStrm)
document windows properties protection flag
Definition: xicontent.cxx:1271
SC_DLLPUBLIC void CheckLinkFormulaNeedingCheck(const ScTokenArray &rCode)
Check token array and set link check if ocDde/ocWebservice is contained.
Definition: documen8.cxx:1152
void ReadFileSharing()
Definition: impop.cxx:161
XclImpOutlineBfrRef mxRowOutlineBuff
Definition: imp_op.hxx:70
XclImpOutlineBuffer * pColOutlineBuff
Definition: imp_op.hxx:100
SC_DLLPUBLIC bool RenameTab(SCTAB nTab, const OUString &rName, bool bExternalDocument=false)
Definition: document.cxx:853
void SetXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index.
Definition: xistyle.cxx:1920
MS Excel 4.0.
Definition: xlconst.hxx:35
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
#define SAL_MAX_UINT16
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
Definition: xlroot.cxx:299
const OUString & GetDocUrl() const
Returns the document URL of the imported/exported file.
Definition: xlroot.hxx:170
static bool IsFuzzing()
void Rec1904()
Definition: impop.cxx:538
int nCount
ScDocument * pD
Definition: imp_op.hxx:47
void Bof3()
Definition: impop.cxx:979
rtl_TextEncoding eQuellChar
Definition: imp_op.hxx:46
void SetLookUpColRowNames(bool bVal)
Definition: docoptio.hxx:53
void SetIgnoreCase(bool bVal)
Definition: docoptio.hxx:59
virtual void PostDocLoad()
Definition: impop.cxx:1233
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
Definition: document.cxx:191
SCTAB Tab() const
Definition: address.hxx:271
const sal_uInt8 EXC_BOOLERR_BOOL
Definition: xltable.hxx:57
void TraceInvalidRow(sal_uInt32 nRow, sal_uInt32 nMaxrow)
Definition: xltracer.cxx:55
XclImpXFBuffer & GetXFBuffer() const
Returns the cell formatting attributes buffer.
Definition: xiroot.cxx:156
ImportExcel(XclImpRootData &rImpData, SvStream &rStrm)
Definition: impop.cxx:85
virtual ~XclImpOutlineDataBuffer() override
Definition: impop.cxx:1358
ScRefAddress aRefRowCell
Definition: paramisc.hxx:52
void SetNeedNumberFormat(bool bVal)
void ReadLabel()
Definition: impop.cxx:315
void TableOp()
Definition: impop.cxx:1045
void SetSrcCharSet(rtl_TextEncoding eNew)
Definition: document.hxx:2050
void DisableDecryption()
Switches usage of current decryption algorithm off.
Definition: xistream.hxx:335
long GetCharWidth() const
Returns the width of the '0' character (default font) for the current printer (twips).
Definition: xlroot.hxx:156
ImportTyp(ScDocument *, rtl_TextEncoding eSrc)
Definition: impop.cxx:75
const XclFontData & GetAppFontData() const
Returns the application font data of this file, needed i.e.
Definition: xistyle.hxx:169
std::unique_ptr< ScRangeListTabs > pPrintTitles
Definition: root.hxx:59
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
Definition: documen3.cxx:1904
void setMatrixCells(const ScRange &rRange, const ScTokenArray &rArray, formula::FormulaGrammar::Grammar eGrammar)
void WrapReference(const ScAddress &rPos, SCCOL nMaxCol, SCROW nMaxRow)
Definition: token.cxx:5175
bool mbBiff2HasXfs
Definition: imp_op.hxx:119
ScExtTabSettings & GetOrCreateTabSettings(SCTAB nTab)
Definition: scextopt.cxx:190
SC_DLLPUBLIC void SetVisibleTab(SCTAB nTab)
Definition: document.hxx:860
ScFormulaCell * mpCell
Definition: imp_op.hxx:84
void ReadPasswordHash(XclImpStream &rStrm)
Definition: xicontent.cxx:1276
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:438
void Read(XclImpStream &rStrm, bool bCol16Bit=true)
Definition: xladdress.cxx:46
Parameter for data table aka multiple operations.
Definition: paramisc.hxx:46
void SetBlankXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for blank cells.
Definition: xistyle.cxx:1925
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:36
void SetDefWidth(sal_uInt16 nDefWidth, bool bStdWidthRec=false)
Definition: colrowst.cxx:50
void Window1()
Definition: impop.cxx:390
void SetWidthRange(SCCOL nCol1, SCCOL nCol2, sal_uInt16 nWidth)
Definition: colrowst.cxx:65
void Shrfmla()
Definition: impop.cxx:802
static double GetDoubleFromRK(sal_Int32 nRKValue)
GUID of file moniker (HLINK record).
Definition: xltools.cxx:95
void Mulblank()
Definition: impop.cxx:882
std::unique_ptr< ExcelToSc > pFormConv
Visible range if embedded.
Definition: imp_op.hxx:98
void Bof5()
Definition: impop.cxx:1150
ScExtDocOptions & GetExtDocOptions() const
Returns the extended document options.
Definition: xlroot.cxx:421
Extended settings for the document, used in import/export filters.
Definition: scextopt.hxx:28
sal_Int16 SCCOL
Definition: types.hxx:22
ScModelObj * GetDocModelObj() const
Returns the object model of the Calc document.
Definition: xlroot.cxx:288
double ReadDouble()
Definition: xistream.cxx:702
SC_DLLPUBLIC void SetViewOptions(const ScViewOptions &rOpt)
Definition: documen3.cxx:1924
void Eof()
Definition: impop.cxx:440
SC_DLLPUBLIC void CreateValidTabName(OUString &rName) const
Definition: document.cxx:392
XclImpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xiroot.cxx:119
void SetDate(sal_uInt16 nD, sal_uInt16 nM, sal_Int16 nY)
Definition: docoptio.hxx:69
ScRefAddress aRefFormulaCell
Definition: paramisc.hxx:50
void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
void SetUILanguage(LanguageType eLang)
Sets the UI language, i.e.
Definition: xlroot.hxx:251
void SetDocLanguage(LanguageType eLang)
Sets the document language.
Definition: xlroot.hxx:249
bool bTabTruncated
Definition: imp_op.hxx:116
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
void Hideobj()
Definition: impop.cxx:756
void FinalizeTable()
Is called when import filter stops importing a single sheet (all BIFF versions).
Definition: xiroot.cxx:111
const SCROW EXC_MAXROW8
Definition: xlconst.hxx:66
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
XclImpOutlineBfrRef mxColOutlineBuff
Definition: imp_op.hxx:69
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
#define LANGUAGE_DONTKNOW
void ReadWindow1(XclImpStream &rStrm)
Reads a WINDOW1 record.
Definition: xiview.cxx:39
const sal_uInt16 EXC_ROW_COLLAPSED
Definition: xltable.hxx:83
const sal_uInt16 EXC_ID4_FORMULA
Definition: xltable.hxx:63
sal_uInt16 mnCol
Definition: xladdress.hxx:32
void Rstring()
Definition: impop.cxx:899
void SetRowDefXF(SCROW nScRow, sal_uInt16 nXFIndex)
Inserts a new XF index for all cells in a row.
Definition: xistyle.cxx:1935
void SetTextEncoding(rtl_TextEncoding eTextEnc)
Sets the text encoding to import/export byte strings.
Definition: xlroot.cxx:201
A 2D cell address struct with Excel column and row indexes.
Definition: xladdress.hxx:30
SC_DLLPUBLIC void AddPrintRange(SCTAB nTab, const ScRange &rNew)
Adds a new print ranges.
Definition: document.cxx:6312
const ScExtTabSettings * GetTabSettings(SCTAB nTab) const
Definition: scextopt.cxx:180
bool IsValid() const
Definition: address.hxx:547
void setTableOpCells(const ScRange &rRange, const ScTabOpParam &rParam)
sal_uInt16 ReaduInt16()
Definition: xistream.cxx:648
void ReadDocProtect(XclImpStream &rStrm)
document structure protection flag
Definition: xicontent.cxx:1266
Extended settings for a sheet, used in import/export filters.
Definition: scextopt.hxx:48
void SetHeight(SCROW nRow, sal_uInt16 nHeight)
Definition: colrowst.cxx:112
void EnableDecryption(bool bEnable=true)
Switches usage of current decryption algorithm on/off.
Definition: xistream.cxx:521
SCCOL Col() const
Definition: address.hxx:267
XclTracer & GetTracer() const
Returns the filter tracer.
Definition: xlroot.cxx:426
SC_DLLPUBLIC void SetRepeatRowRange(SCTAB nTab, std::unique_ptr< ScRange > pNew)
Definition: document.cxx:6330
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:160
SC_DLLPUBLIC void EnsureTable(SCTAB nTab)
Definition: documen2.cxx:537
void Defrowheight345()
Definition: impop.cxx:1030
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
Definition: documen3.cxx:1918
void SetFitToPages(bool bFitToPages)
Sets or clears the fit-to-pages setting (contained in WSBOOL record).
Definition: xipage.hxx:61
sal_uInt16 ReadXFIndex(const ScAddress &rScPos, bool bBiff2)
Definition: impop.cxx:182
void ReadBlank()
Definition: impop.cxx:267
XclImpXF * GetXF(sal_uInt16 nXFIndex)
Returns the object that stores all contents of an XF record.
Definition: xistyle.hxx:496
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: document.hxx:877
sal_uInt16 GetColCount() const
Definition: xladdress.hxx:72
void NewTable()
Definition: impop.cxx:1191
std::unique_ptr< XclImpOutlineListBuffer > pOutlineListBuffer
Definition: imp_op.hxx:105
std::size_t GetRecLeft()
Returns remaining data size of the whole record without record headers.
Definition: xistream.cxx:581
void SetCodePage(sal_uInt16 nCodePage)
Sets a code page read from a CODEPAGE record for byte string import.
Definition: xiroot.cxx:89
void setFormulaCell(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr)
sal_Int32 SCROW
Definition: types.hxx:18
const sal_uInt16 EXC_TABLEOP_ROW
Definition: xltable.hxx:129
const sal_uInt16 EXC_WSBOOL_ROWBELOW
Definition: xlconst.hxx:190
void ReadPasswordHash(XclImpStream &rStrm, SCTAB nTab)
Definition: xicontent.cxx:1363
const sal_uInt16 EXC_ID2_BLANK
Definition: xltable.hxx:37
bool ValidRow(SCROW nRow) const
Definition: document.hxx:876
OUString ReadByteString(bool b16BitLen)
Reads 8/16 bit string length, character array and returns the string.
Definition: xistream.cxx:954
SC_DLLPUBLIC void SetDocOptions(const ScDocOptions &rOpt)
Definition: documen3.cxx:1910
void SetBoolXF(const ScAddress &rScPos, sal_uInt16 nXFIndex)
Inserts a new XF index for boolean cells.
Definition: xistyle.cxx:1930
void Cellmerging()
Definition: impop.cxx:922
void SetLevelRange(SCSIZE nF, SCSIZE nL, sal_uInt8 nVal, bool bCollapsed)
Definition: exctools.cxx:135
ScRange maScOleSize
Definition: imp_op.hxx:96
std::unique_ptr< ExtNameBuff > pExtNameBuff
Definition: root.hxx:52
static sal_uInt16 GetScColumnWidth(sal_uInt16 nXclWidth, long nScCharWidth)
Returns the Calc column width (twips) for the passed Excel width.
Definition: xltools.cxx:303
#define SAL_WARN_IF(condition, area, stream)
void WinProtection()
Definition: impop.cxx:464
void Ignore(std::size_t nBytes)
Seeks forward inside the current record.
Definition: xistream.cxx:795
void DocPasssword()
Definition: impop.cxx:618
unsigned char sal_uInt8
sal_uInt8 ReaduInt8()
Definition: xistream.cxx:616
void IncCurrScTab()
Increases the current Calc sheet index by 1.
Definition: xlroot.hxx:260
const sal_uInt16 EXC_ID2_BOOLERR
Definition: xltable.hxx:54
void Mulrk()
Definition: impop.cxx:860
void SetResultDouble(double n)
For import only: set a double result.
XclImpRoot * pIR
Definition: root.hxx:65
XclImpColRowSettRef mxColRowBuff
Definition: imp_op.hxx:71
void Array34()
Definition: impop.cxx:997
OUString aName
ScRefAddress aRefColCell
Definition: paramisc.hxx:53
XclImpOutlineBuffer * pRowOutlineBuff
Definition: imp_op.hxx:101
XclImpFontBuffer & GetFontBuffer() const
Returns the font buffer.
Definition: xiroot.cxx:146
void HideCol(SCCOL nCol)
Definition: colrowst.cxx:83
Always use UCS-2 characters (default: try to compress). BIFF8 only.
void Finalize()
Sets the view settings at the document.
Definition: xiview.cxx:63
Store and manage shared formula tokens.
Definition: namebuff.hxx:61
void * p
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
const sal_uInt16 EXC_COLINFO_HIDDEN
Definition: xltable.hxx:143
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:140
sal_Int16 mnLastRefIdx
Definition: imp_op.hxx:110
const sal_uInt16 EXC_ROW_XFMASK
Definition: xltable.hxx:89
bool ConvertRange(ScRange &rScRange, const XclRange &rXclRange, SCTAB nScTab1, SCTAB nScTab2, bool bWarn)
Converts the passed Excel cell range to a Calc cell range.
Definition: xihelper.cxx:101
XclImpOutlineBuffer * GetColOutline() const
Definition: imp_op.hxx:61
void Colinfo()
Definition: impop.cxx:655
ExcelToSc * pFmlaConverter
Definition: root.hxx:53
SC_DLLPUBLIC void SetPrintEntireSheet(SCTAB nTab)
Marks the specified sheet to be printed completely.
Definition: document.cxx:6318
void SetLastFormula(SCCOL nCol, SCROW nRow, double fVal, sal_uInt16 nXF, ScFormulaCell *pCell)
False = mbBiff2HasXfs is undetermined yet.
Definition: impop.cxx:142
const ScAddress & GetScMaxPos() const
Returns the highest possible cell address in a Calc document.
Definition: xlroot.hxx:242
void SetHybridDouble(double n)
For import only: set a double result.
void Bof4()
Definition: impop.cxx:1133
void TracePrintRange()
Definition: xltracer.cxx:67
XclImpDocViewSettings & GetDocViewSettings() const
Returns the view settings of the entire document.
Definition: xiroot.cxx:253
ScVObjMode
Definition: global.hxx:376
bool ValidColRow(SCCOL nCol, SCROW nRow, SCCOL nMaxCol, SCROW nMaxRow)
Definition: address.hxx:115
bool ValidRow(SCROW nRow, SCROW nMaxRow)
Definition: address.hxx:99
void ReadInteger()
Definition: impop.cxx:281
#define SAL_WARN(area, stream)
void Codepage()
Definition: impop.cxx:626
virtual void EndSheet()
Definition: impop.cxx:1178
const SCCOL EXC_MAXCOL8
Definition: xlconst.hxx:65
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:283
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
Definition: document.cxx:168
void SheetPassword()
Definition: impop.cxx:447
ScRefAddress aRefFormulaEnd
Definition: paramisc.hxx:51
SC_DLLPUBLIC void SetExtDocOptions(std::unique_ptr< ScExtDocOptions > pNewOptions)
Definition: documen3.cxx:1986
void setNumericCell(const ScAddress &rPos, double fVal)
void Wsbool()
Definition: impop.cxx:685
sal_uInt16 mnLastRecId
Current XF identifier from IXFE record.
Definition: imp_op.hxx:112
XclImpStream & aIn
Definition: imp_op.hxx:93
const sal_uInt16 EXC_WSBOOL_COLBELOW
Definition: xlconst.hxx:191
const sal_uInt16 EXC_COLINFO_COLLAPSED
Definition: xltable.hxx:145
BiffTyp eDateiTyp
Definition: root.hxx:49
XclImpColRowSettings * pColRowBuff
Definition: root.hxx:54
void SetDefaultXF(SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex)
Definition: colrowst.cxx:166
void InitializeTable(SCTAB nScTab)
Is called when import filter starts importing a single sheet (all BIFF versions). ...
Definition: xiroot.cxx:95
bool mbBiff2HasXfsValid
Select XF formatting or direct formatting in BIFF2.
Definition: imp_op.hxx:120
Access to global data from other classes.
Definition: xiroot.hxx:126
const sal_uInt16 EXC_WSBOOL_FITTOPAGE
Definition: xlconst.hxx:192
sal_uInt32 ReaduInt32()
Definition: xistream.cxx:684
XclImpSheetProtectBuffer & GetSheetProtectBuffer() const
Returns the sheet protection options of the current sheet.
Definition: xiroot.cxx:236
This class represents an unformatted or formatted string and provides importing from stream...
Definition: xistring.hxx:31
void ReadBoolErr()
Definition: impop.cxx:345
XclImpDocProtectBuffer & GetDocProtectBuffer() const
Returns the document protection options.
Definition: xiroot.cxx:242
sal_uInt16 mnIxfeIndex
Definition: imp_op.hxx:111
std::unique_ptr< ExtSheetBuffer > pExtSheetBuff
Definition: root.hxx:50
SfxMedium & GetMedium() const
Returns the medium to import from.
Definition: xlroot.hxx:168
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(176)
void ReadDimensions()
Definition: impop.cxx:224
A 2D cell range address struct with Excel column and row indexes.
Definition: xladdress.hxx:58
sal_Int16 SCTAB
Definition: types.hxx:23
static const double fExcToTwips
Definition: imp_op.hxx:88
void DefColWidth()
Definition: impop.cxx:636
void ReadRk()
Definition: impop.cxx:373
LastFormulaMapType maLastFormulaCells
Definition: imp_op.hxx:107
sal_Int16 nValue
SCTAB mnDisplTab
Index of displayed sheet.
Definition: scextopt.hxx:33
XclImpOutlineDataBuffer(const XclImpRoot &rRoot, SCTAB nScTab)
Definition: impop.cxx:1349
const sal_uInt16 EXC_ID2_NUMBER
Definition: xltable.hxx:44
ScDocument & getDoc()
static void DecodeUrl(OUString &rUrl, OUString &rTabName, bool &rbSameWb, const XclImpRoot &rRoot, const OUString &rEncodedUrl)
Decodes an encoded external document URL with optional sheet name.
Definition: xihelper.cxx:603