diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-17 12:43:12 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-18 14:13:21 -0500 |
commit | ba92fb9347bc2f1c09544013047507bb7abcdf91 (patch) | |
tree | d5f3b232e7738dbb34d5ff7062cefbc39a01dc30 | |
parent | ff6da5057d4b66c4bdd4bdcf402382e4faf991a4 (diff) |
Store filter orientation in the query param.
-rw-r--r-- | sc/source/core/tool/queryparam.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldrani.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldrani.hxx | 1 |
3 files changed, 11 insertions, 7 deletions
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index d997acb67e35..c8c9686e8464 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -59,7 +59,13 @@ struct FindUnused : public std::unary_function<ScQueryEntry, bool> } -ScQueryParamBase::ScQueryParamBase() +ScQueryParamBase::ScQueryParamBase() : + bHasHeader(true), + bByRow(true), + bInplace(true), + bCaseSens(false), + bRegExp(false), + bDuplicate(false) { for (size_t i = 0; i < MAXQUERY; ++i) maEntries.push_back(new ScQueryEntry); diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index e7cb55126ca2..42a52eb6a817 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -132,7 +132,6 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, mpQueryParam(new ScQueryParam), sDatabaseRangeName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)), aSortSequence(), - eOrientation(table::TableOrientation_ROWS), nRefresh(0), nSubTotalsUserListIndex(0), bContainsSort(false), @@ -196,8 +195,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, break; case XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION : { - if (IsXMLToken(sValue, XML_COLUMN)) - eOrientation = table::TableOrientation_COLUMNS; + mpQueryParam->bByRow = !IsXMLToken(sValue, XML_COLUMN); } break; case XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER : @@ -349,7 +347,6 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName) mpQueryParam->nCol2 = aRange.aEnd.Col(); mpQueryParam->nRow2 = aRange.aEnd.Row(); - mpQueryParam->bByRow = (eOrientation == table::TableOrientation_ROWS); mpQueryParam->bInplace = !bFilterCopyOutputData; mpQueryParam->bCaseSens = bFilterIsCaseSensitive; mpQueryParam->bDuplicate = !bFilterSkipDuplicates; @@ -386,7 +383,9 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName) aSortSequence.realloc(nOldSize + 1); beans::PropertyValue aProperty; aProperty.Name = OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ORIENT)); - aProperty.Value <<= eOrientation; + table::TableOrientation eOrient = mpQueryParam->bByRow ? + table::TableOrientation_ROWS : table::TableOrientation_COLUMNS; + aProperty.Value <<= eOrient; aSortSequence[nOldSize] = aProperty; ScSortParam aParam; ScSortDescriptor::FillSortParam(aParam, aSortSequence); diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index a2eba21e069e..e9c45ea1b137 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -89,7 +89,6 @@ class ScXMLDatabaseRangeContext : public SvXMLImportContext com::sun::star::table::CellAddress aFilterOutputPosition; com::sun::star::table::CellRangeAddress aFilterConditionSourceRangeAddress; com::sun::star::sheet::DataImportMode nSourceType; - com::sun::star::table::TableOrientation eOrientation; sal_Int32 nRefresh; sal_Int16 nSubTotalsUserListIndex; sal_Int16 nSubTotalRuleGroupFieldNumber; |