Kaydet (Commit) 445b34fb authored tarafından Noel Grandin's avatar Noel Grandin

convert SGX_IMPORT constants to scoped enum

Change-Id: I5c80b8b762682bc666761710039b3b57bb3d579d
üst ab1b535f
......@@ -69,9 +69,10 @@ enum SgaObjKind
#define GAL_RESSTR(nId) GAL_RES(nId).toString()
#define STREAMBUF_SIZE 16384L
#define SGA_IMPORT_NONE 0x0000
#define SGA_IMPORT_FILE 0x0001
#define SGA_IMPORT_INET 0x0002
enum class GalleryGraphicImportRet
{
NONE, FILE, INET
};
#define GALLERY_PROGRESS_RANGE 10000
......@@ -88,7 +89,7 @@ class Gallery;
SVX_DLLPUBLIC ResMgr*
GetGalleryResMgr();
sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName, bool bShowProgress = false );
GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName, bool bShowProgress = false );
bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel );
bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& rImageMap );
SVX_DLLPUBLIC OUString
......
......@@ -82,10 +82,10 @@ IMPL_LINK( SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory )
return 0L;
}
sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic,
GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic,
OUString& rFilterName, bool bShowProgress )
{
sal_uInt16 nRet = SGA_IMPORT_NONE;
GalleryGraphicImportRet nRet = GalleryGraphicImportRet::NONE;
SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ );
aMedium.Download();
......@@ -101,7 +101,7 @@ sal_uInt16 GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic,
if( !rGraphicFilter.ImportGraphic( rGraphic, rURL.GetMainURL( INetURLObject::NO_DECODE ), *pIStm, GRFILTER_FORMAT_DONTKNOW, &nFormat ) )
{
rFilterName = rGraphicFilter.GetImportFormatName( nFormat );
nRet = SGA_IMPORT_FILE;
nRet = GalleryGraphicImportRet::FILE;
}
}
......
......@@ -278,7 +278,7 @@ SgaObjectBmp::SgaObjectBmp( const INetURLObject& rURL )
Graphic aGraphic;
OUString aFilter;
if ( SGA_IMPORT_NONE != GalleryGraphicImport( rURL, aGraphic, aFilter ) )
if ( GalleryGraphicImportRet::NONE != GalleryGraphicImport( rURL, aGraphic, aFilter ) )
Init( aGraphic, rURL );
}
......
......@@ -553,7 +553,7 @@ void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProg
{
aGraphic.Clear();
if ( GalleryGraphicImport( aURL, aGraphic, aFormat ) )
if ( GalleryGraphicImport( aURL, aGraphic, aFormat ) != GalleryGraphicImportRet::NONE )
{
boost::scoped_ptr<SgaObject> pNewObj;
......@@ -790,7 +790,7 @@ bool GalleryTheme::GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, bool bProgre
case( SGA_OBJ_INET ):
{
OUString aFilterDummy;
bRet = ( GalleryGraphicImport( aURL, rGraphic, aFilterDummy, bProgress ) != SGA_IMPORT_NONE );
bRet = ( GalleryGraphicImport( aURL, rGraphic, aFilterDummy, bProgress ) != GalleryGraphicImportRet::NONE );
}
break;
......@@ -1105,12 +1105,12 @@ bool GalleryTheme::InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos
Graphic aGraphic;
OUString aFormat;
boost::scoped_ptr<SgaObject> pNewObj;
const sal_uInt16 nImportRet = GalleryGraphicImport( rURL, aGraphic, aFormat );
const GalleryGraphicImportRet nImportRet = GalleryGraphicImport( rURL, aGraphic, aFormat );
bool bRet = false;
if( nImportRet != SGA_IMPORT_NONE )
if( nImportRet != GalleryGraphicImportRet::NONE )
{
if ( SGA_IMPORT_INET == nImportRet )
if ( GalleryGraphicImportRet::INET == nImportRet )
pNewObj.reset((SgaObject*) new SgaObjectINet( aGraphic, rURL, aFormat ));
else if ( aGraphic.IsAnimated() )
pNewObj.reset((SgaObject*) new SgaObjectAnim( aGraphic, rURL, aFormat ));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment