diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-09 14:58:47 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-09 15:13:51 +0100 |
commit | e9309e1f32e9029b62d67a3706ea63d4c5bb587a (patch) | |
tree | 75f79840340e505ce5d6ab6f4e709abcd082b69d | |
parent | 555ee51b77a789253bffdd9ffb16bdc5e51b980a (diff) |
don't assert that no ODF import happens without a base URL
Turns out that if you create a new document and then copy an embedded
object from it to the clipboard, there really is no usable base URL.
So don't assert and just log something, hopefully the important file
import cases have been fixed already.
Change-Id: Iee1027cbab4db10a273518739a5ab2c31627180e
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index c18ac15632b1..ed133f433afa 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -383,7 +383,8 @@ sal_Int32 XMLFilter::impl_Import( } } - assert(!aBaseUri.isEmpty()); // needed for relative URLs + // needed for relative URLs, but in clipboard copy/paste there may be none + SAL_INFO_IF(aBaseUri.isEmpty(), "chart2", "chart::XMLFilter: no base URL"); if( !aBaseUri.isEmpty() ) xImportInfo->setPropertyValue( "BaseURI", uno::makeAny( aBaseUri ) ); diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 0df5913cf120..f6dde8d02c3c 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -349,7 +349,8 @@ bool ScXMLImportWrapper::Import( sal_uInt8 nMode, ErrCode& rError ) // Set base URI OSL_ENSURE( pMedium, "There is no medium to get MediaDescriptor from!\n" ); OUString aBaseURL = pMedium ? pMedium->GetBaseURL() : OUString(); - assert(!aBaseURL.isEmpty()); // needed for relative URLs + // needed for relative URLs, but in clipboard copy/paste there may be none + SAL_INFO_IF(aBaseURL.isEmpty(), "sc.filter", "ScXMLImportWrapper: no base URL"); OUString sPropName("BaseURI"); xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) ); diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 98ae6551da02..5829e61ad552 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -587,7 +587,8 @@ bool SdXMLFilter::Import( ErrCode& nError ) // Set base URI OUString const baseURI(mrMedium.GetBaseURL()); - assert(!baseURI.isEmpty()); // needed for relative URLs + // needed for relative URLs, but in clipboard copy/paste there may be none + SAL_INFO_IF(baseURI.isEmpty(), "sd.filter", "SdXMLFilter: no base URL"); xInfoSet->setPropertyValue("BaseURI", makeAny(baseURI)); if( 0 == nRet && SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() ) diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 7c9b2412a65b..33c976f61b68 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -492,7 +492,9 @@ static void lcl_ConvertSdrOle2ObjsToSdrGrafObjs(SwDoc& _rDoc) sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & rName ) { - // TODO: sadly SwXMLTextBlocks doesn't set this? assert(!rBaseURL.isEmpty()); // needed for relative URLs + // needed for relative URLs, but in clipboard copy/paste there may be none + // and also there is the SwXMLTextBlocks special case + SAL_INFO_IF(rBaseURL.isEmpty(), "sw.filter", "sw::XMLReader: no base URL"); // Get service factory uno::Reference< uno::XComponentContext > xContext = |