framework/inc/interaction/quietinteraction.hxx | 1 framework/inc/pch/precompiled_fwk.hxx | 1 framework/source/interaction/quietinteraction.cxx | 12 -- framework/source/services/desktop.cxx | 12 -- include/framework/interaction.hxx | 1 uui/inc/pch/precompiled_uui.hxx | 1 uui/source/iahndl-filter.cxx | 122 ---------------------- uui/source/iahndl.cxx | 3 uui/source/iahndl.hxx | 5 xmloff/source/draw/shapeexport.cxx | 32 +++-- 10 files changed, 20 insertions(+), 170 deletions(-)
New commits: commit fd641c7b23ce4205c29fc0c564b73336cb2cfb07 Author: Oliver-Rainer Wittmann <[email protected]> Date: Wed Jul 23 08:53:15 2014 +0000 Resolves: #i125289# do apply possible changed <GraphicStreamURL>... only for embedded images which already have its stream inside the package fixes also issue 125290 (cherry picked from commit 9602a121b458e7456fc533dad86f434f846a72ba) Conflicts: xmloff/source/draw/shapeexport2.cxx Change-Id: I5af0093b20f2f291d3a94c690bfbdb59a59320c3 diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 7f33e58..ba8ce16 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2256,9 +2256,12 @@ void XMLShapeExport::ImpExportGraphicObjectShape( OUString aResolveURL( sImageURL ); const OUString sPackageURL( "vnd.sun.star.Package:" ); - // trying to preserve the filename + // trying to preserve the filename for embedded images which already have its stream inside the package + bool bIsEmbeddedImageWithExistingStreamInPackage = false; if ( aStreamURL.match( sPackageURL, 0 ) ) { + bIsEmbeddedImageWithExistingStreamInPackage = true; + OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) ); sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1; if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) ) @@ -2278,20 +2281,23 @@ void XMLShapeExport::ImpExportGraphicObjectShape( if( !aStr.isEmpty() ) { - aStreamURL = sPackageURL; - if( aStr[ 0 ] == '#' ) - { - aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); - } - else + // apply possible changed stream URL to embedded image object + if ( bIsEmbeddedImageWithExistingStreamInPackage ) { - aStreamURL = aStreamURL.concat( aStr ); - } + aStreamURL = sPackageURL; + if ( aStr[0] == '#' ) + { + aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); + } + else + { + aStreamURL = aStreamURL.concat( aStr ); + } - // update stream URL for load on demand - uno::Any aAny; - aAny <<= aStreamURL; - xPropSet->setPropertyValue("GraphicStreamURL", aAny ); + uno::Any aAny; + aAny <<= aStreamURL; + xPropSet->setPropertyValue( OUString("GraphicStreamURL"), aAny ); + } mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); commit 23e818d4f5cb6dff4c2238fa42a38496a9a85255 Author: Caolán McNamara <[email protected]> Date: Wed Jul 23 10:49:30 2014 +0100 AmbigousFilterRequest is only ever extracted, never created Change-Id: I79c669c1635192199d6ef135e1ab9b48a9e7e63a diff --git a/framework/inc/interaction/quietinteraction.hxx b/framework/inc/interaction/quietinteraction.hxx index c2dbeaa..0a990f4 100644 --- a/framework/inc/interaction/quietinteraction.hxx +++ b/framework/inc/interaction/quietinteraction.hxx @@ -38,7 +38,6 @@ namespace framework{ But it can be used to intercept problems e.g. during loading of documents. In current implementation we solve conflicts for following situations only: - - AmbigousFilterRequest - InteractiveIOException - InteractiveAugmentedIOException All other requests will be aborted. diff --git a/framework/inc/pch/precompiled_fwk.hxx b/framework/inc/pch/precompiled_fwk.hxx index 31e5c4f..c37deaf 100644 --- a/framework/inc/pch/precompiled_fwk.hxx +++ b/framework/inc/pch/precompiled_fwk.hxx @@ -82,7 +82,6 @@ #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/document/FilterOptionsRequest.hpp> #include <com/sun/star/document/LockedDocumentRequest.hpp> #include <com/sun/star/document/MacroExecMode.hpp> diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx index 680fe09..3b27f18 100644 --- a/framework/source/interaction/quietinteraction.cxx +++ b/framework/source/interaction/quietinteraction.cxx @@ -25,7 +25,6 @@ #include <com/sun/star/task/XInteractionApprove.hpp> #include <com/sun/star/document/XInteractionFilterSelect.hpp> #include <com/sun/star/document/XInteractionFilterOptions.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/document/FilterOptionsRequest.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> @@ -81,20 +80,9 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI // differ between abortable interactions (error, unknown filter ...) // and other ones (ambigous but not unknown filter ...) css::task::ErrorCodeRequest aErrorCodeRequest; - css::document::AmbigousFilterRequest aAmbigousFilterRequest; css::document::LockedDocumentRequest aLockedDocumentRequest; css::document::FilterOptionsRequest aFilterOptionsRequest; - if (aRequest>>=aAmbigousFilterRequest) - { - if (xFilter.is()) - { - // user selected filter wins every time! - xFilter->setFilter( aAmbigousFilterRequest.SelectedFilter ); - xFilter->select(); - } - } - else if( aRequest >>= aErrorCodeRequest ) { // warnings can be ignored => approve diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 10bb545..781ce63 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -46,7 +46,6 @@ #include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/task/XInteractionApprove.hpp> #include <com/sun/star/document/XInteractionFilterSelect.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> @@ -1220,16 +1219,7 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio // differ between abortable interactions (error, unknown filter ...) // and other ones (ambigous but not unknown filter ...) css::task::ErrorCodeRequest aErrorCodeRequest; - css::document::AmbigousFilterRequest aAmbigousFilterRequest; - if( aRequest >>= aAmbigousFilterRequest ) - { - if( xFilterSelect.is() ) - { - xFilterSelect->setFilter( aAmbigousFilterRequest.SelectedFilter ); // user selected filter wins! - xFilterSelect->select(); - } - } - else if( aRequest >>= aErrorCodeRequest ) + if( aRequest >>= aErrorCodeRequest ) { bool bWarning = ((aErrorCodeRequest.ErrCode & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK); if (xApprove.is() && bWarning) diff --git a/include/framework/interaction.hxx b/include/framework/interaction.hxx index 415f7a7..aa43a85 100644 --- a/include/framework/interaction.hxx +++ b/include/framework/interaction.hxx @@ -28,7 +28,6 @@ #include <com/sun/star/task/XInteractionRetry.hpp> #include <com/sun/star/document/XInteractionFilterSelect.hpp> #include <com/sun/star/document/NoSuchFilterRequest.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/uno/RuntimeException.hpp> #include <rtl/ustring.hxx> diff --git a/uui/inc/pch/precompiled_uui.hxx b/uui/inc/pch/precompiled_uui.hxx index cc81635..d8f029e 100644 --- a/uui/inc/pch/precompiled_uui.hxx +++ b/uui/inc/pch/precompiled_uui.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/document/BrokenPackageRequest.hpp> #include <com/sun/star/document/ChangedByOthersRequest.hpp> #include <com/sun/star/document/FilterOptionsRequest.hpp> diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index d8f574e..c43f018 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -20,7 +20,6 @@ #include <com/sun/star/beans/XPropertyAccess.hpp> #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/document/AmbigousFilterRequest.hpp> #include <com/sun/star/document/FilterOptionsRequest.hpp> #include <com/sun/star/document/NoSuchFilterRequest.hpp> #include <com/sun/star/document/XImporter.hpp> @@ -190,109 +189,6 @@ handleNoSuchFilterRequest_( } void -handleAmbigousFilterRequest_( - Window * pParent, - uno::Reference< uno::XComponentContext > const & xContext, - document::AmbigousFilterRequest const & rRequest, - uno::Sequence< - uno::Reference< - task::XInteractionContinuation > > const & rContinuations) -{ - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< document::XInteractionFilterSelect > xFilterTransport; - getContinuations(rContinuations, &xAbort, &xFilterTransport); - - uui::FilterNameList lNames; - - uno::Reference< container::XNameContainer > xFilterContainer; - try - { - xFilterContainer.set( xContext->getServiceManager()->createInstanceWithContext( - OUString( "com.sun.star.document.FilterFactory"), xContext ), - uno::UNO_QUERY ); - } - catch ( uno::Exception & ) - { - } - - if( xFilterContainer.is() ) - { - uno::Any aPackedSet ; - uno::Sequence< beans::PropertyValue > lProps ; - sal_Int32 nStep ; - uui::FilterNamePair aPair ; - - try - { - aPackedSet = xFilterContainer->getByName( rRequest.SelectedFilter ); - } - catch(const container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStep<lProps.getLength(); ++nStep ) - { - if( lProps[nStep].Name.equalsAscii("UIName") ) - { - OUString sTemp; - lProps[nStep].Value >>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.SelectedFilter; - lNames.push_back( aPair ); - break; - } - } - - try - { - aPackedSet = xFilterContainer->getByName( rRequest.DetectedFilter ); - } - catch(const container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStep<lProps.getLength(); ++nStep ) - { - if( lProps[nStep].Name.equalsAscii("UIName") ) - { - OUString sTemp; - lProps[nStep].Value >>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.DetectedFilter; - lNames.push_back( aPair ); - break; - } - } - } - - if( xAbort.is() && xFilterTransport.is() ) - { - if( lNames.size() < 1 ) - { - xAbort->select(); - } - else - { - OUString sFilter; - executeFilterDialog( pParent, - rRequest.URL, - lNames, - sFilter ); - - if( !sFilter.isEmpty() ) - { - xFilterTransport->setFilter( sFilter ); - xFilterTransport->select(); - } - else - xAbort->select(); - } - } -} - -void handleFilterOptionsRequest_( uno::Reference< uno::XComponentContext > const & xContext, document::FilterOptionsRequest const & rRequest, @@ -412,24 +308,6 @@ UUIInteractionHelper::handleNoSuchFilterRequest( } bool -UUIInteractionHelper::handleAmbigousFilterRequest( - uno::Reference< task::XInteractionRequest > const & rRequest) -{ - uno::Any aAnyRequest(rRequest->getRequest()); - - document::AmbigousFilterRequest aAmbigousFilterRequest; - if (aAnyRequest >>= aAmbigousFilterRequest) - { - handleAmbigousFilterRequest_(getParentProperty(), - m_xContext, - aAmbigousFilterRequest, - rRequest->getContinuations()); - return true; - } - return false; -} - -bool UUIInteractionHelper::handleFilterOptionsRequest( uno::Reference< task::XInteractionRequest > const & rRequest) { diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 89a45d2..d80904b 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -852,9 +852,6 @@ UUIInteractionHelper::handleRequest_impl( if ( handleNoSuchFilterRequest( rRequest ) ) return true; - if ( handleAmbigousFilterRequest( rRequest ) ) - return true; - if ( handleFilterOptionsRequest( rRequest ) ) return true; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 3333e87..efbee64 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -217,11 +217,6 @@ private: com::sun::star::task::XInteractionRequest > const & rRequest); bool - handleAmbigousFilterRequest( - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & rRequest); - - bool handleFilterOptionsRequest( com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const & rRequest);
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
