XMLFilter.cxx (cde9e8dc) XMLFilter.cxx (9ec58d04)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 144 unchanged lines hidden (view full) ---

153 }
154 }
155
156 // set correct media type at storage
157 uno::Reference<beans::XPropertySet> xProp(xStorage,uno::UNO_QUERY);
158 OUString aMediaType;
159 if ( ! xProp.is() ||
160 ! ( xProp->getPropertyValue( C2U("MediaType")) >>= aMediaType ) ||
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 144 unchanged lines hidden (view full) ---

153 }
154 }
155
156 // set correct media type at storage
157 uno::Reference<beans::XPropertySet> xProp(xStorage,uno::UNO_QUERY);
158 OUString aMediaType;
159 if ( ! xProp.is() ||
160 ! ( xProp->getPropertyValue( C2U("MediaType")) >>= aMediaType ) ||
161 ( aMediaType.getLength() == 0 ))
161 aMediaType.isEmpty() )
162 {
163 xProp->setPropertyValue( C2U("MediaType"), uno::makeAny( _sMediaType ));
164 }
165 }
166 catch( uno::Exception & ex )
167 {
168 ASSERT_EXCEPTION( ex );
169 }

--- 258 unchanged lines hidden (view full) ---

428 }
429 else if( aModProps[nInd].Name.equals( C2U( "DocumentBaseURL" ) ) )
430 {
431 aModProps[nInd].Value >>= aBaseUri;
432 }
433 }
434 }
435
162 {
163 xProp->setPropertyValue( C2U("MediaType"), uno::makeAny( _sMediaType ));
164 }
165 }
166 catch( uno::Exception & ex )
167 {
168 ASSERT_EXCEPTION( ex );
169 }

--- 258 unchanged lines hidden (view full) ---

428 }
429 else if( aModProps[nInd].Name.equals( C2U( "DocumentBaseURL" ) ) )
430 {
431 aModProps[nInd].Value >>= aBaseUri;
432 }
433 }
434 }
435
436 if( aBaseUri.getLength() )
436 if( !aBaseUri.isEmpty() )
437 xImportInfo->setPropertyValue( C2U("BaseURI"), uno::makeAny( aBaseUri ) );
438
437 xImportInfo->setPropertyValue( C2U("BaseURI"), uno::makeAny( aBaseUri ) );
438
439 if( aHierarchName.getLength() )
439 if( !aHierarchName.isEmpty() )
440 xImportInfo->setPropertyValue( C2U("StreamRelPath"), uno::makeAny( aHierarchName ) );
441
442 // import meta information
443 if( bOasis )
444 nWarning |= impl_ImportStream(
445 C2U( sXML_metaStreamName ),
446 C2U( sXML_import_chart_oasis_meta_service ),
447 xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );

--- 91 unchanged lines hidden (view full) ---

539 Reference< xml::sax::XDocumentHandler > xDocHandler(
540 xFactory->createInstanceWithArgumentsAndContext( rServiceName, aFilterCompArgs, m_xContext ),
541 uno::UNO_QUERY_THROW );
542
543
544 Reference< document::XImporter > xImporter( xDocHandler, uno::UNO_QUERY_THROW );
545 xImporter->setTargetDocument( Reference< lang::XComponent >( m_xTargetDoc, uno::UNO_QUERY_THROW ));
546
440 xImportInfo->setPropertyValue( C2U("StreamRelPath"), uno::makeAny( aHierarchName ) );
441
442 // import meta information
443 if( bOasis )
444 nWarning |= impl_ImportStream(
445 C2U( sXML_metaStreamName ),
446 C2U( sXML_import_chart_oasis_meta_service ),
447 xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );

--- 91 unchanged lines hidden (view full) ---

539 Reference< xml::sax::XDocumentHandler > xDocHandler(
540 xFactory->createInstanceWithArgumentsAndContext( rServiceName, aFilterCompArgs, m_xContext ),
541 uno::UNO_QUERY_THROW );
542
543
544 Reference< document::XImporter > xImporter( xDocHandler, uno::UNO_QUERY_THROW );
545 xImporter->setTargetDocument( Reference< lang::XComponent >( m_xTargetDoc, uno::UNO_QUERY_THROW ));
546
547 if ( m_sDocumentHandler.getLength() )
547 if ( !m_sDocumentHandler.isEmpty() )
548 {
549 try
550 {
551 uno::Sequence< uno::Any > aArgs(2);
552 beans::NamedValue aValue;
553 aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler"));
554 aValue.Value <<= xDocHandler;
555 aArgs[0] <<= aValue;

--- 81 unchanged lines hidden (view full) ---

637
638 uno::Reference< embed::XStorage > xStorage( lcl_getWriteStorage( rMediaDescriptor, m_xContext, getMediaType(bOasis) ) );
639 OSL_ENSURE( xStorage.is(), "No Storage" );
640 if( ! xStorage.is())
641 return ERRCODE_SFX_GENERAL;
642
643 uno::Reference< xml::sax::XDocumentHandler> xDocHandler( xSaxWriter, uno::UNO_QUERY );
644
548 {
549 try
550 {
551 uno::Sequence< uno::Any > aArgs(2);
552 beans::NamedValue aValue;
553 aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler"));
554 aValue.Value <<= xDocHandler;
555 aArgs[0] <<= aValue;

--- 81 unchanged lines hidden (view full) ---

637
638 uno::Reference< embed::XStorage > xStorage( lcl_getWriteStorage( rMediaDescriptor, m_xContext, getMediaType(bOasis) ) );
639 OSL_ENSURE( xStorage.is(), "No Storage" );
640 if( ! xStorage.is())
641 return ERRCODE_SFX_GENERAL;
642
643 uno::Reference< xml::sax::XDocumentHandler> xDocHandler( xSaxWriter, uno::UNO_QUERY );
644
645 if ( m_sDocumentHandler.getLength() )
645 if ( !m_sDocumentHandler.isEmpty() )
646 {
647 try
648 {
649 uno::Sequence< uno::Any > aArgs(2);
650 beans::NamedValue aValue;
651 aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler"));
652 aValue.Value <<= xDocHandler;
653 aArgs[0] <<= aValue;

--- 216 unchanged lines hidden ---
646 {
647 try
648 {
649 uno::Sequence< uno::Any > aArgs(2);
650 beans::NamedValue aValue;
651 aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler"));
652 aValue.Value <<= xDocHandler;
653 aArgs[0] <<= aValue;

--- 216 unchanged lines hidden ---