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>
31#include <xmloff/xmltoken.hxx>
33
34using namespace com::sun::star;
35using namespace xmloff::token;
36
37using ::com::sun::star::uno::Reference;
38
39ScXMLFilterContext::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);
78 }
79 break;
81 {
82 // not supported by StarOffice
83 }
84 break;
86 {
88 }
89 break;
90 }
91 }
92}
93
95{
96}
97
98uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLFilterContext::createFastChildContext(
99 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
100{
101 SvXMLImportContext *pContext(nullptr);
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
130void 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
202uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLAndContext::createFastChildContext(
203 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
204{
205 SvXMLImportContext *pContext(nullptr);
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
227void 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
246uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLOrContext::createFastChildContext(
247 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
248{
249 SvXMLImportContext *pContext(nullptr);
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
272void 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;
319 {
320 sOperator = aIter.toString();
321 }
322 break;
323 }
324 }
325}
326
328{
329}
330
331uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLConditionContext::createFastChildContext(
332 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
333{
334 SvXMLImportContext *pContext = nullptr;
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))
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
408void 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
529uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPFilterContext::createFastChildContext(
530 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
531{
532 SvXMLImportContext *pContext(nullptr);
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
558void 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
588uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPAndContext::createFastChildContext(
589 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
590{
591 SvXMLImportContext *pContext(nullptr);
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
612void 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
629uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPOrContext::createFastChildContext(
630 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
631{
632 SvXMLImportContext *pContext(nullptr);
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
653void 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;
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
745void SAL_CALL ScXMLDPConditionContext::endFastElement( sal_Int32 /*nElement*/ )
746{
747 ScQueryEntry aFilterField;
748 aFilterField.nField = nField;
750 aFilterField.eConnect = SC_OR;
751 else
752 aFilterField.eConnect = SC_AND;
755 aFilterField.SetQueryByEmpty();
757 aFilterField.SetQueryByNonEmpty();
758 else
759 {
761 getOperatorXML(sOperator, aFilterField.eOp, eSearchType);
762 pFilterContext->SetSearchType(eSearchType);
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: */
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:586
static bool GetRangeFromString(ScRange &rRange, const OUString &rRangeStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
ScAddress aStart
Definition: address.hxx:497
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:73
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:227
virtual ~ScXMLAndContext() override
Definition: xmlfilti.cxx:198
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:74
ScXMLAndContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:188
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
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:408
static void GetOperator(std::u16string_view aOpStr, ScQueryParam &rParam, ScQueryEntry &rEntry)
Definition: xmlfilti.cxx:351
void AddSetItem(const ScQueryEntry::Item &rItem)
Definition: xmlfilti.cxx:403
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
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:112
ScXMLConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:277
OUString sConditionValue
Definition: xmlfilti.hxx:116
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:111
virtual ~ScXMLConditionContext() override
Definition: xmlfilti.cxx:327
ScQueryEntry::QueryItemsType maQueryItems
Definition: xmlfilti.hxx:114
virtual ~ScXMLDPAndContext() override
Definition: xmlfilti.cxx:584
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
ScXMLDPAndContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:576
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:612
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:212
static void getOperatorXML(std::u16string_view sTempOperator, ScQueryOp &aFilterOperator, utl::SearchParam::SearchType &rSearchType)
Definition: xmlfilti.cxx:709
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:244
ScXMLDPConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:658
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:745
virtual ~ScXMLDPConditionContext() override
Definition: xmlfilti.cxx:705
ScXMLDataPilotTableContext * pDataPilotTable
Definition: xmlfilti.hxx:153
void SetIsCaseSensitive(const bool bTemp)
Definition: xmlfilti.hxx:177
void SetSearchType(const utl::SearchParam::SearchType eTemp)
Definition: xmlfilti.hxx:178
utl::SearchParam::SearchType eSearchType
Definition: xmlfilti.hxx:156
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:558
ScQueryParam aFilterFields
Definition: xmlfilti.hxx:155
ScXMLDPFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDataPilotTableContext *pTempDataPilotTableContext)
Definition: xmlfilti.cxx:482
virtual ~ScXMLDPFilterContext() override
Definition: xmlfilti.cxx:525
void OpenConnection(const bool bVal)
Definition: xmlfilti.hxx:184
void AddFilterField(const ScQueryEntry &aFilterField)
Definition: xmlfilti.cxx:567
sal_uInt8 nFilterFieldCount
Definition: xmlfilti.hxx:157
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
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
virtual ~ScXMLDPOrContext() override
Definition: xmlfilti.cxx:625
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:228
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:653
ScXMLDPOrContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:617
void SetSourceQueryParam(const ScQueryParam &aValue)
Definition: xmldpimp.hxx:131
void SetFilterConditionSourceRangeAddress(const ScRange &aRange)
Definition: xmldrani.hxx:115
ScXMLFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmlfilti.cxx:41
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmlfilti.hxx:43
void OpenConnection(bool b)
Definition: xmlfilti.cxx:146
bool bConditionSourceRange
Definition: xmlfilti.hxx:49
ScRange aConditionSourceRangeAddress
Definition: xmlfilti.hxx:46
ScAddress aOutputPosition
Definition: xmlfilti.hxx:45
void CloseConnection()
Definition: xmlfilti.cxx:151
std::vector< ConnStackItem > maConnStack
Definition: xmlfilti.hxx:50
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:130
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
virtual ~ScXMLFilterContext() override
Definition: xmlfilti.cxx:94
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:42
This class exists only to provide GetScImport() to its derived classes.
ScXMLImport & GetScImport()
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:272
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
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:92
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:93
ScXMLOrContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:232
virtual ~ScXMLOrContext() override
Definition: xmlfilti.cxx:242
ScXMLSetItemContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLConditionContext &rParent)
Definition: xmlfilti.cxx:452
virtual ~ScXMLSetItemContext() override
Definition: xmlfilti.cxx:478
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
SharedString intern(const OUString &rStr)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
float u
@ SC_OR
Definition: global.hxx:855
@ SC_AND
Definition: global.hxx:854
ScQueryOp
Definition: global.hxx:833
@ SC_DOES_NOT_CONTAIN
Definition: global.hxx:845
@ SC_LESS_EQUAL
Definition: global.hxx:837
@ SC_LESS
Definition: global.hxx:835
@ SC_GREATER_EQUAL
Definition: global.hxx:838
@ SC_CONTAINS
Definition: global.hxx:844
@ SC_TOPPERC
Definition: global.hxx:842
@ SC_ENDS_WITH
Definition: global.hxx:848
@ SC_DOES_NOT_END_WITH
Definition: global.hxx:849
@ SC_BEGINS_WITH
Definition: global.hxx:846
@ SC_TOPVAL
Definition: global.hxx:840
@ SC_GREATER
Definition: global.hxx:836
@ SC_EQUAL
Definition: global.hxx:834
@ SC_BOTPERC
Definition: global.hxx:843
@ SC_NOT_EQUAL
Definition: global.hxx:839
@ SC_DOES_NOT_BEGIN_WITH
Definition: global.hxx:847
@ SC_BOTVAL
Definition: global.hxx:841
TABLE
T saturating_add(T a, T b)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_NOMATCH
XML_FIELD_NUMBER
XML_CONDITION_SOURCE_RANGE_ADDRESS
XML_FILTER_SET_ITEM
XML_CONDITION_SOURCE
XML_ENDS_WITH
XML_OPERATOR
XML_CONTAINS
XML_CASE_SENSITIVE
XML_TRUE
XML_TOP_PERCENT
XML_DOES_NOT_BEGIN_WITH
XML_NOEMPTY
XML_NUMBER
XML_MATCH
XML_DOES_NOT_END_WITH
XML_DOES_NOT_CONTAIN
XML_WINDOW_FONT_COLOR
XML_TEXT
XML_TOP_VALUES
XML_VALUE
XML_EMPTY
XML_BOTTOM_VALUES
XML_FILTER_CONDITION
XML_FILTER_OR
XML_TARGET_RANGE_ADDRESS
XML_BEGINS_WITH
XML_FILTER_AND
XML_TEXT_COLOR
XML_BOTTOM_PERCENT
XML_BACKGROUND_COLOR
XML_DISPLAY_DUPLICATES
XML_DATA_TYPE
XML_TRANSPARENT
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
svl::SharedString maString
Definition: queryentry.hxx:49
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:34
SCCOLROW nField
Definition: queryentry.hxx:61
const Item & GetQueryItem() const
Definition: queryentry.hxx:85
void SetQueryByNonEmpty()
Definition: queryentry.cxx:99
ScQueryConnect eConnect
Definition: queryentry.hxx:63
ScQueryOp eOp
Definition: queryentry.hxx:62
void SetQueryByEmpty()
Definition: queryentry.cxx:77
QueryItemsType & GetQueryItems()
Definition: queryentry.hxx:75
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
Definition: queryparam.cxx:116
utl::SearchParam::SearchType eSearchType
Definition: queryparam.hxx:43
void Resize(size_t nNew)
Definition: queryparam.cxx:196
SC_DLLPUBLIC ScQueryEntry & AppendEntry()
Definition: queryparam.cxx:126
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
#define XML_ELEMENT(prefix, name)