LibreOffice Module sc (master)  1
xmldrani.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 "xmldrani.hxx"
21 #include "xmlimprt.hxx"
22 #include "xmlfilti.hxx"
23 #include "xmlsorti.hxx"
24 #include <document.hxx>
25 #include <globalnames.hxx>
26 #include <dbdata.hxx>
27 #include <datauno.hxx>
28 #include <attrib.hxx>
29 #include <unonames.hxx>
30 #include "XMLConverter.hxx"
31 #include <rangeutl.hxx>
32 #include <dputil.hxx>
33 #include <sortparam.hxx>
34 
35 #include <xmloff/xmltoken.hxx>
36 #include <xmloff/xmlnamespace.hxx>
37 
38 #include <sax/tools/converter.hxx>
39 
40 #include <com/sun/star/sheet/DataImportMode.hpp>
41 #include <com/sun/star/table/TableOrientation.hpp>
42 #include <osl/diagnose.h>
43 
44 #include <memory>
45 
46 using namespace com::sun::star;
47 using namespace xmloff::token;
48 
50  ScXMLImportContext( rImport )
51 {
52  // has no attributes
53  rImport.LockSolarMutex();
54 }
55 
57 {
59 }
60 
61 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangesContext::createFastChildContext(
62  sal_Int32 nElement,
63  const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
64 {
65  SvXMLImportContext *pContext = nullptr;
68 
69  switch( nElement )
70  {
72  {
73  pContext = new ScXMLDatabaseRangeContext( GetScImport(), pAttribList );
74  }
75  break;
76  }
77 
78  return pContext;
79 }
80 
83  ScXMLImportContext( rImport ),
84  mpQueryParam(new ScQueryParam),
85  sDatabaseRangeName(STR_DB_LOCAL_NONAME),
86  nSourceType(sheet::DataImportMode_NONE),
87  nRefresh(0),
88  nSubTotalsUserListIndex(0),
89  mbValidRange(true),
90  bContainsSort(false),
91  bContainsSubTotal(false),
92  bNative(true),
93  bIsSelection(false),
94  bKeepFormats(false),
95  bMoveCells(false),
96  bStripData(false),
97  bAutoFilter(false),
98  bSubTotalsBindFormatsToContent(false),
99  bSubTotalsIsCaseSensitive(false),
100  bSubTotalsInsertPageBreaks(false),
101  bSubTotalsSortGroups(false),
102  bSubTotalsEnabledUserList(false),
103  bSubTotalsAscending(true),
104  bFilterConditionSourceRange(false),
105  bHasHeader(true),
106  bByRow(false),
107  meRangeType(ScDBCollection::GlobalNamed)
108 {
109  if( rAttrList.is() )
110  {
111  for( auto &aIter : *rAttrList )
112  {
113  switch( aIter.getToken() )
114  {
115  case XML_ELEMENT( TABLE, XML_NAME ):
116  {
117  sDatabaseRangeName = aIter.toString();
118  }
119  break;
121  {
122  bIsSelection = IsXMLToken( aIter, XML_TRUE );
123  }
124  break;
126  {
127  bKeepFormats = IsXMLToken( aIter, XML_TRUE );
128  }
129  break;
131  {
132  bMoveCells = !IsXMLToken( aIter, XML_TRUE );
133  }
134  break;
136  {
137  bStripData = !IsXMLToken( aIter, XML_TRUE );
138  }
139  break;
141  {
142  bByRow = !IsXMLToken( aIter, XML_COLUMN );
143  mpQueryParam->bByRow = bByRow;
144  }
145  break;
147  {
148  bHasHeader = IsXMLToken( aIter, XML_TRUE );
149  mpQueryParam->bHasHeader = bHasHeader;
150  }
151  break;
153  {
154  bAutoFilter = IsXMLToken( aIter, XML_TRUE );
155  }
156  break;
158  {
159  ScDocument* pDoc = GetScImport().GetDocument();
160  assert(pDoc);
161  sal_Int32 nOffset = 0;
163  maRange, aIter.toString(), *pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset))
164  mbValidRange = false;
165  }
166  break;
168  {
169  double fTime;
170  if (::sax::Converter::convertDuration( fTime, aIter.toString() ))
171  nRefresh = std::max( static_cast<sal_Int32>(fTime * 86400.0), sal_Int32(0) );
172  }
173  break;
174  }
175  }
176  }
177 
178  mpQueryParam->nTab = maRange.aStart.Tab();
179  mpQueryParam->nCol1 = maRange.aStart.Col();
180  mpQueryParam->nRow1 = maRange.aStart.Row();
181  mpQueryParam->nCol2 = maRange.aEnd.Col();
182  mpQueryParam->nRow2 = maRange.aEnd.Row();
183 
184  if (sDatabaseRangeName.startsWith(STR_DB_LOCAL_NONAME))
186  else if (sDatabaseRangeName.startsWith(STR_DB_GLOBAL_NONAME))
188 }
189 
191 {
192 }
193 
194 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangeContext::createFastChildContext(
195  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
196 {
197  SvXMLImportContext *pContext = nullptr;
198  sax_fastparser::FastAttributeList *pAttribList =
200 
201  switch (nElement)
202  {
204  {
205  pContext = new ScXMLSourceSQLContext( GetScImport(), pAttribList, this);
206  }
207  break;
209  {
210  pContext = new ScXMLSourceTableContext( GetScImport(), pAttribList, this);
211  }
212  break;
214  {
215  pContext = new ScXMLSourceQueryContext( GetScImport(), pAttribList, this);
216  }
217  break;
218  case XML_ELEMENT( TABLE, XML_FILTER ):
219  {
220  pContext = new ScXMLFilterContext(
221  GetScImport(), pAttribList, *mpQueryParam, this);
222  }
223  break;
224  case XML_ELEMENT( TABLE, XML_SORT ):
225  {
226  bContainsSort = true;
227  pContext = new ScXMLSortContext( GetScImport(), pAttribList, this);
228  }
229  break;
231  {
232  bContainsSubTotal = true;
233  pContext = new ScXMLSubTotalRulesContext( GetScImport(), pAttribList, this);
234  }
235  break;
236  }
237 
238  return pContext;
239 }
240 
241 std::unique_ptr<ScDBData> ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName)
242 {
243  if (!mbValidRange)
244  return nullptr;
245 
246  ScDocument* pDoc = GetScImport().GetDocument();
247 
248  ::std::unique_ptr<ScDBData> pData(
250 
251  pData->SetAutoFilter(bAutoFilter);
252  pData->SetKeepFmt(bKeepFormats);
253  pData->SetDoSize(bMoveCells);
254  pData->SetStripData(bStripData);
255 
256  pDoc->PrepareQuery(mpQueryParam->nTab, *mpQueryParam);
257 
258  pData->SetQueryParam(*mpQueryParam);
259 
261  {
262  pData->SetAdvancedQuerySource( &aFilterConditionSourceRangeAddress );
263  }
264 
265  {
266  ScImportParam aParam;
267  aParam.bNative = bNative;
269  aParam.aStatement = sSourceObject;
270  switch (nSourceType)
271  {
272  case sheet::DataImportMode_NONE:
273  aParam.bImport = false;
274  break;
275  case sheet::DataImportMode_SQL:
276  aParam.bImport = true;
277  aParam.bSql = true;
278  break;
279  case sheet::DataImportMode_TABLE:
280  aParam.bImport = true;
281  aParam.bSql = false;
282  aParam.nType = ScDbTable;
283  break;
284  case sheet::DataImportMode_QUERY:
285  aParam.bImport = true;
286  aParam.bSql = false;
287  aParam.nType = ScDbQuery;
288  break;
289  default:
290  OSL_FAIL("Unknown data import mode");
291  aParam.bImport = false;
292  }
293  pData->SetImportParam(aParam);
294  }
295 
296  if (bContainsSort)
297  {
298  size_t nOldSize = aSortSequence.getLength();
299  aSortSequence.realloc(nOldSize + 1);
300  beans::PropertyValue aProperty;
301  aProperty.Name = SC_UNONAME_ORIENT;
302  table::TableOrientation eOrient = mpQueryParam->bByRow ?
303  table::TableOrientation_ROWS : table::TableOrientation_COLUMNS;
304  aProperty.Value <<= eOrient;
305  aSortSequence[nOldSize] = aProperty;
306  ScSortParam aParam;
308 
309  SCCOLROW nStartPos = aParam.bByRow ? maRange.aStart.Col() : maRange.aStart.Row();
310  for (size_t i = 0; i < aParam.GetSortKeyCount(); ++i)
311  {
312  if (!aParam.maKeyState[i].bDoSort)
313  break;
314  aParam.maKeyState[i].nField += nStartPos;
315  }
316 
317  pData->SetSortParam(aParam);
318  }
319 
320  if (bContainsSubTotal)
321  {
322  ScSubTotalParam aParam;
328  aParam.bDoSort = bSubTotalsSortGroups;
330  size_t nPos = 0;
331  for (const auto& rSubTotalRule : aSubTotalRules)
332  {
333  if (nPos >= MAXSUBTOTAL)
334  break;
335 
336  const uno::Sequence<sheet::SubTotalColumn>& rColumns = rSubTotalRule.aSubTotalColumns;
337  sal_Int32 nColCount = rColumns.getLength();
338  sal_Int16 nGroupColumn = rSubTotalRule.nSubTotalRuleGroupFieldNumber;
339  aParam.bGroupActive[nPos] = true;
340  aParam.nField[nPos] = static_cast<SCCOL>(nGroupColumn);
341 
342  SCCOL nCount = static_cast<SCCOL>(nColCount);
343  aParam.nSubTotals[nPos] = nCount;
344  if (nCount != 0)
345  {
346  aParam.pSubTotals[nPos].reset(new SCCOL[nCount]);
347  aParam.pFunctions[nPos].reset(new ScSubTotalFunc[nCount]);
348 
349  const sheet::SubTotalColumn* pAry = rColumns.getConstArray();
350  for (SCCOL i = 0; i < nCount; ++i)
351  {
352  aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
353  aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
354  }
355  }
356  else
357  {
358  aParam.pSubTotals[nPos].reset();
359  aParam.pFunctions[nPos].reset();
360  }
361  ++nPos;
362  }
363 
364  pData->SetSubTotalParam(aParam);
365  }
366 
367  if (pData->HasImportParam() && !pData->HasImportSelection())
368  {
369  pData->SetRefreshDelay(nRefresh);
370  pData->SetRefreshHandler(pDoc->GetDBCollection()->GetRefreshHandler());
371  pData->SetRefreshControl(&pDoc->GetRefreshTimerControlAddress());
372  }
373 
374  return pData;
375 }
376 
377 namespace {
378 
379 bool setAutoFilterFlags(ScDocument& rDoc, const ScDBData& rData)
380 {
381  if (!rData.HasAutoFilter())
382  return false;
383 
384  // Set autofilter flags so that the buttons get displayed.
385  ScRange aRange;
386  rData.GetArea(aRange);
387  rDoc.ApplyFlagsTab(
388  aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aStart.Row(),
389  aRange.aStart.Tab(), ScMF::Auto);
390  return false;
391 }
392 
393 }
394 
395 void SAL_CALL ScXMLDatabaseRangeContext::endFastElement( sal_Int32 /*nElement*/ )
396 {
397  ScDocument* pDoc = GetScImport().GetDocument();
398  if (!pDoc)
399  return;
400 
402  {
403  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_LOCAL_NONAME));
404 
405  if (pData)
406  {
407  ScRange aRange;
408  pData->GetArea(aRange);
409 
410  setAutoFilterFlags(*pDoc, *pData);
411  pDoc->SetAnonymousDBData(aRange.aStart.Tab(), std::move(pData));
412  }
413  return;
414  }
416  {
417  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_GLOBAL_NONAME));
418 
419  if (pData)
420  {
421  ScRange aRange;
422  pData->GetArea(aRange);
423 
424  if (setAutoFilterFlags(*pDoc, *pData))
425  pDoc->SetAnonymousDBData(aRange.aStart.Tab(), std::move(pData));
426  else
427  pDoc->GetDBCollection()->getAnonDBs().insert(pData.release());
428  }
429  return;
430  }
432  {
433  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(sDatabaseRangeName));
434 
435  if (pData)
436  {
437  setAutoFilterFlags(*pDoc, *pData);
438  (void)pDoc->GetDBCollection()->getNamedDBs().insert(std::move(pData));
439  }
440  }
441 }
442 
445  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
446  ScXMLImportContext( rImport ),
447  pDatabaseRangeContext(pTempDatabaseRangeContext)
448 {
449  if ( rAttrList.is() )
450  {
451  for (auto &aIter : *rAttrList)
452  {
453  switch (aIter.getToken())
454  {
456  sDBName = aIter.toString();
457  break;
459  pDatabaseRangeContext->SetSourceObject(aIter.toString());
460  break;
463  break;
464  }
465  }
466  }
467  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_SQL);
468 }
469 
471 {
472 }
473 
474 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceSQLContext::createFastChildContext(
475  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
476 {
477  SvXMLImportContext *pContext = nullptr;
478  sax_fastparser::FastAttributeList *pAttribList =
480 
481  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
482  {
483  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
484  }
485 
486  return pContext;
487 }
488 
489 void SAL_CALL ScXMLSourceSQLContext::endFastElement( sal_Int32 /*nElement*/ )
490 {
491  if (!sDBName.isEmpty())
493 }
494 
497  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
498  ScXMLImportContext( rImport ),
499  pDatabaseRangeContext(pTempDatabaseRangeContext)
500 {
501  if ( rAttrList.is() )
502  {
503  for (auto &aIter : *rAttrList)
504  {
505  switch (aIter.getToken())
506  {
508  sDBName = aIter.toString();
509  break;
512  pDatabaseRangeContext->SetSourceObject(aIter.toString());
513  break;
514  }
515  }
516  }
517  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_TABLE);
518 }
519 
521 {
522 }
523 
524 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceTableContext::createFastChildContext(
525  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
526 {
527  SvXMLImportContext *pContext = nullptr;
528  sax_fastparser::FastAttributeList *pAttribList =
530 
531  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
532  {
533  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
534  }
535 
536  return pContext;
537 }
538 
539 void SAL_CALL ScXMLSourceTableContext::endFastElement( sal_Int32 /*nElement*/ )
540 {
541  if (!sDBName.isEmpty())
543 }
544 
547  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
548  ScXMLImportContext( rImport ),
549  pDatabaseRangeContext(pTempDatabaseRangeContext)
550 {
551  if ( rAttrList.is() )
552  {
553  for (auto &aIter : *rAttrList)
554  {
555  switch (aIter.getToken())
556  {
558  sDBName = aIter.toString();
559  break;
561  pDatabaseRangeContext->SetSourceObject(aIter.toString());
562  break;
563  }
564  }
565  }
566  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_QUERY);
567 }
568 
570 {
571 }
572 
573 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceQueryContext::createFastChildContext(
574  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
575 {
576  SvXMLImportContext *pContext = nullptr;
577  sax_fastparser::FastAttributeList *pAttribList =
579 
580  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
581  {
582  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
583  }
584 
585  return pContext;
586 }
587 
588 void SAL_CALL ScXMLSourceQueryContext::endFastElement( sal_Int32 /*nElement*/ )
589 {
590  if (!sDBName.isEmpty())
592 }
593 
596  ScXMLDatabaseRangeContext* pDatabaseRangeContext) :
597  ScXMLImportContext( rImport )
598 {
599  OUString sConRes;
600  if ( rAttrList.is() )
601  {
602  auto aIter( rAttrList->find( XML_ELEMENT( XLINK, XML_HREF ) ) );
603  if (aIter != rAttrList->end())
604  sConRes = aIter.toString();
605  }
606  if (!sConRes.isEmpty())
607  pDatabaseRangeContext->SetConnectionResource(sConRes);
608 }
609 
611 {
612 }
613 
616  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
617  ScXMLImportContext( rImport ),
618  pDatabaseRangeContext(pTempDatabaseRangeContext)
619 {
620  if ( !rAttrList.is() )
621  return;
622 
623  for (auto &aIter : *rAttrList)
624  {
625  switch (aIter.getToken())
626  {
629  break;
632  break;
635  break;
636  }
637  }
638 }
639 
641 {
642 }
643 
644 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRulesContext::createFastChildContext(
645  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
646 {
647  SvXMLImportContext *pContext = nullptr;
648  sax_fastparser::FastAttributeList *pAttribList =
650 
651  switch (nElement)
652  {
654  {
655  pContext = new ScXMLSortGroupsContext( GetScImport(), pAttribList, pDatabaseRangeContext);
656  }
657  break;
659  {
660  pContext = new ScXMLSubTotalRuleContext( GetScImport(), pAttribList, pDatabaseRangeContext);
661  }
662  break;
663  }
664 
665  return pContext;
666 }
667 
670  ScXMLDatabaseRangeContext* pDatabaseRangeContext) :
671  ScXMLImportContext( rImport )
672 {
673  pDatabaseRangeContext->SetSubTotalsSortGroups(true);
674  if ( !rAttrList.is() )
675  return;
676 
677  for (auto &aIter : *rAttrList)
678  {
679  switch (aIter.getToken())
680  {
682  {
683  const OUString &sValue = aIter.toString();
684  if (sValue.getLength() > 8)
685  {
686  OUString sTemp = sValue.copy(0, 8);
687  if (sTemp == "UserList")
688  {
689  pDatabaseRangeContext->SetSubTotalsEnabledUserList(true);
690  sTemp = sValue.copy(8);
691  pDatabaseRangeContext->SetSubTotalsUserListIndex(static_cast<sal_Int16>(sTemp.toInt32()));
692  }
693  else
694  {
695  //if (IsXMLToken(aIter, XML_AUTOMATIC))
696  //aSortField.FieldType = util::SortFieldType_AUTOMATIC;
697  // is not supported by StarOffice
698  }
699  }
700  else
701  {
702  //if (IsXMLToken(aIter, XML_TEXT))
703  //aSortField.FieldType = util::SortFieldType_ALPHANUMERIC;
704  // is not supported by StarOffice
705  //else if (IsXMLToken(aIter, XML_NUMBER))
706  //aSortField.FieldType = util::SortFieldType_NUMERIC;
707  // is not supported by StarOffice
708  }
709  }
710  break;
711  case XML_ELEMENT( TABLE, XML_ORDER ):
712  {
713  if (IsXMLToken(aIter, XML_ASCENDING))
714  pDatabaseRangeContext->SetSubTotalsAscending(true);
715  else
716  pDatabaseRangeContext->SetSubTotalsAscending(false);
717  }
718  break;
719  }
720  }
721 }
722 
724 {
725 }
726 
729  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
730  ScXMLImportContext( rImport ),
731  pDatabaseRangeContext(pTempDatabaseRangeContext)
732 {
733  if ( rAttrList.is() )
734  {
735  for (auto &aIter : *rAttrList)
736  {
737  switch (aIter.getToken())
738  {
740  aSubTotalRule.nSubTotalRuleGroupFieldNumber = static_cast<sal_Int16>(aIter.toInt32());
741  break;
742  }
743  }
744  }
745 }
746 
748 {
749 }
750 
751 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRuleContext::createFastChildContext(
752  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
753 {
754  SvXMLImportContext *pContext = nullptr;
755  sax_fastparser::FastAttributeList *pAttribList =
757 
758  switch (nElement)
759  {
761  {
762  pContext = new ScXMLSubTotalFieldContext( GetScImport(), pAttribList, this);
763  }
764  break;
765  }
766 
767  return pContext;
768 }
769 
770 void SAL_CALL ScXMLSubTotalRuleContext::endFastElement( sal_Int32 /*nElement*/ )
771 {
774 }
775 
778  ScXMLSubTotalRuleContext* pTempSubTotalRuleContext) :
779  ScXMLImportContext( rImport ),
780  pSubTotalRuleContext(pTempSubTotalRuleContext)
781 {
782  if ( !rAttrList.is() )
783  return;
784 
785  for (auto &aIter : *rAttrList)
786  {
787  switch (aIter.getToken())
788  {
790  sFieldNumber = aIter.toString();
791  break;
792  case XML_ELEMENT( TABLE, XML_FUNCTION ):
793  sFunction = aIter.toString();
794  break;
795  }
796  }
797 }
798 
800 {
801 }
802 
803 void SAL_CALL ScXMLSubTotalFieldContext::endFastElement( sal_Int32 /*nElement*/ )
804 {
805  sheet::SubTotalColumn aSubTotalColumn;
806  aSubTotalColumn.Column = sFieldNumber.toInt32();
807  aSubTotalColumn.Function = ScXMLConverter::GetFunctionFromString( sFunction );
808  pSubTotalRuleContext->AddSubTotalColumn(aSubTotalColumn);
809 }
810 
811 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetSubTotalsAscending(const bool bTemp)
Definition: xmldrani.hxx:111
::std::vector< ScSortKeyState > maKeyState
Definition: sortparam.hxx:121
bool bGroupActive[MAXSUBTOTAL]
active groups
ScXMLSubTotalRuleContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:727
XML_IS_SELECTION
const Link< Timer *, void > & GetRefreshHandler() const
Definition: dbdata.hxx:338
bool insert(std::unique_ptr< ScDBData > p)
Takes ownership of p and attempts to insert it into the collection.
Definition: dbdata.cxx:1155
bool HasAutoFilter() const
Definition: dbdata.hxx:204
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:121
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:814
SCCOL nField[MAXSUBTOTAL]
associated field
bool bUserDef
sort user defined
ScAddress aStart
Definition: address.hxx:499
virtual ~ScXMLDatabaseRangeContext() override
Definition: xmldrani.cxx:190
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:524
XML_FIELD_NUMBER
std::unique_ptr< ScDBData > ConvertToDBData(const OUString &rName)
Definition: xmldrani.cxx:241
XML_HAS_PERSISTENT_DATA
SCROW Row() const
Definition: address.hxx:261
XML_ON_UPDATE_KEEP_SIZE
XML_CONTAINS_HEADER
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
Definition: document.hxx:2431
OUString aDBName
Definition: global.hxx:456
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:216
ScXMLSourceQueryContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:545
std::unique_ptr< ContentProperties > pData
XML_DATABASE_SOURCE_QUERY
void AddSubTotalColumn(const css::sheet::SubTotalColumn &rSubTotalColumn)
Definition: xmldrani.hxx:232
SC_DLLPUBLIC void SetAnonymousDBData(SCTAB nTab, std::unique_ptr< ScDBData > pDBData)
Definition: document.cxx:319
virtual ~ScXMLSourceSQLContext() override
Definition: xmldrani.cxx:470
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
#define STR_DB_LOCAL_NONAME
Definition: globalnames.hxx:12
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5038
XML_ON_UPDATE_KEEP_STYLES
std::unique_ptr< ScQueryParam > mpQueryParam
Definition: xmldrani.hxx:55
XML_SUBTOTAL_RULE
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:803
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:770
void SetSubTotalsBindFormatsToContent(const bool bTemp)
Definition: xmldrani.hxx:106
ScAddress aEnd
Definition: address.hxx:500
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
bool bDoSort
presort
XML_DATABASE_TABLE_NAME
bool bPagebreak
page break at change of group
void SetSubTotalsSortGroups(const bool bTemp)
Definition: xmldrani.hxx:112
ScXMLSubTotalFieldContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLSubTotalRuleContext *pSubTotalRuleContext)
Definition: xmldrani.cxx:776
XML_DATA_TYPE
virtual ~ScXMLSubTotalFieldContext() override
Definition: xmldrani.cxx:799
void SetSubTotalsInsertPageBreaks(const bool bTemp)
Definition: xmldrani.hxx:108
exports com.sun.star. sheet
XML_COLUMN
sal_uInt16 nUserIndex
index into list
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:573
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
AnonDBs & getAnonDBs()
Definition: dbdata.hxx:318
void LockSolarMutex()
Definition: xmlimprt.cxx:1508
XML_ORDER
int nCount
ScSubTotalRule aSubTotalRule
Definition: xmldrani.hxx:217
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:539
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:140
SCTAB Tab() const
Definition: address.hxx:270
css::sheet::DataImportMode nSourceType
Definition: xmldrani.hxx:64
XML_SORT
ScXMLSortGroupsContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:668
XML_FUNCTION
ScRange aFilterConditionSourceRangeAddress
Definition: xmldrani.hxx:63
void SetSubTotalsIsCaseSensitive(const bool bTemp)
Definition: xmldrani.hxx:107
XML_HREF
XML_GROUP_BY_FIELD_NUMBER
static bool GetRangeFromString(ScRange &rRange, const OUString &rRangeStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator= ' ', sal_Unicode cQuote= '\'')
ScXMLSubTotalRulesContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:614
ScXMLDatabaseRangeContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList)
Definition: xmldrani.cxx:81
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:588
XML_SUBTOTAL_FIELD
This class exists only to provide GetScImport() to its derived classes.
OUString aStatement
Definition: global.hxx:457
virtual ~ScXMLSourceQueryContext() override
Definition: xmldrani.cxx:569
XML_SQL_STATEMENT
SCCOL nSubTotals[MAXSUBTOTAL]
number of SubTotals
int i
XML_REFRESH_DELAY
XML_ORIENTATION
ScXMLConResContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:594
void insert(ScDBData *p)
Definition: dbdata.cxx:1254
XML_DATABASE_SOURCE_SQL
sal_Int16 SCCOL
Definition: types.hxx:21
css::uno::Sequence< css::beans::PropertyValue > aSortSequence
Definition: xmldrani.hxx:61
XML_QUERY_NAME
void SetSourceObject(const OUString &sTempSourceObject)
Definition: xmldrani.hxx:103
bool bNative
Definition: global.hxx:458
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:489
std::unique_ptr< ScSubTotalFunc[]> pFunctions[MAXSUBTOTAL]
array of associated functions
virtual ~ScXMLDatabaseRangesContext() override
Definition: xmldrani.cxx:56
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:395
ScXMLImport & GetScImport()
XML_TARGET_RANGE_ADDRESS
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:189
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:159
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:300
static void FillSortParam(ScSortParam &rParam, const css::uno::Sequence< css::beans::PropertyValue > &rSeq)
Definition: datauno.cxx:325
SCCOL Col() const
Definition: address.hxx:266
ScXMLSubTotalRuleContext * pSubTotalRuleContext
Definition: xmldrani.hxx:241
XML_TRUE
static css::sheet::GeneralFunction GetFunctionFromString(std::u16string_view rString)
ScXMLSourceTableContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:495
TABLE
virtual ~ScXMLSortGroupsContext() override
Definition: xmldrani.cxx:723
void SetDatabaseName(const OUString &sTempDatabaseName)
Definition: xmldrani.hxx:101
XML_DATABASE_RANGE
#define SC_UNONAME_ORIENT
Definition: unonames.hxx:302
XML_SORT_GROUPS
sal_uInt8 nType
Definition: global.hxx:460
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:194
virtual ~ScXMLSubTotalRulesContext() override
Definition: xmldrani.cxx:640
XML_PARSE_SQL_STATEMENT
XML_TABLE_NAME
virtual ~ScXMLSubTotalRuleContext() override
Definition: xmldrani.cxx:747
sal_Int16 nSubTotalRuleGroupFieldNumber
Definition: xmldrani.hxx:49
#define STR_DB_GLOBAL_NONAME
Definition: globalnames.hxx:13
sal_uInt16 GetSortKeyCount() const
Definition: sortparam.hxx:139
void SetConnectionResource(const OUString &sTempConRes)
Definition: xmldrani.hxx:102
void UnlockSolarMutex()
Definition: xmlimprt.cxx:1526
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:61
XML_CASE_SENSITIVE
XML_DATABASE_SOURCE_TABLE
bool bIncludePattern
sort formats
FORM
#define XML_ELEMENT(prefix, name)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:474
virtual ~ScXMLConResContext() override
Definition: xmldrani.cxx:610
std::vector< ScSubTotalRule > aSubTotalRules
Definition: xmldrani.hxx:62
void AddSubTotalRule(const ScSubTotalRule &rRule)
Definition: xmldrani.hxx:113
bool bImport
Definition: global.hxx:455
ScDBCollection::RangeType meRangeType
Definition: xmldrani.hxx:85
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:315
void SetSubTotalsEnabledUserList(const bool bTemp)
Definition: xmldrani.hxx:109
XML_PAGE_BREAKS_ON_GROUP_CHANGE
XML_BIND_STYLES_TO_CONTENT
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:751
XML_FILTER
ScXMLDatabaseRangesContext(ScXMLImport &rImport)
Definition: xmldrani.cxx:49
void PrepareQuery(SCTAB nTab, ScQueryParam &rQueryParam)
Definition: documen3.cxx:1459
XML_SUBTOTAL_RULES
virtual ~ScXMLSourceTableContext() override
Definition: xmldrani.cxx:520
XML_CONNECTION_RESOURCE
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:644
ScSubTotalFunc
Definition: global.hxx:850
XML_ASCENDING
sal_Int16 nSubTotalsUserListIndex
Definition: xmldrani.hxx:66
XML_DISPLAY_FILTER_BUTTONS
std::unique_ptr< SCCOL[]> pSubTotals[MAXSUBTOTAL]
array of columns to be calculated
XML_DATABASE_NAME
void SetNative(const bool bTempNative)
Definition: xmldrani.hxx:105
ScXMLSourceSQLContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:443
bool bAscending
sort ascending
void SetSubTotalsUserListIndex(const sal_Int16 nTemp)
Definition: xmldrani.hxx:110
sal_uInt16 nPos
static SC_DLLPUBLIC ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc)
Definition: dputil.cxx:397
void SetSourceType(const css::sheet::DataImportMode nTempSourceType)
Definition: xmldrani.hxx:104
const SCSIZE MAXSUBTOTAL
Definition: global.hxx:80
XML_NAME
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo