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/xmlnmspe.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  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  pData->SetQueryParam(*mpQueryParam);
257 
259  {
260  pData->SetAdvancedQuerySource( &aFilterConditionSourceRangeAddress );
261  }
262 
263  {
264  ScImportParam aParam;
265  aParam.bNative = bNative;
267  aParam.aStatement = sSourceObject;
268  switch (nSourceType)
269  {
270  case sheet::DataImportMode_NONE:
271  aParam.bImport = false;
272  break;
273  case sheet::DataImportMode_SQL:
274  aParam.bImport = true;
275  aParam.bSql = true;
276  break;
277  case sheet::DataImportMode_TABLE:
278  aParam.bImport = true;
279  aParam.bSql = false;
280  aParam.nType = ScDbTable;
281  break;
282  case sheet::DataImportMode_QUERY:
283  aParam.bImport = true;
284  aParam.bSql = false;
285  aParam.nType = ScDbQuery;
286  break;
287  default:
288  OSL_FAIL("Unknown data import mode");
289  aParam.bImport = false;
290  }
291  pData->SetImportParam(aParam);
292  }
293 
294  if (bContainsSort)
295  {
296  size_t nOldSize = aSortSequence.getLength();
297  aSortSequence.realloc(nOldSize + 1);
298  beans::PropertyValue aProperty;
299  aProperty.Name = SC_UNONAME_ORIENT;
300  table::TableOrientation eOrient = mpQueryParam->bByRow ?
301  table::TableOrientation_ROWS : table::TableOrientation_COLUMNS;
302  aProperty.Value <<= eOrient;
303  aSortSequence[nOldSize] = aProperty;
304  ScSortParam aParam;
306 
307  SCCOLROW nStartPos = aParam.bByRow ? maRange.aStart.Col() : maRange.aStart.Row();
308  for (size_t i = 0; i < aParam.GetSortKeyCount(); ++i)
309  {
310  if (!aParam.maKeyState[i].bDoSort)
311  break;
312  aParam.maKeyState[i].nField += nStartPos;
313  }
314 
315  pData->SetSortParam(aParam);
316  }
317 
318  if (bContainsSubTotal)
319  {
320  ScSubTotalParam aParam;
326  aParam.bDoSort = bSubTotalsSortGroups;
328  size_t nPos = 0;
329  for (const auto& rSubTotalRule : aSubTotalRules)
330  {
331  if (nPos >= MAXSUBTOTAL)
332  break;
333 
334  const uno::Sequence<sheet::SubTotalColumn>& rColumns = rSubTotalRule.aSubTotalColumns;
335  sal_Int32 nColCount = rColumns.getLength();
336  sal_Int16 nGroupColumn = rSubTotalRule.nSubTotalRuleGroupFieldNumber;
337  aParam.bGroupActive[nPos] = true;
338  aParam.nField[nPos] = static_cast<SCCOL>(nGroupColumn);
339 
340  SCCOL nCount = static_cast<SCCOL>(nColCount);
341  aParam.nSubTotals[nPos] = nCount;
342  if (nCount != 0)
343  {
344  aParam.pSubTotals[nPos] = new SCCOL[nCount];
345  aParam.pFunctions[nPos] = new ScSubTotalFunc[nCount];
346 
347  const sheet::SubTotalColumn* pAry = rColumns.getConstArray();
348  for (SCCOL i = 0; i < nCount; ++i)
349  {
350  aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
351  aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
352  }
353  }
354  else
355  {
356  aParam.pSubTotals[nPos] = nullptr;
357  aParam.pFunctions[nPos] = nullptr;
358  }
359  ++nPos;
360  }
361 
362  pData->SetSubTotalParam(aParam);
363  }
364 
365  if (pData->HasImportParam() && !pData->HasImportSelection())
366  {
367  pData->SetRefreshDelay(nRefresh);
368  pData->SetRefreshHandler(pDoc->GetDBCollection()->GetRefreshHandler());
369  pData->SetRefreshControl(&pDoc->GetRefreshTimerControlAddress());
370  }
371 
372  return pData;
373 }
374 
375 namespace {
376 
377 bool setAutoFilterFlags(ScDocument& rDoc, const ScDBData& rData)
378 {
379  if (!rData.HasAutoFilter())
380  return false;
381 
382  // Set autofilter flags so that the buttons get displayed.
383  ScRange aRange;
384  rData.GetArea(aRange);
385  rDoc.ApplyFlagsTab(
386  aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aStart.Row(),
387  aRange.aStart.Tab(), ScMF::Auto);
388  return false;
389 }
390 
391 }
392 
393 void SAL_CALL ScXMLDatabaseRangeContext::endFastElement( sal_Int32 /*nElement*/ )
394 {
395  ScDocument* pDoc = GetScImport().GetDocument();
396  if (!pDoc)
397  return;
398 
400  {
401  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_LOCAL_NONAME));
402 
403  if (pData)
404  {
405  ScRange aRange;
406  pData->GetArea(aRange);
407 
408  setAutoFilterFlags(*pDoc, *pData);
409  pDoc->SetAnonymousDBData(aRange.aStart.Tab(), std::move(pData));
410  }
411  return;
412  }
414  {
415  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_GLOBAL_NONAME));
416 
417  if (pData)
418  {
419  ScRange aRange;
420  pData->GetArea(aRange);
421 
422  if (setAutoFilterFlags(*pDoc, *pData))
423  pDoc->SetAnonymousDBData(aRange.aStart.Tab(), std::move(pData));
424  else
425  pDoc->GetDBCollection()->getAnonDBs().insert(pData.release());
426  }
427  return;
428  }
430  {
431  ::std::unique_ptr<ScDBData> pData(ConvertToDBData(sDatabaseRangeName));
432 
433  if (pData)
434  {
435  setAutoFilterFlags(*pDoc, *pData);
436  (void)pDoc->GetDBCollection()->getNamedDBs().insert(std::move(pData));
437  }
438  }
439 }
440 
443  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
444  ScXMLImportContext( rImport ),
445  pDatabaseRangeContext(pTempDatabaseRangeContext)
446 {
447  if ( rAttrList.is() )
448  {
449  for (auto &aIter : *rAttrList)
450  {
451  switch (aIter.getToken())
452  {
454  sDBName = aIter.toString();
455  break;
457  pDatabaseRangeContext->SetSourceObject(aIter.toString());
458  break;
461  break;
462  }
463  }
464  }
465  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_SQL);
466 }
467 
469 {
470 }
471 
472 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceSQLContext::createFastChildContext(
473  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
474 {
475  SvXMLImportContext *pContext = nullptr;
476  sax_fastparser::FastAttributeList *pAttribList =
478 
479  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
480  {
481  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
482  }
483 
484  return pContext;
485 }
486 
487 void SAL_CALL ScXMLSourceSQLContext::endFastElement( sal_Int32 /*nElement*/ )
488 {
489  if (!sDBName.isEmpty())
491 }
492 
495  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
496  ScXMLImportContext( rImport ),
497  pDatabaseRangeContext(pTempDatabaseRangeContext)
498 {
499  if ( rAttrList.is() )
500  {
501  for (auto &aIter : *rAttrList)
502  {
503  switch (aIter.getToken())
504  {
506  sDBName = aIter.toString();
507  break;
510  pDatabaseRangeContext->SetSourceObject(aIter.toString());
511  break;
512  }
513  }
514  }
515  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_TABLE);
516 }
517 
519 {
520 }
521 
522 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceTableContext::createFastChildContext(
523  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
524 {
525  SvXMLImportContext *pContext = nullptr;
526  sax_fastparser::FastAttributeList *pAttribList =
528 
529  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
530  {
531  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
532  }
533 
534  return pContext;
535 }
536 
537 void SAL_CALL ScXMLSourceTableContext::endFastElement( sal_Int32 /*nElement*/ )
538 {
539  if (!sDBName.isEmpty())
541 }
542 
545  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
546  ScXMLImportContext( rImport ),
547  pDatabaseRangeContext(pTempDatabaseRangeContext)
548 {
549  if ( rAttrList.is() )
550  {
551  for (auto &aIter : *rAttrList)
552  {
553  switch (aIter.getToken())
554  {
556  sDBName = aIter.toString();
557  break;
559  pDatabaseRangeContext->SetSourceObject(aIter.toString());
560  break;
561  }
562  }
563  }
564  pDatabaseRangeContext->SetSourceType(sheet::DataImportMode_QUERY);
565 }
566 
568 {
569 }
570 
571 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceQueryContext::createFastChildContext(
572  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
573 {
574  SvXMLImportContext *pContext = nullptr;
575  sax_fastparser::FastAttributeList *pAttribList =
577 
578  if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() )
579  {
580  pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
581  }
582 
583  return pContext;
584 }
585 
586 void SAL_CALL ScXMLSourceQueryContext::endFastElement( sal_Int32 /*nElement*/ )
587 {
588  if (!sDBName.isEmpty())
590 }
591 
594  ScXMLDatabaseRangeContext* pDatabaseRangeContext) :
595  ScXMLImportContext( rImport )
596 {
597  OUString sConRes;
598  if ( rAttrList.is() )
599  {
600  auto aIter( rAttrList->find( XML_ELEMENT( XLINK, XML_HREF ) ) );
601  if (aIter != rAttrList->end())
602  sConRes = aIter.toString();
603  }
604  if (!sConRes.isEmpty())
605  pDatabaseRangeContext->SetConnectionResource(sConRes);
606 }
607 
609 {
610 }
611 
614  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
615  ScXMLImportContext( rImport ),
616  pDatabaseRangeContext(pTempDatabaseRangeContext)
617 {
618  if ( !rAttrList.is() )
619  return;
620 
621  for (auto &aIter : *rAttrList)
622  {
623  switch (aIter.getToken())
624  {
627  break;
630  break;
633  break;
634  }
635  }
636 }
637 
639 {
640 }
641 
642 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRulesContext::createFastChildContext(
643  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
644 {
645  SvXMLImportContext *pContext = nullptr;
646  sax_fastparser::FastAttributeList *pAttribList =
648 
649  switch (nElement)
650  {
652  {
653  pContext = new ScXMLSortGroupsContext( GetScImport(), pAttribList, pDatabaseRangeContext);
654  }
655  break;
657  {
658  pContext = new ScXMLSubTotalRuleContext( GetScImport(), pAttribList, pDatabaseRangeContext);
659  }
660  break;
661  }
662 
663  return pContext;
664 }
665 
668  ScXMLDatabaseRangeContext* pDatabaseRangeContext) :
669  ScXMLImportContext( rImport )
670 {
671  pDatabaseRangeContext->SetSubTotalsSortGroups(true);
672  if ( !rAttrList.is() )
673  return;
674 
675  for (auto &aIter : *rAttrList)
676  {
677  switch (aIter.getToken())
678  {
680  {
681  const OUString &sValue = aIter.toString();
682  if (sValue.getLength() > 8)
683  {
684  OUString sTemp = sValue.copy(0, 8);
685  if (sTemp == "UserList")
686  {
687  pDatabaseRangeContext->SetSubTotalsEnabledUserList(true);
688  sTemp = sValue.copy(8);
689  pDatabaseRangeContext->SetSubTotalsUserListIndex(static_cast<sal_Int16>(sTemp.toInt32()));
690  }
691  else
692  {
693  //if (IsXMLToken(aIter, XML_AUTOMATIC))
694  //aSortField.FieldType = util::SortFieldType_AUTOMATIC;
695  // is not supported by StarOffice
696  }
697  }
698  else
699  {
700  //if (IsXMLToken(aIter, XML_TEXT))
701  //aSortField.FieldType = util::SortFieldType_ALPHANUMERIC;
702  // is not supported by StarOffice
703  //else if (IsXMLToken(aIter, XML_NUMBER))
704  //aSortField.FieldType = util::SortFieldType_NUMERIC;
705  // is not supported by StarOffice
706  }
707  }
708  break;
709  case XML_ELEMENT( TABLE, XML_ORDER ):
710  {
711  if (IsXMLToken(aIter, XML_ASCENDING))
712  pDatabaseRangeContext->SetSubTotalsAscending(true);
713  else
714  pDatabaseRangeContext->SetSubTotalsAscending(false);
715  }
716  break;
717  }
718  }
719 }
720 
722 {
723 }
724 
727  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
728  ScXMLImportContext( rImport ),
729  pDatabaseRangeContext(pTempDatabaseRangeContext)
730 {
731  if ( rAttrList.is() )
732  {
733  for (auto &aIter : *rAttrList)
734  {
735  switch (aIter.getToken())
736  {
738  aSubTotalRule.nSubTotalRuleGroupFieldNumber = static_cast<sal_Int16>(aIter.toInt32());
739  break;
740  }
741  }
742  }
743 }
744 
746 {
747 }
748 
749 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRuleContext::createFastChildContext(
750  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
751 {
752  SvXMLImportContext *pContext = nullptr;
753  sax_fastparser::FastAttributeList *pAttribList =
755 
756  switch (nElement)
757  {
759  {
760  pContext = new ScXMLSubTotalFieldContext( GetScImport(), pAttribList, this);
761  }
762  break;
763  }
764 
765  return pContext;
766 }
767 
768 void SAL_CALL ScXMLSubTotalRuleContext::endFastElement( sal_Int32 /*nElement*/ )
769 {
772 }
773 
776  ScXMLSubTotalRuleContext* pTempSubTotalRuleContext) :
777  ScXMLImportContext( rImport ),
778  pSubTotalRuleContext(pTempSubTotalRuleContext)
779 {
780  if ( !rAttrList.is() )
781  return;
782 
783  for (auto &aIter : *rAttrList)
784  {
785  switch (aIter.getToken())
786  {
788  sFieldNumber = aIter.toString();
789  break;
790  case XML_ELEMENT( TABLE, XML_FUNCTION ):
791  sFunction = aIter.toString();
792  break;
793  }
794  }
795 }
796 
798 {
799 }
800 
801 void SAL_CALL ScXMLSubTotalFieldContext::endFastElement( sal_Int32 /*nElement*/ )
802 {
803  sheet::SubTotalColumn aSubTotalColumn;
804  aSubTotalColumn.Column = sFieldNumber.toInt32();
805  aSubTotalColumn.Function = ScXMLConverter::GetFunctionFromString( sFunction );
806  pSubTotalRuleContext->AddSubTotalColumn(aSubTotalColumn);
807 }
808 
809 /* 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
static bool GetRangeFromString(ScRange &rRange, const OUString &rRangeStr, const ScDocument *pDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator= ' ', sal_Unicode cQuote= '\'')
const int nColCount
ScXMLSubTotalRuleContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:725
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:816
SCCOL nField[MAXSUBTOTAL]
associated field
bool bUserDef
sort user defined
ScAddress aStart
Definition: address.hxx:500
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:522
std::unique_ptr< ScDBData > ConvertToDBData(const OUString &rName)
Definition: xmldrani.cxx:241
SCROW Row() const
Definition: address.hxx:262
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
Definition: document.hxx:2418
OUString aDBName
Definition: global.hxx:455
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:217
XML_SQL_STATEMENT
ScXMLSourceQueryContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:543
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:468
ScDocument * GetDocument()
Definition: xmlimprt.hxx:296
#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:5015
std::unique_ptr< ScQueryParam > mpQueryParam
Definition: xmldrani.hxx:56
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:801
XML_DATABASE_SOURCE_QUERY
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:768
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:774
XML_ON_UPDATE_KEEP_STYLES
virtual ~ScXMLSubTotalFieldContext() override
Definition: xmldrani.cxx:797
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:571
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:24
XML_IS_SELECTION
AnonDBs & getAnonDBs()
Definition: dbdata.hxx:318
void LockSolarMutex()
Definition: xmlimprt.cxx:1699
int nCount
ScSubTotalRule aSubTotalRule
Definition: xmldrani.hxx:218
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:537
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:666
XML_SUBTOTAL_FIELD
ScRange aFilterConditionSourceRangeAddress
Definition: xmldrani.hxx:64
XML_QUERY_NAME
void SetSubTotalsIsCaseSensitive(const bool bTemp)
Definition: xmldrani.hxx:108
XML_ON_UPDATE_KEEP_SIZE
ScXMLSubTotalRulesContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:612
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:586
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:456
XML_PARSE_SQL_STATEMENT
virtual ~ScXMLSourceQueryContext() override
Definition: xmldrani.cxx:567
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:592
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:457
XML_HREF
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:487
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:393
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:493
TABLE
virtual ~ScXMLSortGroupsContext() override
Definition: xmldrani.cxx:721
void SetDatabaseName(const OUString &sTempDatabaseName)
Definition: xmldrani.hxx:102
#define SC_UNONAME_ORIENT
Definition: unonames.hxx:303
sal_uInt8 nType
Definition: global.hxx:459
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:194
virtual ~ScXMLSubTotalRulesContext() override
Definition: xmldrani.cxx:638
virtual ~ScXMLSubTotalRuleContext() override
Definition: xmldrani.cxx:745
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:1717
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:472
virtual ~ScXMLConResContext() override
Definition: xmldrani.cxx:608
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:454
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:749
ScXMLDatabaseRangesContext(ScXMLImport &rImport)
Definition: xmldrani.cxx:49
virtual ~ScXMLSourceTableContext() override
Definition: xmldrani.cxx:518
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:642
ScSubTotalFunc
Definition: global.hxx:847
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:441
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:78
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo