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 return;
428 {
429 rItem.mfVal = sConditionValue.toDouble();
431 }
434 {
439 rItem.maColor = COL_AUTO;
440 else
442 }
443 else
444 {
446 rItem.maString = rPool.intern(sConditionValue);
448 }
449 }
450 else
451 rEntry.GetQueryItems().swap(maQueryItems);
452}
453
455 ScXMLImport& rImport, sal_Int32 /*nElement*/,
457 ScXMLImportContext(rImport)
458{
459 if ( !rAttrList.is() )
460 return;
461
462 for (auto &aIter : *rAttrList)
463 {
464 switch (aIter.getToken())
465 {
466 case XML_ELEMENT( TABLE, XML_VALUE ):
467 {
469 ScQueryEntry::Item aItem;
470 aItem.maString = rPool.intern(aIter.toString());
472 aItem.mfVal = 0.0;
473 rParent.AddSetItem(aItem);
474 }
475 break;
476 }
477 }
478}
479
481{
482}
483
486 ScXMLDataPilotTableContext* pTempDataPilotTableContext) :
487 ScXMLImportContext( rImport ),
488 pDataPilotTable(pTempDataPilotTableContext),
489 eSearchType(utl::SearchParam::SearchType::Normal),
490 nFilterFieldCount(0),
491 bSkipDuplicates(false),
492 bIsCaseSensitive(false),
493 bConnectionOr(true),
494 bNextConnectionOr(true)
495{
496 if ( !rAttrList.is() )
497 return;
498
499 for (auto &aIter : *rAttrList)
500 {
501 switch (aIter.getToken())
502 {
504 {
505 // not supported
506 }
507 break;
509 {
510 // not supported
511 }
512 break;
514 {
515 // not supported by StarOffice
516 }
517 break;
519 {
521 }
522 break;
523 }
524 }
525}
526
528{
529}
530
531uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPFilterContext::createFastChildContext(
532 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
533{
534 SvXMLImportContext *pContext(nullptr);
537
538 switch (nElement)
539 {
541 {
542 pContext = new ScXMLDPAndContext( GetScImport(), this);
543 }
544 break;
546 {
547 pContext = new ScXMLDPOrContext( GetScImport(), this);
548 }
549 break;
551 {
552 pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, this);
553 }
554 break;
555 }
556
557 return pContext;
558}
559
560void SAL_CALL ScXMLDPFilterContext::endFastElement( sal_Int32 /*nElement*/ )
561{
565
567}
568
570{
573 rEntry = aFilterField;
574 rEntry.bDoQuery = true;
576}
577
579 ScXMLDPFilterContext* pTempFilterContext) :
580 ScXMLImportContext( rImport )
581{
582 pFilterContext = pTempFilterContext;
584}
585
587{
588}
589
590uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPAndContext::createFastChildContext(
591 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
592{
593 SvXMLImportContext *pContext(nullptr);
596
597 switch (nElement)
598 {
600 {
601 // not supported in StarOffice
602 }
603 break;
605 {
606 pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, pFilterContext);
607 }
608 break;
609 }
610
611 return pContext;
612}
613
614void SAL_CALL ScXMLDPAndContext::endFastElement( sal_Int32 /*nElement*/ )
615{
617}
618
620 ScXMLDPFilterContext* pTempFilterContext) :
621 ScXMLImportContext( rImport ),
622 pFilterContext(pTempFilterContext)
623{
625}
626
628{
629}
630
631uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPOrContext::createFastChildContext(
632 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
633{
634 SvXMLImportContext *pContext(nullptr);
637
638 switch (nElement)
639 {
641 {
642 pContext = new ScXMLDPAndContext( GetScImport(), pFilterContext);
643 }
644 break;
646 {
647 pContext = new ScXMLDPConditionContext( GetScImport(), nElement, pAttribList, pFilterContext);
648 }
649 break;
650 }
651
652 return pContext;
653}
654
655void SAL_CALL ScXMLDPOrContext::endFastElement( sal_Int32 /*nElement*/ )
656{
658}
659
661 sal_Int32 /*nElement*/,
663 ScXMLDPFilterContext* pTempFilterContext) :
664 ScXMLImportContext( rImport ),
665 pFilterContext(pTempFilterContext),
666 sDataType(GetXMLToken(XML_TEXT)),
667 nField(0),
668 bIsCaseSensitive(false)
669{
670
671 if ( !rAttrList.is() )
672 return;
673
674 for (auto &aIter : *rAttrList)
675 {
676 switch (aIter.getToken())
677 {
679 {
680 nField = aIter.toInt32();
681 }
682 break;
684 {
686 }
687 break;
689 {
690 sDataType = aIter.toString();
691 }
692 break;
693 case XML_ELEMENT( TABLE, XML_VALUE ):
694 {
695 sConditionValue = aIter.toString();
696 }
697 break;
699 {
700 sOperator = aIter.toString();
701 }
702 break;
703 }
704 }
705}
706
708{
709}
710
712 std::u16string_view sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType)
713{
715 if (IsXMLToken(sTempOperator, XML_MATCH))
716 {
718 aFilterOperator = SC_EQUAL;
719 }
720 else if (IsXMLToken(sTempOperator, XML_NOMATCH))
721 {
723 aFilterOperator = SC_NOT_EQUAL;
724 }
725 else if (sTempOperator == u"=")
726 aFilterOperator = SC_EQUAL;
727 else if (sTempOperator == u"!=")
728 aFilterOperator = SC_NOT_EQUAL;
729 else if (IsXMLToken(sTempOperator, XML_BOTTOM_PERCENT))
730 aFilterOperator = SC_BOTPERC;
731 else if (IsXMLToken(sTempOperator, XML_BOTTOM_VALUES))
732 aFilterOperator = SC_BOTVAL;
733 else if (sTempOperator == u">")
734 aFilterOperator = SC_GREATER;
735 else if (sTempOperator == u">=")
736 aFilterOperator = SC_GREATER_EQUAL;
737 else if (sTempOperator == u"<")
738 aFilterOperator = SC_LESS;
739 else if (sTempOperator == u"<=")
740 aFilterOperator = SC_LESS_EQUAL;
741 else if (IsXMLToken(sTempOperator, XML_TOP_PERCENT))
742 aFilterOperator = SC_TOPPERC;
743 else if (IsXMLToken(sTempOperator, XML_TOP_VALUES))
744 aFilterOperator = SC_TOPVAL;
745}
746
747void SAL_CALL ScXMLDPConditionContext::endFastElement( sal_Int32 /*nElement*/ )
748{
749 ScQueryEntry aFilterField;
750 aFilterField.nField = nField;
752 aFilterField.eConnect = SC_OR;
753 else
754 aFilterField.eConnect = SC_AND;
757 aFilterField.SetQueryByEmpty();
759 aFilterField.SetQueryByNonEmpty();
760 else
761 {
763 getOperatorXML(sOperator, aFilterField.eOp, eSearchType);
764 pFilterContext->SetSearchType(eSearchType);
765 ScQueryEntry::Item& rItem = aFilterField.GetQueryItem();
767
769 {
770 rItem.mfVal = sConditionValue.toDouble();
771 rItem.maString = rPool.intern(sConditionValue);
773 }
774 else
775 {
776 rItem.maString = rPool.intern(sConditionValue);
778 rItem.mfVal = 0.0;
779 }
780 }
781 pFilterContext->AddFilterField(aFilterField);
782}
783
784/* 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:601
static bool GetRangeFromString(ScRange &rRange, std::u16string_view 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:586
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:590
ScXMLDPAndContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:578
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:614
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:212
static void getOperatorXML(std::u16string_view sTempOperator, ScQueryOp &aFilterOperator, utl::SearchParam::SearchType &rSearchType)
Definition: xmlfilti.cxx:711
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:244
ScXMLDPConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:660
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:747
virtual ~ScXMLDPConditionContext() override
Definition: xmlfilti.cxx:707
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:560
ScQueryParam aFilterFields
Definition: xmlfilti.hxx:155
ScXMLDPFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDataPilotTableContext *pTempDataPilotTableContext)
Definition: xmlfilti.cxx:484
virtual ~ScXMLDPFilterContext() override
Definition: xmlfilti.cxx:527
void OpenConnection(const bool bVal)
Definition: xmlfilti.hxx:184
void AddFilterField(const ScQueryEntry &aFilterField)
Definition: xmlfilti.cxx:569
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:531
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:631
virtual ~ScXMLDPOrContext() override
Definition: xmlfilti.cxx:627
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:228
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:655
ScXMLDPOrContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:619
void SetSourceQueryParam(const ScQueryParam &aValue)
Definition: xmldpimp.hxx:133
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:454
virtual ~ScXMLSetItemContext() override
Definition: xmlfilti.cxx:480
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:856
@ SC_AND
Definition: global.hxx:855
ScQueryOp
Definition: global.hxx:834
@ SC_DOES_NOT_CONTAIN
Definition: global.hxx:846
@ SC_LESS_EQUAL
Definition: global.hxx:838
@ SC_LESS
Definition: global.hxx:836
@ SC_GREATER_EQUAL
Definition: global.hxx:839
@ SC_CONTAINS
Definition: global.hxx:845
@ SC_TOPPERC
Definition: global.hxx:843
@ SC_ENDS_WITH
Definition: global.hxx:849
@ SC_DOES_NOT_END_WITH
Definition: global.hxx:850
@ SC_BEGINS_WITH
Definition: global.hxx:847
@ SC_TOPVAL
Definition: global.hxx:841
@ SC_GREATER
Definition: global.hxx:837
@ SC_EQUAL
Definition: global.hxx:835
@ SC_BOTPERC
Definition: global.hxx:844
@ SC_NOT_EQUAL
Definition: global.hxx:840
@ SC_DOES_NOT_BEGIN_WITH
Definition: global.hxx:848
@ SC_BOTVAL
Definition: global.hxx:842
TABLE
constexpr 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)