LibreOffice Module sc (master)  1
worksheetfragment.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 <worksheetfragment.hxx>
21 #include <formulaparser.hxx>
22 
23 #include <osl/diagnose.h>
24 #include <oox/core/filterbase.hxx>
25 #include <oox/core/relations.hxx>
27 #include <oox/token/namespaces.hxx>
28 #include <oox/token/tokens.hxx>
29 #include <addressconverter.hxx>
30 #include <biffhelper.hxx>
31 #include <autofilterbuffer.hxx>
32 #include <autofiltercontext.hxx>
33 #include <commentsfragment.hxx>
34 #include <condformatcontext.hxx>
35 #include <drawingfragment.hxx>
36 #include <pagesettings.hxx>
37 #include <pivottablefragment.hxx>
38 #include <querytablefragment.hxx>
39 #include <scenariocontext.hxx>
40 #include <sheetdatabuffer.hxx>
41 #include <sheetdatacontext.hxx>
42 #include <tablefragment.hxx>
43 #include <extlstcontext.hxx>
44 #include <viewsettings.hxx>
45 #include <worksheetsettings.hxx>
46 
47 namespace oox::xls {
48 
49 using namespace ::oox::core;
50 
51 namespace {
52 
53 const sal_uInt16 BIFF_COLINFO_HIDDEN = 0x0001;
54 const sal_uInt16 BIFF_COLINFO_SHOWPHONETIC = 0x0008;
55 const sal_uInt16 BIFF_COLINFO_COLLAPSED = 0x1000;
56 
57 const sal_uInt16 BIFF_DEFROW_CUSTOMHEIGHT = 0x0001;
58 const sal_uInt16 BIFF_DEFROW_HIDDEN = 0x0002;
59 const sal_uInt16 BIFF_DEFROW_THICKTOP = 0x0004;
60 const sal_uInt16 BIFF_DEFROW_THICKBOTTOM = 0x0008;
61 
62 const sal_uInt32 BIFF_DATAVAL_STRINGLIST = 0x00000080;
63 const sal_uInt32 BIFF_DATAVAL_ALLOWBLANK = 0x00000100;
64 const sal_uInt32 BIFF_DATAVAL_NODROPDOWN = 0x00000200;
65 const sal_uInt32 BIFF_DATAVAL_SHOWINPUT = 0x00040000;
66 const sal_uInt32 BIFF_DATAVAL_SHOWERROR = 0x00080000;
67 
68 const sal_Int32 BIFF12_OLEOBJECT_ICON = 4;
69 const sal_Int32 BIFF12_OLEOBJECT_ALWAYS = 1;
70 const sal_uInt16 BIFF12_OLEOBJECT_LINKED = 0x0001;
71 const sal_uInt16 BIFF12_OLEOBJECT_AUTOLOAD = 0x0002;
72 
73 } // namespace
74 
76 {
77  if (!mxValModel)
78  return;
79 
80  rTarget.getAddressConverter().convertToCellRangeList(mxValModel->maRanges, maSqref, rTarget.getSheetIndex(), true);
81  mxValModel->msRef = maSqref;
82 
83  mxValModel->maTokens1 = rTarget.getFormulaParser().importFormula(mxValModel->maRanges.GetTopLeftCorner(), maFormula1);
84  // process string list of a list validation (convert to list of string tokens)
85  if (mxValModel->mnType == XML_list)
86  rTarget.getFormulaParser().convertStringToStringList(mxValModel->maTokens1, ',', true);
87 
88  mxValModel->maTokens2 = rTarget.getFormulaParser().importFormula(mxValModel->maRanges.GetTopLeftCorner(), maFormula2);
89 
90  rTarget.setValidation(*mxValModel);
91  mxValModel.reset();
92 }
93 
95 {
96  mxValModel.reset(new ValidationModel);
97  maFormula1.clear();
98  maFormula2.clear();
99  maSqref = rAttribs.getString(XML_sqref, OUString());
100  mxValModel->maInputTitle = rAttribs.getXString(XML_promptTitle, OUString());
101  mxValModel->maInputMessage = rAttribs.getXString(XML_prompt, OUString());
102  mxValModel->maErrorTitle = rAttribs.getXString(XML_errorTitle, OUString());
103  mxValModel->maErrorMessage = rAttribs.getXString(XML_error, OUString());
104  mxValModel->mnType = rAttribs.getToken(XML_type, XML_none);
105  mxValModel->mnOperator = rAttribs.getToken(XML_operator, XML_between);
106  mxValModel->mnErrorStyle = rAttribs.getToken(XML_errorStyle, XML_stop);
107  mxValModel->mbShowInputMsg = rAttribs.getBool(XML_showInputMessage, false);
108  mxValModel->mbShowErrorMsg = rAttribs.getBool(XML_showErrorMessage, false);
109  /* The attribute showDropDown@dataValidation is in fact a "suppress
110  dropdown" flag, as it was in the BIFF format! ECMA specification
111  and attribute name are plain wrong! */
112  mxValModel->mbNoDropDown = rAttribs.getBool(XML_showDropDown, false);
113  mxValModel->mbAllowBlank = rAttribs.getBool(XML_allowBlank, false);
114 }
115 
117 {
118  ValidationModel aModel;
119 
120  sal_uInt32 nFlags;
121  BinRangeList aRanges;
122  nFlags = rStrm.readuInt32();
123  rStrm >> aRanges >> aModel.maErrorTitle >> aModel.maErrorMessage >> aModel.maInputTitle >> aModel.maInputMessage;
124 
125  // equal flags in all BIFFs
126  aModel.setBiffType(extractValue< sal_uInt8 >(nFlags, 0, 4));
127  aModel.setBiffOperator(extractValue< sal_uInt8 >(nFlags, 20, 4));
128  aModel.setBiffErrorStyle(extractValue< sal_uInt8 >(nFlags, 4, 3));
129  aModel.mbAllowBlank = getFlag(nFlags, BIFF_DATAVAL_ALLOWBLANK);
130  aModel.mbNoDropDown = getFlag(nFlags, BIFF_DATAVAL_NODROPDOWN);
131  aModel.mbShowInputMsg = getFlag(nFlags, BIFF_DATAVAL_SHOWINPUT);
132  aModel.mbShowErrorMsg = getFlag(nFlags, BIFF_DATAVAL_SHOWERROR);
133 
134  // cell range list
135  rTarget.getAddressConverter().convertToCellRangeList(aModel.maRanges, aRanges, rTarget.getSheetIndex(), true);
136 
137  // condition formula(s)
138  FormulaParser& rParser = rTarget.getFormulaParser();
139  ScAddress aBaseAddr = aModel.maRanges.GetTopLeftCorner();
140  aModel.maTokens1 = rParser.importFormula(aBaseAddr, FormulaType::Validation, rStrm);
141  aModel.maTokens2 = rParser.importFormula(aBaseAddr, FormulaType::Validation, rStrm);
142  // process string list of a list validation (convert to list of string tokens)
143  if ((aModel.mnType == XML_list) && getFlag(nFlags, BIFF_DATAVAL_STRINGLIST))
144  rParser.convertStringToStringList(aModel.maTokens1, ',', true);
145 
146  // set validation data
147  rTarget.setValidation(aModel);
148 }
149 
151  WorksheetContextBase( rFragment )
152 {
153 }
154 
156 {
157  switch( getCurrentElementWithMce() )
158  {
159  case XLS_TOKEN( dataValidations ):
160  if( nElement == XLS_TOKEN( dataValidation ) )
161  {
162  importDataValidation( rAttribs );
163  return this;
164  }
165  break;
166  case XLS_TOKEN( dataValidation ):
167  switch( nElement )
168  {
169  case MCE_TOKEN( AlternateContent ):
170  case XLS_TOKEN( formula1 ):
171  case XLS_TOKEN( formula2 ):
172  return this; // collect formulas in onCharacters()
173  }
174  break;
175  case MCE_TOKEN( AlternateContent ):
176  switch( nElement )
177  {
178  case MCE_TOKEN( Choice ):
179  case MCE_TOKEN( Fallback ):
180  return this;
181  }
182  break;
183  case MCE_TOKEN( Choice ):
184  switch( nElement )
185  {
186  case X12AC_TOKEN( list ):
187  return this;
188  }
189  break;
190  case MCE_TOKEN( Fallback ):
191  switch( nElement )
192  {
193  case XLS_TOKEN( formula1 ):
194  if (!isFormula1Set()) // only if more preferable choice was not used
195  return this; // collect formulas in onCharacters()
196  break;
197  case XLS_TOKEN( formula2 ):
198  if (!isFormula2Set()) // only if more preferable choice was not used
199  return this; // collect formulas in onCharacters()
200  break;
201  }
202  break;
203  }
204  return nullptr;
205 }
206 
207 namespace {
208 // Convert strings like 1,"2,3",4 to form "1","2,3","4"
209 OUString NormalizeOoxList(const OUString& aList)
210 {
211  OUStringBuffer aResult("\"");
212  bool bInsideQuotes = false;
213  const sal_Int32 nLen = aList.getLength();
214  for (sal_Int32 i = 0; i < nLen; ++i)
215  {
216  sal_Unicode ch = aList[i];
217 
218  switch (ch)
219  {
220  case L'"':
221  bInsideQuotes = !bInsideQuotes;
222  break;
223  case L',':
224  if (!bInsideQuotes)
225  {
226  aResult.append("\",\"");
227  break;
228  }
229  [[fallthrough]];
230  default:
231  aResult.append(ch);
232  break;
233  }
234  }
235  return aResult.append('"').makeStringAndClear();
236 }
237 }
238 
239 void DataValidationsContext::onCharacters( const OUString& rChars )
240 {
241  switch( getCurrentElement() )
242  {
243  case XLS_TOKEN( formula1 ):
244  SetFormula1( rChars );
245  break;
246  case XLS_TOKEN( formula2 ):
247  SetFormula2( rChars );
248  break;
249  case X12AC_TOKEN( list ):
250  SetFormula1( NormalizeOoxList( rChars ) );
251  break;
252  }
253 }
254 
256 {
257  if( getCurrentElementWithMce() == XLS_TOKEN( dataValidation ) )
258  {
259  SetValidation( *this );
260  }
261 }
262 
264 {
265  if( nRecId == BIFF12_ID_DATAVALIDATION )
266  importDataValidation( rStrm, *this );
267  return nullptr;
268 }
269 
271  WorksheetContextBase( rFragment ), mCurrFormula( 0 )
272 {
273 }
274 
276 {
277  switch( getCurrentElement() )
278  {
279  case XLS14_TOKEN( dataValidations ):
280  if ( nElement == XLS14_TOKEN( dataValidation ) )
281  {
282  importDataValidation( rAttribs );
283  return this;
284  }
285  break;
286  case XLS14_TOKEN( dataValidation ):
287  switch ( nElement )
288  {
289  case XLS14_TOKEN( formula1 ):
290  case XLS14_TOKEN( formula2 ):
291  mCurrFormula = nElement;
292  return this;
293  case XM_TOKEN( sqref ):
294  return this; // collect sqref in onCharacters()
295  }
296  break;
297  case XLS14_TOKEN( formula1 ):
298  case XLS14_TOKEN( formula2 ):
299  switch( nElement )
300  {
301  case XM_TOKEN( f ):
302  return this; // collect formulas in onCharacters()
303  }
304  break;
305  }
306  return nullptr;
307 }
308 
309 void ExtDataValidationsContext::onCharacters( const OUString& rChars )
310 {
311  switch( getCurrentElement() )
312  {
313  case XM_TOKEN( f ):
314  switch( mCurrFormula )
315  {
316  case XLS14_TOKEN( formula1 ):
317  SetFormula1( rChars );
318  break;
319  case XLS14_TOKEN( formula2 ):
320  SetFormula2( rChars );
321  break;
322  }
323  break;
324  case XM_TOKEN( sqref ):
325  SetSqref( rChars );
326  break;
327  }
328 }
329 
331 {
332  if( isCurrentElement( XLS14_TOKEN( dataValidation ) ) )
333  {
334  SetValidation( *this );
335  }
336 }
337 
338 WorksheetFragment::WorksheetFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
339  WorksheetFragmentBase( rHelper, rFragmentPath )
340 {
341  // import data tables related to this worksheet
342  RelationsRef xTableRels = getRelations().getRelationsFromTypeFromOfficeDoc( "table" );
343  for( const auto& rEntry : *xTableRels )
344  importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( rEntry.second ) ) );
345 
346  // import comments related to this worksheet
347  OUString aCommentsFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "comments" );
348  if( !aCommentsFragmentPath.isEmpty() )
349  importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) );
350 }
351 
353 {
354  switch( getCurrentElement() )
355  {
356  case XML_ROOT_CONTEXT: switch( getSheetType() )
357  {
358  case WorksheetType::Work: return (nElement == XLS_TOKEN( worksheet )) ? this : nullptr;
359  case WorksheetType::Chart: return nullptr;
360  case WorksheetType::Macro: return (nElement == XM_TOKEN( macrosheet )) ? this : nullptr;
361  case WorksheetType::Dialog: return (nElement == XLS_TOKEN( dialogsheet )) ? this : nullptr;
362  case WorksheetType::Empty: return nullptr;
363  }
364  break;
365 
366  case XLS_TOKEN( worksheet ):
367  case XM_TOKEN( macrosheet ):
368  case XLS_TOKEN( dialogsheet ):
369  switch( nElement )
370  {
371  case XLS_TOKEN( sheetData ): return new SheetDataContext( *this );
372  case XLS_TOKEN( conditionalFormatting ): return new CondFormatContext( *this );
373  case XLS_TOKEN( dataValidations ): return new DataValidationsContext( *this );
374  case XLS_TOKEN( autoFilter ): return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
375  case XLS_TOKEN( scenarios ): return new ScenariosContext( *this );
376  case XLS_TOKEN( extLst ): return new ExtLstGlobalContext( *this );
377 
378  case XLS_TOKEN( sheetViews ):
379  case XLS_TOKEN( cols ):
380  case XLS_TOKEN( mergeCells ):
381  case XLS_TOKEN( hyperlinks ):
382  case XLS_TOKEN( rowBreaks ):
383  case XLS_TOKEN( colBreaks ):
384  case XLS_TOKEN( oleObjects ):
385  case XLS_TOKEN( controls ): return this;
386 
387  case XLS_TOKEN( sheetPr ): getWorksheetSettings().importSheetPr( rAttribs ); return this;
388  case XLS_TOKEN( dimension ): importDimension( rAttribs ); break;
389  case XLS_TOKEN( sheetFormatPr ): importSheetFormatPr( rAttribs ); break;
390  case XLS_TOKEN( sheetProtection ): getWorksheetSettings().importSheetProtection( rAttribs ); break;
391  case XLS_TOKEN( protectedRanges ):
392  // no attribs known (yet?)
393  return this;
394  case XLS_TOKEN( phoneticPr ): getWorksheetSettings().importPhoneticPr( rAttribs ); break;
395  case XLS_TOKEN( printOptions ): getPageSettings().importPrintOptions( rAttribs ); break;
396  case XLS_TOKEN( pageMargins ): getPageSettings().importPageMargins( rAttribs ); break;
397  case XLS_TOKEN( pageSetup ): getPageSettings().importPageSetup( getRelations(), rAttribs ); break;
398  case XLS_TOKEN( headerFooter ): getPageSettings().importHeaderFooter( rAttribs ); return this;
399  case XLS_TOKEN( picture ): getPageSettings().importPicture( getRelations(), rAttribs ); break;
400  case XLS_TOKEN( drawing ): importDrawing( rAttribs ); break;
401  case XLS_TOKEN( legacyDrawing ): importLegacyDrawing( rAttribs ); break;
402  }
403  break;
404 
405  case XLS_TOKEN( sheetPr ):
406  switch( nElement )
407  {
408  case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break;
409  case XLS_TOKEN( outlinePr ): getWorksheetSettings().importOutlinePr( rAttribs ); break;
410  case XLS_TOKEN( pageSetUpPr ): importPageSetUpPr( rAttribs ); break;
411  }
412  break;
413 
414  case XLS_TOKEN( sheetViews ):
415  switch( nElement )
416  {
417  case XLS_TOKEN( sheetView ): getSheetViewSettings().importSheetView( rAttribs ); return this;
418  }
419  break;
420  case XLS_TOKEN( sheetView ):
421  switch( nElement )
422  {
423  case XLS_TOKEN( pane ): getSheetViewSettings().importPane( rAttribs ); break;
424  case XLS_TOKEN( selection ): getSheetViewSettings().importSelection( rAttribs ); break;
425  }
426  break;
427 
428  case XLS_TOKEN( cols ):
429  if( nElement == XLS_TOKEN( col ) ) importCol( rAttribs );
430  break;
431  case XLS_TOKEN( mergeCells ):
432  if( nElement == XLS_TOKEN( mergeCell ) ) importMergeCell( rAttribs );
433  break;
434  case XLS_TOKEN( hyperlinks ):
435  if( nElement == XLS_TOKEN( hyperlink ) ) importHyperlink( rAttribs );
436  break;
437  case XLS_TOKEN( rowBreaks ):
438  if( nElement == XLS_TOKEN( brk ) ) importBrk( rAttribs, true );
439  break;
440  case XLS_TOKEN( colBreaks ):
441  if( nElement == XLS_TOKEN( brk ) ) importBrk( rAttribs, false );
442  break;
443 
444  case XLS_TOKEN( protectedRanges ):
445  switch( nElement )
446  {
447  case XLS_TOKEN( protectedRange ): getWorksheetSettings().importProtectedRange( rAttribs ); return this;
448  }
449  break;
450 
451  case XLS_TOKEN( headerFooter ):
452  switch( nElement )
453  {
454  case XLS_TOKEN( firstHeader ):
455  case XLS_TOKEN( firstFooter ):
456  case XLS_TOKEN( oddHeader ):
457  case XLS_TOKEN( oddFooter ):
458  case XLS_TOKEN( evenHeader ):
459  case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters()
460  }
461  break;
462  // Only process an oleObject or control if outside a mc:AlternateContent
463  // element OR if within a mc:Fallback. I suppose ideally we
464  // should process the stuff within 'mc:Choice'
465  case XLS_TOKEN( controls ):
466  case XLS_TOKEN( oleObjects ):
467  if ( getCurrentElement() == XLS_TOKEN( controls ) )
468  {
469  if( aMceState.empty() || aMceState.back() == MCE_STATE::Started )
470  {
471  if ( getCurrentElement() == XLS_TOKEN( oleObjects ) ) importOleObject( rAttribs );
472  else
473  importControl( rAttribs );
474  }
475  else if ( !aMceState.empty() && aMceState.back() == MCE_STATE::FoundChoice )
476  {
477  // reset the handling within 'Choice'
478  // this will force attempted handling in Fallback
479  aMceState.back() = MCE_STATE::Started;
480  }
481  }
482  break;
483  }
484  return nullptr;
485 }
486 
487 void WorksheetFragment::onCharacters( const OUString& rChars )
488 {
489  switch( getCurrentElement() )
490  {
491  case XLS_TOKEN( firstHeader ):
492  case XLS_TOKEN( firstFooter ):
493  case XLS_TOKEN( oddHeader ):
494  case XLS_TOKEN( oddFooter ):
495  case XLS_TOKEN( evenHeader ):
496  case XLS_TOKEN( evenFooter ):
498  break;
499  }
500 }
501 
503 {
504  switch( getCurrentElement() )
505  {
506  case XML_ROOT_CONTEXT:
507  if( nRecId == BIFF12_ID_WORKSHEET ) return this;
508  break;
509 
510  case BIFF12_ID_WORKSHEET:
511  switch( nRecId )
512  {
513  case BIFF12_ID_SHEETDATA: return new SheetDataContext( *this );
514  case BIFF12_ID_CONDFORMATTING: return new CondFormatContext( *this );
515  case BIFF12_ID_DATAVALIDATIONS: return new DataValidationsContext( *this );
516  case BIFF12_ID_AUTOFILTER: return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
517  case BIFF12_ID_SCENARIOS: return new ScenariosContext( *this );
518 
520  case BIFF12_ID_COLS:
522  case BIFF12_ID_ROWBREAKS:
523  case BIFF12_ID_COLBREAKS:
525  case BIFF12_ID_CONTROLS: return this;
526 
527  case BIFF12_ID_SHEETPR: getWorksheetSettings().importSheetPr( rStrm ); break;
528  case BIFF12_ID_DIMENSION: importDimension( rStrm ); break;
529  case BIFF12_ID_SHEETFORMATPR: importSheetFormatPr( rStrm ); break;
530  case BIFF12_ID_HYPERLINK: importHyperlink( rStrm ); break;
532  case BIFF12_ID_PAGESETUP: getPageSettings().importPageSetup( getRelations(), rStrm ); break;
535  case BIFF12_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
538  case BIFF12_ID_DRAWING: importDrawing( rStrm ); break;
539  case BIFF12_ID_LEGACYDRAWING: importLegacyDrawing( rStrm ); break;
540  }
541  break;
542 
544  switch( nRecId )
545  {
546  case BIFF12_ID_SHEETVIEW: getSheetViewSettings().importSheetView( rStrm ); return this;
547  }
548  break;
549  case BIFF12_ID_SHEETVIEW:
550  switch( nRecId )
551  {
552  case BIFF12_ID_PANE: getSheetViewSettings().importPane( rStrm ); break;
554  }
555  break;
556 
557  case BIFF12_ID_COLS:
558  if( nRecId == BIFF12_ID_COL ) importCol( rStrm );
559  break;
561  if( nRecId == BIFF12_ID_MERGECELL ) importMergeCell( rStrm );
562  break;
563  case BIFF12_ID_ROWBREAKS:
564  if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, true );
565  break;
566  case BIFF12_ID_COLBREAKS:
567  if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, false );
568  break;
570  if( nRecId == BIFF12_ID_OLEOBJECT ) importOleObject( rStrm );
571  break;
572  case BIFF12_ID_CONTROLS:
573  if( nRecId == BIFF12_ID_CONTROL ) importControl( rStrm );
574  break;
575  }
576  return nullptr;
577 }
578 
579 const RecordInfo* WorksheetFragment::getRecordInfos() const
580 {
581  static const RecordInfo spRecInfos[] =
582  {
601  { BIFF12_ID_ROW, -1 },
610  { -1, -1 }
611  };
612  return spRecInfos;
613 }
614 
616 {
617  // initial processing in base class WorksheetHelper
619 
620  // import query table fragments related to this worksheet
621  RelationsRef xQueryRels = getRelations().getRelationsFromTypeFromOfficeDoc( "queryTable" );
622  for( const auto& rEntry : *xQueryRels )
623  importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( rEntry.second ) ) );
624 
625  // import pivot table fragments related to this worksheet
626  RelationsRef xPivotRels = getRelations().getRelationsFromTypeFromOfficeDoc( "pivotTable" );
627  for( const auto& rEntry : *xPivotRels )
628  importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( rEntry.second ) ) );
629 }
630 
632 {
633  // final processing in base class WorksheetHelper
635 }
636 
637 // private --------------------------------------------------------------------
638 
640 {
641  // for whatever reason, this flag is still stored separated from the page settings
642  getPageSettings().setFitToPagesMode( rAttribs.getBool( XML_fitToPage, false ) );
643 }
644 
646 {
647  ScRange aRange;
648  AddressConverter::convertToCellRangeUnchecked( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() );
649  /* OOXML stores the used area, if existing, or "A1" if the sheet is empty.
650  In case of "A1", the dimension at the WorksheetHelper object will not
651  be set. If the cell A1 exists, the used area will be updated while
652  importing the cell. */
653  if( (aRange.aEnd.Col() > 0) || (aRange.aEnd.Row() > 0) )
654  {
655  extendUsedArea( aRange );
656  }
657 }
658 
660 {
661  // default column settings
662  setBaseColumnWidth( rAttribs.getInteger( XML_baseColWidth, 8 ) );
663  setDefaultColumnWidth( rAttribs.getDouble( XML_defaultColWidth, 0.0 ) );
664  // default row settings
665 
666  // We don't need to import:
667  // XML_outlineLevelRow
668  // XML_outlineLevelCol
669  // as it will be updated during export to OOXML
671  rAttribs.getDouble( XML_defaultRowHeight, 0.0 ),
672  rAttribs.getBool( XML_customHeight, false ),
673  rAttribs.getBool( XML_zeroHeight, false ),
674  rAttribs.getBool( XML_thickTop, false ),
675  rAttribs.getBool( XML_thickBottom, false ) );
676 }
677 
679 {
680  ColumnModel aModel;
681  aModel.maRange.mnFirst = rAttribs.getInteger( XML_min, -1 );
682  aModel.maRange.mnLast = rAttribs.getInteger( XML_max, -1 );
683  aModel.mfWidth = rAttribs.getDouble( XML_width, 0.0 );
684  aModel.mnXfId = rAttribs.getInteger( XML_style, -1 );
685  aModel.mnLevel = rAttribs.getInteger( XML_outlineLevel, 0 );
686  aModel.mbShowPhonetic = rAttribs.getBool( XML_phonetic, false );
687  aModel.mbHidden = rAttribs.getBool( XML_hidden, false );
688  aModel.mbCollapsed = rAttribs.getBool( XML_collapsed, false );
689  // set column properties in the current sheet
690  setColumnModel( aModel );
691 }
692 
694 {
695  ScRange aRange;
696  if( getAddressConverter().convertToCellRange( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
697  getSheetData().setMergedRange( aRange );
698 }
699 
701 {
702  HyperlinkModel aModel;
703  if( getAddressConverter().convertToCellRange( aModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
704  {
705  aModel.maTarget = getRelations().getExternalTargetFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
706  aModel.maLocation = rAttribs.getXString( XML_location, OUString() );
707  aModel.maDisplay = rAttribs.getXString( XML_display, OUString() );
708  aModel.maTooltip = rAttribs.getXString( XML_tooltip, OUString() );
709  setHyperlink( aModel );
710  }
711 }
712 
713 void WorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
714 {
715  PageBreakModel aModel;
716  aModel.mnColRow = rAttribs.getInteger( XML_id, 0 );
717  aModel.mnMin = rAttribs.getInteger( XML_min, aModel.mnColRow );
718  aModel.mnMax = rAttribs.getInteger( XML_max, aModel.mnColRow );
719  aModel.mbManual = rAttribs.getBool( XML_man, false );
720  setPageBreak( aModel, bRowBreak );
721 }
722 
724 {
725  setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
726 }
727 
729 {
730  setVmlDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
731 }
732 
734 {
736  aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
737  OSL_ENSURE( rAttribs.hasAttribute( XML_link ) != rAttribs.hasAttribute( R_TOKEN( id ) ),
738  "WorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
739  aInfo.mbLinked = rAttribs.hasAttribute( XML_link );
740  if( aInfo.mbLinked )
741  aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rAttribs.getString( XML_link, OUString() ) );
742  else if( rAttribs.hasAttribute( R_TOKEN( id ) ) )
743  importEmbeddedOleData( aInfo.maEmbeddedData, rAttribs.getString( R_TOKEN( id ), OUString() ) );
744  aInfo.maProgId = rAttribs.getString( XML_progId, OUString() );
745  aInfo.mbShowAsIcon = rAttribs.getToken( XML_dvAspect, XML_DVASPECT_CONTENT ) == XML_DVASPECT_ICON;
746  aInfo.mbAutoUpdate = rAttribs.getToken( XML_oleUpdate, XML_OLEUPDATE_ONCALL ) == XML_OLEUPDATE_ALWAYS;
747  aInfo.mbAutoLoad = rAttribs.getBool( XML_autoLoad, false );
748  getVmlDrawing().registerOleObject( aInfo );
749 }
750 
752 {
754  aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
755  aInfo.maFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
756  aInfo.maName = rAttribs.getString( XML_name, OUString() );
757  getVmlDrawing().registerControl( aInfo );
758 }
759 
761 {
762  BinRange aBinRange;
763  aBinRange.read( rStrm );
764  ScRange aRange;
766  /* BIFF12 stores the used area, if existing, or "A1" if the sheet is
767  empty. In case of "A1", the dimension at the WorksheetHelper object
768  will not be set. If the cell A1 exists, the used area will be updated
769  while importing the cell. */
770  if( (aRange.aEnd.Col() > 0) || (aRange.aEnd.Row() > 0) )
771  extendUsedArea( aRange );
772 }
773 
775 {
776  sal_Int32 nDefaultWidth;
777  sal_uInt16 nBaseWidth, nDefaultHeight, nFlags;
778  nDefaultWidth = rStrm.readInt32();
779  nBaseWidth = rStrm.readuInt16();
780  nDefaultHeight = rStrm.readuInt16();
781  nFlags = rStrm.readuInt16();
782 
783  // base column with
784  setBaseColumnWidth( nBaseWidth );
785  // default width is stored as 1/256th of a character in BIFF12, convert to entire character
786  setDefaultColumnWidth( static_cast< double >( nDefaultWidth ) / 256.0 );
787  // row height is in twips in BIFF12, convert to points; equal flags in all BIFFs
789  nDefaultHeight / 20.0,
790  getFlag( nFlags, BIFF_DEFROW_CUSTOMHEIGHT ),
791  getFlag( nFlags, BIFF_DEFROW_HIDDEN ),
792  getFlag( nFlags, BIFF_DEFROW_THICKTOP ),
793  getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
794 }
795 
797 {
798  ColumnModel aModel;
799 
800  sal_Int32 nWidth;
801  sal_uInt16 nFlags;
802  aModel.maRange.mnFirst = rStrm.readInt32();
803  aModel.maRange.mnLast = rStrm.readInt32();
804  nWidth = rStrm.readInt32();
805  aModel.mnXfId = rStrm.readInt32();
806  nFlags = rStrm.readuInt16();
807 
808  // column indexes are 0-based in BIFF12, but ColumnModel expects 1-based
809  ++aModel.maRange.mnFirst;
810  ++aModel.maRange.mnLast;
811  // width is stored as 1/256th of a character in BIFF12, convert to entire character
812  aModel.mfWidth = static_cast< double >( nWidth ) / 256.0;
813  // equal flags in all BIFFs
814  aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 8, 3 );
815  aModel.mbShowPhonetic = getFlag( nFlags, BIFF_COLINFO_SHOWPHONETIC );
816  aModel.mbHidden = getFlag( nFlags, BIFF_COLINFO_HIDDEN );
817  aModel.mbCollapsed = getFlag( nFlags, BIFF_COLINFO_COLLAPSED );
818  // set column properties in the current sheet
819  setColumnModel( aModel );
820 }
821 
823 {
824  BinRange aBinRange;
825  rStrm >> aBinRange;
826  ScRange aRange;
827  if( getAddressConverter().convertToCellRange( aRange, aBinRange, getSheetIndex(), true, true ) )
828  getSheetData().setMergedRange( aRange );
829 }
830 
832 {
833  BinRange aBinRange;
834  rStrm >> aBinRange;
835  HyperlinkModel aModel;
836  if( getAddressConverter().convertToCellRange( aModel.maRange, aBinRange, getSheetIndex(), true, true ) )
837  {
838  aModel.maTarget = getRelations().getExternalTargetFromRelId( BiffHelper::readString( rStrm ) );
839  rStrm >> aModel.maLocation >> aModel.maTooltip >> aModel.maDisplay;
840  setHyperlink( aModel );
841  }
842 }
843 
844 void WorksheetFragment::importBrk( SequenceInputStream& rStrm, bool bRowBreak )
845 {
846  PageBreakModel aModel;
847  sal_Int32 nManual;
848  aModel.mnColRow = rStrm.readInt32();
849  aModel.mnMin = rStrm.readInt32();
850  aModel.mnMax = rStrm.readInt32();
851  nManual = rStrm.readInt32();
852  aModel.mbManual = nManual != 0;
853  setPageBreak( aModel, bRowBreak );
854 }
855 
857 {
858  setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
859 }
860 
862 {
863  setVmlDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
864 }
865 
867 {
869  sal_Int32 nAspect, nUpdateMode, nShapeId;
870  sal_uInt16 nFlags;
871  nAspect = rStrm.readInt32();
872  nUpdateMode = rStrm.readInt32();
873  nShapeId = rStrm.readInt32();
874  nFlags = rStrm.readuInt16();
875  rStrm >> aInfo.maProgId;
876  aInfo.mbLinked = getFlag( nFlags, BIFF12_OLEOBJECT_LINKED );
877  if( aInfo.mbLinked )
879  else
881  aInfo.setShapeId( nShapeId );
882  aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON;
883  aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS;
884  aInfo.mbAutoLoad = getFlag( nFlags, BIFF12_OLEOBJECT_AUTOLOAD );
885  getVmlDrawing().registerOleObject( aInfo );
886 }
887 
889 {
891  aInfo.setShapeId( rStrm.readInt32() );
892  aInfo.maFragmentPath = getFragmentPathFromRelId( BiffHelper::readString( rStrm ) );
893  rStrm >> aInfo.maName;
894  getVmlDrawing().registerControl( aInfo );
895 }
896 
897 void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
898 {
899  OUString aFragmentPath = getFragmentPathFromRelId( rRelId );
900  if( !aFragmentPath.isEmpty() )
901  getBaseFilter().importBinaryData( orEmbeddedData, aFragmentPath );
902 }
903 
904 } // namespace oox
905 
906 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_Int32 BIFF12_ID_SHEETPR
Definition: biffhelper.hxx:218
std::shared_ptr< Relations > RelationsRef
const sal_Int32 BIFF12_ID_CONTROL
Definition: biffhelper.hxx:76
virtual void initializeImport() override
SheetDataBuffer & getSheetData() const
Returns the buffer for cell contents and cell formatting.
OptValue< bool > getBool(sal_Int32 nAttrToken) const
::std::vector< MCE_STATE > aMceState
SCROW Row() const
Definition: address.hxx:262
Condition of a conditional format rule.
A 2D cell range address list for binary filters.
OptValue< OUString > getXString(sal_Int32 nAttrToken) const
ExtDataValidationsContext(WorksheetContextBase &rFragment)
void importDataValidation(const AttributeList &rAttribs)
Imports the dataValidation element containing data validation settings.
OptValue< sal_Int32 > getInteger(sal_Int32 nAttrToken) const
bool isCurrentElement(sal_Int32 nElement) const
const sal_Int32 BIFF12_ID_PRINTOPTIONS
Definition: biffhelper.hxx:188
void importLegacyDrawing(const AttributeList &rAttribs)
Imports the relation identifier for the legacy VML drawing part.
A 2D cell range address struct for binary filters.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
void SetSqref(const OUString &rChars)
sal_Int32 mnMax
Start of limited break.
const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS
Definition: biffhelper.hxx:83
ScAddress aEnd
Definition: address.hxx:501
const sal_Int32 BIFF12_ID_PAGESETUP
Definition: biffhelper.hxx:154
OptValue< double > getDouble(sal_Int32 nAttrToken) const
void importHeaderFooter(const AttributeList &rAttribs)
Imports header and footer settings from a headerFooter element.
sal_uInt32 readuInt32()
DataValidationsContext(WorksheetFragmentBase &rFragment)
OptValue< OUString > getString(sal_Int32 nAttrToken) const
void importHeaderFooterCharacters(const OUString &rChars, sal_Int32 nElement)
Imports header/footer characters from a headerFooter element.
void registerOleObject(const OleObjectInfo &rOleObject)
void SetFormula2(const OUString &rChars)
WorksheetSettings & getWorksheetSettings() const
Returns the worksheet settings object.
virtual void onCharacters(const OUString &rChars) override
static bool convertToCellRangeUnchecked(ScRange &orRange, const OUString &rString, sal_Int16 nSheet)
Converts the passed string to a cell range address, without checking any sheet limits.
const sal_Int32 BIFF12_ID_PAGEMARGINS
Definition: biffhelper.hxx:153
SheetViewSettings & getSheetViewSettings() const
Returns the view settings for this sheet.
void importOutlinePr(const AttributeList &rAttribs)
Imports outline settings from the outlinePr element.
const sal_Int32 BIFF12_ID_PICTURE
Definition: biffhelper.hxx:184
bool importOoxFragment(const rtl::Reference< oox::core::FragmentHandler > &rxHandler)
Imports a fragment using the passed fragment handler, which contains the full path to the fragment st...
const sal_Int32 BIFF12_ID_HEADERFOOTER
Definition: biffhelper.hxx:131
void SetFormula1(const OUString &rChars)
const sal_Int32 BIFF12_ID_CONTROLS
Definition: biffhelper.hxx:77
void setHyperlink(const HyperlinkModel &rModel)
Inserts the hyperlink URL into the spreadsheet.
sal_Int32 getCurrentElementWithMce() const
void importProtectedRange(const AttributeList &rAttribs)
Imports enhanced protection settings from the protectedRange element.
sal_uInt16 sal_Unicode
sal_uInt16 readuInt16()
const sal_Int32 BIFF12_ID_PANE
Definition: biffhelper.hxx:155
void importPicture(const ::oox::core::Relations &rRelations, const AttributeList &rAttribs)
Imports the picture element.
void importCol(const AttributeList &rAttribs)
Imports column settings from a col element.
void setBiffType(sal_uInt8 nType)
Sets the passed BIFF validation type.
bool importBinaryData(StreamDataSequence &orDataSeq, const OUString &rStreamName)
virtual void finalizeImport() override
const sal_Int32 BIFF12_ID_CFRULE
Definition: biffhelper.hxx:55
Stores formatting data about a page break.
OUString maTooltip
The cell area containing the hyperlink.
Used for the actual ExtLst containing the new extended definition.
const sal_Int32 BIFF12_ID_COLORSCALE
Definition: biffhelper.hxx:65
bool hasAttribute(sal_Int32 nAttrToken) const
void setVmlDrawingPath(const OUString &rVmlDrawingPath)
Sets the path to the legacy VML drawing fragment of this sheet.
const sal_Int32 BIFF12_ID_LEGACYDRAWING
Definition: biffhelper.hxx:136
::oox::core::FilterBase & getBaseFilter() const
Returns the base filter object (base class of all filters).
const sal_Int32 BIFF12_ID_DISCRETEFILTERS
Definition: biffhelper.hxx:97
void importHyperlink(const AttributeList &rAttribs)
Imports the hyperlink element containing a hyperlink for a cell range.
const sal_Int32 BIFF12_ID_SHEETPROTECTION
Definition: biffhelper.hxx:219
WorksheetFragment(const WorksheetHelper &rHelper, const OUString &rFragmentPath)
const sal_Int32 BIFF12_ID_OLEOBJECTS
Definition: biffhelper.hxx:151
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
void importPrintOptions(const AttributeList &rAttribs)
Imports printing options from a printOptions element.
const sal_Int32 BIFF12_ID_BRK
Definition: biffhelper.hxx:40
sal_Int32 mnLevel
Column default formatting.
void importBrk(const AttributeList &rAttribs, bool bRowBreak)
Imports individual break that is either within row or column break context.
virtual void onCharacters(const OUString &rChars) override
void setMergedRange(const ScRange &rRange)
Merges the cells in the passed cell range.
ApiTokenSequence importFormula(const ScAddress &rBaseAddr, const OUString &rFormulaString) const
Converts an OOXML formula string.
bool getFlag(Type nBitField, Type nMask)
const sal_Int32 BIFF12_ID_AUTOFILTER
Definition: biffhelper.hxx:33
ScAddress GetTopLeftCorner() const
Definition: rangelst.cxx:1157
void setBiffOperator(sal_uInt8 nOperator)
Sets the passed BIFF operator.
sal_Int32 mnFirst
double mfWidth
1-based (!) range of the described columns.
sal_Int32 mnXfId
Column width in number of characters.
const sal_Int32 BIFF12_ID_COL
Definition: biffhelper.hxx:61
void importEmbeddedOleData(StreamDataSequence &orEmbeddedData, const OUString &rRelId)
Imports the binary data of an embedded OLE object from the fragment with the passed ID...
void importSheetFormatPr(const AttributeList &rAttribs)
Imports sheet format properties from a sheetFormatPr element.
const sal_Int32 BIFF12_ID_SHEETVIEW
Definition: biffhelper.hxx:221
css::uno::Sequence< sal_Int8 > StreamDataSequence
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
const sal_Int32 BIFF12_ID_DATAVALIDATIONS
Definition: biffhelper.hxx:88
void importPageSetUpPr(const AttributeList &rAttribs)
Imports page settings from a pageSetUpPr element.
void setDrawingPath(const OUString &rDrawingPath)
Sets the path to the DrawingML fragment of this sheet.
int i
bool mbHidden
True = cells in column show phonetic settings.
This class implements importing the sheetData element.
bool mbCollapsed
True = column is hidden.
const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW
Definition: biffhelper.hxx:82
const sal_Int32 BIFF12_ID_DRAWING
Definition: biffhelper.hxx:98
Stores settings and formatting data about a range of sheet columns.
void importSheetPr(const AttributeList &rAttribs)
Imports sheet settings from the sheetPr element.
WorksheetType getSheetType() const
Returns the type of this sheet.
const sal_Int32 BIFF12_ID_DIMENSION
Definition: biffhelper.hxx:95
static OUString readString(SequenceInputStream &rStrm, bool b32BitLen=true)
Reads a BIFF12 string with leading 16-bit or 32-bit length field.
Definition: biffhelper.cxx:78
const sal_Int32 BIFF12_ID_DATAVALIDATION
Definition: biffhelper.hxx:87
void importSelection(const AttributeList &rAttribs)
Imports the selection element containing selection settings for a pane.
const sal_Int32 BIFF12_ID_SHEETDATA
Definition: biffhelper.hxx:216
void setPageBreak(const PageBreakModel &rModel, bool bRowBreak)
Sets a column or row page break described in the passed struct.
sal_Int32 getCurrentElement() const
const sal_Int32 BIFF12_ID_MERGECELL
Definition: biffhelper.hxx:137
std::unique_ptr< ValidationModel > mxValModel
void convertToCellRangeList(ScRangeList &orRanges, const OUString &rString, sal_Int16 nSheet, bool bTrackOverflow)
Tries to convert the passed string to a cell range list.
const sal_Int32 BIFF12_ID_CUSTOMFILTERS
Definition: biffhelper.hxx:81
const sal_Int32 BIFF12_ID_SELECTION
Definition: biffhelper.hxx:213
void setBaseColumnWidth(sal_Int32 nWidth)
Sets base width for all columns (without padding pixels).
const sal_Int32 BIFF12_ID_FILTERCOLUMN
Definition: biffhelper.hxx:122
const sal_Int32 BIFF12_ID_SHEETVIEWS
Definition: biffhelper.hxx:222
StreamDataSequence maEmbeddedData
void importMergeCell(const AttributeList &rAttribs)
Imports a merged cell range from a mergeCell element.
void convertStringToStringList(ApiTokenSequence &orTokens, sal_Unicode cStringSep, bool bTrimLeadingSpaces) const
Converts a single string with separators in the passed formula token sequence to a list of string tok...
void setDefaultRowSettings(double fHeight, bool bCustomHeight, bool bHidden, bool bThickTop, bool bThickBottom)
Sets default height and hidden state for all unused rows in the sheet.
void initializeWorksheetImport()
Initial conversion before importing the worksheet.
const sal_Int32 BIFF12_ID_ROWBREAKS
Definition: biffhelper.hxx:210
void setShapeId(sal_Int32 nShapeId)
const sal_Int32 BIFF12_ID_COLS
Definition: biffhelper.hxx:66
void setColumnModel(const ColumnModel &rModel)
Sets column settings for a specific range of columns.
OUString importOleTargetLink(const OUString &rFormulaString)
Converts the passed XML formula to an OLE link target.
SCCOL Col() const
Definition: address.hxx:267
void setValidation(const ValidationModel &rModel)
Inserts the data validation settings into the spreadsheet.
const sal_Int32 BIFF12_ID_PHONETICPR
Definition: biffhelper.hxx:183
Fragment handler derived from the WorksheetHelper helper class.
Stores data about ranges with data validation settings.
const sal_Int32 BIFF12_ID_DATABAR
Definition: biffhelper.hxx:85
void extendUsedArea(const ScAddress &rAddress)
Extends the used area of this sheet by the passed cell position.
const sal_Int32 BIFF12_ID_OLEOBJECT
Definition: biffhelper.hxx:150
void importPhoneticPr(const AttributeList &rAttribs)
Imports phonetic settings from the phoneticPr element.
virtual void onEndElement() override
sal_Int32 mnMin
0-based (!) index of column/row.
void importPageSetup(const ::oox::core::Relations &rRelations, const AttributeList &rAttribs)
Imports pageSetup element for worksheets.
Context handler derived from the WorksheetHelper helper class.
virtual void onCharacters(const OUString &rChars) override
const sal_Int32 BIFF12_ID_SCENARIO
Definition: biffhelper.hxx:211
const sal_Int32 BIFF12_ID_COLBREAKS
Definition: biffhelper.hxx:62
SCTAB getSheetIndex() const
Returns the index of the current sheet.
void read(SequenceInputStream &rStrm)
bool mbShowPhonetic
Column outline level.
void importSheetView(const AttributeList &rAttribs)
Imports the sheetView element containing sheet view settings.
void importPageMargins(const AttributeList &rAttribs)
Imports pageMarings element containing page margins.
void importControl(const AttributeList &rAttribs)
Imports additional data for an OCX form control.
const sal_Int32 BIFF12_ID_SHEETFORMATPR
Definition: biffhelper.hxx:217
const sal_Int32 BIFF12_ID_ROW
Definition: biffhelper.hxx:209
void importOleObject(const AttributeList &rAttribs)
Imports additional data for an OLE object.
Import formula parser for OOXML and BIFF filters.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
FormulaParser & getFormulaParser() const
Returns a shared import formula parser (import filter only!).
const sal_Int32 XML_ROOT_CONTEXT
Dialog sheet (BIFF5+).
const sal_Int32 BIFF12_ID_MERGECELLS
Definition: biffhelper.hxx:138
void registerControl(const ControlInfo &rControl)
void(* f)(TrueTypeTable *)
void setFitToPagesMode(bool bFitToPages)
Sets whether percentual scaling or fit to width/height scaling is used.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
VmlDrawing & getVmlDrawing() const
Returns the VML drawing page for this sheet (OOXML/BIFF12 only).
void importTabColor(const AttributeList &rAttribs)
Imports the sheet tab color from the tabColor element.
void importDimension(const AttributeList &rAttribs)
Imports the dimension element containing the used area of the sheet.
void SetValidation(WorksheetHelper &rTarget)
Stores data about a hyperlink range.
const sal_Int32 BIFF12_ID_CONDFORMATTING
Definition: biffhelper.hxx:73
const sal_Int32 BIFF12_ID_ICONSET
Definition: biffhelper.hxx:133
void importDrawing(const AttributeList &rAttribs)
Imports the relation identifier for the DrawingML part.
void importPane(const AttributeList &rAttribs)
Imports the pane element containing sheet pane settings.
AutoFilterBuffer & getAutoFilters() const
Returns the auto filters for the sheet.
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
void setShapeId(sal_Int32 nShapeId)
void finalizeWorksheetImport()
Final conversion after importing the worksheet.
void importSheetProtection(const AttributeList &rAttribs)
Imports protection settings from the sheetProtection element.
const sal_Int32 BIFF12_ID_HYPERLINK
Definition: biffhelper.hxx:132
const sal_Int32 BIFF12_ID_TABLEPARTS
Definition: biffhelper.hxx:228
OptValue< sal_Int32 > getToken(sal_Int32 nAttrToken) const
PageSettings & getPageSettings() const
Returns the page/print settings for this sheet.
const sal_Int32 BIFF12_ID_SCENARIOS
Definition: biffhelper.hxx:212
bool mbManual
End of limited break.
AddressConverter & getAddressConverter() const
Returns the converter for string to cell address/range conversion.
sal_Int32 mnLast
const sal_Int32 BIFF12_ID_WORKSHEET
Definition: biffhelper.hxx:242
void setDefaultColumnWidth(double fWidth)
Sets default width for all columns.
void setBiffErrorStyle(sal_uInt8 nErrorStyle)
Sets the passed BIFF error style.