diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-09 11:14:17 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-09 11:14:17 +0000 |
commit | 4db51daf0b6dd5623cfee344a1b4332a20e80561 (patch) | |
tree | 311d28386d147b7bb1be5b4967328b3c65189e91 /xmloff | |
parent | 0584e38ca4071ebcbdcf325c7af67d3585d6094c (diff) |
INTEGRATION: CWS oasisbf1 (1.7.38); FILE MERGED
2004/10/15 08:12:53 mib 1.7.38.2: RESYNC: (1.7-1.8); FILE MERGED
2004/10/07 15:54:59 mib 1.7.38.1: #i34042#: copy namespace declarations to embedded object root elements
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/XMLEmbeddedObjectImportContext.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 2fa8b7ef0bd2..c6fd90193757 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEmbeddedObjectImportContext.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: kz $ $Date: 2004-10-04 18:11:04 $ + * last change: $Author: hr $ $Date: 2004-11-09 12:14:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,6 +102,9 @@ #ifndef _XMLOFF_XMLERROR_HXX #include "xmlerror.hxx" #endif +#ifndef _XMLOFF_ATTRLIST_HXX +#include "attrlist.hxx" +#endif #ifndef _XMLOFF_XMLFILTERSERVICENAMES_H #include "XMLFilterServiceNames.h" @@ -336,11 +339,27 @@ SvXMLImportContext *XMLEmbeddedObjectImportContext::CreateChildContext( } void XMLEmbeddedObjectImportContext::StartElement( - const Reference< XAttributeList >& xAttrList ) + const Reference< XAttributeList >& rAttrList ) { if( xHandler.is() ) { xHandler->startDocument(); + + // #i34042: copy namepspace declarations + SvXMLAttributeList *pAttrList = new SvXMLAttributeList( rAttrList ); + Reference< XAttributeList > xAttrList( pAttrList ); + const SvXMLNamespaceMap& rNamespaceMap = GetImport().GetNamespaceMap(); + sal_uInt16 nPos = rNamespaceMap.GetFirstKey(); + while( USHRT_MAX != nPos ) + { + OUString aAttrName( rNamespaceMap.GetAttrNameByKey( nPos ) ); + if( 0 == xAttrList->getValueByName( aAttrName ).getLength() ) + { + pAttrList->AddAttribute( aAttrName, + rNamespaceMap.GetNameByKey( nPos ) ); + } + nPos = rNamespaceMap.GetNextKey( nPos ); + } xHandler->startElement( GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), GetLocalName() ), xAttrList ); @@ -370,7 +389,7 @@ void XMLEmbeddedObjectImportContext::EndElement() { xStorable->store(); } - catch( ::com::sun::star::beans::PropertyVetoException& e ) + catch( ::com::sun::star::beans::PropertyVetoException& ) { Sequence<OUString> aSeq( 0 ); GetImport().SetError( XMLERROR_FLAG_WARNING | |