diff options
author | Sascha Ballach <sab@openoffice.org> | 2002-03-22 15:02:47 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2002-03-22 15:02:47 +0000 |
commit | 1575bf8359fe478a8e10ddd792a5af4641b9fb09 (patch) | |
tree | 6d605c5f91bdc0bd4fbfe6e9194927fb6bde8f53 | |
parent | ebca31005835555f0a25af1957b625b5c64ef4a3 (diff) |
#98317#; add Orientation to SortParam Sequence; make the relative field numbers absolute
-rw-r--r-- | sc/source/filter/xml/xmldrani.cxx | 26 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldrani.hxx | 9 |
2 files changed, 28 insertions, 7 deletions
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 0245f38fb579..51deb74f5775 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldrani.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: sab $ $Date: 2001-10-08 08:06:19 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:02:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -183,7 +183,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, bKeepFormats(sal_False), bMoveCells(sal_False), bStripData(sal_False), - bOrientation(sal_False), + eOrientation(table::TableOrientation_ROWS), bContainsHeader(sal_True), bAutoFilter(sal_False), bFilterCopyOutputData(sal_False), @@ -244,7 +244,8 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, break; case XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION : { - bOrientation = IsXMLToken(sValue, XML_COLUMN); + if (IsXMLToken(sValue, XML_COLUMN)) + eOrientation = table::TableOrientation_COLUMNS; } break; case XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER : @@ -427,8 +428,24 @@ void ScXMLDatabaseRangeContext::EndElement() pDBData->SetImportParam(aImportParam); if (bContainsSort) { + sal_uInt32 nOldSize(aSortSequence.getLength()); + aSortSequence.realloc(nOldSize + 1); + beans::PropertyValue aProperty; + aProperty.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ORIENT)); + aProperty.Value <<= eOrientation; + aSortSequence[nOldSize] = aProperty; ScSortParam aSortParam; ScSortDescriptor::FillSortParam(aSortParam, aSortSequence); + + //#98317#; until now the Fields are relative to the left top edge of the range, but the + // core wants to have the absolute position (column/row) + sal_uInt16 nFieldStart = aSortParam.bByRow ? aCellRangeAddress.StartColumn : aCellRangeAddress.StartRow; + for (sal_uInt16 i = 0; i < MAXSORT; ++i) + { + if (aSortParam.bDoSort[i]) + aSortParam.nField[i] += nFieldStart; + } + pDBData->SetSortParam(aSortParam); } uno::Reference <sheet::XSheetFilterDescriptor> xSheetFilterDescriptor = xDatabaseRange->getFilterDescriptor(); @@ -438,6 +455,7 @@ void ScXMLDatabaseRangeContext::EndElement() if (xFilterPropertySet.is()) { uno::Any aTemp; + sal_Bool bOrientation(table::TableOrientation_COLUMNS == eOrientation); aTemp = ::cppu::bool2any(bOrientation); xFilterPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ORIENT)), aTemp); aTemp = ::cppu::bool2any(bContainsHeader); diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index b20413f67aff..fa7d77ee7048 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldrani.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2001-05-02 10:31:45 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:02:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,9 @@ #ifndef _COM_SUN_STAR_TABLE_CELLRANGEADDRESS_HPP_ #include <com/sun/star/table/CellRangeAddress.hpp> #endif +#ifndef _COM_SUN_STAR_TABLE_TABLEORIENTATION_HPP_ +#include <com/sun/star/table/TableOrientation.hpp> +#endif class ScXMLImport; @@ -125,6 +128,7 @@ 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; @@ -135,7 +139,6 @@ class ScXMLDatabaseRangeContext : public SvXMLImportContext sal_Bool bKeepFormats : 1; sal_Bool bMoveCells : 1; sal_Bool bStripData : 1; - sal_Bool bOrientation : 1; sal_Bool bContainsHeader : 1; sal_Bool bAutoFilter : 1; sal_Bool bSubTotalsBindFormatsToContent : 1; |