LibreOffice Module sc (master)  1
xmlfilti.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 "xmlfilti.hxx"
21 #include "xmlimprt.hxx"
22 #include "xmldrani.hxx"
23 #include "xmldpimp.hxx"
24 #include <rangeutl.hxx>
25 #include <queryentry.hxx>
26 #include <document.hxx>
27 
28 #include <o3tl/safeint.hxx>
29 #include <sax/tools/converter.hxx>
30 #include <svl/sharedstringpool.hxx>
31 #include <xmloff/xmltoken.hxx>
32 #include <xmloff/xmlnamespace.hxx>
33 
34 using namespace com::sun::star;
35 using namespace xmloff::token;
36 
37 using ::com::sun::star::uno::Reference;
38 
39 ScXMLFilterContext::ConnStackItem::ConnStackItem(bool bOr) : mbOr(bOr), mnCondCount(0) {}
40 
43  ScQueryParam& rParam,
44  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) :
45  ScXMLImportContext( rImport ),
46  mrQueryParam(rParam),
47  pDatabaseRangeContext(pTempDatabaseRangeContext),
48  bSkipDuplicates(false),
49  bCopyOutputData(false),
51 {
52  ScDocument* pDoc(GetScImport().GetDocument());
53  assert(pDoc);
54 
55  if ( !rAttrList.is() )
56  return;
57 
58  for (auto &aIter : *rAttrList)
59  {
60  switch (aIter.getToken())
61  {
63  {
64  ScRange aScRange;
65  sal_Int32 nOffset(0);
66  if (ScRangeStringConverter::GetRangeFromString( aScRange, aIter.toString(), *pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset ))
67  {
68  aOutputPosition = aScRange.aStart;
69  bCopyOutputData = true;
70  }
71  }
72  break;
74  {
75  sal_Int32 nOffset(0);
77  bConditionSourceRange = true;
78  }
79  break;
81  {
82  // not supported by StarOffice
83  }
84  break;
86  {
88  }
89  break;
90  }
91  }
92 }
93 
95 {
96 }
97 
98 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLFilterContext::createFastChildContext(
99  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
100 {
101  SvXMLImportContext *pContext(nullptr);
102  sax_fastparser::FastAttributeList *pAttribList =
104 
105  switch (nElement)
106  {
108  {
109  pContext = new ScXMLAndContext(
110  GetScImport(), mrQueryParam, this);
111  }
112  break;
114  {
115  pContext = new ScXMLOrContext(
116  GetScImport(), mrQueryParam, this);
117  }
118  break;
120  {
121  pContext = new ScXMLConditionContext(
122  GetScImport(), nElement, pAttribList, mrQueryParam, this);
123  }
124  break;
125  }
126 
127  return pContext;
128 }
129 
130 void SAL_CALL ScXMLFilterContext::endFastElement( sal_Int32 /*nElement*/ )
131 {
134 
135  if (bCopyOutputData)
136  {
140  }
141 
144 }
145 
147 {
148  maConnStack.emplace_back(b);
149 }
150 
152 {
153  maConnStack.pop_back();
154 }
155 
157 {
158  // For condition items in each stack, the first one gets the connection of
159  // the last stack, while the rest of them get that of the current stack.
160 
161  if (maConnStack.empty())
162  // This should never happen.
163  return true;
164 
165  ConnStackItem& rItem = maConnStack.back();
166  if (rItem.mnCondCount)
167  // secondary item gets the current connection.
168  return rItem.mbOr;
169 
170  // The next condition of this stack will get the current connection.
171  ++rItem.mnCondCount;
172 
173  if (maConnStack.size() < 2)
174  // There is no last stack. Likely the first condition in the first
175  // stack whose connection is not used. Default in
176  // ScQueryEntry::eConnect is SC_AND, so return false (AND instead of
177  // OR) here. Otherwise, when saving the document again, we'd write a
178  // uselessly stacked
179  // <table:filter-or><table:filter-and>...</table:filter-and></table:filter-or>
180  // for two conditions connected with AND.
181  return false;
182 
183  std::vector<ConnStackItem>::reverse_iterator itr = maConnStack.rbegin();
184  ++itr;
185  return itr->mbOr; // connection of the last stack.
186 }
187 
189  ScQueryParam& rParam,
190  ScXMLFilterContext* pTempFilterContext) :
191  ScXMLImportContext( rImport ),
192  mrQueryParam(rParam),
193  pFilterContext(pTempFilterContext)
194 {
196 }
197 
199 {
200 }
201 
202 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLAndContext::createFastChildContext(
203  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
204 {
205  SvXMLImportContext *pContext(nullptr);
206  sax_fastparser::FastAttributeList *pAttribList =
208 
209  switch (nElement)
210  {
212  {
213  // not supported in StarOffice
214  }
215  break;
217  {
218  pContext = new ScXMLConditionContext(
219  GetScImport(), nElement, pAttribList, mrQueryParam, pFilterContext);
220  }
221  break;
222  }
223 
224  return pContext;
225 }
226 
227 void SAL_CALL ScXMLAndContext::endFastElement( sal_Int32 /*nElement*/ )
228 {
230 }
231 
233  ScQueryParam& rParam,
234  ScXMLFilterContext* pTempFilterContext) :
235  ScXMLImportContext( rImport ),
236  mrQueryParam(rParam),
237  pFilterContext(pTempFilterContext)
238 {
240 }
241 
243 {
244 }
245 
246 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLOrContext::createFastChildContext(
247  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
248 {
249  SvXMLImportContext *pContext(nullptr);
250  sax_fastparser::FastAttributeList *pAttribList =
252 
253  switch (nElement)
254  {
256  {
257  pContext = new ScXMLAndContext(
259  }
260  break;
262  {
263  pContext = new ScXMLConditionContext(
264  GetScImport(), nElement, pAttribList, mrQueryParam, pFilterContext);
265  }
266  break;
267  }
268 
269  return pContext;
270 }
271 
272 void SAL_CALL ScXMLOrContext::endFastElement( sal_Int32 /*nElement*/ )
273 {
275 }
276 
278  ScXMLImport& rImport, sal_Int32 /*nElement*/,
280  ScQueryParam& rParam,
281  ScXMLFilterContext* pTempFilterContext) :
282  ScXMLImportContext( rImport ),
283  mrQueryParam(rParam),
284  pFilterContext(pTempFilterContext),
285  sDataType(GetXMLToken(XML_TEXT)),
286  nField(0),
287  bIsCaseSensitive(false)
288 {
289 
290  if ( !rAttrList.is() )
291  return;
292 
293  for (auto &aIter : *rAttrList)
294  {
295  switch (aIter.getToken())
296  {
298  {
299  nField = aIter.toInt32();
300  }
301  break;
303  {
305  }
306  break;
308  case XML_ELEMENT( LO_EXT, XML_DATA_TYPE ):
309  {
310  sDataType = aIter.toString();
311  }
312  break;
313  case XML_ELEMENT( TABLE, XML_VALUE ):
314  {
315  sConditionValue = aIter.toString();
316  }
317  break;
318  case XML_ELEMENT( TABLE, XML_OPERATOR ):
319  {
320  sOperator = aIter.toString();
321  }
322  break;
323  }
324  }
325 }
326 
328 {
329 }
330 
331 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLConditionContext::createFastChildContext(
332  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
333 {
334  SvXMLImportContext *pContext = nullptr;
335  sax_fastparser::FastAttributeList *pAttribList =
337 
338  switch (nElement)
339  {
341  {
342  pContext = new ScXMLSetItemContext(
343  GetScImport(), nElement, pAttribList, *this);
344  }
345  break;
346  }
347 
348  return pContext;
349 }
350 
352  std::u16string_view aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry)
353 {
355  if (IsXMLToken(aOpStr, XML_MATCH))
356  {
358  rEntry.eOp = SC_EQUAL;
359  }
360  else if (IsXMLToken(aOpStr, XML_NOMATCH))
361  {
363  rEntry.eOp = SC_NOT_EQUAL;
364  }
365  else if (aOpStr == u"=")
366  rEntry.eOp = SC_EQUAL;
367  else if (aOpStr == u"!=")
368  rEntry.eOp = SC_NOT_EQUAL;
369  else if (IsXMLToken(aOpStr, XML_BOTTOM_PERCENT))
370  rEntry.eOp = SC_BOTPERC;
371  else if (IsXMLToken(aOpStr, XML_BOTTOM_VALUES))
372  rEntry.eOp = SC_BOTVAL;
373  else if (IsXMLToken(aOpStr, XML_EMPTY))
374  rEntry.SetQueryByEmpty();
375  else if (aOpStr == u">")
376  rEntry.eOp = SC_GREATER;
377  else if (aOpStr == u">=")
378  rEntry.eOp = SC_GREATER_EQUAL;
379  else if (aOpStr == u"<")
380  rEntry.eOp = SC_LESS;
381  else if (aOpStr == u"<=")
382  rEntry.eOp = SC_LESS_EQUAL;
383  else if (IsXMLToken(aOpStr, XML_NOEMPTY))
384  rEntry.SetQueryByNonEmpty();
385  else if (IsXMLToken(aOpStr, XML_TOP_PERCENT))
386  rEntry.eOp = SC_TOPPERC;
387  else if (IsXMLToken(aOpStr, XML_TOP_VALUES))
388  rEntry.eOp = SC_TOPVAL;
389  else if (IsXMLToken(aOpStr, XML_CONTAINS))
390  rEntry.eOp = SC_CONTAINS;
391  else if (IsXMLToken(aOpStr, XML_DOES_NOT_CONTAIN))
392  rEntry.eOp = SC_DOES_NOT_CONTAIN;
393  else if (IsXMLToken(aOpStr, XML_BEGINS_WITH))
394  rEntry.eOp = SC_BEGINS_WITH;
395  else if (IsXMLToken(aOpStr, XML_DOES_NOT_BEGIN_WITH))
396  rEntry.eOp = SC_DOES_NOT_BEGIN_WITH;
397  else if (IsXMLToken(aOpStr, XML_ENDS_WITH))
398  rEntry.eOp = SC_ENDS_WITH;
399  else if (IsXMLToken(aOpStr, XML_DOES_NOT_END_WITH))
400  rEntry.eOp = SC_DOES_NOT_END_WITH;
401 }
402 
404 {
405  maQueryItems.push_back(rItem);
406 }
407 
408 void SAL_CALL ScXMLConditionContext::endFastElement( sal_Int32 /*nElement*/ )
409 {
411 
412  // We currently don't support per-condition case sensitivity.
414 
415  rEntry.bDoQuery = true;
417 
420  rEntry.nField = o3tl::saturating_add(nField, nStartPos);
421 
422  if (maQueryItems.empty())
423  {
424  ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
426  {
427  rItem.mfVal = sConditionValue.toDouble();
429  }
432  {
437  rItem.maColor = COL_AUTO;
438  else
440  }
441  else
442  {
444  rItem.maString = rPool.intern(sConditionValue);
446  }
447  }
448  else
449  rEntry.GetQueryItems().swap(maQueryItems);
450 }
451 
453  ScXMLImport& rImport, sal_Int32 /*nElement*/,
455  ScXMLImportContext(rImport)
456 {
457  if ( !rAttrList.is() )
458  return;
459 
460  for (auto &aIter : *rAttrList)
461  {
462  switch (aIter.getToken())
463  {
464  case XML_ELEMENT( TABLE, XML_VALUE ):
465  {
467  ScQueryEntry::Item aItem;
468  aItem.maString = rPool.intern(aIter.toString());
470  aItem.mfVal = 0.0;
471  rParent.AddSetItem(aItem);
472  }
473  break;
474  }
475  }
476 }
477 
479 {
480 }
481 
484  ScXMLDataPilotTableContext* pTempDataPilotTableContext) :
485  ScXMLImportContext( rImport ),
486  pDataPilotTable(pTempDataPilotTableContext),
487  eSearchType(utl::SearchParam::SearchType::Normal),
488  nFilterFieldCount(0),
489  bSkipDuplicates(false),
490  bIsCaseSensitive(false),
491  bConnectionOr(true),
492  bNextConnectionOr(true)
493 {
494  if ( !rAttrList.is() )
495  return;
496 
497  for (auto &aIter : *rAttrList)
498  {
499  switch (aIter.getToken())
500  {
502  {
503  // not supported
504  }
505  break;
507  {
508  // not supported
509  }
510  break;
512  {
513  // not supported by StarOffice
514  }
515  break;
517  {
519  }
520  break;
521  }
522  }
523 }
524 
526 {
527 }
528 
529 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPFilterContext::createFastChildContext(
530  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
531 {
532  SvXMLImportContext *pContext(nullptr);
533  sax_fastparser::FastAttributeList *pAttribList =
535 
536  switch (nElement)
537  {
539  {
540  pContext = new ScXMLDPAndContext( GetScImport(), this);
541  }
542  break;
544  {
545  pContext = new ScXMLDPOrContext( GetScImport(), this);
546  }
547  break;
549  {
550  pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, this);
551  }
552  break;
553  }
554 
555  return pContext;
556 }
557 
558 void SAL_CALL ScXMLDPFilterContext::endFastElement( sal_Int32 /*nElement*/ )
559 {
563 
565 }
566 
568 {
571  rEntry = aFilterField;
572  rEntry.bDoQuery = true;
574 }
575 
577  ScXMLDPFilterContext* pTempFilterContext) :
578  ScXMLImportContext( rImport )
579 {
580  pFilterContext = pTempFilterContext;
582 }
583 
585 {
586 }
587 
588 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPAndContext::createFastChildContext(
589  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
590 {
591  SvXMLImportContext *pContext(nullptr);
592  sax_fastparser::FastAttributeList *pAttribList =
594 
595  switch (nElement)
596  {
598  {
599  // not supported in StarOffice
600  }
601  break;
603  {
604  pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, pFilterContext);
605  }
606  break;
607  }
608 
609  return pContext;
610 }
611 
612 void SAL_CALL ScXMLDPAndContext::endFastElement( sal_Int32 /*nElement*/ )
613 {
615 }
616 
618  ScXMLDPFilterContext* pTempFilterContext) :
619  ScXMLImportContext( rImport ),
620  pFilterContext(pTempFilterContext)
621 {
623 }
624 
626 {
627 }
628 
629 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPOrContext::createFastChildContext(
630  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
631 {
632  SvXMLImportContext *pContext(nullptr);
633  sax_fastparser::FastAttributeList *pAttribList =
635 
636  switch (nElement)
637  {
639  {
640  pContext = new ScXMLDPAndContext( GetScImport(), pFilterContext);
641  }
642  break;
644  {
645  pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, pFilterContext);
646  }
647  break;
648  }
649 
650  return pContext;
651 }
652 
653 void SAL_CALL ScXMLDPOrContext::endFastElement( sal_Int32 /*nElement*/ )
654 {
656 }
657 
659  sal_Int32 /*nElement*/,
661  ScXMLDPFilterContext* pTempFilterContext) :
662  ScXMLImportContext( rImport ),
663  pFilterContext(pTempFilterContext),
664  sDataType(GetXMLToken(XML_TEXT)),
665  nField(0),
666  bIsCaseSensitive(false)
667 {
668 
669  if ( !rAttrList.is() )
670  return;
671 
672  for (auto &aIter : *rAttrList)
673  {
674  switch (aIter.getToken())
675  {
677  {
678  nField = aIter.toInt32();
679  }
680  break;
682  {
684  }
685  break;
687  {
688  sDataType = aIter.toString();
689  }
690  break;
691  case XML_ELEMENT( TABLE, XML_VALUE ):
692  {
693  sConditionValue = aIter.toString();
694  }
695  break;
696  case XML_ELEMENT( TABLE, XML_OPERATOR ):
697  {
698  sOperator = aIter.toString();
699  }
700  break;
701  }
702  }
703 }
704 
706 {
707 }
708 
710  std::u16string_view sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType)
711 {
713  if (IsXMLToken(sTempOperator, XML_MATCH))
714  {
716  aFilterOperator = SC_EQUAL;
717  }
718  else if (IsXMLToken(sTempOperator, XML_NOMATCH))
719  {
721  aFilterOperator = SC_NOT_EQUAL;
722  }
723  else if (sTempOperator == u"=")
724  aFilterOperator = SC_EQUAL;
725  else if (sTempOperator == u"!=")
726  aFilterOperator = SC_NOT_EQUAL;
727  else if (IsXMLToken(sTempOperator, XML_BOTTOM_PERCENT))
728  aFilterOperator = SC_BOTPERC;
729  else if (IsXMLToken(sTempOperator, XML_BOTTOM_VALUES))
730  aFilterOperator = SC_BOTVAL;
731  else if (sTempOperator == u">")
732  aFilterOperator = SC_GREATER;
733  else if (sTempOperator == u">=")
734  aFilterOperator = SC_GREATER_EQUAL;
735  else if (sTempOperator == u"<")
736  aFilterOperator = SC_LESS;
737  else if (sTempOperator == u"<=")
738  aFilterOperator = SC_LESS_EQUAL;
739  else if (IsXMLToken(sTempOperator, XML_TOP_PERCENT))
740  aFilterOperator = SC_TOPPERC;
741  else if (IsXMLToken(sTempOperator, XML_TOP_VALUES))
742  aFilterOperator = SC_TOPVAL;
743 }
744 
745 void SAL_CALL ScXMLDPConditionContext::endFastElement( sal_Int32 /*nElement*/ )
746 {
747  ScQueryEntry aFilterField;
749  aFilterField.eConnect = SC_OR;
750  else
751  aFilterField.eConnect = SC_AND;
754  aFilterField.SetQueryByEmpty();
755  else if (IsXMLToken(sOperator, XML_NOEMPTY))
756  aFilterField.SetQueryByNonEmpty();
757  else
758  {
760  getOperatorXML(sOperator, aFilterField.eOp, eSearchType);
761  pFilterContext->SetSearchType(eSearchType);
762  aFilterField.nField = nField;
763  ScQueryEntry::Item& rItem = aFilterField.GetQueryItem();
765 
767  {
768  rItem.mfVal = sConditionValue.toDouble();
769  rItem.maString = rPool.intern(sConditionValue);
771  }
772  else
773  {
774  rItem.maString = rPool.intern(sConditionValue);
776  rItem.mfVal = 0.0;
777  }
778  }
779  pFilterContext->AddFilterField(aFilterField);
780 }
781 
782 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XML_NUMBER
ScXMLAndContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:188
static void getOperatorXML(std::u16string_view sTempOperator, ScQueryOp &aFilterOperator, utl::SearchParam::SearchType &rSearchType)
Definition: xmlfilti.cxx:709
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: xmlfilti.cxx:202
void SetQueryByEmpty()
Definition: queryentry.cxx:76
void OpenConnection(bool b)
Definition: xmlfilti.cxx:146
virtual ~ScXMLDPOrContext() override
Definition: xmlfilti.cxx:625
ScAddress aStart
Definition: address.hxx:499
SharedString intern(const OUString &rStr)
ScXMLConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:277
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:566
XML_WINDOW_FONT_COLOR
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:112
XML_FIELD_NUMBER
SCROW Row() const
Definition: address.hxx:261
XML_NOMATCH
const Item & GetQueryItem() const
Definition: queryentry.hxx:84
ScXMLDPConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:658
void SetIsCaseSensitive(const bool bTemp)
Definition: xmlfilti.hxx:177
XML_MATCH
std::vector< ConnStackItem > maConnStack
Definition: xmlfilti.hxx:50
void SetSourceQueryParam(const ScQueryParam &aValue)
Definition: xmldpimp.hxx:131
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
XML_TEXT
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:244
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: xmlfilti.cxx:98
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:272
QueryItemsType & GetQueryItems()
Definition: queryentry.hxx:74
XML_TOP_VALUES
virtual ~ScXMLOrContext() override
Definition: xmlfilti.cxx:242
SCCOLROW nField
Definition: queryentry.hxx:60
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: xmlfilti.cxx:246
ScXMLSetItemContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLConditionContext &rParent)
Definition: xmlfilti.cxx:452
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_CONDITION_SOURCE
void CloseConnection()
Definition: xmlfilti.cxx:151
XML_VALUE
XML_DATA_TYPE
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:92
XML_DOES_NOT_END_WITH
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:227
XML_EMPTY
ScXMLOrContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:232
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:73
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:745
ScXMLDPOrContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:617
XML_CONTAINS
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
bool bConditionSourceRange
Definition: xmlfilti.hxx:49
virtual ~ScXMLConditionContext() override
Definition: xmlfilti.cxx:327
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:74
XML_BACKGROUND_COLOR
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
Definition: queryparam.cxx:125
ScXMLDPAndContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:576
SCTAB Tab() const
Definition: address.hxx:270
ScXMLDPFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDataPilotTableContext *pTempDataPilotTableContext)
Definition: xmlfilti.cxx:482
virtual ~ScXMLFilterContext() override
Definition: xmlfilti.cxx:94
ScRange aConditionSourceRangeAddress
Definition: xmlfilti.hxx:46
XML_NOEMPTY
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:558
static bool GetRangeFromString(ScRange &rRange, const OUString &rRangeStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator= ' ', sal_Unicode cQuote= '\'')
OUString sConditionValue
Definition: xmlfilti.hxx:116
static void GetOperator(std::u16string_view aOpStr, ScQueryParam &rParam, ScQueryEntry &rEntry)
Definition: xmlfilti.cxx:351
This class exists only to provide GetScImport() to its derived classes.
XML_FILTER_AND
XML_TEXT_COLOR
XML_BEGINS_WITH
ScQueryParam aFilterFields
Definition: xmlfilti.hxx:155
virtual ~ScXMLDPFilterContext() override
Definition: xmlfilti.cxx:525
virtual ~ScXMLDPConditionContext() override
Definition: xmlfilti.cxx:705
void Resize(size_t nNew)
Definition: queryparam.cxx:205
float u
XML_ENDS_WITH
ScAddress aOutputPosition
Definition: xmlfilti.hxx:45
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
XML_TOP_PERCENT
XML_OPERATOR
ScXMLImport & GetScImport()
XML_TARGET_RANGE_ADDRESS
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: xmlfilti.cxx:588
virtual ~ScXMLSetItemContext() override
Definition: xmlfilti.cxx:478
utl::SearchParam::SearchType eSearchType
Definition: xmlfilti.hxx:156
XML_FILTER_OR
svl::SharedString maString
Definition: queryentry.hxx:49
void SetSearchType(const utl::SearchParam::SearchType eTemp)
Definition: xmlfilti.hxx:178
SCCOL Col() const
Definition: address.hxx:266
XML_DOES_NOT_BEGIN_WITH
XML_TRUE
sal_uInt8 nFilterFieldCount
Definition: xmlfilti.hxx:157
TABLE
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:408
void OpenConnection(const bool bVal)
Definition: xmlfilti.hxx:184
T saturating_add(T a, T b)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:130
void AddFilterField(const ScQueryEntry &aFilterField)
Definition: xmlfilti.cxx:567
SC_DLLPUBLIC ScQueryEntry & AppendEntry()
Definition: queryparam.cxx:135
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: xmlfilti.cxx:331
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: xmlfilti.cxx:629
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
XML_BOTTOM_VALUES
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:653
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:612
XML_CASE_SENSITIVE
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmlfilti.hxx:43
void SetFilterConditionSourceRangeAddress(const ScRange &aRange)
Definition: xmldrani.hxx:115
#define XML_ELEMENT(prefix, name)
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:228
ScXMLDataPilotTableContext * pDataPilotTable
Definition: xmlfilti.hxx:153
ScQueryConnect eConnect
Definition: queryentry.hxx:62
void AddSetItem(const ScQueryEntry::Item &rItem)
Definition: xmlfilti.cxx:403
ScQueryOp
Definition: global.hxx:824
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:93
XML_DISPLAY_DUPLICATES
XML_DOES_NOT_CONTAIN
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:42
virtual ~ScXMLAndContext() override
Definition: xmlfilti.cxx:198
XML_FILTER_SET_ITEM
XML_TRANSPARENT
ScXMLFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmlfilti.cxx:41
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: xmlfilti.cxx:529
ScQueryOp eOp
Definition: queryentry.hxx:61
ScQueryEntry::QueryItemsType maQueryItems
Definition: xmlfilti.hxx:114
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:212
XML_FILTER_CONDITION
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:33
void SetQueryByNonEmpty()
Definition: queryentry.cxx:98
utl::SearchParam::SearchType eSearchType
Definition: queryparam.hxx:43
XML_BOTTOM_PERCENT
XML_CONDITION_SOURCE_RANGE_ADDRESS
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:111
virtual ~ScXMLDPAndContext() override
Definition: xmlfilti.cxx:584