diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-17 13:01:24 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-18 14:13:21 -0500 |
commit | 1249182e1cd1245b9aaff908a6937bbc9010ff90 (patch) | |
tree | a74358294a7d64c91fe5e3cd5d5e2a637bdc57f9 /sc | |
parent | ba92fb9347bc2f1c09544013047507bb7abcdf91 (diff) |
Store case sensitivity flag directly.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmldrani.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldrani.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfilti.cxx | 17 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfilti.hxx | 10 |
4 files changed, 19 insertions, 16 deletions
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 42a52eb6a817..0716111147e8 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -149,7 +149,6 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, bSubTotalsEnabledUserList(false), bSubTotalsAscending(true), bFilterCopyOutputData(false), - bFilterIsCaseSensitive(false), bFilterSkipDuplicates(false), bFilterUseRegularExpressions(false), bFilterConditionSourceRange(false), @@ -263,8 +262,8 @@ SvXMLImportContext *ScXMLDatabaseRangeContext::CreateChildContext( sal_uInt16 nP break; case XML_TOK_FILTER : { - pContext = new ScXMLFilterContext( GetScImport(), nPrefix, - rLName, xAttrList, this); + pContext = new ScXMLFilterContext( + GetScImport(), nPrefix, rLName, xAttrList, *mpQueryParam, this); } break; case XML_TOK_SORT : @@ -348,7 +347,6 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName) mpQueryParam->nRow2 = aRange.aEnd.Row(); mpQueryParam->bInplace = !bFilterCopyOutputData; - mpQueryParam->bCaseSens = bFilterIsCaseSensitive; mpQueryParam->bDuplicate = !bFilterSkipDuplicates; mpQueryParam->bRegExp = bFilterUseRegularExpressions; mpQueryParam->nDestTab = aFilterOutputPosition.Sheet; diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index e9c45ea1b137..9c4995e780e2 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -107,7 +107,6 @@ class ScXMLDatabaseRangeContext : public SvXMLImportContext bool bSubTotalsEnabledUserList; bool bSubTotalsAscending; bool bFilterCopyOutputData; - bool bFilterIsCaseSensitive; bool bFilterSkipDuplicates; bool bFilterUseRegularExpressions; bool bFilterConditionSourceRange; @@ -149,7 +148,6 @@ public: void AddSubTotalRule(const ScSubTotalRule& rRule) { aSubTotalRules.push_back(rRule); } void SetSortSequence(const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& aTempSortSequence) { aSortSequence = aTempSortSequence; } void SetFilterCopyOutputData(const bool bTemp) { bFilterCopyOutputData = bTemp; } - void SetFilterIsCaseSensitive(const bool bTemp) { bFilterIsCaseSensitive = bTemp; } void SetFilterSkipDuplicates(const bool bTemp) { bFilterSkipDuplicates = bTemp; } void SetFilterUseRegularExpressions(const bool bTemp) { bFilterUseRegularExpressions = bTemp; } void SetFilterFields(const com::sun::star::uno::Sequence <com::sun::star::sheet::TableFilterField2>& aTemp) { aFilterFields = aTemp; } diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index d1417b3c43c1..7eb44cfb0ae5 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -53,12 +53,13 @@ using ::com::sun::star::xml::sax::XAttributeList; //------------------------------------------------------------------ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport, - sal_uInt16 nPrfx, - const ::rtl::OUString& rLName, - const ::com::sun::star::uno::Reference< - ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + sal_uInt16 nPrfx, + const rtl::OUString& rLName, + const Reference<XAttributeList>& xAttrList, + ScQueryParam& rParam, ScXMLDatabaseRangeContext* pTempDatabaseRangeContext) : SvXMLImportContext( rImport, nPrfx, rLName ), + mrQueryParam(rParam), pDatabaseRangeContext(pTempDatabaseRangeContext), aFilterFields(), bSkipDuplicates(false), @@ -164,13 +165,17 @@ void ScXMLFilterContext::EndElement() } else pDatabaseRangeContext->SetFilterCopyOutputData(false); - pDatabaseRangeContext->SetFilterIsCaseSensitive(bIsCaseSensitive); pDatabaseRangeContext->SetFilterSkipDuplicates(bSkipDuplicates); pDatabaseRangeContext->SetFilterFields(aFilterFields); if (bConditionSourceRange) pDatabaseRangeContext->SetFilterConditionSourceRangeAddress(aConditionSourceRangeAddress); } +void ScXMLFilterContext::SetCaseSensitive(bool b) +{ + mrQueryParam.bCaseSens = b; +} + ScXMLAndContext::ScXMLAndContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, @@ -410,7 +415,7 @@ void ScXMLConditionContext::EndElement() aFilterField.Connection = sheet::FilterConnection_OR; else aFilterField.Connection = sheet::FilterConnection_AND; - pFilterContext->SetIsCaseSensitive(bIsCaseSensitive); + pFilterContext->SetCaseSensitive(bIsCaseSensitive); bool bUseRegularExpressions; getOperatorXML(sOperator, aFilterField.Operator, bUseRegularExpressions); pFilterContext->SetUseRegularExpressions(bUseRegularExpressions); diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx index 90c74720e0ff..4759b7356127 100644 --- a/sc/source/filter/xml/xmlfilti.hxx +++ b/sc/source/filter/xml/xmlfilti.hxx @@ -42,9 +42,11 @@ #include "xmldpimp.hxx" class ScXMLImport; +struct ScQueryParam; class ScXMLFilterContext : public SvXMLImportContext { + ScQueryParam& mrQueryParam; ScXMLDatabaseRangeContext* pDatabaseRangeContext; com::sun::star::uno::Sequence <com::sun::star::sheet::TableFilterField2> aFilterFields; @@ -54,7 +56,6 @@ class ScXMLFilterContext : public SvXMLImportContext bool bSkipDuplicates; bool bCopyOutputData; bool bUseRegularExpressions; - bool bIsCaseSensitive; bool bEnabledUserList; bool bConnectionOr; bool bNextConnectionOr; @@ -69,8 +70,9 @@ public: ScXMLFilterContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< - ::com::sun::star::xml::sax::XAttributeList>& xAttrList, - ScXMLDatabaseRangeContext* pTempDatabaseRangeContext); + ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + ScQueryParam& rParam, + ScXMLDatabaseRangeContext* pTempDatabaseRangeContext); virtual ~ScXMLFilterContext(); @@ -81,7 +83,7 @@ public: virtual void EndElement(); - void SetIsCaseSensitive(const bool bTemp) { bIsCaseSensitive = bTemp; } + void SetCaseSensitive(const bool b); void SetUseRegularExpressions(const bool bTemp) { if (!bUseRegularExpressions) bUseRegularExpressions = bTemp;} void OpenConnection(const bool bTemp) { bool* pTemp = new bool; *pTemp = bConnectionOr; bConnectionOr = bNextConnectionOr; bNextConnectionOr = bTemp; |