summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-01-21 22:19:00 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-01-21 22:19:00 -0500
commitf8020ab3ea085e531f1e88537cccab46defcb95c (patch)
treeff6a92f6deb341140f3e8bec7ee6d0ec15949223
parentbee2fd88edac562c5ba28037339c726bdecb9ff7 (diff)
Import source range name properly from ods document.
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx9
-rw-r--r--sc/source/filter/xml/xmldpimp.hxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx3
-rw-r--r--sc/source/filter/xml/xmlimprt.hxx3
4 files changed, 14 insertions, 3 deletions
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 60c74afc9389..f02bb9793ced 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -447,7 +447,11 @@ void ScXMLDataPilotTableContext::EndElement()
if (bSourceCellRange)
{
ScSheetSourceDesc aSheetDesc(pDoc);
- aSheetDesc.SetSourceRange(aSourceCellRangeAddress);
+ if (sSourceRangeName.getLength())
+ // Range name takes precedence.
+ aSheetDesc.SetRangeName(sSourceRangeName);
+ else
+ aSheetDesc.SetSourceRange(aSourceCellRangeAddress);
aSheetDesc.SetQueryParam(aSourceQueryParam);
pDPObject->SetSheetDesc(aSheetDesc);
}
@@ -856,6 +860,9 @@ ScXMLSourceCellRangeContext::ScXMLSourceCellRangeContext( ScXMLImport& rImport,
pDataPilotTable->SetSourceCellRangeAddress(aSourceRangeAddress);
}
break;
+ case XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME:
+ pDataPilotTable->SetSourceRangeName(sValue);
+ break;
}
}
}
diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx
index 554853ff78ff..1308668cc688 100644
--- a/sc/source/filter/xml/xmldpimp.hxx
+++ b/sc/source/filter/xml/xmldpimp.hxx
@@ -106,6 +106,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
rtl::OUString sServiceUsername;
rtl::OUString sServicePassword;
rtl::OUString sButtons;
+ rtl::OUString sSourceRangeName;
ScRange aSourceCellRangeAddress;
ScRange aTargetRangeAddress;
ScRange aFilterSourceRange;
@@ -157,6 +158,7 @@ public:
void SetServiceSourceObject(const rtl::OUString& sValue) { sServiceSourceObject = sValue; }
void SetServiceUsername(const rtl::OUString& sValue) { sServiceUsername = sValue; }
void SetServicePassword(const rtl::OUString& sValue) { sServicePassword = sValue; }
+ void SetSourceRangeName(const rtl::OUString& sValue) { sSourceRangeName = sValue; bSourceCellRange = true; }
void SetSourceCellRangeAddress(const ScRange& aValue) { aSourceCellRangeAddress = aValue; bSourceCellRange = sal_True; }
void SetSourceQueryParam(const ScQueryParam& aValue) { aSourceQueryParam = aValue; }
// void SetFilterUseRegularExpressions(const sal_Bool bValue) { aSourceQueryParam.bRegExp = bValue; }
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 6acaf645d6e0..eab120e1081f 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1430,7 +1430,8 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceCellRangeAttrTokenMap()
{
static SvXMLTokenMapEntry aDataPilotTableSourceCellRangeAttrTokenMap[] =
{
- { XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS},
+ { XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS },
+ { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME },
XML_TOKEN_MAP_END
};
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index a76e5d8fc50a..7f26f9b656ec 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -530,7 +530,8 @@ enum ScXMLDataPilotTableSourceCellRangeElemTokens
enum ScXMLDataPilotTableSourceCellRangeAttrTokens
{
- XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS
+ XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS,
+ XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME
};
enum ScXMLDataPilotFieldAttrTokens