summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlsceni.cxx
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2000-11-02 15:41:53 +0000
committerDaniel Rentz <dr@openoffice.org>2000-11-02 15:41:53 +0000
commitd0ef14ed8798ba0813c4c676769c5ffd3484a774 (patch)
treeaa2bf9a8a07ad26482f37b2b6522c4a96ebf989c /sc/source/filter/xml/xmlsceni.cxx
parent9c1d5759861667d11c3a356fbeef0f58835289f1 (diff)
chg: ScXMLConverter integrated
Diffstat (limited to 'sc/source/filter/xml/xmlsceni.cxx')
-rw-r--r--sc/source/filter/xml/xmlsceni.cxx65
1 files changed, 32 insertions, 33 deletions
diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx
index 39582ec0633c..ba5afb64417a 100644
--- a/sc/source/filter/xml/xmlsceni.cxx
+++ b/sc/source/filter/xml/xmlsceni.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlsceni.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2000-10-10 09:42:33 $
+ * last change: $Author: dr $ $Date: 2000-11-02 16:39:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,10 @@
#include "docuno.hxx"
#include "attrib.hxx"
+#ifndef _SC_XMLCONVERTER_HXX
+#include "XMLConverter.hxx"
+#endif
+
#include <xmloff/xmltkmap.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlkywd.hxx>
@@ -87,7 +91,7 @@ using namespace com::sun::star;
ScXMLTableScenarioContext::ScXMLTableScenarioContext(
ScXMLImport& rImport,
USHORT nPrfx,
- const NAMESPACE_RTL(OUString)& rLName,
+ const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList ):
SvXMLImportContext( rImport, nPrfx, rLName ),
aBorderColor( COL_BLACK ),
@@ -100,11 +104,11 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
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;
+ OUString sAttrName = xAttrList->getNameByIndex( i );
+ OUString aLocalName;
USHORT nPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName(
sAttrName, &aLocalName );
- rtl::OUString sValue = xAttrList->getValueByIndex( i );
+ OUString sValue = xAttrList->getValueByIndex( i );
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableScenarioAttrTokenMap();
@@ -142,7 +146,8 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
break;
case XML_TOK_TABLE_SCENARIO_ATTR_SCENARIO_RANGES:
{
- GetScImport().GetRangeListFromString( sValue, aScenarioRanges );
+ ScXMLConverter::GetRangeListFromString(
+ aScenarioRanges, sValue, GetScImport().GetDocument() );
}
break;
case XML_TOK_TABLE_SCENARIO_ATTR_COMMENT:
@@ -160,7 +165,7 @@ ScXMLTableScenarioContext::~ScXMLTableScenarioContext()
SvXMLImportContext *ScXMLTableScenarioContext::CreateChildContext(
USHORT nPrefix,
- const NAMESPACE_RTL(OUString)& rLName,
+ const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList )
{
return new SvXMLImportContext( GetImport(), nPrefix, rLName );
@@ -169,32 +174,26 @@ SvXMLImportContext *ScXMLTableScenarioContext::CreateChildContext(
void ScXMLTableScenarioContext::EndElement()
{
sal_Int16 nCurrTable( GetScImport().GetTables().GetCurrentSheet() );
- ScModelObj* pDocObj = ScModelObj::getImplementation( GetScImport().GetModel() );
- if( pDocObj )
+ ScDocument* pDoc = GetScImport().GetDocument();
+
+ pDoc->SetScenario( nCurrTable, TRUE );
+ USHORT nFlags( 0 );
+ if( bDisplayBorder )
+ nFlags |= SC_SCENARIO_SHOWFRAME;
+ if( bCopyBack )
+ nFlags |= SC_SCENARIO_TWOWAY;
+ if( bCopyStyles )
+ nFlags |= SC_SCENARIO_ATTRIB;
+ if( !bCopyFormulas )
+ nFlags |= SC_SCENARIO_VALUE;
+ pDoc->SetScenarioData( nCurrTable, String( sComment ), aBorderColor, nFlags );
+ for( sal_Int32 i = 0; i < aScenarioRanges.Count(); i++ )
{
- ScDocument* pDoc = pDocObj->GetDocument();
- if( pDoc )
- {
- pDoc->SetScenario( nCurrTable, TRUE );
- USHORT nFlags( 0 );
- if( bDisplayBorder )
- nFlags |= SC_SCENARIO_SHOWFRAME;
- if( bCopyBack )
- nFlags |= SC_SCENARIO_TWOWAY;
- if( bCopyStyles )
- nFlags |= SC_SCENARIO_ATTRIB;
- if( !bCopyFormulas )
- nFlags |= SC_SCENARIO_VALUE;
- pDoc->SetScenarioData( nCurrTable, String( sComment ), aBorderColor, nFlags );
- for( sal_Int32 i = 0; i < aScenarioRanges.Count(); i++ )
- {
- ScRange* pRange = aScenarioRanges.GetObject( i );
- if( pRange )
- pDoc->ApplyFlagsTab( pRange->aStart.Col(), pRange->aStart.Row(),
- pRange->aEnd.Col(), pRange->aEnd.Row(), nCurrTable, SC_MF_SCENARIO );
- }
- pDoc->SetActiveScenario( nCurrTable, bIsActive );
- }
+ ScRange* pRange = aScenarioRanges.GetObject( i );
+ if( pRange )
+ pDoc->ApplyFlagsTab( pRange->aStart.Col(), pRange->aStart.Row(),
+ pRange->aEnd.Col(), pRange->aEnd.Row(), nCurrTable, SC_MF_SCENARIO );
}
+ pDoc->SetActiveScenario( nCurrTable, bIsActive );
}