diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-03 16:33:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-10 08:05:53 +0200 |
commit | 24f0aa76c005d1506a6d13945c39dafc6e9b8d91 (patch) | |
tree | de84b05444d3436ed107bc4fb7d3522284e69529 /filter | |
parent | b9a4a0b9658015a0d55c42de1f5e56941e20d268 (diff) |
fdo#46808, use service constructor for embed::StorageFactory
Change-Id: I26cd1cf86118122f392f16801a646df753a7df26
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 861be9d81b95..546215173995 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2702,47 +2702,44 @@ void DffPropertyReader::CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItem ( new ::comphelper::SequenceInputStream( aXMLDataSeq ) ); try { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if ( xFactory.is() ) + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + ::com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage + ( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( + OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xContext, sal_True ) ); + if ( xStorage.is() ) { - ::com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage - ( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( - OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xFactory, sal_True ) ); - if ( xStorage.is() ) + const rtl::OUString sDRS( RTL_CONSTASCII_USTRINGPARAM ( "drs" ) ); + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > + xStorageDRS( xStorage->openStorageElement( sDRS, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); + if ( xStorageDRS.is() ) { - const rtl::OUString sDRS( RTL_CONSTASCII_USTRINGPARAM ( "drs" ) ); - ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > - xStorageDRS( xStorage->openStorageElement( sDRS, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); - if ( xStorageDRS.is() ) + const rtl::OUString sShapeXML( RTL_CONSTASCII_USTRINGPARAM ( "shapexml.xml" ) ); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xShapeXMLStream( xStorageDRS->openStreamElement( sShapeXML, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); + if ( xShapeXMLStream.is() ) { - const rtl::OUString sShapeXML( RTL_CONSTASCII_USTRINGPARAM ( "shapexml.xml" ) ); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xShapeXMLStream( xStorageDRS->openStreamElement( sShapeXML, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); - if ( xShapeXMLStream.is() ) + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xShapeXMLInputStream( xShapeXMLStream->getInputStream() ); + if ( xShapeXMLInputStream.is() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xShapeXMLInputStream( xShapeXMLStream->getInputStream() ); - if ( xShapeXMLInputStream.is() ) - { - ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; - sal_Int32 nBytesRead = xShapeXMLInputStream->readBytes( aSeq, 0x7fffffff ); - if ( nBytesRead ) - { // for only one property I spare to use a XML parser at this point, this - // should be enhanced if needed - - bRotateTextWithShape = sal_True; // using the correct xml default - const char* pArry = reinterpret_cast< char* >( aSeq.getArray() ); - const char* pUpright = "upright="; - const char* pEnd = pArry + nBytesRead; - const char* pPtr = pArry; - while( ( pPtr + 12 ) < pEnd ) + ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; + sal_Int32 nBytesRead = xShapeXMLInputStream->readBytes( aSeq, 0x7fffffff ); + if ( nBytesRead ) + { // for only one property I spare to use a XML parser at this point, this + // should be enhanced if needed + + bRotateTextWithShape = sal_True; // using the correct xml default + const char* pArry = reinterpret_cast< char* >( aSeq.getArray() ); + const char* pUpright = "upright="; + const char* pEnd = pArry + nBytesRead; + const char* pPtr = pArry; + while( ( pPtr + 12 ) < pEnd ) + { + if ( !memcmp( pUpright, pPtr, 8 ) ) { - if ( !memcmp( pUpright, pPtr, 8 ) ) - { - bRotateTextWithShape = ( pPtr[ 9 ] != '1' ) && ( pPtr[ 9 ] != 't' ); - break; - } - else - pPtr++; + bRotateTextWithShape = ( pPtr[ 9 ] != '1' ) && ( pPtr[ 9 ] != 't' ); + break; } + else + pPtr++; } } } |