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