summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2001-04-10 11:27:25 +0000
committerBjörn Milcke <bm@openoffice.org>2001-04-10 11:27:25 +0000
commita2fc681d7838132502aa883544b343a71a75f6e0 (patch)
treef61063fd76a0cec05a12268cc0e38e05c4dc0b49 /xmloff
parent385ceedd7a195dd84d34af2ff43e58f573e2ec15 (diff)
#85929# programming error
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx32
1 files changed, 27 insertions, 5 deletions
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 8a94493f0bdb..8f4f5ba4b902 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLTableContext.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: bm $ $Date: 2001-04-10 10:24:40 $
+ * last change: $Author: bm $ $Date: 2001-04-10 12:27:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,10 +109,12 @@ using namespace com::sun::star;
SchXMLTableContext::SchXMLTableContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport,
const rtl::OUString& rLName,
- SchXMLTable& aTable ) :
+ SchXMLTable& aTable,
+ ::rtl::OUString& rTableName ) :
SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLName ),
mrImportHelper( rImpHelper ),
- mrTable( aTable )
+ mrTable( aTable ),
+ mrTableName( rTableName )
{
mrTable.nColumnIndex = -1;
mrTable.nMaxColumnIndex = -1;
@@ -124,6 +126,26 @@ SchXMLTableContext::~SchXMLTableContext()
{
}
+void SchXMLTableContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ // get number-columns-repeated attribute
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
+ rtl::OUString aLocalName;
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ if( nPrefix == XML_NAMESPACE_TABLE &&
+ aLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_name )))
+ {
+ mrTableName = xAttrList->getValueByIndex( i );
+ break; // we only need this attribute
+ }
+ }
+}
+
SvXMLImportContext *SchXMLTableContext::CreateChildContext(
USHORT nPrefix,
const rtl::OUString& rLocalName,
@@ -489,7 +511,7 @@ void SchXMLTableHelper::applyTableSimple(
}
xData->setColumnDescriptions( aLabels );
- for( ++iRow; iRow != rTable.aData.end(); iRow++, nRow++ )
+ for( ++iRow, nRow = 0; iRow != rTable.aData.end(); iRow++, nRow++ )
{
aCategories[ nRow ] = (*iRow)[ 0 ].aString;
for( nCol = 1; nCol < nColumnCount; nCol++ )