Kaydet (Commit) 7fcca395 authored tarafından Duncan Foster's avatar Duncan Foster

#i17007#

Fix the ScriptStorage::save
Removed code from ScriptStorage::save that was adding incorrect <par> tags
Fixed ScriptElement so that ScriptInfo data added under, not alongside,
script element.
Added debug code to XMLElement.
üst 656a5319
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptElement.cxx,v $ * $RCSfile: ScriptElement.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: dfoster $ $Date: 2002-10-24 12:00:38 $ * last change: $Author: dfoster $ $Date: 2003-07-17 08:36:34 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -85,12 +85,12 @@ ScriptElement::ScriptElement( ScriptData & sII ) : ...@@ -85,12 +85,12 @@ ScriptElement::ScriptElement( ScriptData & sII ) :
{ {
OSL_TRACE( "ScriptElement ctor called\n" ); OSL_TRACE( "ScriptElement ctor called\n" );
{ addAttribute( OUSTR( "language" ), sII.language );
XMLElement* xel = new XMLElement( OUSTR( "script" ) ); addAttribute( OUSTR( "xmlns:parcel" ), OUSTR( "scripting.dtd" ) );
xel->addAttribute( OUSTR( "language" ), sII.language ); XMLElement* xScriptElt = new XMLElement( OUSTR( "script" ) );
Reference < xml::sax::XAttributeList > xal( xel ); xScriptElt->addAttribute( OUSTR( "language" ), sII.language );
addSubElement( xal ); Reference < xml::sax::XAttributeList > xal( xScriptElt );
} addSubElement( xal );
strpair_map::const_iterator mp_it = sII.locales.begin(); strpair_map::const_iterator mp_it = sII.locales.begin();
strpair_map::const_iterator mp_itend = sII.locales.end(); strpair_map::const_iterator mp_itend = sII.locales.end();
...@@ -114,21 +114,21 @@ ScriptElement::ScriptElement( ScriptData & sII ) : ...@@ -114,21 +114,21 @@ ScriptElement::ScriptElement( ScriptData & sII ) :
} }
Reference < xml::sax::XAttributeList > xal( xel ); Reference < xml::sax::XAttributeList > xal( xel );
addSubElement( xal ); xScriptElt->addSubElement( xal );
} }
{ {
XMLElement* xel = new XMLElement( OUSTR( "functionname" ) ); XMLElement* xel = new XMLElement( OUSTR( "functionname" ) );
xel->addAttribute( OUSTR( "value" ), sII.functionname ); xel->addAttribute( OUSTR( "value" ), sII.functionname );
Reference < xml::sax::XAttributeList > xal( xel ); Reference < xml::sax::XAttributeList > xal( xel );
addSubElement( xal ); xScriptElt->addSubElement( xal );
} }
{ {
XMLElement* xel = new XMLElement( OUSTR( "logicalname" ) ); XMLElement* xel = new XMLElement( OUSTR( "logicalname" ) );
xel->addAttribute( OUSTR( "value" ), sII.logicalname ); xel->addAttribute( OUSTR( "value" ), sII.logicalname );
Reference < xml::sax::XAttributeList > xal( xel ); Reference < xml::sax::XAttributeList > xal( xel );
addSubElement( xal ); xScriptElt->addSubElement( xal );
} }
props_vec::const_iterator vp_it = sII.languagedepprops.begin(); props_vec::const_iterator vp_it = sII.languagedepprops.begin();
...@@ -148,7 +148,7 @@ ScriptElement::ScriptElement( ScriptData & sII ) : ...@@ -148,7 +148,7 @@ ScriptElement::ScriptElement( ScriptData & sII ) :
} }
Reference < xml::sax::XAttributeList > xal( xel ); Reference < xml::sax::XAttributeList > xal( xel );
addSubElement( xal ); xScriptElt->addSubElement( xal );
} }
filesets_map::const_iterator fm_it = sII.filesets.begin(); filesets_map::const_iterator fm_it = sII.filesets.begin();
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* $RCSfile: ScriptStorage.cxx,v $ * $RCSfile: ScriptStorage.cxx,v $
* *
* $Revision: 1.24 $ * $Revision: 1.25 $
* last change: $Author: npower $ $Date: 2003-07-07 14:27:28 $ * last change: $Author: dfoster $ $Date: 2003-07-17 08:36:34 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -576,7 +576,7 @@ ScriptStorage::updateMaps( const Datas_vec & vScriptDatas ) ...@@ -576,7 +576,7 @@ ScriptStorage::updateMaps( const Datas_vec & vScriptDatas )
} }
//************************************************************************* //*************************************************************************
// Not part of the interface yet, ie. not in the idl, and it should be!! // XScriptStorageExport::save
void void
ScriptStorage::save() ScriptStorage::save()
throw ( RuntimeException ) throw ( RuntimeException )
...@@ -630,9 +630,6 @@ throw ( RuntimeException ) ...@@ -630,9 +630,6 @@ throw ( RuntimeException )
writeMetadataHeader( xHandler ); writeMetadataHeader( xHandler );
xHandler->startElement( ou_parcel,
Reference< xml::sax::XAttributeList >() );
mh_parcels[ it_datas->parcelURI ] = xHandler; mh_parcels[ it_datas->parcelURI ] = xHandler;
} }
else else
...@@ -653,7 +650,6 @@ throw ( RuntimeException ) ...@@ -653,7 +650,6 @@ throw ( RuntimeException )
out_it != out_it_end; ++out_it ) out_it != out_it_end; ++out_it )
{ {
out_it->second->ignorableWhitespace( ::rtl::OUString() ); out_it->second->ignorableWhitespace( ::rtl::OUString() );
out_it->second->endElement( ou_parcel );
out_it->second->endDocument(); out_it->second->endDocument();
xSource.set( out_it->second, UNO_QUERY ); xSource.set( out_it->second, UNO_QUERY );
Reference< io::XOutputStream > xOS = xSource->getOutputStream(); Reference< io::XOutputStream > xOS = xSource->getOutputStream();
...@@ -710,8 +706,7 @@ ScriptStorage::writeMetadataHeader( ...@@ -710,8 +706,7 @@ ScriptStorage::writeMetadataHeader(
{ {
xHandler->startDocument(); xHandler->startDocument();
OUString aDocTypeStr( RTL_CONSTASCII_USTRINGPARAM( OUString aDocTypeStr( RTL_CONSTASCII_USTRINGPARAM(
"<!DOCTYPE dlg:window PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\"" "<!DOCTYPE parcel SYSTEM \"scripting.dtd\">" ) );
" \"parcel.dtd\">" ) );
xHandler->unknown( aDocTypeStr ); xHandler->unknown( aDocTypeStr );
xHandler->ignorableWhitespace( OUString() ); xHandler->ignorableWhitespace( OUString() );
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: XMLElement.cxx,v $ * $RCSfile: XMLElement.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: npower $ $Date: 2002-10-24 10:37:53 $ * last change: $Author: dfoster $ $Date: 2003-07-17 08:36:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -111,9 +111,11 @@ void XMLElement::dumpSubElements( Reference< xml::sax::XExtendedDocumentHandler ...@@ -111,9 +111,11 @@ void XMLElement::dumpSubElements( Reference< xml::sax::XExtendedDocumentHandler
//************************************************************************* //*************************************************************************
void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut ) void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut )
{ {
OSL_TRACE( "XMLElement::dump\n" ); OSL_TRACE( "XMLElement::dump" );
xOut->ignorableWhitespace( OUString() ); xOut->ignorableWhitespace( OUString() );
OSL_TRACE( "XMLElement::dump starting %s",::rtl::OUStringToOString(
_name, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
xOut->startElement( _name, static_cast< xml::sax::XAttributeList * >( this ) ); xOut->startElement( _name, static_cast< xml::sax::XAttributeList * >( this ) );
// Write out CDATA // Write out CDATA
if( _chars.getLength() > 0 ) if( _chars.getLength() > 0 )
...@@ -125,6 +127,8 @@ void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & x ...@@ -125,6 +127,8 @@ void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & x
dumpSubElements( xOut ); dumpSubElements( xOut );
xOut->ignorableWhitespace( OUString() ); xOut->ignorableWhitespace( OUString() );
xOut->endElement( _name ); xOut->endElement( _name );
OSL_TRACE( "XMLElement::dump ending %s",::rtl::OUStringToOString(
_name, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
} }
//************************************************************************* //*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment