diff options
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 16 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 18 | ||||
-rw-r--r-- | sc/inc/xmlwrap.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 15 | ||||
-rw-r--r-- | sd/inc/strmname.h | 1 | ||||
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 30 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 3 | ||||
-rw-r--r-- | starmath/source/document.cxx | 11 | ||||
-rw-r--r-- | starmath/source/mathmlimport.cxx | 14 | ||||
-rw-r--r-- | starmath/source/mathmlimport.hxx | 1 | ||||
-rw-r--r-- | starmath/source/view.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/swxml.cxx | 30 |
13 files changed, 28 insertions, 124 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 467afe8038a2..3126eca15a1b 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -382,15 +382,6 @@ ErrCode XMLFilter::impl_Import( : OUString("com.sun.star.comp.Chart.XMLContentImporter"), xStorage, xFactory, xGraphicStorageHandler, xImportInfo ); nWarning = nWarning != ERRCODE_NONE ? nWarning : nContentWarning; - - // import of "content.xml" didn't work - try old "Content.xml" stream - if( nContentWarning != ERRCODE_NONE ) - { - nWarning = impl_ImportStream( - "Content.xml", // old content stream name - "com.sun.star.office.sax.importer.Chart", - xStorage, xFactory, xGraphicStorageHandler, xImportInfo ); - } } catch (const uno::Exception&) { diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 7de744403d03..50acc7bcf7b5 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -127,7 +127,6 @@ static ErrCode ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference<XComponent>& xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, const uno::Reference<XComponentContext> & rxContext, ODBFilter& _rFilter) { @@ -144,17 +143,8 @@ static ErrCode ReadThroughComponent( OUString sStreamName = OUString::createFromAscii(pStreamName); if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) { - // stream name not found! Then try the compatibility name. - // if no stream can be opened, return immediately with OK signal - - // do we even have an alternative name? - if ( nullptr == pCompatibilityStreamName ) - return ERRCODE_NONE; - - // if so, does the stream exist? - sStreamName = OUString::createFromAscii(pCompatibilityStreamName); - if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) - return ERRCODE_NONE; + // stream name not found! return immediately with OK signal + return ERRCODE_NONE; } // get input stream @@ -349,7 +339,6 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ErrCode nRet = ReadThroughComponent( xStorage ,xModel ,"settings.xml" - ,"Settings.xml" ,GetComponentContext() ,*this ); @@ -358,7 +347,6 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) nRet = ReadThroughComponent( xStorage ,xModel ,"content.xml" - ,"Content.xml" ,GetComponentContext() ,*this ); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 4f32ed1aa403..311bbcbff367 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -180,7 +180,6 @@ static ErrCode ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference<XComponent>& xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, const uno::Reference<XComponentContext> & rxContext, const Reference<document::XGraphicStorageHandler> & rxGraphicStorageHandler, const Reference<document::XEmbeddedObjectResolver>& _xEmbeddedObjectResolver, @@ -200,17 +199,8 @@ static ErrCode ReadThroughComponent( OUString sStreamName = OUString::createFromAscii(pStreamName); if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) { - // stream name not found! Then try the compatibility name. - // if no stream can be opened, return immediately with OK signal - - // do we even have an alternative name? - if ( nullptr == pCompatibilityStreamName ) - return ERRCODE_NONE; - - // if so, does the stream exist? - sStreamName = OUString::createFromAscii(pCompatibilityStreamName); - if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) ) - return ERRCODE_NONE; + // stream name not found! return immediately with OK signal + return ERRCODE_NONE; } // get input stream @@ -488,7 +478,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ErrCode nRet = ReadThroughComponent( xStorage ,xModel ,"meta.xml" - ,"Meta.xml" ,GetComponentContext() ,xGraphicStorageHandler ,xEmbeddedObjectResolver @@ -512,7 +501,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) nRet = ReadThroughComponent( xStorage ,xModel ,"settings.xml" - ,"Settings.xml" ,GetComponentContext() ,xGraphicStorageHandler ,xEmbeddedObjectResolver @@ -526,7 +514,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) nRet = ReadThroughComponent(xStorage ,xModel ,"styles.xml" - ,"Styles.xml" ,GetComponentContext() ,xGraphicStorageHandler ,xEmbeddedObjectResolver @@ -540,7 +527,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) nRet = ReadThroughComponent( xStorage ,xModel ,"content.xml" - ,"Content.xml" ,GetComponentContext() ,xGraphicStorageHandler ,xEmbeddedObjectResolver diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx index 48b94a2dc30b..2b6c8b6ed33e 100644 --- a/sc/inc/xmlwrap.hxx +++ b/sc/inc/xmlwrap.hxx @@ -70,7 +70,7 @@ class ScXMLImportWrapper const css::uno::Reference<css::frame::XModel>& xModel, const css::uno::Reference<css::xml::sax::XParser>& xParser, css::xml::sax::InputSource& aParserInput, - const OUString& sComponentName, const OUString& sDocName, const OUString& sOldDocName, + const OUString& sComponentName, const OUString& sDocName, const css::uno::Sequence<css::uno::Any>& aArgs, bool bMustBeSuccessfull); diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index a425e4214060..7712bfcc265f 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -107,7 +107,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo const uno::Reference<frame::XModel>& xModel, const uno::Reference<xml::sax::XParser>& xParser, xml::sax::InputSource& aParserInput, const OUString& sComponentName, const OUString& sDocName, - const OUString& sOldDocName, const uno::Sequence<uno::Any>& aArgs, + const uno::Sequence<uno::Any>& aArgs, bool bMustBeSuccessfull) { uno::Reference < io::XStream > xDocStream; @@ -122,11 +122,6 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo { if ( xStorage->hasByName(sDocName) && xStorage->isStreamElement( sDocName) ) xDocStream = xStorage->openStreamElement( sDocName, embed::ElementModes::READ ); - else if (!sOldDocName.isEmpty() && xStorage->hasByName(sOldDocName) && xStorage->isStreamElement( sOldDocName) ) - { - xDocStream = xStorage->openStreamElement( sOldDocName, embed::ElementModes::READ ); - sStream = sOldDocName; - } else return ERRCODE_NONE; @@ -433,7 +428,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError ) xContext, xModel, xXMLParser, aParserInput, bOasis ? OUString("com.sun.star.comp.Calc.XMLOasisMetaImporter") : OUString("com.sun.star.comp.Calc.XMLMetaImporter"), - "meta.xml", "Meta.xml", aMetaArgs, false); + "meta.xml", aMetaArgs, false); SAL_INFO( "sc.filter", "meta import end" ); } @@ -475,7 +470,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError ) xContext, xModel, xXMLParser, aParserInput, bOasis ? OUString("com.sun.star.comp.Calc.XMLOasisSettingsImporter") : OUString("com.sun.star.comp.Calc.XMLSettingsImporter"), - "settings.xml", "", aSettingsArgs, false); + "settings.xml", aSettingsArgs, false); SAL_INFO( "sc.filter", "settings import end" ); } @@ -489,7 +484,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError ) bOasis ? OUString("com.sun.star.comp.Calc.XMLOasisStylesImporter") : OUString("com.sun.star.comp.Calc.XMLStylesImporter"), "styles.xml", - "", aStylesArgs, true); + aStylesArgs, true); SAL_INFO( "sc.filter", "styles import end" ); } @@ -514,7 +509,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError ) bOasis ? OUString("com.sun.star.comp.Calc.XMLOasisContentImporter") : OUString("com.sun.star.comp.Calc.XMLContentImporter"), "content.xml", - "Content.xml", aDocArgs, + aDocArgs, true); SAL_INFO( "sc.filter", "content import end" ); diff --git a/sd/inc/strmname.h b/sd/inc/strmname.h index 3706f010340b..724bd3987fa3 100644 --- a/sd/inc/strmname.h +++ b/sd/inc/strmname.h @@ -29,7 +29,6 @@ static const OUString pFilterPowerPoint97AutoPlay( "MS PowerPoint 97 AutoPlay" ) // XML content stream static const OUString pStarDrawXMLContent( "content.xml" ); -static const OUString pStarDrawOldXMLContent( "Content.xml" ); #endif // INCLUDED_SD_INC_STRMNAME_H diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index ab365ac60304..9b20d9d7b322 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -312,7 +312,6 @@ ErrCode ReadThroughComponent( const uno::Reference < embed::XStorage >& xStorage, const Reference<XComponent>& xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, Reference<uno::XComponentContext> const & rxContext, const char* pFilterName, const Sequence<Any>& rFilterArguments, @@ -335,25 +334,8 @@ ErrCode ReadThroughComponent( if (!bContainsStream ) { - // stream name not found! Then try the compatibility name. - // if no stream can be opened, return immediately with OK signal - - // do we even have an alternative name? - if ( nullptr == pCompatibilityStreamName ) - return ERRCODE_NONE; - - // if so, does the stream exist? - sStreamName = OUString::createFromAscii(pCompatibilityStreamName); - try - { - bContainsStream = xStorage->isStreamElement(sStreamName); - } - catch (const container::NoSuchElementException&) - { - } - - if (! bContainsStream ) - return ERRCODE_NONE; + // stream name not found! return immediately with OK signal + return ERRCODE_NONE; } // set Base URL @@ -626,26 +608,26 @@ bool SdXMLFilter::Import( ErrCode& nError ) // read storage streams // #i103539#: always read meta.xml for generator nWarn = ReadThroughComponent( - xStorage, xModelComp, "meta.xml", "Meta.xml", rxContext, + xStorage, xModelComp, "meta.xml", rxContext, pServices->mpMeta, aEmptyArgs, aName, false ); if( meFilterMode != SdXMLFilterMode::Organizer ) { nWarn2 = ReadThroughComponent( - xStorage, xModelComp, "settings.xml", nullptr, rxContext, + xStorage, xModelComp, "settings.xml", rxContext, pServices->mpSettings, aFilterArgs, aName, false ); } nRet = ReadThroughComponent( - xStorage, xModelComp, "styles.xml", nullptr, rxContext, + xStorage, xModelComp, "styles.xml", rxContext, pServices->mpStyles, aFilterArgs, aName, true ); if( !nRet && (meFilterMode != SdXMLFilterMode::Organizer) ) nRet = ReadThroughComponent( - xStorage, xModelComp, "content.xml", "Content.xml", rxContext, + xStorage, xModelComp, "content.xml", rxContext, pServices->mpContent, aFilterArgs, aName, true ); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index c3ff4a9c7a3b..891e21b0d418 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -636,8 +636,7 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl, weld::Widget&, void) { try { - if (xStorage->hasByName(pStarDrawXMLContent) || - xStorage->hasByName(pStarDrawOldXMLContent)) + if (xStorage->hasByName(pStarDrawXMLContent)) { if (SdDrawDocument* pBookmarkDoc = mpDoc->OpenBookmarkDoc(aFile)) { diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index d64b30fbf09c..644942126c31 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -717,16 +717,7 @@ bool SmDocShell::Load( SfxMedium& rMedium ) if( SfxObjectShell::Load( rMedium )) { uno::Reference < embed::XStorage > xStorage = GetMedium()->GetStorage(); - if ( - ( - xStorage->hasByName( "content.xml" ) && - xStorage->isStreamElement( "content.xml" ) - ) || - ( - xStorage->hasByName( "Content.xml" ) && - xStorage->isStreamElement( "Content.xml" ) - ) - ) + if (xStorage->hasByName("content.xml") && xStorage->isStreamElement("content.xml")) { // is this a fabulous math package ? Reference<css::frame::XModel> xModel(GetModel()); diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index e0dab47598b9..6ae00afbb92e 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -195,7 +195,7 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium &rMedium) xStatusIndicator->setValue(nSteps++); auto nWarn = ReadThroughComponent( - rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml", + rMedium.GetStorage(), xModelComp, "meta.xml", xContext, xInfoSet, (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter" : "com.sun.star.comp.Math.XMLMetaImporter") ); @@ -206,7 +206,7 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium &rMedium) xStatusIndicator->setValue(nSteps++); nWarn = ReadThroughComponent( - rMedium.GetStorage(), xModelComp, "settings.xml", nullptr, + rMedium.GetStorage(), xModelComp, "settings.xml", xContext, xInfoSet, (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter" : "com.sun.star.comp.Math.XMLSettingsImporter" ) ); @@ -217,7 +217,7 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium &rMedium) xStatusIndicator->setValue(nSteps++); nError = ReadThroughComponent( - rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml", + rMedium.GetStorage(), xModelComp, "content.xml", xContext, xInfoSet, "com.sun.star.comp.Math.XMLImporter" ); } else @@ -351,7 +351,6 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const Reference<XComponent>& xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, Reference<uno::XComponentContext> const & rxContext, Reference<beans::XPropertySet> const & rPropSet, const char* pFilterName ) @@ -361,13 +360,6 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent( // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); - if ( !xStorage->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) ) - { - // stream name not found! Then try the compatibility name. - // do we even have an alternative name? - if ( pCompatibilityStreamName ) - sStreamName = OUString::createFromAscii(pCompatibilityStreamName); - } // get input stream try diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx index d4266842bfdd..555ea0d2ca2d 100644 --- a/starmath/source/mathmlimport.hxx +++ b/starmath/source/mathmlimport.hxx @@ -58,7 +58,6 @@ public: const css::uno::Reference< css::embed::XStorage >& xStorage, const css::uno::Reference< css::lang::XComponent >& xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, css::uno::Reference< css::uno::XComponentContext > const & rxContext, css::uno::Reference< css::beans::XPropertySet > const & rPropSet, const char* pFilterName ); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index be02ccd488c2..19274324ada7 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1329,7 +1329,7 @@ void SmViewShell::Insert( SfxMedium& rMedium ) uno::Reference <embed::XStorage> xStorage = rMedium.GetStorage(); if (xStorage.is() && xStorage->getElementNames().hasElements()) { - if (xStorage->hasByName("content.xml") || xStorage->hasByName("Content.xml")) + if (xStorage->hasByName("content.xml")) { // is this a fabulous math package ? Reference<css::frame::XModel> xModel(pDoc->GetModel()); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index d3b84dccf456..d36e206e167f 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -262,7 +262,6 @@ ErrCode ReadThroughComponent( uno::Reference<embed::XStorage> const & xStorage, uno::Reference<XComponent> const & xModelComponent, const char* pStreamName, - const char* pCompatibilityStreamName, uno::Reference<uno::XComponentContext> const & rxContext, const char* pFilterName, const Sequence<Any>& rFilterArguments, @@ -285,25 +284,8 @@ ErrCode ReadThroughComponent( if (!bContainsStream ) { - // stream name not found! Then try the compatibility name. - // if no stream can be opened, return immediately with OK signal - - // do we even have an alternative name? - if ( nullptr == pCompatibilityStreamName ) - return ERRCODE_NONE; - - // if so, does the stream exist? - sStreamName = OUString::createFromAscii(pCompatibilityStreamName); - try - { - bContainsStream = xStorage->isStreamElement(sStreamName); - } - catch( container::NoSuchElementException& ) - { - } - - if (! bContainsStream ) - return ERRCODE_NONE; + // stream name not found! return immediately with OK signal + return ERRCODE_NONE; } // set Base URL @@ -823,7 +805,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con // #i103539#: always read meta.xml for generator ErrCode const nWarn = ReadThroughComponent( - xStorage, xModelComp, "meta.xml", "Meta.xml", xContext, + xStorage, xModelComp, "meta.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter" : "com.sun.star.comp.Writer.XMLMetaImporter"), aEmptyArgs, rName, false ); @@ -833,21 +815,21 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con m_bInsertMode) ) { nWarn2 = ReadThroughComponent( - xStorage, xModelComp, "settings.xml", nullptr, xContext, + xStorage, xModelComp, "settings.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter" : "com.sun.star.comp.Writer.XMLSettingsImporter"), aFilterArgs, rName, false ); } nRet = ReadThroughComponent( - xStorage, xModelComp, "styles.xml", nullptr, xContext, + xStorage, xModelComp, "styles.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesImporter" : "com.sun.star.comp.Writer.XMLStylesImporter"), aFilterArgs, rName, true ); if( !nRet && !(IsOrganizerMode() || m_aOption.IsFormatsOnly()) ) nRet = ReadThroughComponent( - xStorage, xModelComp, "content.xml", "Content.xml", xContext, + xStorage, xModelComp, "content.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentImporter" : "com.sun.star.comp.Writer.XMLContentImporter"), aFilterArgs, rName, true ); |