LibreOffice Module sc (master)  1
xecontent.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <xecontent.hxx>
22 
23 #include <vector>
24 #include <algorithm>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/sheet/XAreaLinks.hpp>
27 #include <com/sun/star/sheet/XAreaLink.hpp>
28 #include <com/sun/star/sheet/TableValidationVisibility.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <sfx2/objsh.hxx>
31 #include <tools/urlobj.hxx>
32 #include <formula/grammar.hxx>
33 #include <scitems.hxx>
34 #include <editeng/flditem.hxx>
35 #include <document.hxx>
36 #include <validat.hxx>
37 #include <unonames.hxx>
38 #include <convuno.hxx>
39 #include <rangenam.hxx>
40 #include <tokenarray.hxx>
41 #include <stlpool.hxx>
42 #include <patattr.hxx>
43 #include <fapihelper.hxx>
44 #include <xehelper.hxx>
45 #include <xestyle.hxx>
46 #include <xename.hxx>
47 #include <xlcontent.hxx>
48 #include <xltools.hxx>
49 #include <xeformula.hxx>
50 #include <rtl/uuid.h>
51 #include <sal/log.hxx>
52 #include <oox/export/utils.hxx>
53 #include <oox/token/namespaces.hxx>
55 
56 using namespace ::oox;
57 
58 using ::com::sun::star::uno::Reference;
59 using ::com::sun::star::uno::UNO_QUERY;
60 using ::com::sun::star::table::CellRangeAddress;
61 using ::com::sun::star::sheet::XAreaLinks;
62 using ::com::sun::star::sheet::XAreaLink;
63 
64 // Shared string table ========================================================
65 
66 namespace {
67 
69 struct XclExpHashEntry
70 {
71  const XclExpString* mpString;
72  sal_uInt32 mnSstIndex;
73  explicit XclExpHashEntry( const XclExpString* pString, sal_uInt32 nSstIndex ) :
74  mpString( pString ), mnSstIndex( nSstIndex ) {}
75 };
76 
78 struct XclExpHashEntrySWO
79 {
80  bool operator()( const XclExpHashEntry& rLeft, const XclExpHashEntry& rRight ) const
81  { return *rLeft.mpString < *rRight.mpString; }
82 };
83 
84 }
85 
90 {
91 public:
92  explicit XclExpSstImpl();
93 
95  sal_uInt32 Insert( XclExpStringRef xString );
96 
98  void Save( XclExpStream& rStrm );
99  void SaveXml( XclExpXmlStream& rStrm );
100 
101 private:
102  typedef ::std::vector< XclExpHashEntry > XclExpHashVec;
103 
104  std::vector< XclExpStringRef > maStringVector;
105  std::vector< XclExpHashVec >
107  sal_uInt32 mnTotal;
108  sal_uInt32 mnSize;
109 };
110 
111 const sal_uInt32 EXC_SST_HASHTABLE_SIZE = 2048;
112 
114  maHashTab( EXC_SST_HASHTABLE_SIZE ),
115  mnTotal( 0 ),
116  mnSize( 0 )
117 {
118 }
119 
121 {
122  OSL_ENSURE( xString, "XclExpSstImpl::Insert - empty pointer not allowed" );
123  if( !xString )
124  xString.reset( new XclExpString );
125 
126  ++mnTotal;
127  sal_uInt32 nSstIndex = 0;
128 
129  // calculate hash value in range [0,EXC_SST_HASHTABLE_SIZE)
130  sal_uInt16 nHash = xString->GetHash();
131  nHash = (nHash ^ (nHash / EXC_SST_HASHTABLE_SIZE)) % EXC_SST_HASHTABLE_SIZE;
132 
133  XclExpHashVec& rVec = maHashTab[ nHash ];
134  XclExpHashEntry aEntry( xString.get(), mnSize );
135  XclExpHashVec::iterator aIt = ::std::lower_bound( rVec.begin(), rVec.end(), aEntry, XclExpHashEntrySWO() );
136  if( (aIt == rVec.end()) || (*aIt->mpString != *xString) )
137  {
138  nSstIndex = mnSize;
139  maStringVector.push_back( xString );
140  rVec.insert( aIt, aEntry );
141  ++mnSize;
142  }
143  else
144  {
145  nSstIndex = aIt->mnSstIndex;
146  }
147 
148  return nSstIndex;
149 }
150 
152 {
153  if( maStringVector.empty() )
154  return;
155 
156  SvMemoryStream aExtSst( 8192 );
157 
158  sal_uInt32 nBucket = mnSize;
159  while( nBucket > 0x0100 )
160  nBucket /= 2;
161 
162  sal_uInt16 nPerBucket = llimit_cast< sal_uInt16 >( nBucket, 8 );
163  sal_uInt16 nBucketIndex = 0;
164 
165  // *** write the SST record ***
166 
167  rStrm.StartRecord( EXC_ID_SST, 8 );
168 
169  rStrm << mnTotal << mnSize;
170  for (auto const& elem : maStringVector)
171  {
172  if( !nBucketIndex )
173  {
174  // write bucket info before string to get correct record position
175  sal_uInt32 nStrmPos = static_cast< sal_uInt32 >( rStrm.GetSvStreamPos() );
176  sal_uInt16 nRecPos = rStrm.GetRawRecPos() + 4;
177  aExtSst.WriteUInt32( nStrmPos ) // stream position
178  .WriteUInt16( nRecPos ) // position from start of SST or CONTINUE
179  .WriteUInt16( 0 ); // reserved
180  }
181 
182  rStrm << *elem;
183 
184  if( ++nBucketIndex == nPerBucket )
185  nBucketIndex = 0;
186  }
187 
188  rStrm.EndRecord();
189 
190  // *** write the EXTSST record ***
191 
192  rStrm.StartRecord( EXC_ID_EXTSST, 0 );
193 
194  rStrm << nPerBucket;
195  rStrm.SetSliceSize( 8 ); // size of one bucket info
196  aExtSst.Seek( STREAM_SEEK_TO_BEGIN );
197  rStrm.CopyFromStream( aExtSst );
198 
199  rStrm.EndRecord();
200 }
201 
203 {
204  if( maStringVector.empty() )
205  return;
206 
208  "xl/sharedStrings.xml",
209  "sharedStrings.xml",
210  rStrm.GetCurrentStream()->getOutputStream(),
211  "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
212  OUStringToOString(oox::getRelationship(Relationship::SHAREDSTRINGS), RTL_TEXTENCODING_UTF8).getStr());
213  rStrm.PushStream( pSst );
214 
215  pSst->startElement( XML_sst,
216  XML_xmlns, rStrm.getNamespaceURL(OOX_NS(xls)),
217  XML_count, OString::number(mnTotal),
218  XML_uniqueCount, OString::number(mnSize) );
219 
220  for (auto const& elem : maStringVector)
221  {
222  pSst->startElement(XML_si);
223  elem->WriteXml( rStrm );
224  pSst->endElement( XML_si );
225  }
226 
227  pSst->endElement( XML_sst );
228 
229  rStrm.PopStream();
230 }
231 
233  mxImpl( new XclExpSstImpl )
234 {
235 }
236 
238 {
239 }
240 
241 sal_uInt32 XclExpSst::Insert( const XclExpStringRef& xString )
242 {
243  return mxImpl->Insert( xString );
244 }
245 
247 {
248  mxImpl->Save( rStrm );
249 }
250 
252 {
253  mxImpl->SaveXml( rStrm );
254 }
255 
256 // Merged cells ===============================================================
257 
259  XclExpRoot( rRoot )
260 {
261 }
262 
263 void XclExpMergedcells::AppendRange( const ScRange& rRange, sal_uInt32 nBaseXFId )
264 {
265  if( GetBiff() == EXC_BIFF8 )
266  {
267  maMergedRanges.push_back( rRange );
268  maBaseXFIds.push_back( nBaseXFId );
269  }
270 }
271 
272 sal_uInt32 XclExpMergedcells::GetBaseXFId( const ScAddress& rPos ) const
273 {
274  OSL_ENSURE( maBaseXFIds.size() == maMergedRanges.size(), "XclExpMergedcells::GetBaseXFId - invalid lists" );
275  ScfUInt32Vec::const_iterator aIt = maBaseXFIds.begin();
276  ScRangeList& rNCRanges = const_cast< ScRangeList& >( maMergedRanges );
277  for ( size_t i = 0, nRanges = rNCRanges.size(); i < nRanges; ++i, ++aIt )
278  {
279  const ScRange & rScRange = rNCRanges[ i ];
280  if( rScRange.In( rPos ) )
281  return *aIt;
282  }
283  return EXC_XFID_NOTFOUND;
284 }
285 
287 {
288  if( GetBiff() == EXC_BIFF8 )
289  {
290  XclRangeList aXclRanges;
291  GetAddressConverter().ConvertRangeList( aXclRanges, maMergedRanges, true );
292  size_t nFirstRange = 0;
293  size_t nRemainingRanges = aXclRanges.size();
294  while( nRemainingRanges > 0 )
295  {
296  size_t nRangeCount = ::std::min< size_t >( nRemainingRanges, EXC_MERGEDCELLS_MAXCOUNT );
297  rStrm.StartRecord( EXC_ID_MERGEDCELLS, 2 + 8 * nRangeCount );
298  aXclRanges.WriteSubList( rStrm, nFirstRange, nRangeCount );
299  rStrm.EndRecord();
300  nFirstRange += nRangeCount;
301  nRemainingRanges -= nRangeCount;
302  }
303  }
304 }
305 
307 {
308  size_t nCount = maMergedRanges.size();
309  if( !nCount )
310  return;
311  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
312  rWorksheet->startElement(XML_mergeCells, XML_count, OString::number(nCount));
313  for( size_t i = 0; i < nCount; ++i )
314  {
315  const ScRange & rRange = maMergedRanges[ i ];
316  rWorksheet->singleElement(XML_mergeCell, XML_ref,
317  XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), rRange));
318  }
319  rWorksheet->endElement( XML_mergeCells );
320 }
321 
322 // Hyperlinks =================================================================
323 
324 XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rUrlField, const ScAddress& rScPos ) :
326  maScPos( rScPos ),
327  mxVarData( new SvMemoryStream ),
328  mnFlags( 0 )
329 {
330  const OUString& rUrl = rUrlField.GetURL();
331  const OUString& rRepr = rUrlField.GetRepresentation();
332  INetURLObject aUrlObj( rUrl );
333  const INetProtocol eProtocol = aUrlObj.GetProtocol();
334  bool bWithRepr = !rRepr.isEmpty();
335  XclExpStream aXclStrm( *mxVarData, rRoot ); // using in raw write mode.
336 
337  // description
338  if( bWithRepr )
339  {
340  XclExpString aDescr( rRepr, XclStrFlags::ForceUnicode, 255 );
341  aXclStrm << sal_uInt32( aDescr.Len() + 1 ); // string length + 1 trailing zero word
342  aDescr.WriteBuffer( aXclStrm ); // NO flags
343  aXclStrm << sal_uInt16( 0 );
344 
346  m_Repr = rRepr;
347  }
348 
349  // file link or URL
350  if( eProtocol == INetProtocol::File || eProtocol == INetProtocol::Smb )
351  {
352  sal_uInt16 nLevel;
353  bool bRel;
354  /* TODO: should we differentiate between BIFF and OOXML and write IURI
355  * encoded for OOXML? */
356  OUString aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot, false ) );
357 
358  if( eProtocol == INetProtocol::Smb )
359  {
360  // #n382718# (and #n261623#) Convert smb notation to '\\'
361  aFileName = aUrlObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
362  aFileName = aFileName.copy(4); // skip the 'smb:' part
363  aFileName = aFileName.replace('/', '\\');
364  }
365 
366  if( !bRel )
369 
370  OString aAsciiLink(OUStringToOString(aFileName,
371  rRoot.GetTextEncoding()));
372  XclExpString aLink( aFileName, XclStrFlags::ForceUnicode, 255 );
373  aXclStrm << XclTools::maGuidFileMoniker
374  << nLevel
375  << sal_uInt32( aAsciiLink.getLength() + 1 ); // string length + 1 trailing zero byte
376  aXclStrm.Write( aAsciiLink.getStr(), aAsciiLink.getLength() );
377  aXclStrm << sal_uInt8( 0 )
378  << sal_uInt32( 0xDEADFFFF );
379  aXclStrm.WriteZeroBytes( 20 );
380  aXclStrm << sal_uInt32( aLink.GetBufferSize() + 6 )
381  << sal_uInt32( aLink.GetBufferSize() ) // byte count, not string length
382  << sal_uInt16( 0x0003 );
383  aLink.WriteBuffer( aXclStrm ); // NO flags
384 
385  if (m_Repr.isEmpty())
386  m_Repr = aFileName;
387 
389 
390  if( bRel )
391  {
392  for( int i = 0; i < nLevel; ++i )
393  msTarget = "../" + msTarget;
394  }
395  else
396  {
397  // ooxml expects the file:/// part appended ( or at least
398  // ms2007 does, ms2010 is more tolerant )
399  msTarget = "file:///" + msTarget;
400  }
401  }
402  else if( eProtocol != INetProtocol::NotValid )
403  {
404  XclExpString aUrl( aUrlObj.GetURLNoMark(), XclStrFlags::ForceUnicode, 255 );
405  aXclStrm << XclTools::maGuidUrlMoniker
406  << sal_uInt32( aUrl.GetBufferSize() + 2 ); // byte count + 1 trailing zero word
407  aUrl.WriteBuffer( aXclStrm ); // NO flags
408  aXclStrm << sal_uInt16( 0 );
409 
411  if (m_Repr.isEmpty())
412  m_Repr = rUrl;
413 
415  }
416  else if( !rUrl.isEmpty() && rUrl[0] == '#' ) // hack for #89066#
417  {
418  OUString aTextMark( rUrl.copy( 1 ) );
419 
420  sal_Int32 nSepPos = aTextMark.lastIndexOf( '!' );
421  sal_Int32 nPointPos = aTextMark.lastIndexOf( '.' );
422  // last dot is the separator, if there is no ! after it
423  if(nSepPos < nPointPos)
424  {
425  nSepPos = nPointPos;
426  aTextMark = aTextMark.replaceAt( nSepPos, 1, "!" );
427  }
428 
429  if(nSepPos != -1)
430  {
431  OUString aSheetName( aTextMark.copy(0, nSepPos));
432 
433  if ( aSheetName.indexOf(' ') != -1 && aSheetName[0] != '\'')
434  {
435  aTextMark = "'" + aTextMark.replaceAt(nSepPos, 0, "'");
436  }
437  }
438 
439  mxTextMark.reset( new XclExpString( aTextMark, XclStrFlags::ForceUnicode, 255 ) );
440  }
441 
442  // text mark
443  if( !mxTextMark && aUrlObj.HasMark() )
444  mxTextMark.reset( new XclExpString( aUrlObj.GetMark(), XclStrFlags::ForceUnicode, 255 ) );
445 
446  if( mxTextMark )
447  {
448  aXclStrm << sal_uInt32( mxTextMark->Len() + 1 ); // string length + 1 trailing zero word
449  mxTextMark->WriteBuffer( aXclStrm ); // NO flags
450  aXclStrm << sal_uInt16( 0 );
451 
453 
454  OUString location = XclXmlUtils::ToOUString(*mxTextMark);
455  if (!location.isEmpty() && msTarget.endsWith("#" + location))
456  msTarget = msTarget.copy(0, msTarget.getLength() - location.getLength() - 1);
457  }
458 
459  SetRecSize( 32 + mxVarData->Tell() );
460 }
461 
463 {
464 }
465 
467  sal_uInt16& rnLevel, bool& rbRel, const OUString& rUrl, const XclExpRoot& rRoot, bool bEncoded )
468 {
469  INetURLObject aURLObject( rUrl );
470  OUString aDosName(bEncoded ? aURLObject.GetMainURL(INetURLObject::DecodeMechanism::ToIUri)
471  : aURLObject.getFSysPath(FSysStyle::Dos));
472  rnLevel = 0;
473  rbRel = rRoot.IsRelUrl();
474 
475  if( rbRel )
476  {
477  // try to convert to relative file name
478  OUString aTmpName( aDosName );
479  aDosName = INetURLObject::GetRelURL( rRoot.GetBasePath(), rUrl,
482 
483  if (aDosName.startsWith(INET_FILE_SCHEME))
484  {
485  // not converted to rel -> back to old, return absolute flag
486  aDosName = aTmpName;
487  rbRel = false;
488  }
489  else if (aDosName.startsWith("./"))
490  {
491  aDosName = aDosName.copy(2);
492  }
493  else
494  {
495  while (aDosName.startsWith("../"))
496  {
497  aDosName = aDosName.copy(3);
498  ++rnLevel;
499  }
500  }
501  }
502  return aDosName;
503 }
504 
506 {
507  sal_uInt16 nXclCol = static_cast< sal_uInt16 >( maScPos.Col() );
508  sal_uInt16 nXclRow = static_cast< sal_uInt16 >( maScPos.Row() );
509  rStrm << nXclRow << nXclRow << nXclCol << nXclCol;
510  WriteEmbeddedData( rStrm );
511 }
512 
514 {
515  rStrm << XclTools::maGuidStdLink
516  << sal_uInt32( 2 )
517  << mnFlags;
518 
520  rStrm.CopyFromStream( *mxVarData );
521 }
522 
524 {
525  OUString sId = !msTarget.isEmpty() ? rStrm.addRelation( rStrm.GetCurrentStream()->getOutputStream(),
526  oox::getRelationship(Relationship::HYPERLINK),
527  msTarget, true ) : OUString();
528  std::optional<OString> sTextMark;
529  if (mxTextMark)
530  sTextMark = XclXmlUtils::ToOString(*mxTextMark);
531  rStrm.GetCurrentStream()->singleElement( XML_hyperlink,
532  XML_ref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), maScPos),
533  FSNS( XML_r, XML_id ), sax_fastparser::UseIf(sId, !sId.isEmpty()),
534  XML_location, sTextMark,
535  // OOXTODO: XML_tooltip, from record HLinkTooltip 800h wzTooltip
536  XML_display, m_Repr );
537 }
538 
539 // Label ranges ===============================================================
540 
542  XclExpRoot( rRoot )
543 {
544  SCTAB nScTab = GetCurrScTab();
545  // row label ranges
546  FillRangeList( maRowRanges, rRoot.GetDoc().GetRowNameRangesRef(), nScTab );
547  // row labels only over 1 column (restriction of Excel97/2000/XP)
548  for ( size_t i = 0, nRanges = maRowRanges.size(); i < nRanges; ++i )
549  {
550  ScRange & rScRange = maRowRanges[ i ];
551  if( rScRange.aStart.Col() != rScRange.aEnd.Col() )
552  rScRange.aEnd.SetCol( rScRange.aStart.Col() );
553  }
554  // col label ranges
555  FillRangeList( maColRanges, rRoot.GetDoc().GetColNameRangesRef(), nScTab );
556 }
557 
559  const ScRangePairListRef& xLabelRangesRef, SCTAB nScTab )
560 {
561  for ( size_t i = 0, nPairs = xLabelRangesRef->size(); i < nPairs; ++i )
562  {
563  const ScRangePair & rRangePair = (*xLabelRangesRef)[i];
564  const ScRange& rScRange = rRangePair.GetRange( 0 );
565  if( rScRange.aStart.Tab() == nScTab )
566  rScRanges.push_back( rScRange );
567  }
568 }
569 
571 {
573  XclRangeList aRowXclRanges, aColXclRanges;
574  rAddrConv.ConvertRangeList( aRowXclRanges, maRowRanges, false );
575  rAddrConv.ConvertRangeList( aColXclRanges, maColRanges, false );
576  if( !aRowXclRanges.empty() || !aColXclRanges.empty() )
577  {
578  rStrm.StartRecord( EXC_ID_LABELRANGES, 4 + 8 * (aRowXclRanges.size() + aColXclRanges.size()) );
579  rStrm << aRowXclRanges << aColXclRanges;
580  rStrm.EndRecord();
581  }
582 }
583 
584 // Conditional formatting ====================================================
585 
587 class XclExpCFImpl : protected XclExpRoot
588 {
589 public:
590  explicit XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority, ScAddress aOrigin );
591 
593  void WriteBody( XclExpStream& rStrm );
594  void SaveXml( XclExpXmlStream& rStrm );
595 
596 private:
604  sal_uInt32 mnFontColorId;
607  sal_Int32 mnPriority;
608  bool mbFontUsed;
611  bool mbColorUsed;
616  bool mbPattUsed;
618 };
619 
620 XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority, ScAddress aOrigin ) :
621  XclExpRoot( rRoot ),
622  mrFormatEntry( rFormatEntry ),
623  maOrigin( aOrigin ),
624  mnFontColorId( 0 ),
626  mnOperator( EXC_CF_CMP_NONE ),
627  mnPriority( nPriority ),
628  mbFontUsed( false ),
629  mbHeightUsed( false ),
630  mbWeightUsed( false ),
631  mbColorUsed( false ),
632  mbUnderlUsed( false ),
633  mbItalicUsed( false ),
634  mbStrikeUsed( false ),
635  mbBorderUsed( false ),
636  mbPattUsed( false ),
637  mbFormula2(false)
638 {
639  // Set correct tab for maOrigin from GetValidSrcPos() of the format-entry.
640  ScAddress aValidSrcPos = mrFormatEntry.GetValidSrcPos();
641  maOrigin.SetTab(aValidSrcPos.Tab());
642 
643  /* Get formatting attributes here, and not in WriteBody(). This is needed to
644  correctly insert all colors into the palette. */
645 
646  if( SfxStyleSheetBase* pStyleSheet = GetDoc().GetStyleSheetPool()->Find( mrFormatEntry.GetStyle(), SfxStyleFamily::Para ) )
647  {
648  const SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
649 
650  // font
653  mbColorUsed = ScfTools::CheckItem( rItemSet, ATTR_FONT_COLOR, true );
658  if( mbFontUsed )
659  {
660  vcl::Font aFont;
661  ScPatternAttr::GetFont( aFont, rItemSet, SC_AUTOCOL_RAW );
662  maFontData.FillFromVclFont( aFont );
664  }
665 
666  // border
667  mbBorderUsed = ScfTools::CheckItem( rItemSet, ATTR_BORDER, true );
668  if( mbBorderUsed )
669  maBorder.FillFromItemSet( rItemSet, GetPalette(), GetBiff() );
670 
671  // pattern
672  mbPattUsed = ScfTools::CheckItem( rItemSet, ATTR_BACKGROUND, true );
673  if( mbPattUsed )
674  maArea.FillFromItemSet( rItemSet, GetPalette(), true );
675  }
676 
677  // *** mode and comparison operator ***
678 
679  switch( rFormatEntry.GetOperation() )
680  {
683  break;
686  mbFormula2 = true;
687  break;
690  mbFormula2 = true;
691  break;
694  break;
697  break;
700  break;
703  break;
706  break;
709  break;
712  break;
713  default:
715  OSL_FAIL( "XclExpCF::WriteBody - unknown condition type" );
716  }
717 }
718 
720 {
721 
722  // *** formulas ***
723 
725 
726  std::unique_ptr< ScTokenArray > xScTokArr( mrFormatEntry.CreateFlatCopiedTokenArray( 0 ) );
727  mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr );
728 
729  if (mbFormula2)
730  {
731  xScTokArr = mrFormatEntry.CreateFlatCopiedTokenArray( 1 );
732  mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr );
733  }
734 
735  // *** mode and comparison operator ***
736 
737  rStrm << mnType << mnOperator;
738 
739  // *** formula sizes ***
740 
741  sal_uInt16 nFmlaSize1 = mxTokArr1 ? mxTokArr1->GetSize() : 0;
742  sal_uInt16 nFmlaSize2 = mxTokArr2 ? mxTokArr2->GetSize() : 0;
743  rStrm << nFmlaSize1 << nFmlaSize2;
744 
745  // *** formatting blocks ***
746 
748  {
749  sal_uInt32 nFlags = EXC_CF_ALLDEFAULT;
750 
754 
755  // attributes used -> set flags to 0.
758 
759  rStrm << nFlags << sal_uInt16( 0 );
760 
761  if( mbFontUsed )
762  {
763  // font height, 0xFFFFFFFF indicates unused
764  sal_uInt32 nHeight = mbHeightUsed ? maFontData.mnHeight : 0xFFFFFFFF;
765  // font style: italic and strikeout
766  sal_uInt32 nStyle = 0;
769  // font color, 0xFFFFFFFF indicates unused
770  sal_uInt32 nColor = mbColorUsed ? GetPalette().GetColorIndex( mnFontColorId ) : 0xFFFFFFFF;
771  // font used flags for italic, weight, and strikeout -> 0 = used, 1 = default
772  sal_uInt32 nFontFlags1 = EXC_CF_FONT_ALLDEFAULT;
773  ::set_flag( nFontFlags1, EXC_CF_FONT_STYLE, !(mbItalicUsed || mbWeightUsed) );
775  // font used flag for underline -> 0 = used, 1 = default
776  sal_uInt32 nFontFlags3 = mbUnderlUsed ? 0 : EXC_CF_FONT_UNDERL;
777 
778  rStrm.WriteZeroBytesToRecord( 64 );
779  rStrm << nHeight
780  << nStyle
784  rStrm.WriteZeroBytesToRecord( 3 );
785  rStrm << nColor
786  << sal_uInt32( 0 )
787  << nFontFlags1
788  << EXC_CF_FONT_ESCAPEM // escapement never used -> set the flag
789  << nFontFlags3;
790  rStrm.WriteZeroBytesToRecord( 16 );
791  rStrm << sal_uInt16( 1 ); // must be 1
792  }
793 
794  if( mbBorderUsed )
795  {
796  sal_uInt16 nLineStyle = 0;
797  sal_uInt32 nLineColor = 0;
799  maBorder.FillToCF8( nLineStyle, nLineColor );
800  rStrm << nLineStyle << nLineColor << sal_uInt16( 0 );
801  }
802 
803  if( mbPattUsed )
804  {
805  sal_uInt16 nPattern = 0, nColor = 0;
807  maArea.FillToCF8( nPattern, nColor );
808  rStrm << nPattern << nColor;
809  }
810  }
811  else
812  {
813  // no data blocks at all
814  rStrm << sal_uInt32( 0 ) << sal_uInt16( 0 );
815  }
816 
817  // *** formulas ***
818 
819  if( mxTokArr1 )
820  mxTokArr1->WriteArray( rStrm );
821  if( mxTokArr2 )
822  mxTokArr2->WriteArray( rStrm );
823 }
824 
825 namespace {
826 
827 const char* GetOperatorString(ScConditionMode eMode, bool& bFrmla2)
828 {
829  const char *pRet = nullptr;
830  switch(eMode)
831  {
833  pRet = "equal";
834  break;
836  pRet = "lessThan";
837  break;
839  pRet = "greaterThan";
840  break;
842  pRet = "lessThanOrEqual";
843  break;
845  pRet = "greaterThanOrEqual";
846  break;
848  pRet = "notEqual";
849  break;
851  bFrmla2 = true;
852  pRet = "between";
853  break;
855  bFrmla2 = true;
856  pRet = "notBetween";
857  break;
859  pRet = nullptr;
860  break;
862  pRet = nullptr;
863  break;
865  pRet = "beginsWith";
866  break;
868  pRet = "endsWith";
869  break;
871  pRet = "containsText";
872  break;
874  pRet = "notContains";
875  break;
877  break;
879  default:
880  break;
881  }
882  return pRet;
883 }
884 
885 const char* GetTypeString(ScConditionMode eMode)
886 {
887  switch(eMode)
888  {
890  return "expression";
895  return "top10";
900  return "aboveAverage";
902  return "uniqueValues";
904  return "duplicateValues";
906  return "containsErrors";
908  return "notContainsErrors";
910  return "beginsWith";
912  return "endsWith";
914  return "containsText";
916  return "notContainsText";
917  default:
918  return "cellIs";
919  }
920 }
921 
922 bool IsTopBottomRule(ScConditionMode eMode)
923 {
924  switch(eMode)
925  {
930  return true;
931  default:
932  break;
933  }
934 
935  return false;
936 }
937 
938 bool IsTextRule(ScConditionMode eMode)
939 {
940  switch(eMode)
941  {
946  return true;
947  default:
948  break;
949  }
950 
951  return false;
952 }
953 
954 bool RequiresFormula(ScConditionMode eMode)
955 {
956  if (IsTopBottomRule(eMode))
957  return false;
958  else if (IsTextRule(eMode))
959  return false;
960 
961  switch (eMode)
962  {
967  return false;
968  default:
969  break;
970  }
971 
972  return true;
973 }
974 
975 bool RequiresFixedFormula(ScConditionMode eMode)
976 {
977  switch(eMode)
978  {
985  return true;
986  default:
987  break;
988  }
989 
990  return false;
991 }
992 
993 OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, const OString& rText)
994 {
995  OStringBuffer aBuffer;
996  XclXmlUtils::ToOString(aBuffer, rAddress);
997  OString aPos = aBuffer.makeStringAndClear();
998  switch (eMode)
999  {
1001  return OString("ISERROR(" + aPos + ")") ;
1003  return OString("NOT(ISERROR(" + aPos + "))") ;
1005  return OString("LEFT(" + aPos + ",LEN(\"" + rText + "\"))=\"" + rText + "\"");
1007  return OString("RIGHT(" + aPos +",LEN(\"" + rText + "\"))=\"" + rText + "\"");
1009  return OString("NOT(ISERROR(SEARCH(\"" + rText + "\"," + aPos + ")))");
1011  return OString("ISERROR(SEARCH(\"" + rText + "\"," + aPos + "))");
1012  default:
1013  break;
1014  }
1015 
1016  return "";
1017 }
1018 
1019 }
1020 
1022 {
1023  bool bFmla2 = false;
1025  bool bAboveAverage = eOperation == ScConditionMode::AboveAverage ||
1026  eOperation == ScConditionMode::AboveEqualAverage;
1027  bool bEqualAverage = eOperation == ScConditionMode::AboveEqualAverage ||
1028  eOperation == ScConditionMode::BelowEqualAverage;
1029  bool bBottom = eOperation == ScConditionMode::Bottom10
1030  || eOperation == ScConditionMode::BottomPercent;
1031  bool bPercent = eOperation == ScConditionMode::TopPercent ||
1032  eOperation == ScConditionMode::BottomPercent;
1033  OUString aRank("0");
1034  if(IsTopBottomRule(eOperation))
1035  {
1036  // position and formula grammar are not important
1037  // we only store a number there
1038  aRank = mrFormatEntry.GetExpression(ScAddress(0,0,0), 0);
1039  }
1040  OString aText;
1041  if(IsTextRule(eOperation))
1042  {
1043  // we need to write the text without quotes
1044  // we have to actually get the string from
1045  // the token array for that
1046  std::unique_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
1047  if(pTokenArray->GetLen())
1048  aText = pTokenArray->FirstToken()->GetString().getString().toUtf8();
1049  }
1050 
1051  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1052  rWorksheet->startElement( XML_cfRule,
1053  XML_type, GetTypeString( mrFormatEntry.GetOperation() ),
1054  XML_priority, OString::number(mnPriority + 1),
1055  XML_operator, GetOperatorString( mrFormatEntry.GetOperation(), bFmla2 ),
1056  XML_aboveAverage, ToPsz10(bAboveAverage),
1057  XML_equalAverage, ToPsz10(bEqualAverage),
1058  XML_bottom, ToPsz10(bBottom),
1059  XML_percent, ToPsz10(bPercent),
1060  XML_rank, aRank,
1061  XML_text, aText,
1062  XML_dxfId, OString::number(GetDxfs().GetDxfId(mrFormatEntry.GetStyle())) );
1063 
1064  if (RequiresFixedFormula(eOperation))
1065  {
1066  rWorksheet->startElement(XML_formula);
1067  OString aFormula = GetFixedFormula(eOperation, maOrigin, aText);
1068  rWorksheet->writeEscaped(aFormula.getStr());
1069  rWorksheet->endElement( XML_formula );
1070  }
1071  else if(RequiresFormula(eOperation))
1072  {
1073  rWorksheet->startElement(XML_formula);
1074  std::unique_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
1076  pTokenArray.get()));
1077  rWorksheet->endElement( XML_formula );
1078  if (bFmla2)
1079  {
1080  rWorksheet->startElement(XML_formula);
1081  std::unique_ptr<ScTokenArray> pTokenArray2(mrFormatEntry.CreateFlatCopiedTokenArray(1));
1083  pTokenArray2.get()));
1084  rWorksheet->endElement( XML_formula );
1085  }
1086  }
1087  // OOXTODO: XML_extLst
1088  rWorksheet->endElement( XML_cfRule );
1089 }
1090 
1091 XclExpCF::XclExpCF( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority, ScAddress aOrigin ) :
1093  XclExpRoot( rRoot ),
1094  mxImpl( new XclExpCFImpl( rRoot, rFormatEntry, nPriority, aOrigin ) )
1095 {
1096 }
1097 
1099 {
1100 }
1101 
1103 {
1104  mxImpl->WriteBody( rStrm );
1105 }
1106 
1108 {
1109  mxImpl->SaveXml( rStrm );
1110 }
1111 
1112 XclExpDateFormat::XclExpDateFormat( const XclExpRoot& rRoot, const ScCondDateFormatEntry& rFormatEntry, sal_Int32 nPriority ):
1114  XclExpRoot( rRoot ),
1115  mrFormatEntry(rFormatEntry),
1116  mnPriority(nPriority)
1117 {
1118 }
1119 
1121 {
1122 }
1123 
1124 namespace {
1125 
1126 const char* getTimePeriodString( condformat::ScCondFormatDateType eType )
1127 {
1128  switch(eType)
1129  {
1130  case condformat::TODAY:
1131  return "today";
1132  case condformat::YESTERDAY:
1133  return "yesterday";
1134  case condformat::TOMORROW:
1135  return "yesterday";
1136  case condformat::THISWEEK:
1137  return "thisWeek";
1138  case condformat::LASTWEEK:
1139  return "lastWeek";
1140  case condformat::NEXTWEEK:
1141  return "nextWeek";
1142  case condformat::THISMONTH:
1143  return "thisMonth";
1144  case condformat::LASTMONTH:
1145  return "lastMonth";
1146  case condformat::NEXTMONTH:
1147  return "nextMonth";
1148  case condformat::LAST7DAYS:
1149  return "last7Days";
1150  default:
1151  break;
1152  }
1153  return nullptr;
1154 }
1155 
1156 }
1157 
1159 {
1160  // only write the supported entries into OOXML
1161  const char* sTimePeriod = getTimePeriodString(mrFormatEntry.GetDateType());
1162  if(!sTimePeriod)
1163  return;
1164 
1165  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1166  rWorksheet->startElement( XML_cfRule,
1167  XML_type, "timePeriod",
1168  XML_priority, OString::number(mnPriority + 1),
1169  XML_timePeriod, sTimePeriod,
1170  XML_dxfId, OString::number(GetDxfs().GetDxfId(mrFormatEntry.GetStyleName())) );
1171  rWorksheet->endElement( XML_cfRule);
1172 }
1173 
1174 XclExpCfvo::XclExpCfvo(const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rAddr, bool bFirst):
1175  XclExpRecord(),
1176  XclExpRoot( rRoot ),
1177  mrEntry(rEntry),
1178  maSrcPos(rAddr),
1179  mbFirst(bFirst)
1180 {
1181 }
1182 
1183 namespace {
1184 
1185 OString getColorScaleType( const ScColorScaleEntry& rEntry, bool bFirst )
1186 {
1187  switch(rEntry.GetType())
1188  {
1189  case COLORSCALE_MIN:
1190  return "min";
1191  case COLORSCALE_MAX:
1192  return "max";
1193  case COLORSCALE_PERCENT:
1194  return "percent";
1195  case COLORSCALE_FORMULA:
1196  return "formula";
1197  case COLORSCALE_AUTO:
1198  if(bFirst)
1199  return "min";
1200  else
1201  return "max";
1202  case COLORSCALE_PERCENTILE:
1203  return "percentile";
1204  default:
1205  break;
1206  }
1207 
1208  return "num";
1209 }
1210 
1211 }
1212 
1214 {
1215  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1216 
1217  OString aValue;
1219  {
1221  mrEntry.GetFormula());
1222  aValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 );
1223  }
1224  else
1225  {
1226  aValue = OString::number( mrEntry.GetValue() );
1227  }
1228 
1229  rWorksheet->startElement( XML_cfvo,
1230  XML_type, getColorScaleType(mrEntry, mbFirst),
1231  XML_val, aValue );
1232 
1233  rWorksheet->endElement( XML_cfvo );
1234 }
1235 
1237  XclExpRecord(),
1238  XclExpRoot( rRoot ),
1239  mrColor( rColor )
1240 {
1241 }
1242 
1244 {
1245 }
1246 
1248 {
1249  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1250 
1251  rWorksheet->startElement(XML_color, XML_rgb, XclXmlUtils::ToOString(mrColor));
1252 
1253  rWorksheet->endElement( XML_color );
1254 }
1255 
1256 namespace {
1257 
1258 OString createHexStringFromDigit(sal_uInt8 nDigit)
1259 {
1260  OString aString = OString::number( nDigit, 16 );
1261  if(aString.getLength() == 1)
1262  aString += OString::number(0);
1263  return aString;
1264 }
1265 
1266 OString createGuidStringFromInt(sal_uInt8 nGuid[16])
1267 {
1268  OStringBuffer aBuffer;
1269  aBuffer.append('{');
1270  for(size_t i = 0; i < 16; ++i)
1271  {
1272  aBuffer.append(createHexStringFromDigit(nGuid[i]));
1273  if(i == 3|| i == 5 || i == 7 || i == 9 )
1274  aBuffer.append('-');
1275  }
1276  aBuffer.append('}');
1277  OString aString = aBuffer.makeStringAndClear();
1278  return aString.toAsciiUpperCase();
1279 }
1280 
1281 OString generateGUIDString()
1282 {
1283  sal_uInt8 nGuid[16];
1284  rtl_createUuid(nGuid, nullptr, true);
1285  return createGuidStringFromInt(nGuid);
1286 }
1287 
1288 }
1289 
1290 XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat& rCondFormat, const XclExtLstRef& xExtLst, sal_Int32& rIndex ) :
1292  XclExpRoot( rRoot )
1293 {
1294  const ScRangeList& aScRanges = rCondFormat.GetRange();
1295  GetAddressConverter().ConvertRangeList( maXclRanges, aScRanges, true );
1296  if( !maXclRanges.empty() )
1297  {
1298  std::vector<XclExpExtCondFormatData> aExtEntries;
1299  ScAddress aOrigin = aScRanges.Combine().aStart;
1300  for( size_t nIndex = 0, nCount = rCondFormat.size(); nIndex < nCount; ++nIndex )
1301  if( const ScFormatEntry* pFormatEntry = rCondFormat.GetEntry( nIndex ) )
1302  {
1303  if(pFormatEntry->GetType() == ScFormatEntry::Type::Condition)
1304  maCFList.AppendNewRecord( new XclExpCF( GetRoot(), static_cast<const ScCondFormatEntry&>(*pFormatEntry), ++rIndex, aOrigin ) );
1305  else if(pFormatEntry->GetType() == ScFormatEntry::Type::ExtCondition)
1306  {
1307  const ScCondFormatEntry& rFormat = static_cast<const ScCondFormatEntry&>(*pFormatEntry);
1308  XclExpExtCondFormatData aExtEntry;
1309  aExtEntry.nPriority = ++rIndex;
1310  aExtEntry.aGUID = generateGUIDString();
1311  aExtEntry.pEntry = &rFormat;
1312  aExtEntries.push_back(aExtEntry);
1313  }
1314  else if(pFormatEntry->GetType() == ScFormatEntry::Type::Colorscale)
1315  maCFList.AppendNewRecord( new XclExpColorScale( GetRoot(), static_cast<const ScColorScaleFormat&>(*pFormatEntry), ++rIndex ) );
1316  else if(pFormatEntry->GetType() == ScFormatEntry::Type::Databar)
1317  {
1318  const ScDataBarFormat& rFormat = static_cast<const ScDataBarFormat&>(*pFormatEntry);
1319  XclExpExtCondFormatData aExtEntry;
1320  aExtEntry.nPriority = -1;
1321  aExtEntry.aGUID = generateGUIDString();
1322  aExtEntry.pEntry = &rFormat;
1323  aExtEntries.push_back(aExtEntry);
1324 
1325  maCFList.AppendNewRecord( new XclExpDataBar( GetRoot(), rFormat, ++rIndex, aExtEntry.aGUID));
1326  }
1327  else if(pFormatEntry->GetType() == ScFormatEntry::Type::Iconset)
1328  {
1329  // don't export iconSet entries that are not in OOXML
1330  const ScIconSetFormat& rIconSet = static_cast<const ScIconSetFormat&>(*pFormatEntry);
1331  bool bNeedsExt = false;
1332  switch (rIconSet.GetIconSetData()->eIconSetType)
1333  {
1334  case IconSet_3Smilies:
1335  case IconSet_3ColorSmilies:
1336  case IconSet_3Stars:
1337  case IconSet_3Triangles:
1338  case IconSet_5Boxes:
1339  {
1340  bNeedsExt = true;
1341  }
1342  break;
1343  default:
1344  break;
1345  }
1346 
1347  bNeedsExt |= rIconSet.GetIconSetData()->mbCustom;
1348 
1349  if (bNeedsExt)
1350  {
1351  XclExpExtCondFormatData aExtEntry;
1352  aExtEntry.nPriority = ++rIndex;
1353  aExtEntry.aGUID = generateGUIDString();
1354  aExtEntry.pEntry = &rIconSet;
1355  aExtEntries.push_back(aExtEntry);
1356  }
1357  else
1358  maCFList.AppendNewRecord( new XclExpIconSet( GetRoot(), rIconSet, ++rIndex ) );
1359  }
1360  else if(pFormatEntry->GetType() == ScFormatEntry::Type::Date)
1361  maCFList.AppendNewRecord( new XclExpDateFormat( GetRoot(), static_cast<const ScCondDateFormatEntry&>(*pFormatEntry), ++rIndex ) );
1362  }
1364 
1365  if(!aExtEntries.empty() && xExtLst)
1366  {
1367  XclExpExt* pParent = xExtLst->GetItem( XclExpExtDataBarType );
1368  if( !pParent )
1369  {
1370  xExtLst->AddRecord( new XclExpExtCondFormat( *xExtLst ) );
1371  pParent = xExtLst->GetItem( XclExpExtDataBarType );
1372  }
1373  static_cast<XclExpExtCondFormat*>(xExtLst->GetItem( XclExpExtDataBarType ))->AddRecord(
1374  new XclExpExtConditionalFormatting( *pParent, aExtEntries, aScRanges));
1375  }
1376  }
1377 }
1378 
1380 {
1381 }
1382 
1384 {
1385  // ccf (2 bytes): An unsigned integer that specifies the count of CF records that follow this
1386  // record. MUST be greater than or equal to 0x0001, and less than or equal to 0x0003.
1387 
1388  SAL_WARN_IF( maCFList.GetSize() > 3, "sc.filter", "More than 3 conditional filters for cell(s), won't export");
1389 
1390  return !maCFList.IsEmpty() && maCFList.GetSize() <= 3 && !maXclRanges.empty();
1391 }
1392 
1394 {
1395  return !maCFList.IsEmpty() && !maXclRanges.empty();
1396 }
1397 
1399 {
1400  if( IsValidForBinary() )
1401  {
1402  XclExpRecord::Save( rStrm );
1403  maCFList.Save( rStrm );
1404  }
1405 }
1406 
1408 {
1409  OSL_ENSURE( !maCFList.IsEmpty(), "XclExpCondfmt::WriteBody - no CF records to write" );
1410  OSL_ENSURE( !maXclRanges.empty(), "XclExpCondfmt::WriteBody - no cell ranges found" );
1411 
1412  rStrm << static_cast< sal_uInt16 >( maCFList.GetSize() )
1413  << sal_uInt16( 1 )
1415  << maXclRanges;
1416 }
1417 
1419 {
1420  if( !IsValidForXml() )
1421  return;
1422 
1423  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1424  rWorksheet->startElement( XML_conditionalFormatting,
1425  XML_sqref, msSeqRef
1426  // OOXTODO: XML_pivot
1427  );
1428 
1429  maCFList.SaveXml( rStrm );
1430 
1431  rWorksheet->endElement( XML_conditionalFormatting );
1432 }
1433 
1434 XclExpColorScale::XclExpColorScale( const XclExpRoot& rRoot, const ScColorScaleFormat& rFormat, sal_Int32 nPriority ):
1435  XclExpRecord(),
1436  XclExpRoot( rRoot ),
1437  mnPriority( nPriority )
1438 {
1439  const ScRange & rRange = rFormat.GetRange().front();
1440  ScAddress aAddr = rRange.aStart;
1441  for(const auto& rxColorScaleEntry : rFormat)
1442  {
1443  // exact position is not important, we allow only absolute refs
1444 
1445  XclExpCfvoList::RecordRefType xCfvo( new XclExpCfvo( GetRoot(), *rxColorScaleEntry, aAddr ) );
1446  maCfvoList.AppendRecord( xCfvo );
1447  XclExpColScaleColList::RecordRefType xClo( new XclExpColScaleCol( GetRoot(), rxColorScaleEntry->GetColor() ) );
1448  maColList.AppendRecord( xClo );
1449  }
1450 }
1451 
1453 {
1454  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1455 
1456  rWorksheet->startElement( XML_cfRule,
1457  XML_type, "colorScale",
1458  XML_priority, OString::number(mnPriority + 1) );
1459 
1460  rWorksheet->startElement(XML_colorScale);
1461 
1462  maCfvoList.SaveXml(rStrm);
1463  maColList.SaveXml(rStrm);
1464 
1465  rWorksheet->endElement( XML_colorScale );
1466 
1467  rWorksheet->endElement( XML_cfRule );
1468 }
1469 
1470 XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, sal_Int32 nPriority, const OString& rGUID):
1471  XclExpRecord(),
1472  XclExpRoot( rRoot ),
1473  mrFormat( rFormat ),
1474  mnPriority( nPriority ),
1475  maGUID(rGUID)
1476 {
1477  const ScRange & rRange = rFormat.GetRange().front();
1478  ScAddress aAddr = rRange.aStart;
1479  // exact position is not important, we allow only absolute refs
1480  mpCfvoLowerLimit.reset(
1481  new XclExpCfvo(GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit, aAddr, true));
1482  mpCfvoUpperLimit.reset(
1483  new XclExpCfvo(GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit, aAddr, false));
1484 
1486 }
1487 
1489 {
1490  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1491 
1492  rWorksheet->startElement( XML_cfRule,
1493  XML_type, "dataBar",
1494  XML_priority, OString::number(mnPriority + 1) );
1495 
1496  rWorksheet->startElement( XML_dataBar,
1497  XML_showValue, ToPsz10(!mrFormat.GetDataBarData()->mbOnlyBar),
1498  XML_minLength, OString::number(sal_uInt32(mrFormat.GetDataBarData()->mnMinLength)),
1499  XML_maxLength, OString::number(sal_uInt32(mrFormat.GetDataBarData()->mnMaxLength)) );
1500 
1501  mpCfvoLowerLimit->SaveXml(rStrm);
1502  mpCfvoUpperLimit->SaveXml(rStrm);
1503  mpCol->SaveXml(rStrm);
1504 
1505  rWorksheet->endElement( XML_dataBar );
1506 
1507  // extLst entries for Excel 2010 and 2013
1508  rWorksheet->startElement(XML_extLst);
1509  rWorksheet->startElement(XML_ext,
1510  FSNS(XML_xmlns, XML_x14), rStrm.getNamespaceURL(OOX_NS(xls14Lst)),
1511  XML_uri, "{B025F937-C7B1-47D3-B67F-A62EFF666E3E}");
1512 
1513  rWorksheet->startElementNS( XML_x14, XML_id );
1514  rWorksheet->write(maGUID);
1515  rWorksheet->endElementNS( XML_x14, XML_id );
1516 
1517  rWorksheet->endElement( XML_ext );
1518  rWorksheet->endElement( XML_extLst );
1519 
1520  rWorksheet->endElement( XML_cfRule );
1521 }
1522 
1523 XclExpIconSet::XclExpIconSet( const XclExpRoot& rRoot, const ScIconSetFormat& rFormat, sal_Int32 nPriority ):
1524  XclExpRecord(),
1525  XclExpRoot( rRoot ),
1526  mrFormat( rFormat ),
1527  mnPriority( nPriority )
1528 {
1529  const ScRange & rRange = rFormat.GetRange().front();
1530  ScAddress aAddr = rRange.aStart;
1531  for (auto const& itr : rFormat)
1532  {
1533  // exact position is not important, we allow only absolute refs
1534 
1535  XclExpCfvoList::RecordRefType xCfvo( new XclExpCfvo( GetRoot(), *itr, aAddr ) );
1536  maCfvoList.AppendRecord( xCfvo );
1537  }
1538 }
1539 
1541 {
1542  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1543 
1544  rWorksheet->startElement( XML_cfRule,
1545  XML_type, "iconSet",
1546  XML_priority, OString::number(mnPriority + 1) );
1547 
1549  rWorksheet->startElement( XML_iconSet,
1550  XML_iconSet, pIconSetName,
1551  XML_showValue, sax_fastparser::UseIf("0", !mrFormat.GetIconSetData()->mbShowValue),
1552  XML_reverse, sax_fastparser::UseIf("1", mrFormat.GetIconSetData()->mbReverse));
1553 
1554  maCfvoList.SaveXml( rStrm );
1555 
1556  rWorksheet->endElement( XML_iconSet );
1557  rWorksheet->endElement( XML_cfRule );
1558 }
1559 
1561  XclExpRoot( rRoot )
1562 {
1563  if( const ScConditionalFormatList* pCondFmtList = GetDoc().GetCondFormList(GetCurrScTab()) )
1564  {
1565  sal_Int32 nIndex = 0;
1566  for( const auto& rxCondFmt : *pCondFmtList)
1567  {
1568  XclExpCondfmtList::RecordRefType xCondfmtRec( new XclExpCondfmt( GetRoot(), *rxCondFmt, xExtLst, nIndex ));
1569  if( xCondfmtRec->IsValidForXml() )
1570  maCondfmtList.AppendRecord( xCondfmtRec );
1571  }
1572  }
1573 }
1574 
1576 {
1577  maCondfmtList.Save( rStrm );
1578 }
1579 
1581 {
1582  maCondfmtList.SaveXml( rStrm );
1583 }
1584 
1585 // Validation =================================================================
1586 
1587 namespace {
1588 
1590 void lclWriteDvFormula( XclExpStream& rStrm, const XclTokenArray* pXclTokArr )
1591 {
1592  sal_uInt16 nFmlaSize = pXclTokArr ? pXclTokArr->GetSize() : 0;
1593  rStrm << nFmlaSize << sal_uInt16( 0 );
1594  if( pXclTokArr )
1595  pXclTokArr->WriteArray( rStrm );
1596 }
1597 
1599 void lclWriteDvFormula( XclExpStream& rStrm, const XclExpString& rString )
1600 {
1601  // fake a formula with a single tStr token
1602  rStrm << static_cast< sal_uInt16 >( rString.GetSize() + 1 )
1603  << sal_uInt16( 0 )
1604  << EXC_TOKID_STR
1605  << rString;
1606 }
1607 
1608 const char* lcl_GetValidationType( sal_uInt32 nFlags )
1609 {
1610  switch( nFlags & EXC_DV_MODE_MASK )
1611  {
1612  case EXC_DV_MODE_ANY: return "none";
1613  case EXC_DV_MODE_WHOLE: return "whole";
1614  case EXC_DV_MODE_DECIMAL: return "decimal";
1615  case EXC_DV_MODE_LIST: return "list";
1616  case EXC_DV_MODE_DATE: return "date";
1617  case EXC_DV_MODE_TIME: return "time";
1618  case EXC_DV_MODE_TEXTLEN: return "textLength";
1619  case EXC_DV_MODE_CUSTOM: return "custom";
1620  }
1621  return nullptr;
1622 }
1623 
1624 const char* lcl_GetOperatorType( sal_uInt32 nFlags )
1625 {
1626  switch( nFlags & EXC_DV_COND_MASK )
1627  {
1628  case EXC_DV_COND_BETWEEN: return "between";
1629  case EXC_DV_COND_NOTBETWEEN: return "notBetween";
1630  case EXC_DV_COND_EQUAL: return "equal";
1631  case EXC_DV_COND_NOTEQUAL: return "notEqual";
1632  case EXC_DV_COND_GREATER: return "greaterThan";
1633  case EXC_DV_COND_LESS: return "lessThan";
1634  case EXC_DV_COND_EQGREATER: return "greaterThanOrEqual";
1635  case EXC_DV_COND_EQLESS: return "lessThanOrEqual";
1636  }
1637  return nullptr;
1638 }
1639 
1640 } // namespace
1641 
1642 XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
1644  XclExpRoot( rRoot ),
1645  mnFlags( 0 ),
1646  mnScHandle( nScHandle )
1647 {
1648  if( const ScValidationData* pValData = GetDoc().GetValidationEntry( mnScHandle ) )
1649  {
1650  // prompt box - empty string represented by single NUL character
1651  OUString aTitle, aText;
1652  bool bShowPrompt = pValData->GetInput( aTitle, aText );
1653  if( !aTitle.isEmpty() )
1654  maPromptTitle.Assign( aTitle );
1655  else
1656  maPromptTitle.Assign( '\0' );
1657  if( !aText.isEmpty() )
1658  maPromptText.Assign( aText );
1659  else
1660  maPromptText.Assign( '\0' );
1661 
1662  // error box - empty string represented by single NUL character
1663  ScValidErrorStyle eScErrorStyle;
1664  bool bShowError = pValData->GetErrMsg( aTitle, aText, eScErrorStyle );
1665  if( !aTitle.isEmpty() )
1666  maErrorTitle.Assign( aTitle );
1667  else
1668  maErrorTitle.Assign( '\0' );
1669  if( !aText.isEmpty() )
1670  maErrorText.Assign( aText );
1671  else
1672  maErrorText.Assign( '\0' );
1673 
1674  // flags
1675  switch( pValData->GetDataMode() )
1676  {
1677  case SC_VALID_ANY: mnFlags |= EXC_DV_MODE_ANY; break;
1678  case SC_VALID_WHOLE: mnFlags |= EXC_DV_MODE_WHOLE; break;
1680  case SC_VALID_LIST: mnFlags |= EXC_DV_MODE_LIST; break;
1681  case SC_VALID_DATE: mnFlags |= EXC_DV_MODE_DATE; break;
1682  case SC_VALID_TIME: mnFlags |= EXC_DV_MODE_TIME; break;
1684  case SC_VALID_CUSTOM: mnFlags |= EXC_DV_MODE_CUSTOM; break;
1685  default: OSL_FAIL( "XclExpDV::XclExpDV - unknown mode" );
1686  }
1687 
1688  switch( pValData->GetOperation() )
1689  {
1690  case ScConditionMode::NONE:
1699  default: OSL_FAIL( "XclExpDV::XclExpDV - unknown condition" );
1700  }
1701  switch( eScErrorStyle )
1702  {
1703  case SC_VALERR_STOP: mnFlags |= EXC_DV_ERROR_STOP; break;
1705  case SC_VALERR_INFO: mnFlags |= EXC_DV_ERROR_INFO; break;
1706  case SC_VALERR_MACRO:
1707  // set INFO for validity with macro call, delete title
1709  maErrorTitle.Assign( '\0' ); // contains macro name
1710  break;
1711  default: OSL_FAIL( "XclExpDV::XclExpDV - unknown error style" );
1712  }
1713  ::set_flag( mnFlags, EXC_DV_IGNOREBLANK, pValData->IsIgnoreBlank() );
1714  ::set_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN, pValData->GetListType() == css::sheet::TableValidationVisibility::INVISIBLE );
1715  ::set_flag( mnFlags, EXC_DV_SHOWPROMPT, bShowPrompt );
1716  ::set_flag( mnFlags, EXC_DV_SHOWERROR, bShowError );
1717 
1718  // formulas
1720 
1721  // first formula
1722  std::unique_ptr< ScTokenArray > xScTokArr = pValData->CreateFlatCopiedTokenArray( 0 );
1723  if (xScTokArr)
1724  {
1725  if( pValData->GetDataMode() == SC_VALID_LIST )
1726  {
1727  OUString aString;
1728  if( XclTokenArrayHelper::GetStringList( aString, *xScTokArr, '\n' ) )
1729  {
1730  OUStringBuffer sFormulaBuf;
1731  sFormulaBuf.append( '"' );
1732  /* Formula is a list of string tokens -> build the Excel string.
1733  Data validity is BIFF8 only (important for the XclExpString object).
1734  Excel uses the NUL character as string list separator. */
1736  if (!aString.isEmpty())
1737  {
1738  sal_Int32 nStringIx = 0;
1739  for(;;)
1740  {
1741  const OUString aToken( aString.getToken( 0, '\n', nStringIx ) );
1742  mxString1->Append( aToken );
1743  sFormulaBuf.append( aToken );
1744  if (nStringIx<0)
1745  break;
1746  mxString1->Append(OUString(u'\0'));
1747  sFormulaBuf.append( ',' );
1748  }
1749  }
1751 
1752  // maximum length allowed in Excel is 255 characters, and don't end with an empty token
1753  sal_uInt32 nLen = sFormulaBuf.getLength();
1754  if( nLen > 256 ) // 255 + beginning quote mark
1755  {
1756  nLen = 256;
1757  if( sFormulaBuf[nLen - 1] == ',' )
1758  --nLen;
1759  sFormulaBuf.truncate(nLen);
1760  }
1761 
1762  sFormulaBuf.append( '"' );
1763  msFormula1 = sFormulaBuf.makeStringAndClear();
1764  }
1765  else
1766  {
1767  /* All other formulas in validation are stored like conditional
1768  formatting formulas (with tRefN/tAreaN tokens as value or
1769  array class). But NOT the cell references and defined names
1770  in list validation - they are stored as reference class
1771  tokens... Example:
1772  1) Cell must be equal to A1 -> formula is =A1 -> writes tRefNV token
1773  2) List is taken from A1 -> formula is =A1 -> writes tRefNR token
1774  Formula compiler supports this by offering two different functions
1775  CreateDataValFormula() and CreateListValFormula(). */
1776  if(GetOutput() == EXC_OUTPUT_BINARY)
1777  mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_LISTVAL, *xScTokArr );
1778  else
1779  msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
1780  xScTokArr.get());
1781  }
1782  }
1783  else
1784  {
1785  // no list validation -> convert the formula
1786  if(GetOutput() == EXC_OUTPUT_BINARY)
1787  mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
1788  else
1789  msFormula1 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
1790  xScTokArr.get());
1791  }
1792  }
1793 
1794  // second formula
1795  xScTokArr = pValData->CreateFlatCopiedTokenArray( 1 );
1796  if (xScTokArr)
1797  {
1798  if(GetOutput() == EXC_OUTPUT_BINARY)
1799  mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr );
1800  else
1801  msFormula2 = XclXmlUtils::ToOUString( GetCompileFormulaContext(), pValData->GetSrcPos(),
1802  xScTokArr.get());
1803  }
1804  }
1805  else
1806  {
1807  OSL_FAIL( "XclExpDV::XclExpDV - missing core data" );
1808  mnScHandle = ULONG_MAX;
1809  }
1810 }
1811 
1813 {
1814 }
1815 
1816 void XclExpDV::InsertCellRange( const ScRange& rRange )
1817 {
1818  maScRanges.Join( rRange );
1819 }
1820 
1822 {
1824  return (mnScHandle != ULONG_MAX) && !maXclRanges.empty();
1825 }
1826 
1828 {
1829  // flags and strings
1831  // condition formulas
1832  if( mxString1 )
1833  lclWriteDvFormula( rStrm, *mxString1 );
1834  else
1835  lclWriteDvFormula( rStrm, mxTokArr1.get() );
1836  lclWriteDvFormula( rStrm, mxTokArr2.get() );
1837  // cell ranges
1838  rStrm << maXclRanges;
1839 }
1840 
1842 {
1843  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1844  rWorksheet->startElement( XML_dataValidation,
1845  XML_allowBlank, ToPsz( ::get_flag( mnFlags, EXC_DV_IGNOREBLANK ) ),
1846  XML_error, XESTRING_TO_PSZ( maErrorText ),
1847  // OOXTODO: XML_errorStyle,
1848  XML_errorTitle, XESTRING_TO_PSZ( maErrorTitle ),
1849  // OOXTODO: XML_imeMode,
1850  XML_operator, lcl_GetOperatorType( mnFlags ),
1851  XML_prompt, XESTRING_TO_PSZ( maPromptText ),
1852  XML_promptTitle, XESTRING_TO_PSZ( maPromptTitle ),
1853  // showDropDown should have been showNoDropDown - check oox/xlsx import for details
1854  XML_showDropDown, ToPsz( ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ),
1855  XML_showErrorMessage, ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWERROR ) ),
1856  XML_showInputMessage, ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWPROMPT ) ),
1857  XML_sqref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), maScRanges),
1858  XML_type, lcl_GetValidationType(mnFlags) );
1859  if( !msFormula1.isEmpty() )
1860  {
1861  rWorksheet->startElement(XML_formula1);
1862  rWorksheet->writeEscaped( msFormula1 );
1863  rWorksheet->endElement( XML_formula1 );
1864  }
1865  if( !msFormula2.isEmpty() )
1866  {
1867  rWorksheet->startElement(XML_formula2);
1868  rWorksheet->writeEscaped( msFormula2 );
1869  rWorksheet->endElement( XML_formula2 );
1870  }
1871  rWorksheet->endElement( XML_dataValidation );
1872 }
1873 
1875  XclExpRecord( EXC_ID_DVAL, 18 ),
1876  XclExpRoot( rRoot )
1877 {
1878 }
1879 
1881 {
1882 }
1883 
1884 void XclExpDval::InsertCellRange( const ScRange& rRange, sal_uLong nScHandle )
1885 {
1886  if( GetBiff() == EXC_BIFF8 )
1887  {
1888  XclExpDV& rDVRec = SearchOrCreateDv( nScHandle );
1889  rDVRec.InsertCellRange( rRange );
1890  }
1891 }
1892 
1894 {
1895  // check all records
1896  size_t nPos = maDVList.GetSize();
1897  while( nPos )
1898  {
1899  --nPos; // backwards to keep nPos valid
1900  XclExpDVRef xDVRec = maDVList.GetRecord( nPos );
1901  if( !xDVRec->Finalize() )
1902  maDVList.RemoveRecord( nPos );
1903  }
1904 
1905  // write the DVAL and the DV's
1906  if( !maDVList.IsEmpty() )
1907  {
1908  XclExpRecord::Save( rStrm );
1909  maDVList.Save( rStrm );
1910  }
1911 }
1912 
1914 {
1915  if( maDVList.IsEmpty() )
1916  return;
1917 
1918  sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1919  rWorksheet->startElement( XML_dataValidations,
1920  XML_count, OString::number(maDVList.GetSize())
1921  // OOXTODO: XML_disablePrompts,
1922  // OOXTODO: XML_xWindow,
1923  // OOXTODO: XML_yWindow
1924  );
1925  maDVList.SaveXml( rStrm );
1926  rWorksheet->endElement( XML_dataValidations );
1927 }
1928 
1930 {
1931  // test last found record
1932  if( mxLastFoundDV && (mxLastFoundDV->GetScHandle() == nScHandle) )
1933  return *mxLastFoundDV;
1934 
1935  // binary search
1936  size_t nCurrPos = 0;
1937  if( !maDVList.IsEmpty() )
1938  {
1939  size_t nFirstPos = 0;
1940  size_t nLastPos = maDVList.GetSize() - 1;
1941  bool bLoop = true;
1942  sal_uLong nCurrScHandle = ::std::numeric_limits< sal_uLong >::max();
1943  while( (nFirstPos <= nLastPos) && bLoop )
1944  {
1945  nCurrPos = (nFirstPos + nLastPos) / 2;
1946  mxLastFoundDV = maDVList.GetRecord( nCurrPos );
1947  nCurrScHandle = mxLastFoundDV->GetScHandle();
1948  if( nCurrScHandle == nScHandle )
1949  bLoop = false;
1950  else if( nCurrScHandle < nScHandle )
1951  nFirstPos = nCurrPos + 1;
1952  else if( nCurrPos )
1953  nLastPos = nCurrPos - 1;
1954  else // special case for nLastPos = -1
1955  bLoop = false;
1956  }
1957  if( nCurrScHandle == nScHandle )
1958  return *mxLastFoundDV;
1959  else if( nCurrScHandle < nScHandle )
1960  ++nCurrPos;
1961  }
1962 
1963  // create new DV record
1964  mxLastFoundDV = new XclExpDV( *this, nScHandle );
1965  maDVList.InsertRecord( mxLastFoundDV, nCurrPos );
1966  return *mxLastFoundDV;
1967 }
1968 
1970 {
1971  rStrm.WriteZeroBytes( 10 );
1972  rStrm << EXC_DVAL_NOOBJ << static_cast< sal_uInt32 >( maDVList.GetSize() );
1973 }
1974 
1975 // Web Queries ================================================================
1976 
1978  const OUString& rRangeName,
1979  const OUString& rUrl,
1980  const OUString& rSource,
1981  sal_Int32 nRefrSecs ) :
1982  maDestRange( rRangeName ),
1983  maUrl( rUrl ),
1984  // refresh delay time: seconds -> minutes
1985  mnRefresh( ulimit_cast< sal_Int16 >( (nRefrSecs + 59) / 60 ) ),
1986  mbEntireDoc( false )
1987 {
1988  // comma separated list of HTML table names or indexes
1989  OUString aNewTables;
1990  OUString aAppendTable;
1991  bool bExitLoop = false;
1992  if (!rSource.isEmpty())
1993  {
1994  sal_Int32 nStringIx = 0;
1995  do
1996  {
1997  OUString aToken( rSource.getToken( 0, ';', nStringIx ) );
1999  bExitLoop = mbEntireDoc || ScfTools::IsHTMLTablesName( aToken );
2000  if( !bExitLoop && ScfTools::GetHTMLNameFromName( aToken, aAppendTable ) )
2001  aNewTables = ScGlobal::addToken( aNewTables, aAppendTable, ',' );
2002  }
2003  while (nStringIx>0 && !bExitLoop);
2004  }
2005 
2006  if( !bExitLoop ) // neither HTML_all nor HTML_tables found
2007  {
2008  if( !aNewTables.isEmpty() )
2009  mxQryTables.reset( new XclExpString( aNewTables ) );
2010  else
2011  mbEntireDoc = true;
2012  }
2013 }
2014 
2016 {
2017 }
2018 
2020 {
2021  OSL_ENSURE( !mbEntireDoc || !mxQryTables, "XclExpWebQuery::Save - illegal mode" );
2022  sal_uInt16 nFlags;
2023 
2024  // QSI record
2025  rStrm.StartRecord( EXC_ID_QSI, 10 + maDestRange.GetSize() );
2026  rStrm << EXC_QSI_DEFAULTFLAGS
2027  << sal_uInt16( 0x0010 )
2028  << sal_uInt16( 0x0012 )
2029  << sal_uInt32( 0x00000000 )
2030  << maDestRange;
2031  rStrm.EndRecord();
2032 
2033  // PARAMQRY record
2034  nFlags = 0;
2035  ::insert_value( nFlags, EXC_PQRYTYPE_WEBQUERY, 0, 3 );
2036  ::set_flag( nFlags, EXC_PQRY_WEBQUERY );
2037  ::set_flag( nFlags, EXC_PQRY_TABLES, !mbEntireDoc );
2038  rStrm.StartRecord( EXC_ID_PQRY, 12 );
2039  rStrm << nFlags
2040  << sal_uInt16( 0x0000 )
2041  << sal_uInt16( 0x0001 );
2042  rStrm.WriteZeroBytes( 6 );
2043  rStrm.EndRecord();
2044 
2045  // WQSTRING record
2047  rStrm << maUrl;
2048  rStrm.EndRecord();
2049 
2050  // unknown record 0x0802
2051  rStrm.StartRecord( EXC_ID_0802, 16 + maDestRange.GetSize() );
2052  rStrm << EXC_ID_0802; // repeated record id ?!?
2053  rStrm.WriteZeroBytes( 6 );
2054  rStrm << sal_uInt16( 0x0003 )
2055  << sal_uInt32( 0x00000000 )
2056  << sal_uInt16( 0x0010 )
2057  << maDestRange;
2058  rStrm.EndRecord();
2059 
2060  // WEBQRYSETTINGS record
2062  rStrm.StartRecord( EXC_ID_WQSETT, 28 );
2063  rStrm << EXC_ID_WQSETT // repeated record id ?!?
2064  << sal_uInt16( 0x0000 )
2065  << sal_uInt16( 0x0004 )
2066  << sal_uInt16( 0x0000 )
2068  << nFlags;
2069  rStrm.WriteZeroBytes( 10 );
2070  rStrm << mnRefresh // refresh delay in minutes
2072  << sal_uInt16( 0x0000 );
2073  rStrm.EndRecord();
2074 
2075  // WEBQRYTABLES record
2076  if( mxQryTables )
2077  {
2078  rStrm.StartRecord( EXC_ID_WQTABLES, 4 + mxQryTables->GetSize() );
2079  rStrm << EXC_ID_WQTABLES // repeated record id ?!?
2080  << sal_uInt16( 0x0000 )
2081  << *mxQryTables; // comma separated list of source tables
2082  rStrm.EndRecord();
2083  }
2084 }
2085 
2087 {
2088  SCTAB nScTab = rRoot.GetCurrScTab();
2089  SfxObjectShell* pShell = rRoot.GetDocShell();
2090  if( !pShell ) return;
2091  ScfPropertySet aModelProp( pShell->GetModel() );
2092  if( !aModelProp.Is() ) return;
2093 
2094  Reference< XAreaLinks > xAreaLinks;
2095  aModelProp.GetProperty( xAreaLinks, SC_UNO_AREALINKS );
2096  if( !xAreaLinks.is() ) return;
2097 
2098  for( sal_Int32 nIndex = 0, nCount = xAreaLinks->getCount(); nIndex < nCount; ++nIndex )
2099  {
2100  Reference< XAreaLink > xAreaLink( xAreaLinks->getByIndex( nIndex ), UNO_QUERY );
2101  if( xAreaLink.is() )
2102  {
2103  CellRangeAddress aDestRange( xAreaLink->getDestArea() );
2104  if( static_cast< SCTAB >( aDestRange.Sheet ) == nScTab )
2105  {
2106  ScfPropertySet aLinkProp( xAreaLink );
2107  OUString aFilter;
2108  if( aLinkProp.GetProperty( aFilter, SC_UNONAME_FILTER ) &&
2109  (aFilter == EXC_WEBQRY_FILTER) )
2110  {
2111  // get properties
2112  OUString /*aFilterOpt,*/ aUrl;
2113  sal_Int32 nRefresh = 0;
2114 
2115 // aLinkProp.GetProperty( aFilterOpt, SC_UNONAME_FILTOPT );
2116  aLinkProp.GetProperty( aUrl, SC_UNONAME_LINKURL );
2117  aLinkProp.GetProperty( nRefresh, SC_UNONAME_REFDELAY );
2118 
2119  OUString aAbsDoc( ScGlobal::GetAbsDocName( aUrl, pShell ) );
2120  INetURLObject aUrlObj( aAbsDoc );
2121  OUString aWebQueryUrl( aUrlObj.getFSysPath( FSysStyle::Dos ) );
2122  if( aWebQueryUrl.isEmpty() )
2123  aWebQueryUrl = aAbsDoc;
2124 
2125  // find range or create a new range
2126  OUString aRangeName;
2127  ScRange aScDestRange;
2128  ScUnoConversion::FillScRange( aScDestRange, aDestRange );
2129  if( const ScRangeData* pRangeData = rRoot.GetNamedRanges().findByRange( aScDestRange ) )
2130  {
2131  aRangeName = pRangeData->GetName();
2132  }
2133  else
2134  {
2135  XclExpFormulaCompiler& rFmlaComp = rRoot.GetFormulaCompiler();
2136  XclExpNameManager& rNameMgr = rRoot.GetNameManager();
2137 
2138  // create a new unique defined name containing the range
2139  XclTokenArrayRef xTokArr = rFmlaComp.CreateFormula( EXC_FMLATYPE_WQUERY, aScDestRange );
2140  sal_uInt16 nNameIdx = rNameMgr.InsertUniqueName( aUrlObj.getBase(), xTokArr, nScTab );
2141  aRangeName = rNameMgr.GetOrigName( nNameIdx );
2142  }
2143 
2144  // create and store the web query record
2145  if( !aRangeName.isEmpty() )
2147  aRangeName, aWebQueryUrl, xAreaLink->getSourceArea(), nRefresh ) );
2148  }
2149  }
2150  }
2151  }
2152 }
2153 
2154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt16 EXC_ID_WQSETT
Definition: xlcontent.hxx:174
const sal_uInt32 EXC_DV_COND_NOTBETWEEN
Definition: xlcontent.hxx:126
void ConvertRangeList(XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn)
Converts the passed Calc cell range list to an Excel cell range list.
Definition: xehelper.cxx:265
void FillFromVclFont(const vcl::Font &rFont)
Fills all members (except color and escapement) from the passed font.
Definition: xlstyle.cxx:202
double mnMaxLength
Maximal length of a databar in percent of cell length Value has to be in the range (0...
Definition: colorscale.hxx:178
XclTokenArrayRef mxTokArr2
Formula for first condition.
Definition: xecontent.cxx:603
static const XclGuid maGuidUrlMoniker
GUID of StdLink (HLINK record).
Definition: xltools.hxx:94
XclExpCfvoList maCfvoList
Definition: xecontent.hxx:288
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:43
bool mbFirst
Definition: xecontent.hxx:207
const sal_uInt16 EXC_WQSETT_SPECTABLES
All tables or entire document.
Definition: xlcontent.hxx:176
const sal_uInt32 EXC_DV_MODE_DECIMAL
Definition: xlcontent.hxx:116
bool mbHeightUsed
true = Any font attribute used.
Definition: xecontent.cxx:609
virtual void Save(XclExpStream &rStrm) override
Writes the complete record list.
Definition: xerecord.hxx:376
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1841
XclExpWebQuery(const OUString &rRangeName, const OUString &rUrl, const OUString &rSource, sal_Int32 nRefrSecs)
Constructs a web query record container with settings from Calc.
Definition: xecontent.cxx:1977
std::size_t Write(const void *pData, std::size_t nBytes)
Writes nBytes bytes from memory.
Definition: xestream.cxx:215
static OString ToOString(const Color &rColor)
Definition: xestream.cxx:698
const sal_uInt16 EXC_ID_CONDFMT
Definition: xlcontent.hxx:54
const sal_uInt16 EXC_ID_LABELRANGES
Definition: xlcontent.hxx:50
sal_Int16 mnRefresh
List of source range names.
Definition: xecontent.hxx:405
XclExpRecordList< XclExpRecord > maCFList
Definition: xecontent.hxx:243
XclExpCFImplPtr mxImpl
Definition: xecontent.hxx:182
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
Definition: xlroot.hxx:146
sal_Int32 nIndex
const sal_uInt8 EXC_CF_CMP_LESS
Definition: xlcontent.hxx:67
const sal_uInt32 EXC_DV_ERROR_STOP
Definition: xlcontent.hxx:136
bool mbBorderUsed
true = Font strikeout used.
Definition: xecontent.cxx:615
ScAddress aStart
Definition: address.hxx:500
const sal_uInt32 EXC_DV_COND_EQGREATER
Definition: xlcontent.hxx:131
const sal_uInt32 EXC_DV_COND_GREATER
Definition: xlcontent.hxx:129
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the DV record.
Definition: xecontent.cxx:1827
static bool GetHTMLNameFromName(const OUString &rSource, OUString &rName)
Converts a built-in range name to an HTML table name.
Definition: ftools.cxx:328
const sal_uInt8 EXC_TOKID_STR
Missing argument.
Definition: xlformula.hxx:75
static bool CheckItem(const SfxItemSet &rItemSet, sal_uInt16 nWhichId, bool bDeep)
Returns true, if the passed item set contains the item.
Definition: ftools.cxx:196
XclExpDV(const XclExpRoot &rRoot, sal_uLong nScHandle)
Definition: xecontent.cxx:1642
bool mbFontUsed
Priority of this entry; needed for oox export.
Definition: xecontent.cxx:608
ScRangeName & GetNamedRanges() const
Returns the defined names container of the Calc document.
Definition: xlroot.cxx:304
sal_uInt8 mnOperator
Type of the condition (cell/formula).
Definition: xecontent.cxx:606
const XclExpRoot & GetRoot() const
Returns the filter root data.
Definition: xestream.hxx:290
XclExpStringRef mxQryTables
Source document URL.
Definition: xecontent.hxx:404
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
This class is used to export Excel record streams.
Definition: xestream.hxx:71
SCROW Row() const
Definition: address.hxx:262
static const XclGuid maGuidFileMoniker
GUID of URL moniker (HLINK record).
Definition: xltools.hxx:95
static bool IsHTMLTablesName(const OUString &rSource)
Returns true, if rSource is the built-in range name for all HTML tables.
Definition: ftools.cxx:323
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xerecord.hxx:383
const ScCondDateFormatEntry & mrFormatEntry
Definition: xecontent.hxx:194
void WriteBuffer(XclExpStream &rStrm) const
Writes the raw character buffer.
Definition: xestring.cxx:304
const sal_uInt16 EXC_ID_PQRY
Definition: xlcontent.hxx:159
const sal_uInt32 EXC_HLINK_BODY
Definition: xlcontent.hxx:144
sal_uInt16 GetRawRecPos() const
Returns the position inside of current record (starts by 0 in every CONTINUE).
Definition: xestream.hxx:94
virtual ~XclExpColScaleCol() override
Definition: xecontent.cxx:1243
const sal_uInt16 EXC_ID_EXTSST
Definition: xlcontent.hxx:46
void AppendRecord(RecType *pRec)
Appends a record to the list.
Definition: xerecord.hxx:349
const sal_uInt8 EXC_CF_TYPE_NONE
Definition: xlcontent.hxx:57
static OUString ToOUString(const char *s)
Definition: xestream.cxx:783
void Format(OUString &, ScRefFlags nFlags, const ScDocument &, formula::FormulaGrammar::AddressConvention eConv=formula::FormulaGrammar::CONV_OOO, sal_Unicode cDelimiter=0, bool bFullAddressNotation=false) const
Definition: rangelst.cxx:146
OUString getBase(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool mbReverse
Specifies whether the icons should be shown in reverse order.
Definition: colorscale.hxx:339
XclExpDVRef mxLastFoundDV
List of DV records.
Definition: xecontent.hxx:378
ScValidErrorStyle
Definition: validat.hxx:50
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
const sal_uInt32 EXC_HLINK_ABS
Contains file link or URL.
Definition: xlcontent.hxx:145
sal_uIntPtr sal_uLong
XclExpCondFormatBuffer(const XclExpRoot &rRoot, const XclExtLstRef &xExtLst)
Constructs CONDFMT and CF records containing the conditional formats of the current sheet...
Definition: xecontent.cxx:1560
const Color & mrColor
Definition: xecontent.hxx:218
double mnMinLength
Minimal length of a databar in percent of cell length Value has to be in the range [0...
Definition: colorscale.hxx:173
XclExpString maUrl
Destination range.
Definition: xecontent.hxx:403
const sal_uInt8 EXC_CF_CMP_EQUAL
Definition: xlcontent.hxx:64
Conditional format.
Definition: xlformula.hxx:166
This struct helps reading and writing Excel fonts.
Definition: xlstyle.hxx:286
bool FillFromItemSet(const SfxItemSet &rItemSet, XclExpPalette &rPalette, bool bStyle)
Fills the area attributes from the passed item set.
Definition: xestyle.cxx:1873
static bool IsHTMLDocName(const OUString &rSource)
Returns true, if rSource is the built-in range name for an HTML document.
Definition: ftools.cxx:318
const sal_uInt32 EXC_DV_MODE_TIME
Definition: xlcontent.hxx:119
bool mbStrikeUsed
true = Font posture used.
Definition: xecontent.cxx:614
const ObjectTypeFormatEntry & mrEntry
const OUString & GetStyle() const
Definition: conditio.hxx:474
XclExpFormulaCompiler & GetFormulaCompiler() const
Returns the formula compiler to produce formula token arrays.
Definition: xeroot.cxx:87
void SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
Definition: xerecord.hxx:164
static bool GetStringList(OUString &rStringList, const ScTokenArray &rScTokArr, sal_Unicode cSep)
Parses the passed formula and tries to find a string token list, i.e.
Definition: xlformula.cxx:874
sal_uInt32 Insert(XclExpStringRef xString)
Inserts the passed string, if not already inserted, and returns the unique SST index.
Definition: xecontent.cxx:120
sal_uInt16 mnHeight
Font color.
Definition: xlstyle.hxx:291
const sal_uInt8 EXC_CF_CMP_BETWEEN
Definition: xlcontent.hxx:62
sal_uInt64 Seek(sal_uInt64 nPos)
condformat::ScCondFormatDateType GetDateType() const
Definition: conditio.hxx:513
const sal_uInt32 EXC_DV_SHOWERROR
Definition: xlcontent.hxx:110
bool mbEntireDoc
Refresh time in minutes.
Definition: xecontent.hxx:406
XclExpString maDestRange
Definition: xecontent.hxx:402
ScRange Combine() const
Definition: rangelst.cxx:1114
bool mbOnlyBar
If TRUE we only show the bar and not the value.
Definition: colorscale.hxx:183
ScAddress aEnd
Definition: address.hxx:501
bool IsValidForBinary() const
Returns true, if this conditional format contains at least one cell range and CF record.
Definition: xecontent.cxx:1383
void set_flag(Type &rnBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in rnBitField.
Definition: ftools.hxx:93
XclFontData maFontData
Top left cell of the combined range.
Definition: xecontent.cxx:599
bool mbColorUsed
true = Font weight used.
Definition: xecontent.cxx:611
Represents a CF record that contains one condition of a conditional format.
Definition: xecontent.cxx:587
const sal_uInt32 EXC_DV_STRINGLIST
Definition: xlcontent.hxx:106
static OUString GetRelURL(OUString const &rTheBaseURIRef, OUString const &rTheAbsURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
sal_uInt16 GetSize() const
Returns the size of the token array in bytes.
Definition: xlformula.cxx:735
const sal_uInt32 EXC_DV_COND_NOTEQUAL
Definition: xlcontent.hxx:128
const ScColorScaleEntry & mrEntry
Definition: xecontent.hxx:205
css::uno::Reference< css::frame::XModel > GetModel() const
ScCondFormatDateType
Definition: conditio.hxx:485
const sal_uInt8 EXC_CF_CMP_LESS_EQUAL
Definition: xlcontent.hxx:69
ScRangeList maScRanges
Definition: xecontent.hxx:337
sal_uLong mnScHandle
Miscellaneous flags.
Definition: xecontent.hxx:349
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:278
XclExpCondfmtList maCondfmtList
Definition: xecontent.hxx:306
const sal_uInt32 EXC_DV_COND_LESS
Definition: xlcontent.hxx:130
const sal_uInt32 EXC_DV_COND_EQLESS
Definition: xlcontent.hxx:132
virtual ~XclExpDval() override
Definition: xecontent.cxx:1880
Shared formula.
Definition: xlformula.hxx:165
sal_Int32 mnPriority
Definition: xecontent.hxx:260
const sal_uInt32 EXC_CF_ALLDEFAULT
Any area attribute modified?
Definition: xlcontent.hxx:80
XclExpStringRef mxString1
The error text.
Definition: xecontent.hxx:343
ScConditionMode GetOperation() const
Definition: conditio.hxx:370
const sal_uInt8 EXC_CF_CMP_NONE
Definition: xlcontent.hxx:61
Web query source range.
Definition: xlformula.hxx:171
Extends the XclCellArea struct for export.
Definition: xestyle.hxx:374
size_t size() const
Definition: xladdress.hxx:109
const sal_uInt32 EXC_DV_COND_BETWEEN
Definition: xlcontent.hxx:125
const sal_uInt16 EXC_PQRYTYPE_WEBQUERY
Source type: ODBC.
Definition: xlcontent.hxx:161
const sal_uInt16 EXC_ID_DV
Definition: xlcontent.hxx:103
Base class for ext entries.
Definition: xeextlst.hxx:37
bool mbItalicUsed
true = Font underline type used.
Definition: xecontent.cxx:613
FuncFlags mnFlags
Information about all parameters.
XclExpString maErrorTitle
The prompt text.
Definition: xecontent.hxx:341
const ScTokenArray * GetFormula() const
Definition: colorscale.cxx:215
static const char * getIconSetName(ScIconSetType eType)
const ScRangeList & GetRange() const
Definition: conditio.hxx:560
The formula compiler to create Excel token arrays from Calc token arrays.
Definition: xeformula.hxx:52
const sal_uInt32 EXC_DV_MODE_DATE
Definition: xlcontent.hxx:118
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:251
void InsertCellRange(const ScRange &rRange, sal_uLong nScHandle)
Inserts the cell range into the range list of the DV record with the specified handle.
Definition: xecontent.cxx:1884
Access to global data from other classes.
Definition: xeroot.hxx:113
const sal_uInt32 EXC_DV_MODE_CUSTOM
Definition: xlcontent.hxx:121
OUString getNamespaceURL(sal_Int32 nNSID) const
void SaveXml(XclExpXmlStream &rStrm)
Definition: xecontent.cxx:202
#define INET_FILE_SCHEME
XclExpColScaleCol(const XclExpRoot &rRoot, const Color &rColor)
Definition: xecontent.cxx:1236
static const XclGuid maGuidStdLink
Definition: xltools.hxx:93
void SaveXml(XclExpXmlStream &rStrm)
Definition: xecontent.cxx:1021
ReturnType ulimit_cast(Type nValue, ReturnType nMax)
Returns the value, if it is not greater than nMax, otherwise nMax.
Definition: ftools.hxx:51
sal_uInt16 InsertUniqueName(const OUString &rName, const XclTokenArrayRef &xTokArr, SCTAB nScTab)
Inserts a new defined name.
Definition: xename.cxx:824
OUString maUrl
const sal_uInt16 EXC_ID_MERGEDCELLS
Definition: xlcontent.hxx:33
const sal_uInt8 EXC_CF_TYPE_CELL
Definition: xlcontent.hxx:58
ScIconSetType eIconSetType
Definition: colorscale.hxx:334
int nCount
void WriteArray(XclExpStream &rStrm) const
Writes the tokens of the token array (without size field).
Definition: xlformula.cxx:765
OUString msFormula2
Formula for second condition.
Definition: xecontent.hxx:347
ScColorScaleEntryType GetType() const
Definition: colorscale.hxx:76
const sal_uInt16 EXC_ID_WQTABLES
Definition: xlcontent.hxx:183
void PushStream(sax_fastparser::FSHelperPtr const &aStream)
Definition: xestream.cxx:916
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1144
const sal_uInt16 EXC_FONTESC_NONE
Definition: xlstyle.hxx:126
SvStream & WriteUInt32(sal_uInt32 nUInt32)
ScConditionMode
Definition: conditio.hxx:61
SCTAB Tab() const
Definition: address.hxx:271
const ScCondFormatEntry & mrFormatEntry
Definition: xecontent.cxx:597
const sal_uInt32 EXC_CF_BLOCK_AREA
Border block present?
Definition: xlcontent.hxx:85
sal_uInt32 InsertColor(const Color &rColor, XclExpColorType eType, sal_uInt16 nAutoDefault=0)
Inserts the color into the list and updates weighting.
Definition: xestyle.cxx:763
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1213
INetProtocol
ScRangeList maRowRanges
Definition: xecontent.hxx:159
XclExpDataBar(const XclExpRoot &rRoot, const ScDataBarFormat &rFormat, sal_Int32 nPriority, const OString &rGUID)
Definition: xecontent.cxx:1470
bool mbItalic
Underline style.
Definition: xlstyle.hxx:297
sax_fastparser::FSHelperPtr & GetCurrentStream()
Definition: xestream.cxx:910
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1107
XclExpCfvo(const XclExpRoot &rRoot, const ScColorScaleEntry &rFormatEntry, const ScAddress &rPos, bool bFirst=true)
Definition: xecontent.cxx:1174
OUString getRelationship(Relationship eRelationship)
void SetCol(SCCOL nColP)
Definition: address.hxx:279
XclExpIconSet(const XclExpRoot &rRoot, const ScIconSetFormat &rFormat, sal_Int32 nPriority)
Definition: xecontent.cxx:1523
XclExpDxfs & GetDxfs() const
Returns the differential formatting list.
Definition: xeroot.cxx:159
size_t size() const
Definition: conditio.cxx:1767
void PopStream()
Definition: xestream.cxx:921
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1247
#define SC_UNONAME_FILTER
Definition: unonames.hxx:366
void SetSliceSize(sal_uInt16 nSize)
Sets data slice length.
Definition: xestream.cxx:129
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
Color maPositiveColor
Color for all Positive Values and if mbNeg == false also for negative ones.
Definition: colorscale.hxx:135
const sal_uInt16 EXC_PQRY_WEBQUERY
ODBC connection.
Definition: xlcontent.hxx:163
sal_uInt32 mnFlags
OOXML Formula for second condition.
Definition: xecontent.hxx:348
virtual ~XclExpSst() override
Definition: xecontent.cxx:237
void SetFinalColors(const XclExpPalette &rPalette)
Fills the mn***Color base members from the mn***ColorId members.
Definition: xestyle.cxx:1891
bool empty() const
Definition: xladdress.hxx:110
ScAddress maOrigin
Calc conditional format entry.
Definition: xecontent.cxx:598
void Save(XclExpStream &rStrm)
Writes the complete SST and EXTSST records.
Definition: xecontent.cxx:151
const sal_uInt32 EXC_CF_AREA_ALL
Background color modified?
Definition: xlcontent.hxx:79
bool mbWeightUsed
true = Font height used.
Definition: xecontent.cxx:610
ScAddress GetValidSrcPos() const
Return a position that's adjusted to allow textual representation of expressions if possible...
Definition: conditio.cxx:1326
std::vector< XclExpStringRef > maStringVector
Definition: xecontent.cxx:104
const sal_uInt32 EXC_CF_FONT_STRIKEOUT
Font posture or weight modified?
Definition: xlcontent.hxx:90
sal_uInt32 mnFontColorId
Formula for second condition.
Definition: xecontent.cxx:604
const sal_uInt16 EXC_ID_DVAL
Font escapement type modified?
Definition: xlcontent.hxx:98
const sal_uInt32 EXC_DV_MODE_LIST
Definition: xlcontent.hxx:117
const sal_uInt32 EXC_CF_BLOCK_BORDER
Alignment block present?
Definition: xlcontent.hxx:84
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the DVAL record.
Definition: xecontent.cxx:1969
sal_Int32 mnPriority
Definition: xecontent.hxx:275
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1580
const ScRangeList & GetRange() const
Definition: colorscale.cxx:437
double mnPriority
const ScFormatEntry * GetEntry(sal_uInt16 nPos) const
Definition: conditio.cxx:1781
::std::vector< XclExpHashEntry > XclExpHashVec
Definition: xecontent.cxx:102
static SC_DLLPUBLIC OUString GetAbsDocName(const OUString &rFileName, const SfxObjectShell *pShell)
Definition: global2.cxx:284
void SetTab(SCTAB nTabP)
Definition: address.hxx:283
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1418
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
const sal_uInt32 EXC_CF_FONT_STYLE
NumberFormat String or Id?
Definition: xlcontent.hxx:89
XclExpCfvoList maCfvoList
Definition: xecontent.hxx:258
bool IsValidForXml() const
Definition: xecontent.cxx:1393
SC_DLLPUBLIC const ScRangeData * findByRange(const ScRange &rRange) const
Definition: rangenam.cxx:675
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:36
OUString getFSysPath(FSysStyle eStyle, sal_Unicode *pDelimiter=nullptr) const
bool mbUnderlUsed
true = Font color used.
Definition: xecontent.cxx:612
Extends the XclCellBorder struct for export.
Definition: xestyle.hxx:343
static void GetFont(vcl::Font &rFont, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
Static helper function to fill a font object from the passed item set.
Definition: patattr.cxx:215
const sal_uInt8 EXC_CF_CMP_GREATER_EQUAL
Definition: xlcontent.hxx:68
void Assign(const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
Definition: xestring.cxx:111
Represents a CONDFMT record that contains all conditions of a conditional format. ...
Definition: xecontent.hxx:223
XclOutput GetOutput() const
Returns the current output format of the importer/exporter.
Definition: xlroot.hxx:142
#define SC_UNO_AREALINKS
Definition: unonames.hxx:38
sal_uInt8 mnUnderline
Windows character set.
Definition: xlstyle.hxx:296
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xeroot.cxx:81
OUString msFormula1
Formula for first condition.
Definition: xecontent.hxx:345
sal_uInt64 GetSvStreamPos() const
Returns the absolute position of the system stream.
Definition: xestream.hxx:139
sal_uInt16 GetColorIndex(sal_uInt32 nColorId) const
Returns the Excel palette index of the color with passed color ID.
Definition: xestyle.cxx:778
const sal_uInt16 EXC_PQRY_TABLES
Web query.
Definition: xlcontent.hxx:164
int i
virtual void Save(XclExpStream &rStrm) override
Writes the CONDFMT record with following CF records, if there is valid data.
Definition: xecontent.cxx:1398
OUString GetURLNoMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
XclExpDV & SearchOrCreateDv(sal_uLong nScHandle)
Searches for or creates a XclExpDV record object with the specified handle.
Definition: xecontent.cxx:1929
Manager that stores all internal defined names (NAME records) of the document.
Definition: xename.hxx:32
OString maGUID
Definition: xecontent.hxx:276
sal_Int32 mnType
#define STREAM_SEEK_TO_BEGIN
Contains all records for a web query (linked tables in an HTML document).
Definition: xecontent.hxx:387
OUString GetExpression(const ScAddress &rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt=0, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
Definition: conditio.cxx:1235
std::unique_ptr< XclExpColScaleCol > mpCol
Definition: xecontent.hxx:272
const sal_uInt32 EXC_DV_ERROR_WARNING
Definition: xlcontent.hxx:137
XclExpPalette & GetPalette() const
Returns the color buffer.
Definition: xeroot.cxx:105
void RemoveRecord(size_t nPos)
Removes the record at the specified position from the list.
Definition: xerecord.hxx:370
const OUString & GetOrigName(sal_uInt16 nNameIdx) const
Returns the Calc sheet of a local defined name, or SCTAB_GLOBAL for global defined names...
Definition: xename.cxx:840
const sal_uInt32 EXC_DV_MODE_TEXTLEN
Definition: xlcontent.hxx:120
const sal_uInt32 EXC_CF_BLOCK_FONT
Font block present?
Definition: xlcontent.hxx:82
ScRangeList maColRanges
Cell range list for row labels.
Definition: xecontent.hxx:160
A 2D cell range address list with Excel column and row indexes.
Definition: xladdress.hxx:101
size_t size() const
Definition: rangelst.hxx:90
void InsertRecord(RecType *pRec, size_t nPos)
Inserts a record at the specified position into the list.
Definition: xerecord.hxx:344
const ScRange & GetRange(sal_uInt16 n) const
Definition: address.hxx:817
float u
const sal_uInt32 EXC_HLINK_MARK
Description.
Definition: xlcontent.hxx:147
const sal_uInt32 EXC_DV_IGNOREBLANK
Definition: xlcontent.hxx:107
void EndRecord()
Checks and corrects real record length.
Definition: xestream.cxx:120
virtual ~XclExpDateFormat() override
Definition: xecontent.cxx:1120
bool get_flag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
Definition: ftools.hxx:73
const ScIconSetFormatData * GetIconSetData() const
virtual ~XclExpCF() override
Definition: xecontent.cxx:1098
const OUString & GetRepresentation() const
XclExpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xeroot.cxx:141
XclExpWebQueryBuffer(const XclExpRoot &rRoot)
Definition: xecontent.cxx:2086
virtual void Save(XclExpStream &rStrm) override
Writes all needed records for this web query.
Definition: xecontent.cxx:2019
const sal_uInt8 EXC_CF_TYPE_FMLA
Definition: xlcontent.hxx:59
const sal_uInt32 EXC_DV_COND_MASK
Definition: xlcontent.hxx:124
const sal_uInt8 EXC_CF_CMP_GREATER
Definition: xlcontent.hxx:66
bool In(const ScAddress &) const
is Address& in Range?
Definition: address.hxx:733
void FillToCF8(sal_uInt16 &rnPattern, sal_uInt16 &rnColor) const
Fills the data to the passed fields of a BIFF8 CF (conditional format) record.
Definition: xestyle.cxx:1910
OString generateGUIDString()
#define XESTRING_TO_PSZ(s)
Definition: xestream.hxx:231
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1540
void CopyFromStream(SvStream &rInStrm, sal_uInt64 nBytes=STREAM_SEEK_TO_END)
Copies nBytes bytes from current position of the stream rInStrm.
Definition: xestream.cxx:283
std::shared_ptr< FastSerializerHelper > FSHelperPtr
virtual ~XclExpDV() override
Definition: xecontent.cxx:1812
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1158
void AppendNewRecord(RecType *pRec)
Appends a newly created record to the list.
Definition: xerecord.hxx:362
std::shared_ptr< XclTokenArray > XclTokenArrayRef
Definition: xlformula.hxx:417
const sal_uInt32 EXC_CF_FONT_UNDERL
Default flags.
Definition: xlcontent.hxx:93
static void FillRangeList(ScRangeList &rScRanges, const ScRangePairListRef &xLabelRangesRef, SCTAB nScTab)
Fills the specified range list with all label headers of the current sheet.
Definition: xecontent.cxx:558
const sal_uInt32 EXC_CF_BORDER_ALL
Bottom border line modified?
Definition: xlcontent.hxx:75
SCCOL Col() const
Definition: address.hxx:267
void FillToCF8(sal_uInt16 &rnLine, sal_uInt32 &rnColor) const
Fills the data to the passed fields of a BIFF8 CF (conditional format) record.
Definition: xestyle.cxx:1798
XclExpColScaleColList maColList
Definition: xecontent.hxx:259
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:119
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:160
bool FillFromItemSet(const SfxItemSet &rItemSet, XclExpPalette &rPalette, XclBiff eBiff, bool bStyle=false)
Fills the border attributes from the passed item set.
Definition: xestyle.cxx:1703
const sal_uInt32 EXC_DV_SUPPRESSDROPDOWN
Definition: xlcontent.hxx:108
ReturnType llimit_cast(Type nValue, ReturnType nMin)
Returns the value, if it is not less than nMin, otherwise nMin.
Definition: ftools.hxx:46
const ScIconSetFormat & mrFormat
Definition: xecontent.hxx:289
const sal_uInt16 EXC_QSI_DEFAULTFLAGS
Definition: xlcontent.hxx:168
const OUString & GetURL() const
XclExpString maErrorText
The error title.
Definition: xecontent.hxx:342
virtual void Save(XclExpStream &rStrm) override
Writes all contained CONDFMT records with their CF records.
Definition: xecontent.cxx:1575
const sal_uInt32 EXC_XFID_NOTFOUND
Special index for "not found" state.
Definition: xlstyle.hxx:143
const sal_uInt16 EXC_ID_SST
Definition: xlcontent.hxx:45
Default string settings.
Provides functions to convert Calc cell addresses to Excel cell addresses.
Definition: xehelper.hxx:79
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const sal_uInt32 EXC_DV_COND_EQUAL
Definition: xlcontent.hxx:127
virtual void Save(XclExpStream &rStrm) override
Writes the record, if it contains at least one merged cell range.
Definition: xecontent.cxx:286
RecType * GetRecord(size_t nPos) const
Returns reference to an existing record or empty reference on error.
Definition: xerecord.hxx:334
Binary representation of an Excel token array.
Definition: xlformula.hxx:377
A wrapper for a UNO property set.
Definition: fapihelper.hxx:104
OUString addRelation(const OUString &rType, const OUString &rTarget)
XclExpDateFormat(const XclExpRoot &rRoot, const ScCondDateFormatEntry &rFormatEntry, sal_Int32 nPriority)
Definition: xecontent.cxx:1112
void InsertCellRange(const ScRange &rPos)
Inserts a new cell range into the cell range list.
Definition: xecontent.cxx:1816
std::unique_ptr< char[]> aBuffer
void WriteZeroBytesToRecord(std::size_t nBytes)
Definition: xestream.cxx:273
sal_Int32 mnPriority
Definition: xecontent.hxx:290
sal_uInt16 Len() const
Returns the character count of the string.
Definition: xestring.hxx:114
const ScFormatEntry * pEntry
Definition: xeextlst.hxx:31
bool mbPattUsed
true = Border attribute used.
Definition: xecontent.cxx:616
XclExpCellBorder maBorder
Font formatting attributes.
Definition: xecontent.cxx:600
OUString msSeqRef
Cell ranges for this conditional format.
Definition: xecontent.hxx:245
void SetFinalColors(const XclExpPalette &rPalette)
Fills the mn***Color base members from the mn***ColorId members.
Definition: xestyle.cxx:1761
#define SC_UNONAME_LINKURL
Definition: unonames.hxx:368
#define SAL_WARN_IF(condition, area, stream)
XclRangeList maXclRanges
Calc range list with all affected cells.
Definition: xecontent.hxx:338
void Join(const ScRange &, bool bIsInList=false)
Definition: rangelst.cxx:166
static SC_DLLPUBLIC OUString addToken(const OUString &rTokenList, const OUString &rToken, sal_Unicode cSep, sal_Int32 nSepCount=1, bool bForceSep=false)
Adds the string rToken to rTokenList, using a list separator character.
Definition: global.cxx:664
virtual ~XclExpCondfmt() override
Definition: xecontent.cxx:1379
unsigned char sal_uInt8
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpUpperLimit
Definition: colorscale.hxx:185
const sal_uInt16 EXC_WQSETT_FORMATFULL
Definition: xlcontent.hxx:180
const OUString & GetStyleName() const
Definition: conditio.hxx:515
void AppendRange(const ScRange &rRange, sal_uInt32 nBaseXFId)
Appends a new range to the list of merged cell ranges.
Definition: xecontent.cxx:263
XclExpColorScale(const XclExpRoot &rRoot, const ScColorScaleFormat &rFormat, sal_Int32 nPriority)
Definition: xecontent.cxx:1434
std::size_t GetSize() const
Returns the byte count the whole string will take on export.
Definition: xestring.cxx:248
virtual ~XclExpWebQuery() override
Definition: xecontent.cxx:2015
sal_Int32 mnPriority
Comparison operator for cell type.
Definition: xecontent.cxx:607
size_t size() const
Definition: rangelst.cxx:1231
Any maOrigin
const sal_uInt16 EXC_ID_QSI
All tables.
Definition: xlcontent.hxx:167
XclRangeList maXclRanges
List of CF records.
Definition: xecontent.hxx:244
bool HasMark() const
INetProtocol GetProtocol() const
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1488
Always use UCS-2 characters (default: try to compress). BIFF8 only.
ScRangeList maMergedRanges
Definition: xecontent.hxx:89
Represents a CF record that contains one condition of a conditional format.
Definition: xecontent.hxx:168
sal_uInt16 mnWeight
Font height in twips (1/20 of a point).
Definition: xlstyle.hxx:292
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1452
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
XclExpCellArea maArea
Border formatting attributes.
Definition: xecontent.cxx:601
XclTokenArrayRef CreateFormula(XclFormulaType eType, const ScTokenArray &rScTokArr, const ScAddress *pScBasePos=nullptr, XclExpRefLog *pRefLog=nullptr)
Creates and returns the token array of a formula.
Definition: xeformula.cxx:2637
void insert_value(Type &rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount)
Inserts a value into a bitfield.
Definition: ftools.hxx:100
virtual void Save(XclExpStream &rStrm) override
Writes the LABELRANGES record if it contains at least one range.
Definition: xecontent.cxx:570
XclExpCondfmt(const XclExpRoot &rRoot, const ScConditionalFormat &rCondFormat, const XclExtLstRef &xExtLst, sal_Int32 &rIndex)
Definition: xecontent.cxx:1290
XclRange GetEnclosingRange() const
Definition: xladdress.cxx:72
const sal_uInt16 EXC_MERGEDCELLS_MAXCOUNT
Definition: xlcontent.hxx:34
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:140
const sal_uInt8 EXC_CF_CMP_NOT_BETWEEN
Definition: xlcontent.hxx:63
const sal_uInt16 EXC_ID_HLINK
Definition: xlcontent.hxx:142
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the CF record.
Definition: xecontent.cxx:1102
bool mbFormula2
true = Pattern attribute used.
Definition: xecontent.cxx:617
XclTokenArrayRef mxTokArr1
String for first condition formula.
Definition: xecontent.hxx:344
const sal_uInt16 EXC_WQSETT_ALL
Definition: xlcontent.hxx:175
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6068
const sal_uInt8 EXC_CF_CMP_NOT_EQUAL
Definition: xlcontent.hxx:65
ScfUInt32Vec maBaseXFIds
All merged cell ranges of the sheet.
Definition: xecontent.hxx:90
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
sal_uInt32 Insert(const XclExpStringRef &xString)
Inserts a new string into the table.
Definition: xecontent.cxx:241
XclExpLabelranges(const XclExpRoot &rRoot)
Fills the cell range lists with all ranges of the current sheet.
Definition: xecontent.cxx:541
size_t GetSize() const
Definition: xerecord.hxx:328
std::vector< XclExpHashVec > maHashTab
List of unique strings (in SST ID order).
Definition: xecontent.cxx:106
const ScDataBarFormatData * GetDataBarData() const
Definition: colorscale.cxx:735
XclTokenArrayRef mxTokArr1
Pattern formatting attributes.
Definition: xecontent.cxx:602
void StartRecord(sal_uInt16 nRecId, std::size_t nRecSize)
Starts a new record: writes header data, stores calculated record size.
Definition: xestream.cxx:108
const sal_uInt32 EXC_CF_FONT_ALLDEFAULT
Font cancellation modified?
Definition: xlcontent.hxx:91
sal_uInt32 mnTotal
Hashed table that manages string pointers.
Definition: xecontent.cxx:107
OUString sId
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the CONDFMT record.
Definition: xecontent.cxx:1407
void WriteBody(XclExpStream &rStrm)
Writes the body of the CF record.
Definition: xecontent.cxx:719
ScRange & front()
Definition: rangelst.hxx:93
const sal_uInt16 EXC_ID_WQSTRING
Definition: xlcontent.hxx:156
const sal_uInt32 EXC_DV_MODE_MASK
Definition: xlcontent.hxx:113
XclExpCF(const XclExpRoot &rRoot, const ScCondFormatEntry &rFormatEntry, sal_Int32 nPriority, ScAddress aOrigin)
Definition: xecontent.cxx:1091
XclExpMergedcells(const XclExpRoot &rRoot)
Definition: xecontent.cxx:258
OUString GetMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const OUString & GetBasePath() const
Returns the base path of the imported/exported file.
Definition: xlroot.hxx:172
Provides export of the data of a DV record.
Definition: xecontent.hxx:315
Color maColor
String with styles (bold, italic).
Definition: xlstyle.hxx:290
#define EXC_WEBQRY_FILTER
UNC path.
Definition: xlcontent.hxx:153
#define SC_UNONAME_REFDELAY
Definition: unonames.hxx:370
std::unique_ptr< ScTokenArray > CreateFlatCopiedTokenArray(sal_uInt16 nPos) const
Create a flat copy using ScTokenArray copy-ctor with shared tokens.
Definition: conditio.cxx:1281
XclExpString maPromptTitle
Excel range list with all affected cells.
Definition: xecontent.hxx:339
XclExpCFImpl(const XclExpRoot &rRoot, const ScCondFormatEntry &rFormatEntry, sal_Int32 nPriority, ScAddress aOrigin)
Definition: xecontent.cxx:620
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:283
XclTokenArrayRef mxTokArr2
OOXML Formula for first condition.
Definition: xecontent.hxx:346
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpLowerLimit
Definition: colorscale.hxx:186
const sal_uInt16 EXC_ID_CF
Definition: xlcontent.hxx:55
std::shared_ptr< XclExpString > XclExpStringRef
Definition: xeroot.hxx:36
virtual void Save(XclExpStream &rStrm) override
Writes the DVAL record and the DV record list.
Definition: xecontent.cxx:1893
const sal_uInt32 EXC_DV_MODE_ANY
Definition: xlcontent.hxx:114
const sal_uInt32 EXC_HLINK_DESCR
Absolute path.
Definition: xlcontent.hxx:146
virtual void Save(XclExpStream &rStrm) override
Writes the complete SST and EXTSST records.
Definition: xecontent.cxx:246
XclExpDVList maDVList
Definition: xecontent.hxx:377
sal_uInt8 mnType
Font color ID.
Definition: xecontent.cxx:605
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
Definition: convuno.hxx:80
bool IsEmpty() const
Definition: xerecord.hxx:327
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xerecord.cxx:150
const sal_uInt32 EXC_SST_HASHTABLE_SIZE
Definition: xecontent.cxx:111
void SvStream & rStrm
bool mbStrikeout
true = Italic.
Definition: xlstyle.hxx:298
XclExpString maPromptText
The prompt title.
Definition: xecontent.hxx:340
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
sax_fastparser::FSHelperPtr CreateOutputStream(const OUString &sFullStream, const OUString &sRelativeStream, const css::uno::Reference< css::io::XOutputStream > &xParentRelation, const char *sContentType, const char *sRelationshipType, OUString *pRelationshipId=nullptr)
Definition: xestream.cxx:939
const sal_uInt32 EXC_DV_ERROR_INFO
Definition: xlcontent.hxx:138
const char * UseIf(const char *s, bool bUse)
const sal_uInt16 EXC_ID_0802
Flags for export.
Definition: xlcontent.hxx:171
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
XclExpDval(const XclExpRoot &rRoot)
Definition: xecontent.cxx:1874
void WriteSubList(XclExpStream &rStrm, size_t nBegin, size_t nCount, bool bCol16Bit=true, sal_uInt16 nCountInStream=0) const
Definition: xladdress.cxx:108
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
bool IsRelUrl() const
Returns true, if URLs should be stored relative to the document location.
Definition: xeroot.hxx:121
bool GetProperty(Type &rValue, const OUString &rPropName) const
Gets the specified property from the property set.
Definition: fapihelper.hxx:149
sc::CompileFormulaContext & GetCompileFormulaContext() const
Definition: xeroot.hxx:122
bool Finalize()
Converts the Calc range list to the Excel range list.
Definition: xecontent.cxx:1821
sal_Int32 mnPriority
Definition: xecontent.hxx:195
std::size_t GetBufferSize() const
Returns the byte count the character buffer will take on export.
Definition: xestring.cxx:243
ScRangePairListRef & GetRowNameRangesRef()
Definition: document.hxx:814
ScAddress maSrcPos
Definition: xecontent.hxx:206
Spreadsheet links in form controls.
Definition: xlformula.hxx:170
sal_uInt32 GetBaseXFId(const ScAddress &rPos) const
Returns the XF identifier of the top-left cell in a merged range.
Definition: xecontent.cxx:272
const sal_uInt32 EXC_DV_MODE_WHOLE
Definition: xlcontent.hxx:115
double GetValue() const
Definition: colorscale.cxx:236
XclExpSstImplPtr mxImpl
Definition: xecontent.hxx:68
const ScDataBarFormat & mrFormat
Definition: xecontent.hxx:274
Base class for single records with any content.
Definition: xerecord.hxx:143
sal_uInt16 nPos
sal_Int16 SCTAB
Definition: types.hxx:23
const sal_uInt32 EXC_DV_SHOWPROMPT
Definition: xlcontent.hxx:109
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:306
Implementation of the SST export.
Definition: xecontent.cxx:89
const sal_uInt16 EXC_WQSETT_DEFAULTFLAGS
Specific tables.
Definition: xlcontent.hxx:177
void WriteZeroBytes(std::size_t nBytes)
Writes a sequence of nBytes zero bytes (respects slice setting).
Definition: xestream.cxx:256
std::unique_ptr< XclExpCfvo > mpCfvoUpperLimit
Definition: xecontent.hxx:271
ScRangePairListRef & GetColNameRangesRef()
Definition: document.hxx:813
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xecontent.cxx:1913
sal_uInt32 mnSize
sal_uInt32 mnSize
Total count of strings (including doubles).
Definition: xecontent.cxx:108
const sal_uInt32 EXC_CF_FONT_ESCAPEM
Font underline type modified?
Definition: xlcontent.hxx:94
std::unique_ptr< XclExpCfvo > mpCfvoLowerLimit
Definition: xecontent.hxx:270