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