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