diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-19 22:15:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-05-20 15:23:09 +0100 |
commit | e8e132784a5fdea65859d06d6356d6beea5d75e4 (patch) | |
tree | 562415779869cee2fb37ea3f948d7d9ff3b154ab | |
parent | 0d9f2e66db48475c9198480a1f04cda5c873d134 (diff) |
adapt for singleton api change
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 6 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 28 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 6 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 16 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 12 |
8 files changed, 47 insertions, 45 deletions
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index aed662aae2d1..3941f418ebc6 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -1172,12 +1172,12 @@ String GalleryBrowser2::GetFilterName() const if( ( SGA_OBJ_BMP == eObjKind ) || ( SGA_OBJ_ANIM == eObjKind ) ) { - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); INetURLObject aURL; mpCurTheme->GetURL( mnCurActionPos, aURL ); - sal_uInt16 nFilter = pFilter->GetImportFormatNumberForShortName( aURL.GetExtension() ); + sal_uInt16 nFilter = rFilter.GetImportFormatNumberForShortName( aURL.GetExtension() ); if( GRFILTER_FORMAT_DONTKNOW != nFilter ) - aFilterName = pFilter->GetImportFormatName( nFilter ); + aFilterName = rFilter.GetImportFormatName( nFilter ); } } diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 5a59e03edf1d..667cc36574b8 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -95,9 +95,9 @@ bool GalleryPreview::SetGraphic( const INetURLObject& _aURL ) } else { - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); - GalleryProgress aProgress( pFilter ); - if( pFilter->ImportGraphic( aGraphic, _aURL, GRFILTER_FORMAT_DONTKNOW ) ) + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); + GalleryProgress aProgress( &rFilter ); + if( rFilter.ImportGraphic( aGraphic, _aURL, GRFILTER_FORMAT_DONTKNOW ) ) bRet = false; } diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index a20e1761aeab..be92ac7ebba9 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -126,13 +126,13 @@ sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, if( pIStm ) { - GraphicFilter* pGraphicFilter = GraphicFilter::GetGraphicFilter(); - GalleryProgress* pProgress = bShowProgress ? new GalleryProgress( pGraphicFilter ) : NULL; + GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); + GalleryProgress* pProgress = bShowProgress ? new GalleryProgress( &rGraphicFilter ) : NULL; sal_uInt16 nFormat; - if( !pGraphicFilter->ImportGraphic( rGraphic, rURL.GetMainURL( INetURLObject::NO_DECODE ), *pIStm, GRFILTER_FORMAT_DONTKNOW, &nFormat ) ) + if( !rGraphicFilter.ImportGraphic( rGraphic, rURL.GetMainURL( INetURLObject::NO_DECODE ), *pIStm, GRFILTER_FORMAT_DONTKNOW, &nFormat ) ) { - rFilterName = pGraphicFilter->GetImportFormatName( nFormat ); + rFilterName = rGraphicFilter.GetImportFormatName( nFormat ); nRet = SGA_IMPORT_FILE; } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 5d22b4dd3a09..000771a6e10a 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -100,10 +100,10 @@ const Graphic ImpLoadLinkedGraphic( const String& rFileName, const String& rFilt if ( pInStrm ) { pInStrm->Seek( STREAM_SEEK_TO_BEGIN ); - GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + GraphicFilter& rGF = GraphicFilter::GetGraphicFilter(); - const sal_uInt16 nFilter = rFilterName.Len() && pGF->GetImportFormatCount() - ? pGF->GetImportFormatNumber( rFilterName ) + const sal_uInt16 nFilter = rFilterName.Len() && rGF.GetImportFormatCount() + ? rGF.GetImportFormatNumber( rFilterName ) : GRFILTER_FORMAT_DONTKNOW; String aEmptyStr; @@ -115,7 +115,7 @@ const Graphic ImpLoadLinkedGraphic( const String& rFileName, const String& rFilt // there we should create a new service to provide this data if needed aFilterData[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) ); aFilterData[ 0 ].Value = Any( sal_True ); - pGF->ImportGraphic( aGraphic, aEmptyStr, *pInStrm, nFilter, NULL, 0, &aFilterData ); + rGF.ImportGraphic( aGraphic, aEmptyStr, *pInStrm, nFilter, NULL, 0, &aFilterData ); } return aGraphic; } @@ -1299,7 +1299,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO ) mbIsPreview = sal_True; } - if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *pStream, + if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *pStream, GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData ) ) { const String aUserData( pGraphic->GetUserData() ); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 55ae13c43696..cb8ba42fc04f 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1005,19 +1005,19 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes if( NULL == mpUnoPage ) return sal_False; - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); - - if( NULL == pFilter || NULL == mpUnoPage->GetSdrPage() || NULL == mpDoc ) + if( NULL == mpUnoPage->GetSdrPage() || NULL == mpDoc ) return sal_False; + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); + // get the arguments from the descriptor ExportSettings aSettings( mpDoc ); ParseSettings( aDescriptor, aSettings ); const sal_uInt16 nFilter = aSettings.maMediaType.getLength() - ? pFilter->GetExportFormatNumberForMediaType( aSettings.maMediaType ) - : pFilter->GetExportFormatNumberForShortName( aSettings.maFilterName ); - sal_Bool bVectorType = !pFilter->IsExportPixelFormat( nFilter ); + ? rFilter.GetExportFormatNumberForMediaType( aSettings.maMediaType ) + : rFilter.GetExportFormatNumberForShortName( aSettings.maFilterName ); + sal_Bool bVectorType = !rFilter.IsExportPixelFormat( nFilter ); // create the output stuff Graphic aGraphic; @@ -1046,7 +1046,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes // SvOutputStream, or adapt the graphic filter to not seek anymore. SvMemoryStream aStream( 1024, 1024 ); - nStatus = pFilter->ExportGraphic( aGraphic, String(), aStream, nFilter, &aSettings.maFilterData ); + nStatus = rFilter.ExportGraphic( aGraphic, String(), aStream, nFilter, &aSettings.maFilterData ); // copy temp stream to XOutputStream SvOutputStream aOutputStream( aSettings.mxOutputStream ); @@ -1058,7 +1058,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes INetURLObject aURLObject( aSettings.maURL.Complete ); DBG_ASSERT( aURLObject.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - nStatus = XOutBitmap::ExportGraphic( aGraphic, aURLObject, *pFilter, nFilter, &aSettings.maFilterData ); + nStatus = XOutBitmap::ExportGraphic( aGraphic, aURLObject, rFilter, nFilter, &aSettings.maFilterData ); } } } @@ -1223,12 +1223,12 @@ sal_Bool SAL_CALL GraphicExporter::supportsMimeType( const OUString& MimeTypeNam { const String aMimeTypeName( MimeTypeName ); - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); - sal_uInt16 nCount = pFilter->GetExportFormatCount(); + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); + sal_uInt16 nCount = rFilter.GetExportFormatCount(); sal_uInt16 nFilter; for( nFilter = 0; nFilter < nCount; nFilter++ ) { - if( aMimeTypeName.Equals( pFilter->GetExportFormatMediaType( nFilter ) ) ) + if( aMimeTypeName.Equals( rFilter.GetExportFormatMediaType( nFilter ) ) ) { return sal_True; } @@ -1239,8 +1239,8 @@ sal_Bool SAL_CALL GraphicExporter::supportsMimeType( const OUString& MimeTypeNam Sequence< OUString > SAL_CALL GraphicExporter::getSupportedMimeTypeNames( ) throw (RuntimeException) { - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); - sal_uInt16 nCount = pFilter->GetExportFormatCount(); + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); + sal_uInt16 nCount = rFilter.GetExportFormatCount(); sal_uInt16 nFilter; sal_uInt16 nFound = 0; @@ -1249,7 +1249,7 @@ Sequence< OUString > SAL_CALL GraphicExporter::getSupportedMimeTypeNames( ) thr for( nFilter = 0; nFilter < nCount; nFilter++ ) { - OUString aMimeType( pFilter->GetExportFormatMediaType( nFilter ) ); + OUString aMimeType( rFilter.GetExportFormatMediaType( nFilter ) ); if( aMimeType.getLength() ) { *pStr++ = aMimeType; diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index b43ce57eb3b3..3840495e47f7 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -101,11 +101,13 @@ SvxShapeGroup::SvxShapeGroup( SdrObject* pObj, SvxDrawPage* pDrawPage ) throw( SvxShape( pObj, getSvxMapProvider().GetMap(SVXMAP_GROUP), getSvxMapProvider().GetPropertySet(SVXMAP_GROUP, SdrObject::GetGlobalDrawObjectItemPool()) ), mxPage( pDrawPage ) { + fprintf(stderr, "SvxShapeGroup::SvxShapeGroup ctor %p\n", this); } //---------------------------------------------------------------------- SvxShapeGroup::~SvxShapeGroup() throw() { + fprintf(stderr, "SvxShapeGroup::SvxShapeGroup dtor %p\n", this); } //---------------------------------------------------------------------- @@ -1730,8 +1732,8 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID ) { - GraphicFilter* pGrfFilter = GraphicFilter::GetGraphicFilter(); - aFilterName = pGrfFilter->GetImportFormatName( pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) ); + GraphicFilter &rGrfFilter = GraphicFilter::GetGraphicFilter(); + aFilterName = rGrfFilter.GetImportFormatName( rGrfFilter.GetImportFormatNumberForShortName( aURLObj.getExtension() ) ); } } else diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 8288390bfbd7..d0112369ec48 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -139,7 +139,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const ::rtl::OUString& rGraphi { if( aGraphic.GetType() == GRAPHIC_BITMAP ) { - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); String aFormat; if( aGraphic.IsAnimated() ) @@ -147,7 +147,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const ::rtl::OUString& rGraphi else aFormat = String( RTL_CONSTASCII_USTRINGPARAM( "png" ) ); - bRet = ( pFilter->ExportGraphic( aGraphic, String(), *pStm, pFilter->GetExportFormatNumberForShortName( aFormat ) ) == 0 ); + bRet = ( rFilter.ExportGraphic( aGraphic, String(), *pStm, rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 ); } else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) { @@ -331,7 +331,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() mpOStm->Seek( 0 ); sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; sal_uInt16 pDeterminedFormat = GRFILTER_FORMAT_DONTKNOW; - GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *mpOStm ,nFormat,&pDeterminedFormat ); + GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *mpOStm ,nFormat,&pDeterminedFormat ); if (pDeterminedFormat == GRFILTER_FORMAT_DONTKNOW) { @@ -374,7 +374,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() if (nStreamLen_) { pDest->Seek(0L); - GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *pDest ,nFormat,&pDeterminedFormat ); + GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *pDest ,nFormat,&pDeterminedFormat ); } } delete pDest; @@ -569,7 +569,7 @@ Graphic SvXMLGraphicHelper::ImplReadGraphic( const ::rtl::OUString& rPictureStor if( aStream.xStream.is() ) { SvStream* pStream = utl::UcbStreamHelper::CreateStream( aStream.xStream ); - GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *pStream ); + GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *pStream ); delete pStream; } @@ -615,7 +615,7 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt { if( aGraphic.GetType() == GRAPHIC_BITMAP ) { - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); String aFormat; if( aGraphic.IsAnimated() ) @@ -623,8 +623,8 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt else aFormat = String( RTL_CONSTASCII_USTRINGPARAM( "png" ) ); - bRet = ( pFilter->ExportGraphic( aGraphic, String(), *pStream, - pFilter->GetExportFormatNumberForShortName( aFormat ) ) == 0 ); + bRet = ( rFilter.ExportGraphic( aGraphic, String(), *pStream, + rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 ); } else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) { diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 547a5334d124..33c6eb7849b3 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -328,7 +328,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName, INetURLObject aURL( rFileName ); Graphic aGraphic; String aExt; - GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); sal_uInt16 nErr = GRFILTER_FILTERERROR, nFilter = GRFILTER_FORMAT_NOTFOUND; sal_Bool bTransparent = rGraphic.IsTransparent(), bAnimated = rGraphic.IsAnimated(); @@ -397,19 +397,19 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName, if( bWriteTransGrf ) aFilter = FORMAT_GIF; - nFilter = pFilter->GetExportFormatNumberForShortName( aFilter ); + nFilter = rFilter.GetExportFormatNumberForShortName( aFilter ); if( GRFILTER_FORMAT_NOTFOUND == nFilter ) { - nFilter = pFilter->GetExportFormatNumberForShortName( FORMAT_JPG ); + nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_JPG ); if( GRFILTER_FORMAT_NOTFOUND == nFilter ) - nFilter = pFilter->GetExportFormatNumberForShortName( FORMAT_BMP ); + nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_BMP ); } if( GRFILTER_FORMAT_NOTFOUND != nFilter ) { - aExt = pFilter->GetExportFormatShortName( nFilter ).ToLowerAscii(); + aExt = rFilter.GetExportFormatShortName( nFilter ).ToLowerAscii(); if( bWriteTransGrf ) { @@ -475,7 +475,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName, { aURL.setExtension( aExt ); rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); - nErr = ExportGraphic( aGraphic, aURL, *pFilter, nFilter, NULL ); + nErr = ExportGraphic( aGraphic, aURL, rFilter, nFilter, NULL ); } } } |