Kaydet (Commit) 7e8c7652 authored tarafından Andreas Bregas's avatar Andreas Bregas

#86383# Export for new library index files

üst 774503c5
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmllib_export.cxx,v $ * $RCSfile: xmllib_export.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: ab $ $Date: 2001-10-23 15:25:50 $ * last change: $Author: ab $ $Date: 2001-11-07 18:21:04 $
* *
* 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
...@@ -69,8 +69,12 @@ using namespace rtl; ...@@ -69,8 +69,12 @@ using namespace rtl;
namespace xmlscript namespace xmlscript
{ {
static OUString aTrueStr ( RTL_CONSTASCII_USTRINGPARAM("true") );
static OUString aFalseStr( RTL_CONSTASCII_USTRINGPARAM("false") );
//################################################################################################## //##################################################################################################
//================================================================================================== //==================================================================================================
SAL_DLLEXPORT void SAL_DLLEXPORT void
...@@ -101,8 +105,6 @@ SAL_CALL exportLibraryContainer( ...@@ -101,8 +105,6 @@ SAL_CALL exportLibraryContainer(
xOut->ignorableWhitespace( OUString() ); xOut->ignorableWhitespace( OUString() );
xOut->startElement( aLibrariesName, xAttributes ); xOut->startElement( aLibrariesName, xAttributes );
OUString aTrueStr ( RTL_CONSTASCII_USTRINGPARAM("true") );
OUString aFalseStr( RTL_CONSTASCII_USTRINGPARAM("false") );
int nLibCount = pLibArray->mnLibCount; int nLibCount = pLibArray->mnLibCount;
for( sal_Int32 i = 0 ; i < nLibCount ; i++ ) for( sal_Int32 i = 0 ; i < nLibCount ; i++ )
{ {
...@@ -116,7 +118,8 @@ SAL_CALL exportLibraryContainer( ...@@ -116,7 +118,8 @@ SAL_CALL exportLibraryContainer(
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":name") ), pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":name") ),
rLib.aName ); rLib.aName );
if( rLib.bLink && rLib.aStorageURL.getLength() )
if( rLib.aStorageURL.getLength() )
{ {
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_XLINK_PREFIX ":href") ), pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_XLINK_PREFIX ":href") ),
rLib.aStorageURL ); rLib.aStorageURL );
...@@ -127,6 +130,42 @@ SAL_CALL exportLibraryContainer( ...@@ -127,6 +130,42 @@ SAL_CALL exportLibraryContainer(
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":link") ), pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":link") ),
rLib.bLink ? aTrueStr : aFalseStr ); rLib.bLink ? aTrueStr : aFalseStr );
pLibElement->dump( xOut );
}
xOut->ignorableWhitespace( OUString() );
xOut->endElement( aLibrariesName );
xOut->endDocument();
}
//==================================================================================================
SAL_DLLEXPORT void
SAL_CALL exportLibrary(
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut,
const LibDescriptor& rLib )
SAL_THROW( (::com::sun::star::uno::Exception) )
{
xOut->startDocument();
OUString aDocTypeStr( RTL_CONSTASCII_USTRINGPARAM(
"<!DOCTYPE library:library PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\""
" \"library.dtd\">" ) );
xOut->unknown( aDocTypeStr );
xOut->ignorableWhitespace( OUString() );
OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":library") );
XMLElement* pLibElement = new XMLElement( aLibraryName );
Reference< xml::sax::XAttributeList > xAttributes( pLibElement );
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_LIBRARY_PREFIX) ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_URI) ) );
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":name") ),
rLib.aName );
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ), pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ),
rLib.bReadOnly ? aTrueStr : aFalseStr ); rLib.bReadOnly ? aTrueStr : aFalseStr );
...@@ -151,12 +190,9 @@ SAL_CALL exportLibraryContainer( ...@@ -151,12 +190,9 @@ SAL_CALL exportLibraryContainer(
} }
pLibElement->dump( xOut ); pLibElement->dump( xOut );
}
xOut->ignorableWhitespace( OUString() );
xOut->endElement( aLibrariesName );
xOut->endDocument(); xOut->endDocument();
} }
}; };
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