summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlwrap.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-01-11 12:19:34 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-01-11 12:19:34 +0000
commitde5df239c6ec603a776cb4bb0517ad804f89ffd0 (patch)
tree51c43cfa984f7179debbe7ae51bc537b778d4c54 /sc/source/filter/xml/xmlwrap.cxx
parent2fdb0df3e80bcb27dead0b7ade1eeea2a5b5063c (diff)
INTEGRATION: CWS sb19 (1.50.16); FILE MERGED
2004/12/09 04:40:07 sb 1.50.16.7: RESYNC: (1.52-1.53); FILE MERGED 2004/10/28 14:24:21 mba 1.50.16.6: #110407#: always get storage from medium 2004/10/27 07:31:51 mba 1.50.16.5: #110407#: remove static BaseURL 2004/10/13 10:09:38 sb 1.50.16.4: #110405# Fixed problems introduced after resyncing. 2004/10/11 21:13:11 sb 1.50.16.3: RESYNC: (1.50-1.52); FILE MERGED 2004/09/02 09:56:14 er 1.50.16.2: #110405# use SfxMedium::GetBaseURL() 2004/09/01 18:13:52 er 1.50.16.1: #110405# replace static INetURLObject Rel/Abs calls
Diffstat (limited to 'sc/source/filter/xml/xmlwrap.cxx')
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx28
1 files changed, 10 insertions, 18 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 5d522098377d..b97243c6bfd2 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlwrap.cxx,v $
*
- * $Revision: 1.53 $
+ * $Revision: 1.54 $
*
- * last change: $Author: obo $ $Date: 2004-11-15 16:37:24 $
+ * last change: $Author: rt $ $Date: 2005-01-11 13:19:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -453,6 +453,8 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
if (pMedium)
aParserInput.sSystemId = OUString(pMedium->GetName());
+ if ( !xStorage.is() && pMedium )
+ xStorage = pMedium->GetStorage();
// get parser
uno::Reference<uno::XInterface> xXMLParser =
@@ -496,14 +498,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
// Set base URI
OSL_ENSURE( pMedium, "There is no medium to get MediaDescriptor from!\n" );
- ::rtl::OUString aBaseURL = OUString(INetURLObject::GetBaseURL());
- if ( pMedium && pMedium->GetItemSet() )
- {
- const SfxStringItem* pBaseURLItem = static_cast<const SfxStringItem*>(
- pMedium->GetItemSet()->GetItem(SID_DOC_BASEURL) );
- if ( pBaseURLItem )
- aBaseURL = pBaseURLItem->GetValue();
- }
+ ::rtl::OUString aBaseURL = pMedium ? pMedium->GetBaseURL() : ::rtl::OUString();
rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) );
@@ -680,6 +675,9 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
uno::Reference<io::XOutputStream> xOut;
uno::Reference<io::XStream> xStream;
+ if ( !xStorage.is() && pMedium )
+ xStorage = pMedium->GetOutputStorage();
+
if( xStorage.is() )
{
// #96807#; trunc stream before use, because it could be an existing stream
@@ -814,14 +812,8 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), aUsePrettyPrinting);
OSL_ENSURE( pMedium, "There is no medium to get MediaDescriptor from!\n" );
- ::rtl::OUString aBaseURL = OUString(INetURLObject::GetBaseURL());
- if ( pMedium && pMedium->GetItemSet() )
- {
- const SfxStringItem* pBaseURLItem = static_cast<const SfxStringItem*>(
- pMedium->GetItemSet()->GetItem(SID_DOC_BASEURL) );
- if ( pBaseURLItem )
- aBaseURL = pBaseURLItem->GetValue();
- }
+ OSL_ENSURE( pMedium, "There is no medium to get MediaDescriptor from!\n" );
+ ::rtl::OUString aBaseURL = pMedium ? pMedium->GetBaseURL( true ) : ::rtl::OUString();
rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) );