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 @@
*
* $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 );
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();
......
......@@ -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() );
}
......
......@@ -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 );
}
//*************************************************************************
......
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