diff options
author | Duncan Foster <dfoster@openoffice.org> | 2003-07-17 07:36:35 +0000 |
---|---|---|
committer | Duncan Foster <dfoster@openoffice.org> | 2003-07-17 07:36:35 +0000 |
commit | 7fcca39511efb46a04a263d8fff8df453c762a24 (patch) | |
tree | 10a95ec04898e2497f5d6615c9b01fd21fb5f3be /scripting/source | |
parent | 656a531939858466e93ee195484cba8bd1cad096 (diff) |
#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.
Diffstat (limited to 'scripting/source')
-rw-r--r-- | scripting/source/storage/ScriptElement.cxx | 24 | ||||
-rw-r--r-- | scripting/source/storage/ScriptStorage.cxx | 13 | ||||
-rw-r--r-- | scripting/source/storage/XMLElement.cxx | 10 |
3 files changed, 23 insertions, 24 deletions
diff --git a/scripting/source/storage/ScriptElement.cxx b/scripting/source/storage/ScriptElement.cxx index 0e595d602a0b..cbab47bc8357 100644 --- a/scripting/source/storage/ScriptElement.cxx +++ b/scripting/source/storage/ScriptElement.cxx @@ -2,9 +2,9 @@ * * $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 * either of the following licenses @@ -85,12 +85,12 @@ ScriptElement::ScriptElement( ScriptData & sII ) : { OSL_TRACE( "ScriptElement ctor called\n" ); - { - XMLElement* xel = new XMLElement( OUSTR( "script" ) ); - xel->addAttribute( OUSTR( "language" ), sII.language ); - Reference < xml::sax::XAttributeList > xal( xel ); - addSubElement( xal ); - } + addAttribute( OUSTR( "language" ), sII.language ); + addAttribute( OUSTR( "xmlns:parcel" ), OUSTR( "scripting.dtd" ) ); + XMLElement* xScriptElt = new XMLElement( OUSTR( "script" ) ); + xScriptElt->addAttribute( OUSTR( "language" ), sII.language ); + Reference < xml::sax::XAttributeList > xal( xScriptElt ); + addSubElement( xal ); strpair_map::const_iterator mp_it = sII.locales.begin(); strpair_map::const_iterator mp_itend = sII.locales.end(); @@ -114,21 +114,21 @@ ScriptElement::ScriptElement( ScriptData & sII ) : } Reference < xml::sax::XAttributeList > xal( xel ); - addSubElement( xal ); + xScriptElt->addSubElement( xal ); } { XMLElement* xel = new XMLElement( OUSTR( "functionname" ) ); xel->addAttribute( OUSTR( "value" ), sII.functionname ); Reference < xml::sax::XAttributeList > xal( xel ); - addSubElement( xal ); + xScriptElt->addSubElement( xal ); } { XMLElement* xel = new XMLElement( OUSTR( "logicalname" ) ); xel->addAttribute( OUSTR( "value" ), sII.logicalname ); Reference < xml::sax::XAttributeList > xal( xel ); - addSubElement( xal ); + xScriptElt->addSubElement( xal ); } props_vec::const_iterator vp_it = sII.languagedepprops.begin(); @@ -148,7 +148,7 @@ ScriptElement::ScriptElement( ScriptData & sII ) : } Reference < xml::sax::XAttributeList > xal( xel ); - addSubElement( xal ); + xScriptElt->addSubElement( xal ); } filesets_map::const_iterator fm_it = sII.filesets.begin(); diff --git a/scripting/source/storage/ScriptStorage.cxx b/scripting/source/storage/ScriptStorage.cxx index 6dd1f7b59ac8..6796ab291992 100644 --- a/scripting/source/storage/ScriptStorage.cxx +++ b/scripting/source/storage/ScriptStorage.cxx @@ -2,8 +2,8 @@ * * $RCSfile: ScriptStorage.cxx,v $ * -* $Revision: 1.24 $ -* last change: $Author: npower $ $Date: 2003-07-07 14:27:28 $ +* $Revision: 1.25 $ +* last change: $Author: dfoster $ $Date: 2003-07-17 08:36:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -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 ScriptStorage::save() throw ( RuntimeException ) @@ -630,9 +630,6 @@ throw ( RuntimeException ) writeMetadataHeader( xHandler ); - xHandler->startElement( ou_parcel, - Reference< xml::sax::XAttributeList >() ); - mh_parcels[ it_datas->parcelURI ] = xHandler; } else @@ -653,7 +650,6 @@ throw ( RuntimeException ) out_it != out_it_end; ++out_it ) { out_it->second->ignorableWhitespace( ::rtl::OUString() ); - out_it->second->endElement( ou_parcel ); out_it->second->endDocument(); xSource.set( out_it->second, UNO_QUERY ); Reference< io::XOutputStream > xOS = xSource->getOutputStream(); @@ -710,8 +706,7 @@ ScriptStorage::writeMetadataHeader( { xHandler->startDocument(); OUString aDocTypeStr( RTL_CONSTASCII_USTRINGPARAM( - "<!DOCTYPE dlg:window PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\"" - " \"parcel.dtd\">" ) ); + "<!DOCTYPE parcel SYSTEM \"scripting.dtd\">" ) ); xHandler->unknown( aDocTypeStr ); xHandler->ignorableWhitespace( OUString() ); } diff --git a/scripting/source/storage/XMLElement.cxx b/scripting/source/storage/XMLElement.cxx index dab4f52fb0a2..f031c6894a4b 100644 --- a/scripting/source/storage/XMLElement.cxx +++ b/scripting/source/storage/XMLElement.cxx @@ -2,9 +2,9 @@ * * $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 * either of the following licenses @@ -111,9 +111,11 @@ void XMLElement::dumpSubElements( Reference< xml::sax::XExtendedDocumentHandler //************************************************************************* void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut ) { - OSL_TRACE( "XMLElement::dump\n" ); + OSL_TRACE( "XMLElement::dump" ); 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 ) ); // Write out CDATA if( _chars.getLength() > 0 ) @@ -125,6 +127,8 @@ void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & x dumpSubElements( xOut ); xOut->ignorableWhitespace( OUString() ); xOut->endElement( _name ); + OSL_TRACE( "XMLElement::dump ending %s",::rtl::OUStringToOString( + _name, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } //************************************************************************* |