LibreOffice Module sc (master)  1
excform8.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 <excform.hxx>
21 
22 #include <document.hxx>
23 #include <documentimport.hxx>
24 #include <xltracer.hxx>
25 #include <xistream.hxx>
26 #include <xihelper.hxx>
27 #include <xilink.hxx>
28 #include <xiname.hxx>
29 
30 #include <externalrefmgr.hxx>
31 
32 #include <cstring>
33 
34 #include <o3tl/safeint.hxx>
35 
36 using ::std::vector;
37 
38 namespace {
39 
46 bool extractFilePath(const OUString& rUrl, OUString& rPath)
47 {
48  const char* prefix = "Excel.Sheet.8\3";
49  size_t nPrefixLen = ::std::strlen(prefix);
50 
51  sal_Int32 n = rUrl.getLength();
52  if (n <= static_cast<sal_Int32>(nPrefixLen))
53  // needs to have the specified prefix.
54  return false;
55 
56  OUStringBuffer aBuf;
57  const sal_Unicode* p = rUrl.getStr();
58  for (size_t i = 0; i < o3tl::make_unsigned(n); ++i, ++p)
59  {
60  if (i < nPrefixLen)
61  {
62  sal_Unicode pc = static_cast<sal_Unicode>(*prefix++);
63  if (pc != *p)
64  return false;
65 
66  continue;
67  }
68  aBuf.append(*p);
69  }
70 
71  rPath = aBuf.makeStringAndClear();
72  return true;
73 }
74 
75 }
76 
78  mnFileId(0), mbExternal(false)
79 {
80 }
81 
83  ExcelToSc( rRoot ),
84  rLinkMan( rRoot.GetLinkManager() )
85 {
86 }
87 
89 {
90 }
91 
92 bool ExcelToSc8::GetExternalFileIdFromXti( sal_uInt16 nIxti, sal_uInt16& rFileId ) const
93 {
94  const OUString* pFileUrl = rLinkMan.GetSupbookUrl(nIxti);
95  if (!pFileUrl || pFileUrl->isEmpty() || !GetDocShell())
96  return false;
97 
98  OUString aFileUrl = ScGlobal::GetAbsDocName(*pFileUrl, GetDocShell());
100  rFileId = pRefMgr->getExternalFileId(aFileUrl);
101 
102  return true;
103 }
104 
105 bool ExcelToSc8::Read3DTabReference( sal_uInt16 nIxti, SCTAB& rFirstTab, SCTAB& rLastTab, ExternalTabInfo& rExtInfo )
106 {
107  rFirstTab = rLastTab = 0;
108  rExtInfo.mbExternal = !rLinkMan.IsSelfRef(nIxti);
109  bool bSuccess = rLinkMan.GetScTabRange(rFirstTab, rLastTab, nIxti);
110  if (!bSuccess)
111  return false;
112 
113  if (!rExtInfo.mbExternal)
114  // This is internal reference. Stop here.
115  return true;
116 
117  rExtInfo.maTabName = rLinkMan.GetSupbookTabName(nIxti, rFirstTab);
118  return GetExternalFileIdFromXti(nIxti, rExtInfo.mnFileId);
119 }
120 
121 bool ExcelToSc8::HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtName, ExternalTabInfo& rExtInfo)
122 {
123  const OUString* pUrl = rLinkMan.GetSupbookUrl(nXtiIndex);
124  if (!pUrl)
125  return false;
126 
127  OUString aPath;
128  if (!extractFilePath(*pUrl, aPath))
129  // file path extraction failed.
130  return false;
131 
132  OUString aFileUrl = ScGlobal::GetAbsDocName(aPath, GetDocShell());
133  return rExtName.CreateOleData(GetDoc(), aFileUrl, rExtInfo.mnFileId, rExtInfo.maTabName, rExtInfo.maRange);
134 }
135 
136 // if bAllowArrays is false stream seeks to first byte after <nFormulaLen>
137 // otherwise it will seek to the first byte past additional content after <nFormulaLen>
138 ConvErr ExcelToSc8::Convert( std::unique_ptr<ScTokenArray>& rpTokArray, XclImpStream& aIn, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT )
139 {
140  bool bError = false;
141  bool bArrayFormula = false;
142  TokenId nBuf0;
143  const bool bCondFormat = eFT == FT_CondFormat;
144  const bool bRangeName = eFT == FT_RangeName;
145  const bool bRangeNameOrCond = bRangeName || bCondFormat;
146  const bool bSharedFormula = eFT == FT_SharedFormula;
147  const bool bRNorSF = bRangeNameOrCond || bSharedFormula;
148 
149  ScSingleRefData aSRD;
150  ScComplexRefData aCRD;
151  ExtensionTypeVec aExtensions;
152 
153  if( nFormulaLen == 0 )
154  {
155  aPool.Store( "-/-" );
156  aPool >> aStack;
157  rpTokArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
158  return ConvErr::OK;
159  }
160 
161  std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen;
162 
163  while( (aIn.GetRecPos() < nEndPos) && !bError )
164  {
165  sal_uInt8 nOp = aIn.ReaduInt8();
166 
167  // always reset flags
168  aSRD.InitFlags();
169  aCRD.InitFlags();
170 
171  switch( nOp ) // book page:
172  { // SDK4 SDK5
173  case 0x01: // Array Formula [325 ]
174  // Array Formula or Shared Formula [ 277]
175  case 0x02: // Data Table [325 277]
176  aIn.Ignore( 4 );
177 
178  bArrayFormula = true;
179  break;
180  case 0x03: // Addition [312 264]
181  aStack >> nBuf0;
182  aPool << aStack << ocAdd << nBuf0;
183  aPool >> aStack;
184  break;
185  case 0x04: // Subtraction [313 264]
186  // SECOND-TOP minus TOP
187  aStack >> nBuf0;
188  aPool << aStack << ocSub << nBuf0;
189  aPool >> aStack;
190  break;
191  case 0x05: // Multiplication [313 264]
192  aStack >> nBuf0;
193  aPool << aStack << ocMul << nBuf0;
194  aPool >> aStack;
195  break;
196  case 0x06: // Division [313 264]
197  // divide TOP by SECOND-TOP
198  aStack >> nBuf0;
199  aPool << aStack << ocDiv << nBuf0;
200  aPool >> aStack;
201  break;
202  case 0x07: // Exponentiation [313 265]
203  // raise SECOND-TOP to power of TOP
204  aStack >> nBuf0;
205  aPool << aStack << ocPow << nBuf0;
206  aPool >> aStack;
207  break;
208  case 0x08: // Concatenation [313 265]
209  // append TOP to SECOND-TOP
210  aStack >> nBuf0;
211  aPool << aStack << ocAmpersand << nBuf0;
212  aPool >> aStack;
213  break;
214  case 0x09: // Less Than [313 265]
215  // SECOND-TOP < TOP
216  aStack >> nBuf0;
217  aPool << aStack << ocLess << nBuf0;
218  aPool >> aStack;
219  break;
220  case 0x0A: // Less Than or Equal [313 265]
221  // SECOND-TOP <= TOP
222  aStack >> nBuf0;
223  aPool << aStack << ocLessEqual << nBuf0;
224  aPool >> aStack;
225  break;
226  case 0x0B: // Equal [313 265]
227  // SECOND-TOP == TOP
228  aStack >> nBuf0;
229  aPool << aStack << ocEqual << nBuf0;
230  aPool >> aStack;
231  break;
232  case 0x0C: // Greater Than or Equal [313 265]
233  // SECOND-TOP >= TOP
234  aStack >> nBuf0;
235  aPool << aStack << ocGreaterEqual << nBuf0;
236  aPool >> aStack;
237  break;
238  case 0x0D: // Greater Than [313 265]
239  // SECOND-TOP > TOP
240  aStack >> nBuf0;
241  aPool << aStack << ocGreater << nBuf0;
242  aPool >> aStack;
243  break;
244  case 0x0E: // Not Equal [313 265]
245  // SECOND-TOP != TOP
246  aStack >> nBuf0;
247  aPool << aStack << ocNotEqual << nBuf0;
248  aPool >> aStack;
249  break;
250  case 0x0F: // Intersection [314 265]
251  aStack >> nBuf0;
252  aPool << aStack << ocIntersect << nBuf0;
253  aPool >> aStack;
254  break;
255  case 0x10: // Union [314 265]
256  // ocSep instead of 'ocUnion'
257  aStack >> nBuf0;
258  aPool << aStack << ocSep << nBuf0;
259  // doesn't fit exactly, but is more Excel-like
260  aPool >> aStack;
261  break;
262  case 0x11: // Range [314 265]
263  aStack >> nBuf0;
264  aPool << aStack << ocRange << nBuf0;
265  aPool >> aStack;
266  break;
267  case 0x12: // Unary Plus [312 264]
268  aPool << ocAdd << aStack;
269  aPool >> aStack;
270  break;
271  case 0x13: // Unary Minus [312 264]
272  aPool << ocNegSub << aStack;
273  aPool >> aStack;
274  break;
275  case 0x14: // Percent Sign [312 264]
276  aPool << aStack << ocPercentSign;
277  aPool >> aStack;
278  break;
279  case 0x15: // Parenthesis [326 278]
280  aPool << ocOpen << aStack << ocClose;
281  aPool >> aStack;
282  break;
283  case 0x16: // Missing Argument [314 266]
284  aPool << ocMissing;
285  aPool >> aStack;
287  break;
288  case 0x17: // String Constant [314 266]
289  {
290  sal_uInt8 nLen = aIn.ReaduInt8(); // Why?
291  OUString aString = aIn.ReadUniString( nLen ); // reads Grbit even if nLen==0
292 
293  aStack << aPool.Store( aString );
294  break;
295  }
296  case 0x18: // natural language formula
297  {
298  sal_uInt8 nEptg;
299  sal_uInt16 nCol, nRow;
300  nEptg = aIn.ReaduInt8();
301  switch( nEptg )
302  { // name size ext type
303  case 0x01: // Lel 4 - err
304  aIn.Ignore( 4 );
305  aPool << ocBad;
306  aPool >> aStack;
307  break;
308  case 0x02: // Rw 4 - ref
309  case 0x03: // Col 4 - ref
310  case 0x06: // RwV 4 - val
311  case 0x07: // ColV 4 - val
312  {
313  nRow = aIn.ReaduInt16();
314  nCol = aIn.ReaduInt16();
315  ScAddress aAddr(static_cast<SCCOL>(nCol & 0xFF), static_cast<SCROW>(nRow), aEingPos.Tab());
316  aSRD.InitAddress(aAddr);
317 
318  if( nEptg == 0x02 || nEptg == 0x06 )
319  aSRD.SetRowRel(true);
320  else
321  aSRD.SetColRel(true);
322 
323  aSRD.SetAddress(GetDocImport().getDoc().GetSheetLimits(), aAddr, aEingPos);
324 
325  aStack << aPool.StoreNlf( aSRD );
326 
327  break;
328  }
329  case 0x0A: // Radical 13 - ref
330  {
331  nRow = aIn.ReaduInt16();
332  nCol = aIn.ReaduInt16();
333  aIn.Ignore( 9 );
334  ScAddress aAddr(static_cast<SCCOL>(nCol & 0xFF), static_cast<SCROW>(nRow), aEingPos.Tab());
335  aSRD.InitAddress(aAddr);
336  aSRD.SetColRel(true);
337  aSRD.SetAddress(GetDocImport().getDoc().GetSheetLimits(), aAddr, aEingPos);
338 
339  aStack << aPool.StoreNlf( aSRD );
340 
341  break;
342  }
343  case 0x0B: // RadicalS 13 x ref
344  aIn.Ignore( 13 );
345  aExtensions.push_back( EXTENSION_NLR );
346  aPool << ocBad;
347  aPool >> aStack;
348  break;
349  case 0x0C: // RwS 4 x ref
350  case 0x0D: // ColS 4 x ref
351  case 0x0E: // RwSV 4 x val
352  case 0x0F: // ColSV 4 x val
353  aIn.Ignore( 4 );
354  aExtensions.push_back( EXTENSION_NLR );
355  aPool << ocBad;
356  aPool >> aStack;
357  break;
358  case 0x10: // RadicalLel 4 - err
359  case 0x1D: // SxName 4 - val
360  aIn.Ignore( 4 );
361  aPool << ocBad;
362  aPool >> aStack;
363  break;
364  default:
365  aPool << ocBad;
366  aPool >> aStack;
367  }
368  }
369  break;
370  case 0x19: // Special Attribute [327 279]
371  {
372  sal_uInt16 nData(0), nFactor(0);
373 
374  sal_uInt8 nOpt = aIn.ReaduInt8();
375  nData = aIn.ReaduInt16();
376  nFactor = 2;
377 
378  if( nOpt & 0x04 )
379  {
380  // nFactor -> skip bytes or words AttrChoose
381  nData++;
382  aIn.Ignore(static_cast<std::size_t>(nData) * nFactor);
383  }
384  else if( nOpt & 0x10 ) // AttrSum
385  DoMulArgs( ocSum, 1 );
386  break;
387  }
388  case 0x1C: // Error Value [314 266]
389  {
390  sal_uInt8 nByte = aIn.ReaduInt8();
391 
392  DefTokenId eOc;
393  switch( nByte )
394  {
395  case EXC_ERR_NULL:
396  case EXC_ERR_DIV0:
397  case EXC_ERR_VALUE:
398  case EXC_ERR_REF:
399  case EXC_ERR_NAME:
400  case EXC_ERR_NUM: eOc = ocStop; break;
401  case EXC_ERR_NA: eOc = ocNotAvail; break;
402  default: eOc = ocNoName;
403  }
404  aPool << eOc;
405  if( eOc != ocStop )
406  aPool << ocOpen << ocClose;
407  aPool >> aStack;
408 
409  break;
410  }
411  case 0x1D: // Boolean [315 266]
412  {
413  sal_uInt8 nByte = aIn.ReaduInt8();
414  if( nByte == 0 )
415  aPool << ocFalse << ocOpen << ocClose;
416  else
417  aPool << ocTrue << ocOpen << ocClose;
418  aPool >> aStack;
419  break;
420  }
421  case 0x1E: // Integer [315 266]
422  {
423  sal_uInt16 nUINT16 = aIn.ReaduInt16();
424  aStack << aPool.Store( static_cast<double>(nUINT16) );
425  break;
426  }
427  case 0x1F: // Number [315 266]
428  {
429  double fDouble = aIn.ReadDouble();
430  aStack << aPool.Store( fDouble );
431  break;
432  }
433  case 0x40:
434  case 0x60:
435  case 0x20: // Array Constant [317 268]
436  {
437  aIn.Ignore( 7 );
438  if( bAllowArrays )
439  {
440  aStack << aPool.StoreMatrix();
441  aExtensions.push_back( EXTENSION_ARRAY );
442  }
443  else
444  {
445  aPool << ocBad;
446  aPool >> aStack;
447  }
448  break;
449  }
450  case 0x41:
451  case 0x61:
452  case 0x21: // Function, Fixed Number of Arguments [333 282]
453  {
454  sal_uInt16 nXclFunc;
455  nXclFunc = aIn.ReaduInt16();
456  if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) )
457  DoMulArgs( pFuncInfo->meOpCode, pFuncInfo->mnMaxParamCount );
458  else
459  DoMulArgs( ocNoName, 0 );
460  break;
461  }
462  case 0x42:
463  case 0x62:
464  case 0x22: // Function, Variable Number of Arg. [333 283]
465  {
466  sal_uInt16 nXclFunc;
468  nParamCount = aIn.ReaduInt8();
469  nXclFunc = aIn.ReaduInt16();
470  nParamCount &= 0x7F;
471  if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) )
472  DoMulArgs( pFuncInfo->meOpCode, nParamCount );
473  else
474  DoMulArgs( ocNoName, 0 );
475  break;
476  }
477  case 0x43:
478  case 0x63:
479  case 0x23: // Name [318 269]
480  {
481  sal_uInt16 nUINT16 = aIn.ReaduInt16();
482  aIn.Ignore( 2 );
483  const XclImpName* pName = GetNameManager().GetName( nUINT16 );
484  if (pName)
485  {
486  if (pName->IsMacro())
487  // user-defined macro name.
488  aStack << aPool.Store(ocMacro, pName->GetXclName());
489  else
490  aStack << aPool.StoreName(nUINT16, pName->IsGlobal() ? -1 : pName->GetScTab());
491  }
492  break;
493  }
494  case 0x44:
495  case 0x64:
496  case 0x24: // Cell Reference [319 270]
497  case 0x4A:
498  case 0x6A:
499  case 0x2A: // Deleted Cell Reference [323 273]
500  {
501  sal_uInt16 nCol, nRow;
502 
503  nRow = aIn.ReaduInt16();
504  nCol = aIn.ReaduInt16();
505 
506  aSRD.SetRelTab(0);
507  aSRD.SetFlag3D( bRangeName );
508 
509  ExcRelToScRel8( nRow, nCol, aSRD, bRangeNameOrCond );
510 
511  switch ( nOp )
512  {
513  case 0x4A:
514  case 0x6A:
515  case 0x2A: // Deleted Cell Reference [323 273]
516  // no information which part is deleted, set both
517  aSRD.SetColDeleted( true );
518  aSRD.SetRowDeleted( true );
519  }
520 
521  aStack << aPool.Store( aSRD );
522  break;
523  }
524  case 0x45:
525  case 0x65:
526  case 0x25: // Area Reference [320 270]
527  case 0x4B:
528  case 0x6B:
529  case 0x2B: // Deleted Area Reference [323 273]
530  {
531  sal_uInt16 nRowFirst, nRowLast;
532  sal_uInt16 nColFirst, nColLast;
533  ScSingleRefData &rSRef1 = aCRD.Ref1;
534  ScSingleRefData &rSRef2 = aCRD.Ref2;
535 
536  nRowFirst = aIn.ReaduInt16();
537  nRowLast = aIn.ReaduInt16();
538  nColFirst = aIn.ReaduInt16();
539  nColLast = aIn.ReaduInt16();
540 
541  rSRef1.SetRelTab(0);
542  rSRef2.SetRelTab(0);
543  rSRef1.SetFlag3D( bRangeName );
544  rSRef2.SetFlag3D( bRangeName );
545 
546  ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRangeNameOrCond );
547  ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRangeNameOrCond );
548 
549  if( IsComplColRange( nColFirst, nColLast ) )
550  SetComplCol( aCRD );
551  else if( IsComplRowRange( nRowFirst, nRowLast ) )
552  SetComplRow( aCRD );
553 
554  switch ( nOp )
555  {
556  case 0x4B:
557  case 0x6B:
558  case 0x2B: // Deleted Area Reference [323 273]
559  // no information which part is deleted, set all
560  rSRef1.SetColDeleted( true );
561  rSRef1.SetRowDeleted( true );
562  rSRef2.SetColDeleted( true );
563  rSRef2.SetRowDeleted( true );
564  }
565 
566  aStack << aPool.Store( aCRD );
567  break;
568  }
569  case 0x46:
570  case 0x66:
571  case 0x26: // Constant Reference Subexpression [321 271]
572  aExtensions.push_back( EXTENSION_MEMAREA );
573  aIn.Ignore( 6 ); // There isn't any more
574  break;
575  case 0x47:
576  case 0x67:
577  case 0x27: // Erroneous Constant Reference Subexpr. [322 272]
578  aIn.Ignore( 6 ); // There isn't any more
579  break;
580  case 0x48:
581  case 0x68:
582  case 0x28: // Incomplete Constant Reference Subexpr.[331 281]
583  aIn.Ignore( 6 ); // There isn't any more
584  break;
585  case 0x49:
586  case 0x69:
587  case 0x29: // Variable Reference Subexpression [331 281]
588  aIn.Ignore( 2 ); // There isn't any more
589  break;
590  case 0x4C:
591  case 0x6C:
592  case 0x2C: // Cell Reference Within a Name [323 ]
593  // Cell Reference Within a Shared Formula[ 273]
594  {
595  sal_uInt16 nRow, nCol;
596 
597  nRow = aIn.ReaduInt16();
598  nCol = aIn.ReaduInt16();
599 
600  aSRD.SetRelTab(0);
601  aSRD.SetFlag3D( bRangeName );
602 
603  ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
604 
605  aStack << aPool.Store( aSRD );
606  break;
607  }
608  case 0x4D:
609  case 0x6D:
610  case 0x2D: // Area Reference Within a Name [324 ]
611  { // Area Reference Within a Shared Formula[ 274]
612  sal_uInt16 nRowFirst, nRowLast;
613  sal_uInt16 nColFirst, nColLast;
614 
615  aCRD.Ref1.SetRelTab(0);
616  aCRD.Ref2.SetRelTab(0);
617  aCRD.Ref1.SetFlag3D( bRangeName );
618  aCRD.Ref2.SetFlag3D( bRangeName );
619 
620  nRowFirst = aIn.ReaduInt16();
621  nRowLast = aIn.ReaduInt16();
622  nColFirst = aIn.ReaduInt16();
623  nColLast = aIn.ReaduInt16();
624 
625  ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF );
626  ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRNorSF );
627 
628  bool bColRel = aCRD.Ref1.IsColRel() || aCRD.Ref2.IsColRel();
629  bool bRowRel = aCRD.Ref1.IsRowRel() || aCRD.Ref2.IsRowRel();
630 
631  if( !bColRel && IsComplColRange( nColFirst, nColLast ) )
632  SetComplCol( aCRD );
633  else if( !bRowRel && IsComplRowRange( nRowFirst, nRowLast ) )
634  SetComplRow( aCRD );
635 
636  aStack << aPool.Store( aCRD );
637  break;
638  }
639  case 0x4E:
640  case 0x6E:
641  case 0x2E: // Reference Subexpression Within a Name [332 282]
642  aIn.Ignore( 2 ); // There isn't any more
643  break;
644  case 0x4F:
645  case 0x6F:
646  case 0x2F: // Incomplete Reference Subexpression... [332 282]
647  aIn.Ignore( 2 ); // There isn't any more
648  break;
649  case 0x58:
650  case 0x78:
651  case 0x38: // Command-Equivalent Function [333 ]
652  {
653  OUString aString = "COMM_EQU_FUNC";
654  sal_uInt8 nByte = aIn.ReaduInt8();
655  aString += OUString::number( nByte );
656  nByte = aIn.ReaduInt8();
657  aStack << aPool.Store( aString );
658  DoMulArgs( ocPush, nByte + 1 );
659  break;
660  }
661  case 0x59:
662  case 0x79:
663  case 0x39: // Name or External Name [ 275]
664  {
665  sal_uInt16 nXtiIndex, nNameIdx;
666  nXtiIndex = aIn.ReaduInt16();
667  nNameIdx = aIn.ReaduInt16();
668  aIn.Ignore( 2 );
669 
670  if( rLinkMan.IsSelfRef( nXtiIndex ) )
671  {
672  // internal defined name with explicit sheet, i.e.: =Sheet1!AnyName
673  const XclImpName* pName = GetNameManager().GetName( nNameIdx );
674  if (pName)
675  {
676  if (pName->GetScRangeData())
677  aStack << aPool.StoreName( nNameIdx, pName->IsGlobal() ? -1 : pName->GetScTab());
678  else
679  aStack << aPool.Store(ocMacro, pName->GetXclName());
680  }
681  }
682  else if( const XclImpExtName* pExtName = rLinkMan.GetExternName( nXtiIndex, nNameIdx ) )
683  {
684  switch( pExtName->GetType() )
685  {
686  case xlExtName:
687  {
688  /* FIXME: enable this code for #i4385# once
689  * external name reference can be stored in ODF,
690  * which remains to be done for #i3740#. Until then
691  * create a #NAME? token. */
692 #if 1
693  sal_uInt16 nFileId;
694  if (!GetExternalFileIdFromXti(nXtiIndex, nFileId) || !pExtName->HasFormulaTokens())
695  {
696  aStack << aPool.Store(ocNoName, pExtName->GetName());
697  break;
698  }
699 
700  aStack << aPool.StoreExtName(nFileId, pExtName->GetName());
701  pExtName->CreateExtNameData(GetDoc(), nFileId);
702 #else
703  aStack << aPool.Store( ocNoName, pExtName->GetName() );
704 #endif
705  }
706  break;
707 
708  case xlExtAddIn:
709  {
710  aStack << aPool.Store( ocExternal, pExtName->GetName() );
711  }
712  break;
713 
714  case xlExtDDE:
715  {
716  OUString aApplic, aTopic;
717  if( rLinkMan.GetLinkData( aApplic, aTopic, nXtiIndex ) )
718  {
719  TokenId nPar1 = aPool.Store( aApplic );
720  TokenId nPar2 = aPool.Store( aTopic );
721  nBuf0 = aPool.Store( pExtName->GetName() );
722  aPool << ocDde << ocOpen << nPar1 << ocSep << nPar2 << ocSep
723  << nBuf0 << ocClose;
724  aPool >> aStack;
725  pExtName->CreateDdeData( GetDoc(), aApplic, aTopic );
727  }
728  }
729  break;
730 
731  case xlExtEuroConvert:
732  {
733  aStack << aPool.Store( ocEuroConvert, OUString() );
734  }
735  break;
736  case xlExtOLE:
737  {
738  ExternalTabInfo aExtInfo;
739  if (HandleOleLink(nXtiIndex, *pExtName, aExtInfo))
740  {
741  if (aExtInfo.maRange.aStart == aExtInfo.maRange.aEnd)
742  {
743  // single cell
744  aSRD.InitAddress(aExtInfo.maRange.aStart);
745  aStack << aPool.StoreExtRef(aExtInfo.mnFileId, aExtInfo.maTabName, aSRD);
746  }
747  else
748  {
749  // range
750  aCRD.InitRange(aExtInfo.maRange);
751  aStack << aPool.StoreExtRef(aExtInfo.mnFileId, aExtInfo.maTabName, aCRD);
752  }
753  }
754  else
755  aStack << aPool.Store(ocNoName, pExtName->GetName());
756  }
757  break;
758  default:
759  {
760  aPool << ocBad;
761  aPool >> aStack;
762  }
763  }
764  }
765  else
766  {
767  aPool << ocBad;
768  aPool >> aStack;
769  }
770  break;
771  }
772  case 0x5A:
773  case 0x7A:
774  case 0x3A: // 3-D Cell Reference [ 275]
775  case 0x5C:
776  case 0x7C:
777  case 0x3C: // Deleted 3-D Cell Reference [ 277]
778  {
779  sal_uInt16 nIxti, nRw, nGrbitCol;
780  SCTAB nTabFirst, nTabLast;
781 
782  nIxti = aIn.ReaduInt16();
783  nRw = aIn.ReaduInt16();
784  nGrbitCol = aIn.ReaduInt16();
785 
786  ExternalTabInfo aExtInfo;
787  if (!Read3DTabReference(nIxti, nTabFirst, nTabLast, aExtInfo))
788  {
789  aPool << ocBad;
790  aPool >> aStack;
791  break;
792  }
793 
794  aSRD.SetAbsTab(nTabFirst);
795  aSRD.SetFlag3D(true);
796 
797  ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeNameOrCond );
798 
799  switch ( nOp )
800  {
801  case 0x5C:
802  case 0x7C:
803  case 0x3C: // Deleted 3-D Cell Reference [ 277]
804  // no information which part is deleted, set both
805  aSRD.SetColDeleted( true );
806  aSRD.SetRowDeleted( true );
807  }
808 
809  if (aExtInfo.mbExternal)
810  {
811  // nTabFirst and nTabLast are the indices of the referenced
812  // sheets in the SUPBOOK record, hence do not represent
813  // the actual indices of the original sheets since the
814  // SUPBOOK record only stores referenced sheets and skips
815  // the ones that are not referenced.
816 
817  if (nTabLast != nTabFirst)
818  {
819  aCRD.Ref1 = aCRD.Ref2 = aSRD;
820  aCRD.Ref2.SetAbsTab(nTabLast);
821  aStack << aPool.StoreExtRef(aExtInfo.mnFileId, aExtInfo.maTabName, aCRD);
822  }
823  else
824  aStack << aPool.StoreExtRef(aExtInfo.mnFileId, aExtInfo.maTabName, aSRD);
825  }
826  else
827  {
828  if ( !ValidTab(nTabFirst))
829  aSRD.SetTabDeleted( true );
830 
831  if( nTabLast != nTabFirst )
832  {
833  aCRD.Ref1 = aCRD.Ref2 = aSRD;
834  aCRD.Ref2.SetAbsTab(nTabLast);
835  aCRD.Ref2.SetTabDeleted( !ValidTab(nTabLast) );
836  aStack << aPool.Store( aCRD );
837  }
838  else
839  aStack << aPool.Store( aSRD );
840  }
841  break;
842  }
843  case 0x5B:
844  case 0x7B:
845  case 0x3B: // 3-D Area Reference [ 276]
846  case 0x5D:
847  case 0x7D:
848  case 0x3D: // Deleted 3-D Area Reference [ 277]
849  {
850  sal_uInt16 nIxti, nRw1, nGrbitCol1, nRw2, nGrbitCol2;
851  SCTAB nTabFirst, nTabLast;
852  nIxti = aIn.ReaduInt16();
853  nRw1 = aIn.ReaduInt16();
854  nRw2 = aIn.ReaduInt16();
855  nGrbitCol1 = aIn.ReaduInt16();
856  nGrbitCol2 = aIn.ReaduInt16();
857 
858  ExternalTabInfo aExtInfo;
859  if (!Read3DTabReference(nIxti, nTabFirst, nTabLast, aExtInfo))
860  {
861  aPool << ocBad;
862  aPool >> aStack;
863  break;
864  }
865  ScSingleRefData &rR1 = aCRD.Ref1;
866  ScSingleRefData &rR2 = aCRD.Ref2;
867 
868  rR1.SetAbsTab(nTabFirst);
869  rR2.SetAbsTab(nTabLast);
870  rR1.SetFlag3D(true);
871  rR2.SetFlag3D( nTabFirst != nTabLast );
872 
873  ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeNameOrCond );
874  ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeNameOrCond );
875 
876  if( IsComplColRange( nGrbitCol1, nGrbitCol2 ) )
877  SetComplCol( aCRD );
878  else if( IsComplRowRange( nRw1, nRw2 ) )
879  SetComplRow( aCRD );
880 
881  switch ( nOp )
882  {
883  case 0x5D:
884  case 0x7D:
885  case 0x3D: // Deleted 3-D Area Reference [ 277]
886  // no information which part is deleted, set all
887  rR1.SetColDeleted( true );
888  rR1.SetRowDeleted( true );
889  rR2.SetColDeleted( true );
890  rR2.SetRowDeleted( true );
891  }
892 
893  if (aExtInfo.mbExternal)
894  {
895  aStack << aPool.StoreExtRef(aExtInfo.mnFileId, aExtInfo.maTabName, aCRD);
896  }
897  else
898  {
899  if ( !ValidTab(nTabFirst) )
900  rR1.SetTabDeleted( true );
901  if ( !ValidTab(nTabLast) )
902  rR2.SetTabDeleted( true );
903 
904  aStack << aPool.Store( aCRD );
905  }
906  break;
907  }
908  default:
909  bError = true;
910  }
911  bError |= !aIn.IsValid();
912  }
913 
914  ConvErr eRet;
915 
916  if( bError )
917  {
918  aPool << ocBad;
919  aPool >> aStack;
920  rpTokArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
921  eRet = ConvErr::Ni;
922  }
923  else if( aIn.GetRecPos() != nEndPos )
924  {
925  aPool << ocBad;
926  aPool >> aStack;
927  rpTokArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
928  eRet = ConvErr::Count;
929  }
930  else if( bArrayFormula )
931  {
932  rpTokArray = nullptr;
933  eRet = ConvErr::OK;
934  }
935  else
936  {
937  rpTokArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
938  eRet = ConvErr::OK;
939  }
940 
941  aIn.Seek( nEndPos );
942 
943  if( eRet == ConvErr::OK)
944  ReadExtensions( aExtensions, aIn );
945 
946  return eRet;
947 }
948 
949 // stream seeks to first byte after <nFormulaLen>
950 ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, std::size_t nFormulaLen,
951  SCTAB nTab, const FORMULA_TYPE eFT )
952 {
953  sal_uInt8 nOp, nLen;
954  bool bError = false;
955  const bool bCondFormat = eFT == FT_CondFormat;
956  const bool bRangeName = eFT == FT_RangeName || bCondFormat;
957  const bool bSharedFormula = eFT == FT_SharedFormula;
958  const bool bRNorSF = bRangeName || bSharedFormula;
959 
960  ScSingleRefData aSRD;
961  ScComplexRefData aCRD;
962 
963  if( nFormulaLen == 0 )
964  return ConvErr::OK;
965 
966  std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen;
967 
968  while( (aIn.GetRecPos() < nEndPos) && !bError )
969  {
970  nOp = aIn.ReaduInt8();
971 
972  // always reset flags
973  aSRD.InitFlags();
974  aCRD.InitFlags();
975 
976  switch( nOp ) // book page:
977  { // SDK4 SDK5
978  case 0x01: // Array Formula [325 ]
979  // Array Formula or Shared Formula [ 277]
980  aIn.Ignore( 4 );
981  break;
982  case 0x02: // Data Table [325 277]
983  aIn.Ignore( 4 );
984  break;
985  case 0x03: // Addition [312 264]
986  case 0x04: // Subtraction [313 264]
987  case 0x05: // Multiplication [313 264]
988  case 0x06: // Division [313 264]
989  case 0x07: // Exponetiation [313 265]
990  case 0x08: // Concatenation [313 265]
991  case 0x09: // Less Than [313 265]
992  case 0x0A: // Less Than or Equal [313 265]
993  case 0x0B: // Equal [313 265]
994  case 0x0C: // Greater Than or Equal [313 265]
995  case 0x0D: // Greater Than [313 265]
996  case 0x0E: // Not Equal [313 265]
997  case 0x0F: // Intersection [314 265]
998  case 0x10: // Union [314 265]
999  case 0x11: // Range [314 265]
1000  case 0x12: // Unary Plus [312 264]
1001  case 0x13: // Unary Minus [312 264]
1002  case 0x14: // Percent Sign [312 264]
1003  case 0x15: // Parenthesis [326 278]
1004  case 0x16: // Missing Argument [314 266]
1005  break;
1006  case 0x17: // String Constant [314 266]
1007  nLen = aIn.ReaduInt8(); // Why?
1008 
1009  aIn.IgnoreUniString( nLen ); // reads Grbit even if nLen==0
1010  break;
1011  case 0x19: // Special Attribute [327 279]
1012  {
1013  sal_uInt16 nData(0), nFactor(0);
1014 
1015  sal_uInt8 nOpt = aIn.ReaduInt8();
1016  nData = aIn.ReaduInt16();
1017  nFactor = 2;
1018 
1019  if( nOpt & 0x04 )
1020  {
1021  // nFactor -> skip bytes or words AttrChoose
1022  ++nData;
1023  aIn.Ignore(static_cast<std::size_t>(nData) * nFactor);
1024  }
1025  }
1026  break;
1027  case 0x1C: // Error Value [314 266]
1028  case 0x1D: // Boolean [315 266]
1029  aIn.Ignore( 1 );
1030  break;
1031  case 0x1E: // Integer [315 266]
1032  aIn.Ignore( 2 );
1033  break;
1034  case 0x1F: // Number [315 266]
1035  aIn.Ignore( 8 );
1036  break;
1037  case 0x40:
1038  case 0x60:
1039  case 0x20: // Array Constant [317 268]
1040  aIn.Ignore( 7 );
1041  break;
1042  case 0x41:
1043  case 0x61:
1044  case 0x21: // Function, Fixed Number of Arguments [333 282]
1045  aIn.Ignore( 2 );
1046  break;
1047  case 0x42:
1048  case 0x62:
1049  case 0x22: // Function, Variable Number of Arg. [333 283]
1050  aIn.Ignore( 3 );
1051  break;
1052  case 0x43:
1053  case 0x63:
1054  case 0x23: // Name [318 269]
1055  aIn.Ignore( 4 );
1056  break;
1057  case 0x44:
1058  case 0x64:
1059  case 0x24: // Cell Reference [319 270]
1060  {
1061  sal_uInt16 nCol, nRow;
1062 
1063  nRow = aIn.ReaduInt16();
1064  nCol = aIn.ReaduInt16();
1065 
1066  aSRD.SetRelTab(0);
1067  aSRD.SetFlag3D( bRangeName && !bCondFormat );
1068 
1069  ExcRelToScRel8( nRow, nCol, aSRD, bRangeName );
1070 
1071  rRangeList.Append(aSRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1072  }
1073  break;
1074  case 0x45:
1075  case 0x65:
1076  case 0x25: // Area Reference [320 270]
1077  {
1078  sal_uInt16 nRowFirst, nRowLast;
1079  sal_uInt16 nColFirst, nColLast;
1080  ScSingleRefData &rSRef1 = aCRD.Ref1;
1081  ScSingleRefData &rSRef2 = aCRD.Ref2;
1082 
1083  nRowFirst = aIn.ReaduInt16();
1084  nRowLast = aIn.ReaduInt16();
1085  nColFirst = aIn.ReaduInt16();
1086  nColLast = aIn.ReaduInt16();
1087 
1088  rSRef1.SetRelTab(0);
1089  rSRef2.SetRelTab(0);
1090  rSRef1.SetFlag3D( bRangeName && !bCondFormat );
1091  rSRef2.SetFlag3D( bRangeName && !bCondFormat );
1092 
1093  ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRangeName );
1094  ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRangeName );
1095 
1096  if( IsComplColRange( nColFirst, nColLast ) )
1097  SetComplCol( aCRD );
1098  else if( IsComplRowRange( nRowFirst, nRowLast ) )
1099  SetComplRow( aCRD );
1100 
1101  rRangeList.Append(aCRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1102  }
1103  break;
1104  case 0x46:
1105  case 0x66:
1106  case 0x26: // Constant Reference Subexpression [321 271]
1107  case 0x47:
1108  case 0x67:
1109  case 0x27: // Erroneous Constant Reference Subexpr. [322 272]
1110  case 0x48:
1111  case 0x68:
1112  case 0x28: // Incomplete Constant Reference Subexpr.[331 281]
1113  aIn.Ignore( 6 ); // There isn't any more
1114  break;
1115  case 0x49:
1116  case 0x69:
1117  case 0x29: // Variable Reference Subexpression [331 281]
1118  aIn.Ignore( 2 ); // There isn't any more
1119  break;
1120  case 0x4A:
1121  case 0x6A:
1122  case 0x2A: // Deleted Cell Reference [323 273]
1123  aIn.Ignore( 3 );
1124  break;
1125  case 0x4B:
1126  case 0x6B:
1127  case 0x2B: // Deleted Area Reference [323 273]
1128  aIn.Ignore( 6 );
1129  break;
1130  case 0x4C:
1131  case 0x6C:
1132  case 0x2C: // Cell Reference Within a Name [323 ]
1133  // Cell Reference Within a Shared Formula[ 273]
1134  {
1135  sal_uInt16 nRow, nCol;
1136 
1137  nRow = aIn.ReaduInt16();
1138  nCol = aIn.ReaduInt16();
1139 
1140  aSRD.SetRelTab(0);
1141  aSRD.SetFlag3D( bRangeName );
1142 
1143  ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
1144 
1145  rRangeList.Append(aSRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1146  }
1147  break;
1148  case 0x4D:
1149  case 0x6D:
1150  case 0x2D: // Area Reference Within a Name [324 ]
1151  { // Area Reference Within a Shared Formula[ 274]
1152  sal_uInt16 nRowFirst, nRowLast;
1153  sal_uInt16 nColFirst, nColLast;
1154 
1155  aCRD.Ref1.SetRelTab(0);
1156  aCRD.Ref2.SetRelTab(0);
1157  aCRD.Ref1.SetFlag3D( bRangeName );
1158  aCRD.Ref2.SetFlag3D( bRangeName );
1159 
1160  nRowFirst = aIn.ReaduInt16();
1161  nRowLast = aIn.ReaduInt16();
1162  nColFirst = aIn.ReaduInt16( );
1163  nColLast = aIn.ReaduInt16();
1164 
1165  ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF );
1166  ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRNorSF );
1167 
1168  if( IsComplColRange( nColFirst, nColLast ) )
1169  SetComplCol( aCRD );
1170  else if( IsComplRowRange( nRowFirst, nRowLast ) )
1171  SetComplRow( aCRD );
1172 
1173  rRangeList.Append(aCRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1174  }
1175  break;
1176  case 0x4E:
1177  case 0x6E:
1178  case 0x2E: // Reference Subexpression Within a Name [332 282]
1179  case 0x4F:
1180  case 0x6F:
1181  case 0x2F: // Incomplete Reference Subexpression... [332 282]
1182  case 0x58:
1183  case 0x78:
1184  case 0x38: // Command-Equivalent Function [333 ]
1185  aIn.Ignore( 2 );
1186  break;
1187  case 0x59:
1188  case 0x79:
1189  case 0x39: // Name or External Name [ 275]
1190  aIn.Ignore( 24 );
1191  break;
1192  case 0x5A:
1193  case 0x7A:
1194  case 0x3A: // 3-D Cell Reference [ 275]
1195  {
1196  sal_uInt16 nIxti, nRw, nGrbitCol;
1197 
1198  nIxti = aIn.ReaduInt16();
1199  nRw = aIn.ReaduInt16();
1200  nGrbitCol = aIn.ReaduInt16();
1201 
1202  SCTAB nFirstScTab, nLastScTab;
1203  if( rLinkMan.GetScTabRange( nFirstScTab, nLastScTab, nIxti ) )
1204  {
1205  aSRD.SetAbsTab(nFirstScTab);
1206  aSRD.SetFlag3D(true);
1207 
1208  ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeName );
1209 
1210  if( nFirstScTab != nLastScTab )
1211  {
1212  aCRD.Ref1 = aSRD;
1213  aCRD.Ref2 = aSRD;
1214  aCRD.Ref2.SetAbsTab(nLastScTab);
1215  rRangeList.Append(aCRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1216  }
1217  else
1218  rRangeList.Append(aSRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1219  }
1220  }
1221  break;
1222  case 0x5B:
1223  case 0x7B:
1224  case 0x3B: // 3-D Area Reference [ 276]
1225  {
1226  sal_uInt16 nIxti, nRw1, nGrbitCol1, nRw2, nGrbitCol2;
1227 
1228  nIxti = aIn.ReaduInt16();
1229  nRw1 = aIn.ReaduInt16();
1230  nRw2 = aIn.ReaduInt16();
1231  nGrbitCol1 = aIn.ReaduInt16();
1232  nGrbitCol2 = aIn.ReaduInt16();
1233 
1234  SCTAB nFirstScTab, nLastScTab;
1235  if( rLinkMan.GetScTabRange( nFirstScTab, nLastScTab, nIxti ) )
1236  {
1237  ScSingleRefData &rR1 = aCRD.Ref1;
1238  ScSingleRefData &rR2 = aCRD.Ref2;
1239 
1240  rR1.SetAbsTab(nFirstScTab);
1241  rR2.SetAbsTab(nLastScTab);
1242  rR1.SetFlag3D(true);
1243  rR2.SetFlag3D( nFirstScTab != nLastScTab );
1244 
1245  ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeName );
1246  ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeName );
1247 
1248  if( IsComplColRange( nGrbitCol1, nGrbitCol2 ) )
1249  SetComplCol( aCRD );
1250  else if( IsComplRowRange( nRw1, nRw2 ) )
1251  SetComplRow( aCRD );
1252 
1253  rRangeList.Append(aCRD.toAbs(&GetDocImport().getDoc(), aEingPos), nTab);
1254  }
1255  }
1256  break;
1257  case 0x5C:
1258  case 0x7C:
1259  case 0x3C: // Deleted 3-D Cell Reference [ 277]
1260  aIn.Ignore( 6 );
1261  break;
1262  case 0x5D:
1263  case 0x7D:
1264  case 0x3D: // Deleted 3-D Area Reference [ 277]
1265  aIn.Ignore( 10 );
1266  break;
1267  default:
1268  bError = true;
1269  }
1270  bError |= !aIn.IsValid();
1271  }
1272 
1273  ConvErr eRet;
1274 
1275  if( bError )
1276  eRet = ConvErr::Ni;
1277  else if( aIn.GetRecPos() != nEndPos )
1278  eRet = ConvErr::Count;
1279  else
1280  eRet = ConvErr::OK;
1281 
1282  aIn.Seek( nEndPos );
1283  return eRet;
1284 }
1285 
1286 void ExcelToSc8::ConvertExternName( std::unique_ptr<ScTokenArray>& rpArray, XclImpStream& rStrm, std::size_t nFormulaLen,
1287  const OUString& rUrl, const vector<OUString>& rTabNames )
1288 {
1289  if( !GetDocShell() )
1290  return;
1291 
1292  OUString aFileUrl = ScGlobal::GetAbsDocName(rUrl, GetDocShell());
1293 
1294  sal_uInt8 nOp, nByte;
1295  bool bError = false;
1296 
1297  ScSingleRefData aSRD;
1298  ScComplexRefData aCRD;
1299 
1300  if (nFormulaLen == 0)
1301  {
1302  aPool.Store("-/-");
1303  aPool >> aStack;
1304  rpArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
1305  return;
1306  }
1307 
1309  sal_uInt16 nFileId = pRefMgr->getExternalFileId(aFileUrl);
1310  sal_uInt16 nTabCount = static_cast< sal_uInt16 >( rTabNames.size() );
1311 
1312  std::size_t nEndPos = rStrm.GetRecPos() + nFormulaLen;
1313 
1314  while( (rStrm.GetRecPos() < nEndPos) && !bError )
1315  {
1316  nOp = rStrm.ReaduInt8();
1317 
1318  // always reset flags
1319  aSRD.InitFlags();
1320  aCRD.InitFlags();
1321 
1322  switch( nOp )
1323  {
1324  case 0x1C: // Error Value
1325  {
1326  nByte = rStrm.ReaduInt8();
1327  DefTokenId eOc;
1328  switch( nByte )
1329  {
1330  case EXC_ERR_NULL:
1331  case EXC_ERR_DIV0:
1332  case EXC_ERR_VALUE:
1333  case EXC_ERR_REF:
1334  case EXC_ERR_NAME:
1335  case EXC_ERR_NUM: eOc = ocStop; break;
1336  case EXC_ERR_NA: eOc = ocNotAvail; break;
1337  default: eOc = ocNoName;
1338  }
1339  aPool << eOc;
1340  if( eOc != ocStop )
1341  aPool << ocOpen << ocClose;
1342  aPool >> aStack;
1343  }
1344  break;
1345  case 0x3A:
1346  {
1347  // cell reference in external range name
1348  sal_uInt16 nExtTab1, nExtTab2, nRow, nGrbitCol;
1349  nExtTab1 = rStrm.ReaduInt16();
1350  nExtTab2 = rStrm.ReaduInt16();
1351  nRow = rStrm.ReaduInt16();
1352  nGrbitCol = rStrm.ReaduInt16();
1353  if (nExtTab1 >= nTabCount || nExtTab2 >= nTabCount)
1354  {
1355  bError = true;
1356  break;
1357  }
1358 
1359  aSRD.SetAbsTab(nExtTab1);
1360  aSRD.SetFlag3D(true);
1361  ExcRelToScRel8(nRow, nGrbitCol, aSRD, true);
1362  aCRD.Ref1 = aCRD.Ref2 = aSRD;
1363  OUString aTabName = rTabNames[nExtTab1];
1364 
1365  if (nExtTab1 == nExtTab2)
1366  {
1367  // single cell reference
1368  aStack << aPool.StoreExtRef(nFileId, aTabName, aSRD);
1369  }
1370  else
1371  {
1372  // area reference
1373  aCRD.Ref2.SetAbsTab(nExtTab2);
1374  aStack << aPool.StoreExtRef(nFileId, aTabName, aCRD);
1375  }
1376  }
1377  break;
1378  case 0x3B:
1379  {
1380  // area reference
1381  sal_uInt16 nExtTab1, nExtTab2, nRow1, nRow2, nGrbitCol1, nGrbitCol2;
1382  nExtTab1 = rStrm.ReaduInt16();
1383  nExtTab2 = rStrm.ReaduInt16();
1384  nRow1 = rStrm.ReaduInt16();
1385  nRow2 = rStrm.ReaduInt16();
1386  nGrbitCol1 = rStrm.ReaduInt16();
1387  nGrbitCol2 = rStrm.ReaduInt16();
1388 
1389  if (nExtTab1 >= nTabCount || nExtTab2 >= nTabCount)
1390  {
1391  bError = true;
1392  break;
1393  }
1394 
1395  ScSingleRefData& rR1 = aCRD.Ref1;
1396  ScSingleRefData& rR2 = aCRD.Ref2;
1397 
1398  rR1.SetAbsTab(nExtTab1);
1399  rR1.SetFlag3D(true);
1400  ExcRelToScRel8(nRow1, nGrbitCol1, rR1, true);
1401 
1402  rR2.SetAbsTab(nExtTab2);
1403  rR2.SetFlag3D(true);
1404  ExcRelToScRel8(nRow2, nGrbitCol2, rR2, true);
1405 
1406  OUString aTabName = rTabNames[nExtTab1];
1407  aStack << aPool.StoreExtRef(nFileId, aTabName, aCRD);
1408  }
1409  break;
1410  default:
1411  bError = true;
1412  }
1413  bError |= !rStrm.IsValid();
1414  }
1415 
1416  if( bError )
1417  {
1418  aPool << ocBad;
1419  aPool >> aStack;
1420  rpArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
1421  }
1422  else if( rStrm.GetRecPos() != nEndPos )
1423  {
1424  aPool << ocBad;
1425  aPool >> aStack;
1426  rpArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
1427  }
1428  else
1429  {
1430  rpArray = aPool.GetTokenArray( &GetDocImport().getDoc(), aStack.Get());
1431  }
1432 
1433  rStrm.Seek(nEndPos);
1434 }
1435 
1436 void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData &rSRD, const bool bName )
1437 {
1438  const bool bColRel = ( nC & 0x4000 ) != 0;
1439  const bool bRowRel = ( nC & 0x8000 ) != 0;
1440  const sal_uInt8 nCol = static_cast<sal_uInt8>(nC);
1441 
1442  if( bName )
1443  {
1444  // C O L
1445  if( bColRel )
1446  {
1447  SCCOL nRelCol = static_cast<sal_Int8>(nC);
1448  sal_Int16 nDiff = aEingPos.Col() + nRelCol;
1449  if ( nDiff < 0)
1450  {
1451  // relative column references wrap around
1452  nRelCol = static_cast<sal_Int16>(256 + static_cast<int>(nRelCol));
1453  }
1454  rSRD.SetRelCol(nRelCol);
1455  }
1456  else
1457  rSRD.SetAbsCol(static_cast<SCCOL>(nCol));
1458 
1459  // R O W
1460  if( bRowRel )
1461  {
1462  SCROW nRelRow = static_cast<sal_Int16>(nRow);
1463  sal_Int32 nDiff = aEingPos.Row() + nRelRow;
1464  if (nDiff < 0)
1465  {
1466  // relative row references wrap around
1467  nRelRow = 65536 + nRelRow;
1468  }
1469  rSRD.SetRelRow(nRelRow);
1470  }
1471  else
1472  rSRD.SetAbsRow(std::min( static_cast<SCROW>(nRow), GetDoc().MaxRow()));
1473  }
1474  else
1475  {
1476  // C O L
1477  if ( bColRel )
1478  rSRD.SetRelCol(static_cast<SCCOL>(nCol) - aEingPos.Col());
1479  else
1480  rSRD.SetAbsCol(nCol);
1481 
1482  // R O W
1483  if ( bRowRel )
1484  rSRD.SetRelRow(static_cast<SCROW>(nRow) - aEingPos.Row());
1485  else
1486  rSRD.SetAbsRow(nRow);
1487  }
1488 }
1489 
1490 // stream seeks to first byte after <nLen>
1491 void ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, std::size_t nLen )
1492 {
1493  sal_uInt8 nOp;
1494  sal_uInt16 nRow1, nRow2, nCol1, nCol2;
1495  SCTAB nTab1, nTab2;
1496  sal_uInt16 nIxti;
1497 
1498  std::size_t nSeek;
1499 
1500  std::size_t nEndPos = aIn.GetRecPos() + nLen;
1501 
1502  while( aIn.IsValid() && (aIn.GetRecPos() < nEndPos) )
1503  {
1504  nOp = aIn.ReaduInt8();
1505  nSeek = 0;
1506 
1507  switch( nOp )
1508  {
1509  case 0x44:
1510  case 0x64:
1511  case 0x24: // Cell Reference [319 270]
1512  case 0x4C:
1513  case 0x6C:
1514  case 0x2C: // Cell Reference Within a Name [323 ]
1515  // Cell Reference Within a Shared Formula[ 273]
1516  nRow1 = aIn.ReaduInt16();
1517  nCol1 = aIn.ReaduInt16();
1518 
1519  nRow2 = nRow1;
1520  nCol2 = nCol1;
1521  nTab1 = nTab2 = GetCurrScTab();
1522  goto _common;
1523  case 0x45:
1524  case 0x65:
1525  case 0x25: // Area Reference [320 270]
1526  case 0x4D:
1527  case 0x6D:
1528  case 0x2D: // Area Reference Within a Name [324 ]
1529  // Area Reference Within a Shared Formula[ 274]
1530  nRow1 = aIn.ReaduInt16();
1531  nRow2 = aIn.ReaduInt16();
1532  nCol1 = aIn.ReaduInt16();
1533  nCol2 = aIn.ReaduInt16();
1534 
1535  nTab1 = nTab2 = GetCurrScTab();
1536  goto _common;
1537  case 0x5A:
1538  case 0x7A:
1539  case 0x3A: // 3-D Cell Reference [ 275]
1540  nIxti = aIn.ReaduInt16();
1541  nRow1 = aIn.ReaduInt16();
1542  nCol1 = aIn.ReaduInt16();
1543 
1544  nRow2 = nRow1;
1545  nCol2 = nCol1;
1546 
1547  goto _3d_common;
1548  case 0x5B:
1549  case 0x7B:
1550  case 0x3B: // 3-D Area Reference [ 276]
1551  nIxti = aIn.ReaduInt16();
1552  nRow1 = aIn.ReaduInt16();
1553  nRow2 = aIn.ReaduInt16();
1554  nCol1 = aIn.ReaduInt16();
1555  nCol2 = aIn.ReaduInt16();
1556 
1557  _3d_common:
1558  // skip references to deleted sheets
1559  if( !rLinkMan.GetScTabRange( nTab1, nTab2, nIxti ) || !ValidTab( nTab1 ) || !ValidTab( nTab2 ) )
1560  break;
1561 
1562  goto _common;
1563  _common:
1564  // do not check abs/rel flags, linked controls have set them!
1565  {
1566  ScRange aScRange;
1567  nCol1 &= 0x3FFF;
1568  nCol2 &= 0x3FFF;
1569  if( GetAddressConverter().ConvertRange( aScRange, XclRange( nCol1, nRow1, nCol2, nRow2 ), nTab1, nTab2, true ) )
1570  r.push_back( aScRange );
1571  }
1572  break;
1573  case 0x1C: // Error Value [314 266]
1574  case 0x1D: // Boolean [315 266]
1575  nSeek = 1;
1576  break;
1577  case 0x1E: // Integer [315 266]
1578  case 0x41:
1579  case 0x61:
1580  case 0x21: // Function, Fixed Number of Arguments [333 282]
1581  case 0x49:
1582  case 0x69:
1583  case 0x29: // Variable Reference Subexpression [331 281]
1584  case 0x4E:
1585  case 0x6E:
1586  case 0x2E: // Reference Subexpression Within a Name [332 282]
1587  case 0x4F:
1588  case 0x6F:
1589  case 0x2F: // Incomplete Reference Subexpression... [332 282]
1590  case 0x58:
1591  case 0x78:
1592  case 0x38: // Command-Equivalent Function [333 ]
1593  nSeek = 2;
1594  break;
1595  case 0x42:
1596  case 0x62:
1597  case 0x22: // Function, Variable Number of Arg. [333 283]
1598  nSeek = 3;
1599  break;
1600  case 0x01: // Array Formula [325 ]
1601  case 0x02: // Data Table [325 277]
1602  case 0x43:
1603  case 0x63:
1604  case 0x23: // Name [318 269]
1605  case 0x4A:
1606  case 0x6A:
1607  case 0x2A: // Deleted Cell Reference [323 273]
1608  nSeek = 4;
1609  break;
1610  case 0x46:
1611  case 0x66:
1612  case 0x26: // Constant Reference Subexpression [321 271]
1613  case 0x47:
1614  case 0x67:
1615  case 0x27: // Erroneous Constant Reference Subexpr. [322 272]
1616  case 0x48:
1617  case 0x68:
1618  case 0x28: // Incomplete Constant Reference Subexpr.[331 281]
1619  case 0x5C:
1620  case 0x7C:
1621  case 0x3C: // Deleted 3-D Cell Reference [ 277]
1622  case 0x59:
1623  case 0x79:
1624  case 0x39: // Name or External Name [ 275]
1625  nSeek = 6;
1626  break;
1627  case 0x40:
1628  case 0x60:
1629  case 0x20: // Array Constant [317 268]
1630  nSeek = 7;
1631  break;
1632  case 0x1F: // Number [315 266]
1633  case 0x4B:
1634  case 0x6B:
1635  case 0x2B: // Deleted Area Reference [323 273]
1636  nSeek = 8;
1637  break;
1638  case 0x5D:
1639  case 0x7D:
1640  case 0x3D: // Deleted 3-D Area Reference [ 277]
1641  nSeek = 10;
1642  break;
1643  case 0x17: // String Constant [314 266]
1644  {
1645  sal_uInt8 nStrLen;
1646  nStrLen = aIn.ReaduInt8();
1647  aIn.IgnoreUniString( nStrLen ); // reads Grbit even if nLen==0
1648  nSeek = 0;
1649  }
1650  break;
1651  case 0x19: // Special Attribute [327 279]
1652  {
1653  sal_uInt16 nData;
1654  sal_uInt8 nOpt;
1655  nOpt = aIn.ReaduInt8();
1656  nData = aIn.ReaduInt16();
1657  if( nOpt & 0x04 )
1658  {// nFactor -> skip bytes or words AttrChoose
1659  nData++;
1660  nSeek = nData * 2;
1661  }
1662  }
1663  break;
1664  }
1665 
1666  aIn.Ignore( nSeek );
1667  }
1668  aIn.Seek( nEndPos );
1669 }
1670 
1671 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ocStop
const sal_uInt8 EXC_ERR_NULL
DDE application-topic delimiter.
Definition: xlconst.hxx:105
virtual void ConvertExternName(std::unique_ptr< ScTokenArray > &rpArray, XclImpStream &rStrm, std::size_t nFormulaLen, const OUString &rUrl, const ::std::vector< OUString > &rTabNames) override
Definition: excform8.cxx:1286
const XclFunctionInfo * GetFuncInfoFromXclFunc(sal_uInt16 nXclFunc) const
Returns the function data for an Excel function index, or 0 on error.
Definition: xlformula.cxx:676
ScDocumentImport & GetDocImport()
Definition: xiroot.cxx:292
void Seek(std::size_t nPos)
Seeks absolute in record content to the specified position.
Definition: xistream.cxx:778
ScAddress aStart
Definition: address.hxx:500
bool GetExternalFileIdFromXti(sal_uInt16 nIxti, sal_uInt16 &rFileId) const
Definition: excform8.cxx:92
const sal_uInt8 EXC_ERR_NA
Definition: xlconst.hxx:111
std::size_t GetRecPos() const
Returns the position inside of the whole record content.
Definition: xistream.cxx:563
ConvErr
Definition: formel.hxx:40
SCROW Row() const
Definition: address.hxx:262
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
signed char sal_Int8
void InitFlags()
Definition: refdata.hxx:128
void SetRelCol(SCCOL nVal)
Definition: refdata.cxx:65
virtual ~ExcelToSc8() override
Definition: excform8.cxx:88
ocAmpersand
TokenId StoreExtName(sal_uInt16 nFileId, const OUString &rName)
Definition: tokstack.cxx:619
static bool IsComplColRange(const sal_uInt16 nCol1, const sal_uInt16 nCol2)
Definition: excform.hxx:83
::std::vector< ExtensionType > ExtensionTypeVec
Definition: excform.hxx:37
void SetRelTab(SCTAB nVal)
Definition: refdata.cxx:99
ocOpen
sal_Int64 n
bool IsValid() const
Returns record reading state: false = record overread.
Definition: xistream.hxx:352
aBuf
ocPercentSign
SC_DLLPUBLIC ScRange toAbs(ScSheetLimits &rLimits, const ScAddress &rPos) const
Definition: refdata.cxx:493
ocIntersect
ScAddress aEnd
Definition: address.hxx:501
void SetAbsRow(SCROW nVal)
Definition: refdata.cxx:76
sal_uInt16 getExternalFileId(const OUString &rFile)
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:278
void SetRowRel(bool bVal)
Definition: refdata.hxx:67
bool CreateOleData(ScDocument &rDoc, const OUString &rUrl, sal_uInt16 &rFileId, OUString &rTabName, ScRange &rRange) const
Create OLE link data.
Definition: xilink.cxx:471
bool IsMacro() const
Definition: xiname.hxx:58
const XclImpName * GetName(sal_uInt16 nXclNameIdx) const
Returns the defined name specified by its Excel index.
Definition: xiname.cxx:310
static bool IsComplRowRange(const sal_uInt16 nRow1, const sal_uInt16 nRow2)
Definition: excform.hxx:137
ScAddress aEingPos
Definition: formel.hxx:81
void SetRowDeleted(bool bVal)
Definition: refdata.cxx:115
sal_uInt16 sal_Unicode
void SetComplCol(ScComplexRefData &)
Definition: excform.cxx:1745
char sal_uInt16 & nParamCount
Definition: callform.cxx:54
ocNegSub
TokenId Store()
Definition: tokstack.hxx:404
const sal_uInt8 EXC_ERR_NUM
Definition: xlconst.hxx:110
SCTAB GetScTab() const
Definition: xiname.hxx:54
virtual bool Read3DTabReference(sal_uInt16 nIxti, SCTAB &rFirstTab, SCTAB &rLastTab, ExternalTabInfo &rExtInfo)
Definition: excform8.cxx:105
TokenId Get()
Definition: tokstack.hxx:281
bool GetScTabRange(SCTAB &rnFirstScTab, SCTAB &rnLastScTab, sal_uInt16 nXtiIndex) const
Returns the Calc sheet index range of the specified XTI entry.
Definition: xilink.cxx:931
OpCode
ocGreater
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
Definition: documen3.cxx:604
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1144
ocEqual
void SetColDeleted(bool bVal)
Definition: refdata.cxx:110
SCTAB Tab() const
Definition: address.hxx:271
bool IsColRel() const
Definition: refdata.hxx:66
TokenId StoreNlf(const ScSingleRefData &rTr)
Definition: tokstack.cxx:554
const sal_uInt8 EXC_ERR_REF
Definition: xlconst.hxx:108
ocSep
void SetRelRow(SCROW nVal)
Definition: refdata.cxx:82
ocDde
static SC_DLLPUBLIC OUString GetAbsDocName(const OUString &rFileName, const SfxObjectShell *pShell)
Definition: global2.cxx:284
void TraceFormulaMissingArg()
Definition: xltracer.cxx:91
sal_uInt16 char * pName
Definition: callform.cxx:58
Represents information for a spreadsheet function for import and export.
Definition: xlformula.hxx:311
int i
const sal_uInt8 EXC_ERR_VALUE
Definition: xlconst.hxx:107
void SetFlag3D(bool bVal)
Definition: refdata.hxx:90
Stores contents of an external name.
Definition: xilink.hxx:112
ocMul
void InitAddress(const ScAddress &rAdr)
InitAddress: InitFlags and set address.
Definition: refdata.cxx:27
sal_Int16 SCCOL
Definition: types.hxx:22
void IgnoreUniString(sal_uInt16 nChars, sal_uInt8 nFlags)
Ignores ext.
Definition: xistream.cxx:931
void SetAbsCol(SCCOL nVal)
Definition: refdata.cxx:59
ocPush
ocSub
double ReadDouble()
Definition: xistream.cxx:702
ocMissing
ScSingleRefData Ref1
Definition: refdata.hxx:125
XclImpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xiroot.cxx:119
const OUString & GetXclName() const
Definition: xiname.hxx:52
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
ocNotAvail
ScSingleRefData Ref2
Definition: refdata.hxx:126
void SetLinkFormulaNeedingCheck(bool bSet)
Definition: document.hxx:2124
ocExternal
ocBad
bool IsRowRel() const
Definition: refdata.hxx:68
const XclImpLinkManager & rLinkMan
Definition: excform.hxx:111
XclImpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xiroot.cxx:183
FORMULA_TYPE
Definition: formel.hxx:47
void SetComplRow(ScComplexRefData &)
Definition: excform.cxx:1755
void SetAbsTab(SCTAB nVal)
Definition: refdata.cxx:93
TokenId StoreMatrix()
Definition: tokstack.cxx:579
sal_uInt16 ReaduInt16()
Definition: xistream.cxx:648
ocLess
TokenId StoreName(sal_uInt16 nIndex, sal_Int16 nSheet)
Definition: tokstack.cxx:601
SCCOL Col() const
Definition: address.hxx:267
XclTracer & GetTracer() const
Returns the filter tracer.
Definition: xlroot.cxx:426
const XclImpExtName * GetExternName(sal_uInt16 nXtiIndex, sal_uInt16 nExtName) const
Returns the specified external name or 0 on error.
Definition: xilink.cxx:937
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:160
ocFalse
bool GetLinkData(OUString &rApplic, OUString &rTopic, sal_uInt16 nXtiIndex) const
Tries to decode the URL of the specified XTI entry to OLE or DDE link components. ...
Definition: xilink.cxx:952
TokenPool aPool
Definition: formel.hxx:79
ScAddress toAbs(ScSheetLimits &rLimits, const ScAddress &rPos) const
Definition: refdata.cxx:193
void ExcRelToScRel8(sal_uInt16 nRow, sal_uInt16 nCol, ScSingleRefData &, const bool bName)
Definition: excform8.cxx:1436
XclImpLinkManager & GetLinkManager() const
Returns the link manager.
Definition: xiroot.cxx:188
ocTrue
sal_Int32 SCROW
Definition: types.hxx:18
OUString ReadUniString(sal_uInt16 nChars, sal_uInt8 nFlags)
Reads ext.
Definition: xistream.cxx:886
bool HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName &rExtName, ExternalTabInfo &rExtInfo)
Definition: excform8.cxx:121
void SetAddress(ScSheetLimits &rLimits, const ScAddress &rAddr, const ScAddress &rPos)
Definition: refdata.cxx:213
void DoMulArgs(DefTokenId eId, sal_uInt8 nNumArgs)
Definition: excform.cxx:1532
ocAdd
ocNoName
virtual void GetAbsRefs(ScRangeList &rRangeList, XclImpStream &rStrm, std::size_t nLen) override
Definition: excform8.cxx:1491
void Ignore(std::size_t nBytes)
Seeks forward inside the current record.
Definition: xistream.cxx:795
unsigned char sal_uInt8
const sal_uInt8 EXC_ERR_NAME
Definition: xlconst.hxx:109
ocEuroConvert
TokenStack aStack
Definition: formel.hxx:80
sal_uInt8 ReaduInt8()
Definition: xistream.cxx:616
void InitFlags()
No default ctor, because used in ScRawToken union, set InitFlags!
Definition: refdata.hxx:55
void InitRange(const ScRange &rRange)
Definition: refdata.hxx:130
const sal_uInt8 EXC_ERR_DIV0
Definition: xlconst.hxx:106
void Append(const ScAddress &aSRD, SCTAB nTab)
Definition: frmbase.cxx:32
void ReadExtensions(const ExtensionTypeVec &rExtensions, XclImpStream &aIn)
Definition: excform.cxx:1892
bool IsGlobal() const
Definition: xiname.hxx:56
void * p
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
TokenId StoreExtRef(sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
Definition: tokstack.cxx:637
virtual ConvErr Convert(std::unique_ptr< ScTokenArray > &rpTokArray, XclImpStream &rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT=FT_CellFormula) override
Definition: excform8.cxx:138
ocDiv
const OUString * GetSupbookUrl(sal_uInt16 nXtiIndex) const
Definition: xilink.cxx:942
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
std::unique_ptr< ScTokenArray > GetTokenArray(const ScDocument *pDoc, const TokenId &rId)
Definition: tokstack.hxx:411
ocPow
ocMacro
ocNotEqual
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:283
ocLessEqual
This class is used to import record oriented streams.
Definition: xistream.hxx:278
void SetTabDeleted(bool bVal)
Definition: refdata.cxx:120
bool IsSelfRef(sal_uInt16 nXtiIndex) const
Returns true, if the specified XTI entry contains an internal reference.
Definition: xilink.cxx:926
ocRange
const ScRangeData * GetScRangeData() const
Definition: xiname.hxx:55
Access to global data from other classes.
Definition: xiroot.hxx:126
void SetColRel(bool bVal)
Definition: refdata.hxx:65
ExcelToSc8(XclImpRoot &rRoot)
Definition: excform8.cxx:82
Represents a defined name.
Definition: xiname.hxx:34
ocClose
bool ValidTab(SCTAB nTab)
Definition: address.hxx:105
XclFunctionProvider maFuncProv
Definition: excform.hxx:41
A 2D cell range address struct with Excel column and row indexes.
Definition: xladdress.hxx:58
sal_Int16 SCTAB
Definition: types.hxx:23
const OUString & GetSupbookTabName(sal_uInt16 nXti, sal_uInt16 nXtiTab) const
Definition: xilink.cxx:947
ocGreaterEqual
ocSum