diff options
96 files changed, 340 insertions, 340 deletions
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index 47e5dac88a7c..e06c99d6d685 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -67,9 +67,9 @@ void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, bool bWrite ) GraphicType eType = aGraphic.GetType(); sal_Int16 nType = 0; - if( eType == GRAPHIC_BITMAP ) + if( eType == GraphicType::Bitmap ) nType = 1; - else if( eType != GRAPHIC_NONE ) + else if( eType != GraphicType::NONE ) nType = 2; pVar->PutInteger( nType ); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 58af6a624c6a..c3cc7a7f160b 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -316,7 +316,7 @@ void ChartController::executeDispatch_Paste() } } - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) { Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic()); if( xGraphic.is()) diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index bd694f2cd061..1a8774ba9219 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -99,7 +99,7 @@ void GraphicPreviewWindow::ScaleImageToFit() mpOrigGraphic->GetPrefMapMode())); Size aGrfSize(aSizePixel); - if( mpOrigGraphic->GetType() == GRAPHIC_BITMAP && + if( mpOrigGraphic->GetType() == GraphicType::Bitmap && aPreviewSize.Width() && aPreviewSize.Height() && aGrfSize.Width() && aGrfSize.Height() ) { @@ -147,7 +147,7 @@ GraphicFilterDialog::GraphicFilterDialog(vcl::Window* pParent, , maSizePixel(LogicToPixel(rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode())) { - bIsBitmap = rGraphic.GetType() == GRAPHIC_BITMAP; + bIsBitmap = rGraphic.GetType() == GraphicType::Bitmap; maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) ); maTimer.SetTimeout( 5 ); diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 1ffd0b4ef5f2..e7cd0def4c93 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -234,7 +234,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet ) if( pGrf ) { aOrigSize = GetGrfOrigSize( *pGrf ); - if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() && aOrigSize.Height()) + if (pGrf->GetType() == GraphicType::Bitmap && aOrigSize.Width() && aOrigSize.Height()) { Bitmap aBitmap = pGrf->GetBitmap(); aOrigPixelSize = aBitmap.GetSizePixel(); @@ -388,7 +388,7 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet) { m_pExampleWN->SetGraphic( *pGrf ); aOrigSize = GetGrfOrigSize( *pGrf ); - if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() > 1 && aOrigSize.Height() > 1) { + if (pGrf->GetType() == GraphicType::Bitmap && aOrigSize.Width() > 1 && aOrigSize.Height() > 1) { Bitmap aBitmap = pGrf->GetBitmap(); aOrigPixelSize = aBitmap.GetSizePixel(); } diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 431e10614e54..df35ae0f7df3 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -592,7 +592,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) case drawing::FillStyle_BITMAP: { //UUUU - if(mbDirectGraphicSet && GRAPHIC_NONE != maDirectGraphic.GetType()) + if(mbDirectGraphicSet && GraphicType::NONE != maDirectGraphic.GetType()) { const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic); rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP)); @@ -1447,7 +1447,7 @@ IMPL_LINK_NOARG_TYPED( SvxAreaTabPage, ClickImportHdl_Impl, Button*, void ) const int nError(aDlg.GetGraphic(maDirectGraphic)); LeaveWait(); - if(!nError && GRAPHIC_NONE != maDirectGraphic.GetType()) + if(!nError && GraphicType::NONE != maDirectGraphic.GetType()) { // extract name from filename const INetURLObject aURL(aDlg.GetPath()); diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx index 7dc1eb3c8ec7..f90c9239de55 100644 --- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx @@ -46,7 +46,7 @@ namespace drawinglayer { const Graphic& rGraphic = rAttribute.getGraphic(); - if(GRAPHIC_BITMAP == rGraphic.GetType() || GRAPHIC_GDIMETAFILE == rGraphic.GetType()) + if(GraphicType::Bitmap == rGraphic.GetType() || GraphicType::GdiMetafile == rGraphic.GetType()) { const Size aSize(rGraphic.GetPrefSize()); diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index d2e9c882922c..e43839b19b48 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -81,7 +81,7 @@ namespace drawinglayer const GraphicObject& rGraphicObject = getGraphicObject(); Graphic aTransformedGraphic(rGraphicObject.GetGraphic()); - const bool isBitmap(GRAPHIC_BITMAP == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get()); + const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get()); const bool isAdjusted(getGraphicAttr().IsAdjusted()); const bool isDrawMode(GRAPHICDRAWMODE_STANDARD != getGraphicAttr().GetDrawMode()); diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 87d3959cebf9..b51fc91f5b43 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -89,7 +89,7 @@ namespace animatedBitmapExPreparator::animatedBitmapExPreparator(const Graphic& rGraphic) : maAnimation(rGraphic.GetAnimation()) { - OSL_ENSURE(GRAPHIC_BITMAP == rGraphic.GetType() && rGraphic.IsAnimated(), "animatedBitmapExPreparator: graphic is not animated (!)"); + OSL_ENSURE(GraphicType::Bitmap == rGraphic.GetType() && rGraphic.IsAnimated(), "animatedBitmapExPreparator: graphic is not animated (!)"); // #128539# secure access to Animation, looks like there exist animated GIFs out there // with a step count of zero @@ -196,7 +196,7 @@ namespace drawinglayer switch(rGraphic.GetType()) { - case GRAPHIC_BITMAP : + case GraphicType::Bitmap : { if(rGraphic.IsAnimated()) { @@ -268,7 +268,7 @@ namespace drawinglayer break; } - case GRAPHIC_GDIMETAFILE : + case GraphicType::GdiMetafile : { // create MetafilePrimitive2D const GDIMetaFile& rMetafile = rGraphic.GetGDIMetaFile(); diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx index 7ad6850e857e..8e9beba05218 100644 --- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx @@ -47,7 +47,7 @@ namespace drawinglayer getBackgroundColor())); xRetval[0] = xRefBackground; - if(GRAPHIC_BITMAP == maSnapshot.GetType() || GRAPHIC_GDIMETAFILE == maSnapshot.GetType()) + if(GraphicType::Bitmap == maSnapshot.GetType() || GraphicType::GdiMetafile == maSnapshot.GetType()) { const GraphicObject aGraphicObject(maSnapshot); const GraphicAttr aGraphicAttr; diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 82e1bbacd833..921359608e2a 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -450,7 +450,7 @@ namespace drawinglayer const GraphicType aType(rGraphic.GetType()); // is there a bitmap or a metafile (do we have content)? - if(GRAPHIC_BITMAP == aType || GRAPHIC_GDIMETAFILE == aType) + if(GraphicType::Bitmap == aType || GraphicType::GdiMetafile == aType) { const Size aPrefSize(rGraphic.GetPrefSize()); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 67625c0b85a4..0d5c1186878c 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -442,7 +442,7 @@ namespace drawinglayer // // when graphic is animated, force decomposition to use the correct graphic, else // fill style will not be animated - if(GRAPHIC_BITMAP == rFillGraphicAttribute.getGraphic().GetType() + if(GraphicType::Bitmap == rFillGraphicAttribute.getGraphic().GetType() && !rFillGraphicAttribute.getGraphic().getSvgData().get() && !rFillGraphicAttribute.getGraphic().IsAnimated()) { @@ -666,12 +666,12 @@ namespace drawinglayer // color (e.g. shadow) switch(rFillGraphicAttribute.getGraphic().GetType()) { - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { // metafiles are potentially transparent, cannot optimize, not done break; } - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(!rFillGraphicAttribute.getGraphic().IsTransparent() && !rFillGraphicAttribute.getGraphic().IsAlpha()) { @@ -738,7 +738,7 @@ namespace drawinglayer } break; } - default: //GRAPHIC_NONE, GRAPHIC_DEFAULT + default: //GraphicType::NONE, GraphicType::Default { // empty graphic, we are done bDone = true; diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index ab3f87d323f6..36c7b35b5669 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -271,7 +271,7 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c { // Correction for empty bitmap if( ( nStyle == SvxBulletStyle::BMP ) && - ( !pGraphicObject || ( GRAPHIC_NONE == pGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == pGraphicObject->GetType() ) ) ) + ( !pGraphicObject || ( GraphicType::NONE == pGraphicObject->GetType() ) || ( GraphicType::Default == pGraphicObject->GetType() ) ) ) { if( pGraphicObject ) { @@ -364,7 +364,7 @@ const GraphicObject& SvxBulletItem::GetGraphicObject() const void SvxBulletItem::SetGraphicObject( const GraphicObject& rGraphicObject ) { - if( ( GRAPHIC_NONE == rGraphicObject.GetType() ) || ( GRAPHIC_DEFAULT == rGraphicObject.GetType() ) ) + if( ( GraphicType::NONE == rGraphicObject.GetType() ) || ( GraphicType::Default == rGraphicObject.GetType() ) ) { if( pGraphicObject ) { diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 00a41e259c68..f9766975bc11 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3829,7 +3829,7 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co } // tdf#94088 when we got a graphic, set it - if(bGraphicLoaded && GRAPHIC_NONE != aGraphic.GetType()) + if(bGraphicLoaded && GraphicType::NONE != aGraphic.GetType()) { pImpl->pGraphicObject = new GraphicObject; pImpl->pGraphicObject->SetGraphic( aGraphic ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 57859e55e830..c22e4695cf54 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -394,7 +394,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter // global default value setting StackMember* pGS; - if (rGraphic.GetType() == GRAPHIC_GDIMETAFILE) + if (rGraphic.GetType() == GraphicType::GdiMetafile) pMTF = &rGraphic.GetGDIMetaFile(); else if (rGraphic.GetGDIMetaFile().GetActionSize()) pMTF = pAMTF = new GDIMetaFile( rGraphic.GetGDIMetaFile() ); diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index fe04bc9bb0d8..00f3447a0a13 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1457,7 +1457,7 @@ bool EscherPropertyContainer::CreateGraphicProperties( { aGraphicObject = aGraphic; aUniqueId = aGraphicObject.GetUniqueID(); - bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE; + bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile; } } } @@ -1474,7 +1474,7 @@ bool EscherPropertyContainer::CreateGraphicProperties( Graphic aGraphic( aBitmapEx ); aGraphicObject = aGraphic; aUniqueId = aGraphicObject.GetUniqueID(); - bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE; + bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile; } } } @@ -1507,7 +1507,7 @@ bool EscherPropertyContainer::CreateGraphicProperties( aGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground, aRect ); aUniqueId = aGraphicObject.GetUniqueID(); eBitmapMode = css::drawing::BitmapMode_REPEAT; - bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE; + bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile; } } @@ -3992,7 +3992,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject sal_uInt32 nLen = static_cast<sal_uInt32>(rId.getLength()); const sal_Char* pData = rId.getStr(); GraphicType eType( rObject.GetType() ); - if ( nLen && pData && ( eType != GRAPHIC_NONE ) ) + if ( nLen && pData && ( eType != GraphicType::NONE ) ) { mnIdentifier[ 0 ] = rtl_crc32( 0,pData, nLen ); mnIdentifier[ 1 ] = 0; @@ -4293,11 +4293,11 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin if ( !bUseNativeGraphic ) { GraphicType eGraphicType = aGraphic.GetType(); - if ( ( eGraphicType == GRAPHIC_BITMAP ) || ( eGraphicType == GRAPHIC_GDIMETAFILE ) ) + if ( ( eGraphicType == GraphicType::Bitmap ) || ( eGraphicType == GraphicType::GdiMetafile ) ) { sal_uInt32 nErrCode; if ( !aGraphic.IsAnimated() ) - nErrCode = GraphicConverter::Export( aStream, aGraphic, ( eGraphicType == GRAPHIC_BITMAP ) ? ConvertDataFormat::PNG : ConvertDataFormat::EMF ); + nErrCode = GraphicConverter::Export( aStream, aGraphic, ( eGraphicType == GraphicType::Bitmap ) ? ConvertDataFormat::PNG : ConvertDataFormat::EMF ); else { // to store a animation, a gif has to be included into the msOG chunk of a png #I5583# GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); @@ -4325,7 +4325,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin } if ( nErrCode == ERRCODE_NONE ) { - p_EscherBlibEntry->meBlibType = ( eGraphicType == GRAPHIC_BITMAP ) ? PNG : EMF; + p_EscherBlibEntry->meBlibType = ( eGraphicType == GraphicType::Bitmap ) ? PNG : EMF; aStream.Seek( STREAM_SEEK_TO_END ); p_EscherBlibEntry->mnSize = aStream.Tell(); pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData()); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index cf802ecbdede..9753f6eec0fb 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3820,7 +3820,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons { sal_uInt32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 ); - if ( aGraf.GetType() == GRAPHIC_BITMAP ) + if ( aGraf.GetType() == GraphicType::Bitmap ) { BitmapEx aBitmapEx( aGraf.GetBitmapEx() ); Bitmap aBitmap( aBitmapEx.GetBitmap() ); @@ -3910,7 +3910,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons } switch ( aGraf.GetType() ) { - case GRAPHIC_BITMAP : + case GraphicType::Bitmap : { BitmapEx aBitmapEx( aGraf.GetBitmapEx() ); if ( nBrightness || nContrast || ( nGamma != 0x10000 ) ) @@ -3924,7 +3924,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons } break; - case GRAPHIC_GDIMETAFILE : + case GraphicType::GdiMetafile : { GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() ); if ( nBrightness || nContrast || ( nGamma != 0x10000 ) ) @@ -6259,7 +6259,7 @@ bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* pVisA to get the Graphic via GraphicObject */ GraphicObject aGraphicObject( iter->second ); rData = aGraphicObject.GetGraphic(); - if ( rData.GetType() != GRAPHIC_NONE ) + if ( rData.GetType() != GraphicType::NONE ) bOk = true; else aEscherBlipCache.erase(iter); @@ -6470,7 +6470,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect // // For pict graphics we will furthermore scale the metafile, because font scaling leads to error if the // dxarray is empty (this has been solved in wmf/emf but not for pict) - if( bMtfBLIP && ( GRFILTER_OK == nRes ) && ( rData.GetType() == GRAPHIC_GDIMETAFILE ) && ( ( nInst & 0xFFFE ) == 0x542 ) ) + if( bMtfBLIP && ( GRFILTER_OK == nRes ) && ( rData.GetType() == GraphicType::GdiMetafile ) && ( ( nInst & 0xFFFE ) == 0x542 ) ) { if ( ( aMtfSize100.Width() >= 1000 ) && ( aMtfSize100.Height() >= 1000 ) ) { // #75956#, scaling does not work properly, if the graphic is less than 1cm @@ -6793,7 +6793,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, sal_uInt16 sz[4]; rStm.Read( sz, 8 ); Graphic aGraphic; - if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() ) + if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() != GraphicType::NONE ) { const GDIMetaFile& rMtf = aGraphic.GetGDIMetaFile(); MakeContentStream( rDest, rMtf ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 39d15befbf7b..4ce59e45a1f2 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -614,7 +614,7 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraphic ) { - if ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) + if ( rGraphic.GetType() == GraphicType::GdiMetafile ) { sal_uInt16 nX, nGlobalColorsCount, nFillColorsCount; diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 96cb1fb5d7d3..61529dac55b8 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1969,9 +1969,9 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag { Graphic aGraphic( SdrExchangeView::GetObjGraphic( pObj->GetModel(), pObj ) ); - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) { - if( aGraphic.GetType() == GRAPHIC_BITMAP ) + if( aGraphic.GetType() == GraphicType::Bitmap ) { GDIMetaFile aMtf; const Point aNullPt; diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index e279cde4cef8..ad635ab4a095 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -259,7 +259,7 @@ void ImageProducer::setImage( css::uno::Reference< css::io::XInputStream > & rIn void ImageProducer::NewDataAvailable() { - if( ( GRAPHIC_NONE == mpGraphic->GetType() ) || mpGraphic->GetContext() ) + if( ( GraphicType::NONE == mpGraphic->GetType() ) || mpGraphic->GetContext() ) startProduction(); } @@ -271,17 +271,17 @@ void ImageProducer::startProduction() throw(css::uno::RuntimeException, std::exc bool bNotifyEmptyGraphics = false; // valid stream or filled graphic? => update consumers - if( mpStm || ( mpGraphic->GetType() != GRAPHIC_NONE ) ) + if( mpStm || ( mpGraphic->GetType() != GraphicType::NONE ) ) { // if we already have a graphic, we don't have to import again; // graphic is cleared if a new Stream is set - if( ( mpGraphic->GetType() == GRAPHIC_NONE ) || mpGraphic->GetContext() ) + if( ( mpGraphic->GetType() == GraphicType::NONE ) || mpGraphic->GetContext() ) { if ( ImplImportGraphic( *mpGraphic ) ) maDoneHdl.Call( mpGraphic ); } - if( mpGraphic->GetType() != GRAPHIC_NONE ) + if( mpGraphic->GetType() != GraphicType::NONE ) ImplUpdateData( *mpGraphic ); else bNotifyEmptyGraphics = true; diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index da73cc6a070d..10efa5af31fc 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -34,12 +34,12 @@ #include <basegfx/vector/b2dsize.hxx> -enum GraphicType +enum class GraphicType { - GRAPHIC_NONE, - GRAPHIC_BITMAP, - GRAPHIC_GDIMETAFILE, - GRAPHIC_DEFAULT + NONE, + Bitmap, + GdiMetafile, + Default }; namespace com { namespace sun { namespace star { namespace graphic { class XGraphic;} } } } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 880351d61bd1..b4af05527f91 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -884,9 +884,9 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) default: { GraphicType aType = rGraphic.GetType(); - if ( aType == GRAPHIC_BITMAP || aType == GRAPHIC_GDIMETAFILE) + if ( aType == GraphicType::Bitmap || aType == GraphicType::GdiMetafile) { - if ( aType == GRAPHIC_BITMAP ) + if ( aType == GraphicType::Bitmap ) { (void)GraphicConverter::Export( aStream, rGraphic, ConvertDataFormat::PNG ); sMediaType = "image/png"; diff --git a/sc/qa/extras/sccondformats.cxx b/sc/qa/extras/sccondformats.cxx index 9f1f8c7b7d8e..135d78cd1fdc 100644 --- a/sc/qa/extras/sccondformats.cxx +++ b/sc/qa/extras/sccondformats.cxx @@ -143,7 +143,7 @@ void ScConditionalFormatTest::testUndoAnchor() const GraphicObject& rGraphicObj = pObject->GetGraphicObject(true); CPPUNIT_ASSERT(!rGraphicObj.IsSwappedOut()); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL(sal_uLong(864900), rGraphicObj.GetSizeBytes()); // Get the document controller @@ -177,14 +177,14 @@ void ScConditionalFormatTest::testUndoAnchor() // Check anchor type CPPUNIT_ASSERT(oldType == ScDrawLayer::GetAnchorType(*pObject) ); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL(sal_uLong(864900), rGraphicObj.GetSizeBytes()); pUndoMgr->Redo(); // Check anchor type CPPUNIT_ASSERT(newType == ScDrawLayer::GetAnchorType(*pObject) ); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL(sal_uLong(864900), rGraphicObj.GetSizeBytes()); ScDrawLayer::SetPageAnchored(*pObject); @@ -202,14 +202,14 @@ void ScConditionalFormatTest::testUndoAnchor() // Check anchor type CPPUNIT_ASSERT(oldType == ScDrawLayer::GetAnchorType(*pObject) ); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL(sal_uLong(864900), rGraphicObj.GetSizeBytes()); pUndoMgr->Redo(); // Check anchor type CPPUNIT_ASSERT(newType == ScDrawLayer::GetAnchorType(*pObject) ); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL(sal_uLong(864900), rGraphicObj.GetSizeBytes()); xComponent->dispose(); diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 294ede0db9b6..1e27fc786cd1 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -2730,7 +2730,7 @@ void ScExportTest::testLinkedGraphicRT() const GraphicObject& rGraphicObj = pObject->GetGraphicObject(true); CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), !rGraphicObj.IsSwappedOut()); - CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), sal_uLong(864900), rGraphicObj.GetSizeBytes()); xDocSh2->DoClose(); diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 27139cc307f0..6d5421894e5f 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -2948,13 +2948,13 @@ SdrObjectPtr XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, con // XclImpPictureObj instance but there are so many layers of indirection I // don't see an easy way. This way at least ensures that we can // avoid a 'blank' shape that can result from a failed control import - if ( !xSdrObj && IsOcxControl() && maGraphic.GetType() == GRAPHIC_NONE ) + if ( !xSdrObj && IsOcxControl() && maGraphic.GetType() == GraphicType::NONE ) { const_cast< XclImpPictureObj* >( this )->maGraphic = SdrOle2Obj::GetEmptyOLEReplacementGraphic(); } // no OLE - create a plain picture from IMGDATA record data - if( !xSdrObj && (maGraphic.GetType() != GRAPHIC_NONE) ) + if( !xSdrObj && (maGraphic.GetType() != GraphicType::NONE) ) { xSdrObj.reset( new SdrGrafObj( maGraphic, rAnchorRect ) ); ConvertRectStyle( *xSdrObj ); @@ -3441,7 +3441,7 @@ SdrObjectPtr XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicOb aGraphic = rPicObj.GetGraphic(); aVisArea = rPicObj.GetVisArea(); } - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) { ErrCode nError = ERRCODE_NONE; namespace cssea = ::com::sun::star::embed::Aspects; diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index 379493f6c411..9089828d688a 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -166,7 +166,7 @@ void XclImpPageSettings::ReadPrintGridLines( XclImpStream& rStrm ) void XclImpPageSettings::ReadImgData( XclImpStream& rStrm ) { Graphic aGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm ); - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) maData.mxBrushItem.reset( new SvxBrushItem( aGraphic, GPOS_TILED, ATTR_BACKGROUND ) ); } diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index d228d9f85072..e602286511ac 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -121,7 +121,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain if (nSdrObjKind == OBJ_GRAF) { bGraphic = true; - if ( static_cast<SdrGrafObj*>(pObject)->GetGraphic().GetType() == GRAPHIC_BITMAP ) + if ( static_cast<SdrGrafObj*>(pObject)->GetGraphic().GetType() == GraphicType::Bitmap ) bGrIsBit = true; } diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index ead955f31c2d..35e7542ee646 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -92,7 +92,7 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView if ( nSdrObjKind == OBJ_GRAF ) { - if ( static_cast<SdrGrafObj*>(pObj)->GetGraphic().GetType() == GRAPHIC_BITMAP ) + if ( static_cast<SdrGrafObj*>(pObj)->GetGraphic().GetType() == GraphicType::Bitmap ) eMode = SC_SELTRANS_DRAW_BITMAP; else eMode = SC_SELTRANS_DRAW_GRAPHIC; diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 1632fd067d81..bf09e7500fe7 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -94,7 +94,7 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -111,7 +111,7 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); @@ -145,7 +145,7 @@ void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -162,7 +162,7 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); m_ExternalEdits.push_back( o3tl::make_unique<SdrExternalToolEdit>( @@ -183,7 +183,7 @@ void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -200,7 +200,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ); @@ -228,7 +228,7 @@ void ScGraphicShell::GetCropGraphicState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -245,7 +245,7 @@ void ScGraphicShell::ExecuteCropGraphic( SfxRequest& ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { pView->SetEditMode(SDREDITMODE_EDIT); pView->SetDragMode(SDRDRAG_CROP); @@ -262,7 +262,7 @@ void ScGraphicShell::ExecuteSaveGraphic(SfxRequest& /*rReq*/) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() ); { @@ -283,7 +283,7 @@ void ScGraphicShell::GetSaveGraphicState(SfxItemSet &rSet) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -300,7 +300,7 @@ void ScGraphicShell::ExecuteChangePicture(SfxRequest& /*rReq*/) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC)); @@ -335,7 +335,7 @@ void ScGraphicShell::GetChangePictureState(SfxItemSet &rSet) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index a1ec9e6a7ed1..089069736b8a 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1173,7 +1173,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu GraphicObject aObject( *pGraphic ); if( pOut->GetPDFWriter() && - (aObject.GetType() == GRAPHIC_BITMAP || aObject.GetType() == GRAPHIC_DEFAULT) ) + (aObject.GetType() == GraphicType::Bitmap || aObject.GetType() == GraphicType::Default) ) { // For PDF export, every draw // operation for bitmaps takes a noticeable diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 624d2908abd7..bdaefa8f7341 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -796,7 +796,7 @@ void SdExportTest::testLinkedGraphicRT() const GraphicObject& rGraphicObj = pObject->GetGraphicObject(true); CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), !rGraphicObj.IsSwappedOut()); - CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); + CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), int(GraphicType::Bitmap), int(rGraphicObj.GetGraphic().GetType())); CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), sal_uLong(864900), rGraphicObj.GetSizeBytes()); xDocShRef->DoClose(); diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 52ed60cc2012..835434c049f0 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -416,7 +416,7 @@ void SdTransferable::AddSupportedFormats() AddFormat( SotClipboardFormatId::SVXB ); - if( mpGraphic->GetType() == GRAPHIC_BITMAP ) + if( mpGraphic->GetType() == GraphicType::Bitmap ) { AddFormat( SotClipboardFormatId::PNG ); AddFormat( SotClipboardFormatId::BITMAP ); diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index b1a104f984f2..67baa4f42d34 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -480,7 +480,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) aFont.SetCharSet( aOldFont.GetCharSet() ); aFont.SetLanguage( aOldFont.GetLanguage() ); - if( !bTimeoutOnly && ( maLogo.GetType() != GRAPHIC_NONE ) ) + if( !bTimeoutOnly && ( maLogo.GetType() != GraphicType::NONE ) ) { Size aGrfSize; diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index 52f77cb429f7..57124390e9ec 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -105,7 +105,7 @@ void GraphicObjectBar::GetFilterState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -121,7 +121,7 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index bbfe30b33207..8704f87cd6ae 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -948,7 +948,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() ); { @@ -967,7 +967,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); m_ExternalEdits.push_back( @@ -988,7 +988,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index cd3162ec40e2..3f679b9e734a 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1341,14 +1341,14 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) switch(pSdrGrafObj->GetGraphicType()) { - case GRAPHIC_BITMAP : + case GraphicType::Bitmap : bFoundBitmap = true; if(pSdrGrafObj->isEmbeddedSvg()) { bFoundMetafile = true; } break; - case GRAPHIC_GDIMETAFILE : + case GraphicType::GdiMetafile : bFoundMetafile = true; break; default: diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index c7d803119a99..3baf250a4cb1 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1003,7 +1003,7 @@ bool View::IsVectorizeAllowed() const if(pObj) { - if(GRAPHIC_BITMAP == pObj->GetGraphicType() && !pObj->isEmbeddedSvg()) + if(GraphicType::Bitmap == pObj->GetGraphicType() && !pObj->isEmbeddedSvg()) { bRet = true; } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 95badc5a7966..58d79806ca64 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -193,7 +193,7 @@ bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPo case MetaActionType::BMPSCALE: case MetaActionType::BMPEX: case MetaActionType::BMPEXSCALE: - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) { bVector = true; } @@ -238,7 +238,7 @@ bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPo } // it is not a vector metafile but it also has no graphic? - if( !bVector && (aGraphic.GetType() == GRAPHIC_NONE) ) + if( !bVector && (aGraphic.GetType() == GraphicType::NONE) ) bVector = true; // restrict movement to WorkArea diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index c56bba56fe50..1460787f94b9 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -141,7 +141,7 @@ bool SvFileObject::GetData( css::uno::Any & rData, } if( SotClipboardFormatId::SVXB != nFmt ) - nFmt = (bLoadError || GRAPHIC_BITMAP == aGrf.GetType()) + nFmt = (bLoadError || GraphicType::Bitmap == aGrf.GetType()) ? SotClipboardFormatId::BITMAP : SotClipboardFormatId::GDIMETAFILE; @@ -149,7 +149,7 @@ bool SvFileObject::GetData( css::uno::Any & rData, switch ( nFmt ) { case SotClipboardFormatId::SVXB: - if( GRAPHIC_NONE != aGrf.GetType() ) + if( GraphicType::NONE != aGrf.GetType() ) { aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); WriteGraphic( aMemStm, aGrf ); diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index ae5997d2ff71..eb633515cc21 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -133,7 +133,7 @@ public: Graphic aGraphic( mxGraphic ); - if( aGraphic.GetType() == GRAPHIC_BITMAP || + if( aGraphic.GetType() == GraphicType::Bitmap || (bForeignSource && hasUnsupportedActions(aGraphic.GetGDIMetaFile()) ) ) { diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 5546d1668672..d8c94189c557 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -103,8 +103,8 @@ bool importShapeGraphic( o_rGraphic = GraphicObject( aOldString ); - if( GRAPHIC_DEFAULT == o_rGraphic.GetType() - || GRAPHIC_NONE == o_rGraphic.GetType() ) + if( GraphicType::Default == o_rGraphic.GetType() + || GraphicType::NONE == o_rGraphic.GetType() ) { // even the GrfMgr does not seem to know this graphic return false; diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 47c802353322..53cc5641d962 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -165,7 +165,7 @@ namespace svgio basegfx::B2DRange& rViewBox, BitmapEx& rBitmapEx) { - if(GRAPHIC_BITMAP == rGraphic.GetType()) + if(GraphicType::Bitmap == rGraphic.GetType()) { if(rGraphic.getSvgData().get()) { diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx index d1ee3c2abe43..22664425677f 100644 --- a/svtools/qa/unit/GraphicObjectTest.cxx +++ b/svtools/qa/unit/GraphicObjectTest.cxx @@ -233,11 +233,11 @@ void GraphicObjectTest::testSizeBasedAutoSwap() void GraphicObjectTest::testTdf88836() { - // Construction with empty bitmap -> type should be GRAPHIC_NONE + // Construction with empty bitmap -> type should be GraphicType::NONE Graphic aGraphic = Bitmap(); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_NONE, aGraphic.GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType())); aGraphic = Graphic(BitmapEx()); - CPPUNIT_ASSERT_EQUAL(GRAPHIC_NONE, aGraphic.GetType()); + CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType())); } void GraphicObjectTest::testTdf88935() diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 1703fde4fc06..9e320ea4783d 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -57,7 +57,7 @@ namespace unographic { GraphicDescriptor::GraphicDescriptor() : ::comphelper::PropertySetHelper( createPropertySetInfo(), SAL_NO_ACQUIRE ), mpGraphic( nullptr ), - meType( GRAPHIC_NONE ), + meType( GraphicType::NONE ), mnBitsPerPixel ( 0 ), mbTransparent ( false ), mbAlpha( false ), @@ -100,7 +100,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL ) mpGraphic = nullptr; maMimeType.clear(); - meType = GRAPHIC_NONE; + meType = GraphicType::NONE; mnBitsPerPixel = 0; mbTransparent = false; @@ -144,7 +144,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL ) if( graphic::GraphicType::EMPTY != cType ) { - meType = ( ( graphic::GraphicType::PIXEL == cType ) ? GRAPHIC_BITMAP : GRAPHIC_GDIMETAFILE ); + meType = ( ( graphic::GraphicType::PIXEL == cType ) ? GraphicType::Bitmap : GraphicType::GdiMetafile ); maMimeType = OUString( pMimeType, strlen(pMimeType), RTL_TEXTENCODING_ASCII_US ); maSizePixel = aDescriptor.GetSizePixel(); maSize100thMM = aDescriptor.GetSize_100TH_MM(); @@ -306,8 +306,8 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** { const GraphicType eType( mpGraphic ? mpGraphic->GetType() : meType ); - *pValues <<= ( ( eType == GRAPHIC_BITMAP ? graphic::GraphicType::PIXEL : - ( eType == GRAPHIC_GDIMETAFILE ? graphic::GraphicType::VECTOR : + *pValues <<= ( ( eType == GraphicType::Bitmap ? graphic::GraphicType::PIXEL : + ( eType == GraphicType::GdiMetafile ? graphic::GraphicType::VECTOR : graphic::GraphicType::EMPTY ) ) ); } break; @@ -347,7 +347,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** aMimeType = OUString::createFromAscii( pMimeType ); } - if( aMimeType.isEmpty() && ( mpGraphic->GetType() != GRAPHIC_NONE ) ) + if( aMimeType.isEmpty() && ( mpGraphic->GetType() != GraphicType::NONE ) ) aMimeType = MIMETYPE_VCLGRAPHIC; } else @@ -363,7 +363,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** if( mpGraphic ) { - if( mpGraphic->GetType() == GRAPHIC_BITMAP ) + if( mpGraphic->GetType() == GraphicType::Bitmap ) { const Size aSizePix( mpGraphic->GetBitmapEx().GetSizePixel() ); aAWTSize = awt::Size( aSizePix.Width(), aSizePix.Height() ); @@ -401,7 +401,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** if( mpGraphic ) { - if( mpGraphic->GetType() == GRAPHIC_BITMAP ) + if( mpGraphic->GetType() == GraphicType::Bitmap ) nBitsPerPixel = mpGraphic->GetBitmapEx().GetBitmap().GetBitCount(); } else diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx index 207f0de3293f..3739d3b491fe 100644 --- a/svtools/source/graphic/graphic.cxx +++ b/svtools/source/graphic/graphic.cxx @@ -161,8 +161,8 @@ uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId() { ::sal_Int8 cRet = graphic::GraphicType::EMPTY; - if( mpGraphic && ( mpGraphic->GetType() != GRAPHIC_NONE ) ) - cRet = ( ( mpGraphic->GetType() == GRAPHIC_BITMAP ) ? graphic::GraphicType::PIXEL : graphic::GraphicType::VECTOR ); + if( mpGraphic && ( mpGraphic->GetType() != GraphicType::NONE ) ) + cRet = ( ( mpGraphic->GetType() == GraphicType::Bitmap ) ? graphic::GraphicType::PIXEL : graphic::GraphicType::VECTOR ); return cRet; } @@ -176,7 +176,7 @@ awt::Size SAL_CALL Graphic::getSize( ) throw (uno::RuntimeException, std::excep SolarMutexGuard aGuard; ::Size aVclSize; - if( mpGraphic && ( mpGraphic->GetType() != GRAPHIC_NONE ) ) + if( mpGraphic && ( mpGraphic->GetType() != GraphicType::NONE ) ) aVclSize = mpGraphic->GetSizePixel(); return awt::Size( aVclSize.Width(), aVclSize.Height() ); @@ -187,7 +187,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL Graphic::getDIB( ) throw (uno::RuntimeExce { SolarMutexGuard aGuard; - if( mpGraphic && ( mpGraphic->GetType() != GRAPHIC_NONE ) ) + if( mpGraphic && ( mpGraphic->GetType() != GraphicType::NONE ) ) { SvMemoryStream aMem; @@ -205,7 +205,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL Graphic::getMaskDIB( ) throw (uno::Runtime { SolarMutexGuard aGuard; - if( mpGraphic && ( mpGraphic->GetType() != GRAPHIC_NONE ) ) + if( mpGraphic && ( mpGraphic->GetType() != GraphicType::NONE ) ) { SvMemoryStream aMem; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 18e75d58916a..3a37dbb03983 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -69,7 +69,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) switch( rGraphic.GetType() ) { - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(rGraphic.getSvgData().get()) { @@ -102,7 +102,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) } break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { const GDIMetaFile& rMtf = rGraphic.GetGDIMetaFile(); @@ -227,7 +227,7 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) switch( rGraphic.GetType() ) { - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(rGraphic.getSvgData().get()) { @@ -244,7 +244,7 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) } break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { mpMtf = new GDIMetaFile( rGraphic.GetGDIMetaFile() ); } @@ -273,7 +273,7 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() ); const Link<Animation*,void> aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() ); const GraphicType eOldType = rSubstitute.GetType(); - const bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); + const bool bDefaultType = ( rSubstitute.GetType() == GraphicType::Default ); if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) ) maGfxLink = rSubstitute.GetLink(); @@ -299,7 +299,7 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) rSubstitute.Clear(); } - if( eOldType != GRAPHIC_NONE ) + if( eOldType != GraphicType::NONE ) { rSubstitute.SetPrefSize( aPrefSize ); rSubstitute.SetPrefMapMode( aPrefMapMode ); @@ -759,9 +759,9 @@ sal_uLong GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Poi const GraphicType eType = rGraphic.GetType(); bool canCacheAsBitmap = false; - if( GRAPHIC_BITMAP == eType ) + if( GraphicType::Bitmap == eType ) canCacheAsBitmap = true; - else if( GRAPHIC_GDIMETAFILE == eType ) + else if( GraphicType::GdiMetafile == eType ) canCacheAsBitmap = IsCacheableAsBitmap( rGraphic.GetGDIMetaFile(), pOut, rSz ); else return 0; @@ -847,9 +847,9 @@ void GraphicCache::AddGraphicObject( if( !rObj.IsSwappedOut() && ( pID || ( pCopyObj - && ( pCopyObj->GetType() != GRAPHIC_NONE ) + && ( pCopyObj->GetType() != GraphicType::NONE ) ) - || ( rObj.GetType() != GRAPHIC_NONE ) + || ( rObj.GetType() != GraphicType::NONE ) ) ) { diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 064b77a15666..42b2799f1d5e 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -249,7 +249,7 @@ void GraphicObject::ImplAutoSwapIn() if( pIStm ) { ReadGraphic( *pIStm, maGraphic ); - mbAutoSwapped = ( maGraphic.GetType() != GRAPHIC_NONE ); + mbAutoSwapped = ( maGraphic.GetType() != GraphicType::NONE ); } } } @@ -266,7 +266,7 @@ void GraphicObject::ImplAutoSwapIn() } else { - DBG_ASSERT( ( GRAPHIC_NONE == meType ) || ( GRAPHIC_DEFAULT == meType ), + DBG_ASSERT( ( GraphicType::NONE == meType ) || ( GraphicType::Default == meType ), "GraphicObject::ImplAutoSwapIn: could not get stream to swap in graphic! (=>KA)" ); } } @@ -285,7 +285,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz { bool bRet = false; - if( GetType() != GRAPHIC_NONE ) + if( GetType() != GraphicType::NONE ) { tools::Polygon aClipPoly( Rectangle( rPt, rSz ) ); const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600; @@ -728,7 +728,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo Size aCropLeftTop; Size aCropRightBottom; - if( GRAPHIC_GDIMETAFILE == eType ) + if( GraphicType::GdiMetafile == eType ) { GDIMetaFile aMtf( aTransGraphic.GetGDIMetaFile() ); @@ -797,7 +797,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo aTransGraphic = aMtf; } - else if( GRAPHIC_BITMAP == eType ) + else if( GraphicType::Bitmap == eType ) { BitmapEx aBitmapEx( aTransGraphic.GetBitmapEx() ); Rectangle aCropRect; @@ -953,7 +953,7 @@ Graphic GraphicObject::GetTransformedGraphic( const GraphicAttr* pAttr ) const / { if( aAttr.IsSpecialDrawMode() || aAttr.IsAdjusted() || aAttr.IsMirrored() || aAttr.IsRotated() || aAttr.IsTransparent() ) { - if( GetType() == GRAPHIC_BITMAP ) + if( GetType() == GraphicType::Bitmap ) { if( IsAnimated() ) { @@ -978,7 +978,7 @@ Graphic GraphicObject::GetTransformedGraphic( const GraphicAttr* pAttr ) const / } else { - if( ( GetType() == GRAPHIC_BITMAP ) && IsAnimated() ) + if( ( GetType() == GraphicType::Bitmap ) && IsAnimated() ) { Animation aAnimation( maGraphic.GetAnimation() ); aAnimation.SetLoopCount( mnAnimationLoopCount ); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 1f934f786c69..457d71f056ff 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -92,7 +92,7 @@ bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rCached = false; - if( ( rObj.GetType() == GRAPHIC_BITMAP ) || ( rObj.GetType() == GRAPHIC_GDIMETAFILE ) ) + if( ( rObj.GetType() == GraphicType::Bitmap ) || ( rObj.GetType() == GraphicType::GdiMetafile ) ) { // create output and fill cache @@ -245,7 +245,7 @@ bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, if( rGraphic.IsSupportedGraphic() && !rObj.IsSwappedOut() ) { - if( GRAPHIC_BITMAP == rGraphic.GetType() ) + if( GraphicType::Bitmap == rGraphic.GetType() ) { const BitmapEx aSrcBmpEx( rGraphic.GetBitmapEx() ); @@ -1891,7 +1891,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c // #i42643# Casting to Int64, to avoid integer overflow for // huge-DPI output devices - if( GetGraphic().GetType() == GRAPHIC_BITMAP && + if( GetGraphic().GetType() == GraphicType::Bitmap && static_cast<sal_Int64>(rSizePixel.Width()) * rSizePixel.Height() < static_cast<sal_Int64>(nTileCacheSize1D)*nTileCacheSize1D ) { @@ -1996,7 +1996,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, int nX, nY; // #107607# Use logical coordinates for metafile playing, too - bool bDrawInPixel( rOut.GetConnectMetaFile() == nullptr && GRAPHIC_BITMAP == GetType() ); + bool bDrawInPixel( rOut.GetConnectMetaFile() == nullptr && GraphicType::Bitmap == GetType() ); bool bRet = false; // #105229# Switch off mapping (converting to logic and back to diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 57ed103ed18f..321818fca2fe 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -478,7 +478,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co if( ( rFilter.ImportGraphic( aVCLGraphic, aPath, *pIStm, GRFILTER_FORMAT_DONTKNOW, nullptr, GraphicFilterImportFlags::NONE, pExtHeader ) == GRFILTER_OK ) && - ( aVCLGraphic.GetType() != GRAPHIC_NONE ) ) + ( aVCLGraphic.GetType() != GraphicType::NONE ) ) { ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic; @@ -602,7 +602,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal else if (aName == "ImageResolution") aValue >>= nImageResolution; } - if ( rGraphic.GetType() == GRAPHIC_BITMAP ) + if ( rGraphic.GetType() == GraphicType::Bitmap ) { if(rGraphic.getSvgData().get()) { @@ -623,7 +623,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal ImplApplyBitmapScaling( rGraphic, nPixelWidth, nPixelHeight ); } } - else if ( ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) && nImageResolution ) + else if ( ( rGraphic.GetType() == GraphicType::GdiMetafile ) && nImageResolution ) { ScopedVclPtrInstance< VirtualDevice > aDummyVDev; GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() ); @@ -812,7 +812,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG const uno::Reference< XInterface > xIFace( rxGraphic, uno::UNO_QUERY ); const ::Graphic* pGraphic = ::unographic::Graphic::getImplementation( xIFace ); - if( pGraphic && ( pGraphic->GetType() != GRAPHIC_NONE ) ) + if( pGraphic && ( pGraphic->GetType() != GraphicType::NONE ) ) { ::Graphic aGraphic( *pGraphic ); ImplApplyFilterData( aGraphic, aFilterDataSeq ); diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx index fbfdfa30516e..0de58a36dd84 100644 --- a/svtools/source/graphic/transformer.cxx +++ b/svtools/source/graphic/transformer.cxx @@ -81,7 +81,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::colorChange( BitmapColor aColorTo( static_cast< sal_uInt8 >( nColorTo ), static_cast< sal_uInt8 >( nColorTo >> 8 ), static_cast< sal_uInt8 >( nColorTo >> 16 ) ); const sal_uInt8 cIndexFrom = aColorFrom.GetBlueOrIndex(); - if ( aGraphic.GetType() == GRAPHIC_BITMAP || aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) + if ( aGraphic.GetType() == GraphicType::Bitmap || aGraphic.GetType() == GraphicType::GdiMetafile ) { BitmapEx aBitmapEx( aGraphic.GetBitmapEx() ); Bitmap aBitmap( aBitmapEx.GetBitmap() ); diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index f21d861d759f..18305d8acd97 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -709,7 +709,7 @@ bool TransferableHelper::SetGDIMetaFile( const GDIMetaFile& rMtf, const DataFlav bool TransferableHelper::SetGraphic( const Graphic& rGraphic, const DataFlavor& ) { - if( rGraphic.GetType() != GRAPHIC_NONE ) + if( rGraphic.GetType() != GraphicType::NONE ) { SvMemoryStream aMemStm( 65535, 65535 ); diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index 782b804784b8..5b7a3daa7899 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -462,7 +462,7 @@ void TransferDataContainer::CopyImageMap( const ImageMap& rImgMap ) void TransferDataContainer::CopyGraphic( const Graphic& rGrf ) { GraphicType nType = rGrf.GetType(); - if( GRAPHIC_NONE != nType ) + if( GraphicType::NONE != nType ) { if( !pImpl->pGrf ) pImpl->pGrf = new Graphic( rGrf ); @@ -471,12 +471,12 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf ) AddFormat( SotClipboardFormatId::SVXB ); - if( GRAPHIC_BITMAP == nType ) + if( GraphicType::Bitmap == nType ) { AddFormat( SotClipboardFormatId::PNG ); AddFormat( SotClipboardFormatId::BITMAP ); } - else if( GRAPHIC_GDIMETAFILE == nType ) + else if( GraphicType::GdiMetafile == nType ) { AddFormat( SotClipboardFormatId::GDIMETAFILE ); } diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index e9a7e4c0f229..f947e7aeb7e7 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -1016,7 +1016,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic ) switch( rGraphic.GetType() ) { - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if( rGraphic.IsAnimated() ) { @@ -1081,7 +1081,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic ) } break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { GDIMetaFile aMtf( aGraphic.GetGDIMetaFile() ); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 096511471c29..b27af8a111bd 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -108,7 +108,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic, Bitmap aBmp; XOutFlags nContourFlags = XOutFlags::ContourHorz; - if ( rGraphic.GetType() == GRAPHIC_BITMAP ) + if ( rGraphic.GetType() == GraphicType::Bitmap ) { if( rGraphic.IsAnimated() ) { @@ -148,7 +148,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic, nContourFlags |= XOutFlags::ContourEdgeDetect; } } - else if( rGraphic.GetType() != GRAPHIC_NONE ) + else if( rGraphic.GetType() != GraphicType::NONE ) { const Graphic aTmpGrf( rGraphic.GetGDIMetaFile().GetMonochromeMtf( Color( COL_BLACK ) ) ); ScopedVclPtrInstance< VirtualDevice > pVDev; @@ -352,7 +352,7 @@ void SvxSuperContourDlg::SetGraphic( const Graphic& rGraphic ) void SvxSuperContourDlg::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly ) { - DBG_ASSERT( m_pContourWnd->GetGraphic().GetType() != GRAPHIC_NONE, "Graphic must've been set first!" ); + DBG_ASSERT( m_pContourWnd->GetGraphic().GetType() != GraphicType::NONE, "Graphic must've been set first!" ); tools::PolyPolygon aPolyPoly( rPolyPoly ); const MapMode aMap100( MAP_100TH_MM ); @@ -423,12 +423,12 @@ void SvxSuperContourDlg::UpdateGraphic( const Graphic& rGraphic, bool _bGraphicL bool SvxSuperContourDlg::IsUndoPossible() const { - return aUndoGraphic.GetType() != GRAPHIC_NONE; + return aUndoGraphic.GetType() != GraphicType::NONE; } bool SvxSuperContourDlg::IsRedoPossible() const { - return aRedoGraphic.GetType() != GRAPHIC_NONE; + return aRedoGraphic.GetType() != GraphicType::NONE; } // Click handler for ToolBox @@ -613,7 +613,7 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, StateHdl, GraphCtrl*, pWnd, void ) const bool bPipette = m_pTbx1->IsItemChecked(mnPipetteId); const bool bWorkplace = m_pTbx1->IsItemChecked(mnWorkSpaceId); const bool bDontHide = !( bPipette || bWorkplace ); - const bool bBitmap = pWnd->GetGraphic().GetType() == GRAPHIC_BITMAP; + const bool bBitmap = pWnd->GetGraphic().GetType() == GraphicType::Bitmap; m_pTbx1->EnableItem(mnApplyId, bDontHide && bExecState && pWnd->IsChanged()); @@ -690,7 +690,7 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void EnterWait(); - if( aGraphic.GetType() == GRAPHIC_BITMAP ) + if( aGraphic.GetType() == GraphicType::Bitmap ) { Bitmap aBmp( aGraphic.GetBitmap() ); const long nTol = static_cast<long>(m_pMtfTolerance->GetValue() * 255L / 100L); diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index 6b560012db53..e0faf2d196e0 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -230,7 +230,7 @@ void ContourWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& r rTarget.DrawRect( Rectangle( Point(), GetGraphicSize() ) ); rTarget.Pop(); - if (rGraphic.GetType() != GRAPHIC_NONE) + if (rGraphic.GetType() != GraphicType::NONE) rGraphic.Draw(&rTarget, Point(), GetGraphicSize()); if (aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom()) diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 8dca9a941530..fac0708ce3fe 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -173,7 +173,7 @@ void GraphCtrl::InitSdrModel() void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel ) { // If possible we dither bitmaps for the display - if ( !bAnim && ( rGraphic.GetType() == GRAPHIC_BITMAP ) ) + if ( !bAnim && ( rGraphic.GetType() == GraphicType::Bitmap ) ) { if ( rGraphic.IsTransparent() ) { @@ -251,7 +251,7 @@ void GraphCtrl::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRec { // #i72889# used splitted repaint to be able to paint an own background // even to the buffered view - const bool bGraphicValid(GRAPHIC_NONE != aGraphic.GetType()); + const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType()); if (bSdrMode) { diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx index 7451f079df82..ce305c6f15b5 100644 --- a/svx/source/dialog/grfflt.cxx +++ b/svx/source/dialog/grfflt.cxx @@ -35,7 +35,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj const Graphic& rGraphic = rFilterObject.GetGraphic(); sal_uIntPtr nRet = SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE; - if( rGraphic.GetType() == GRAPHIC_BITMAP ) + if( rGraphic.GetType() == GraphicType::Bitmap ) { SfxViewFrame* pViewFrame = SfxViewFrame::Current(); SfxObjectShell* pShell = pViewFrame ? pViewFrame->GetObjectShell() : nullptr; @@ -262,7 +262,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj break; } - if( aGraphic.GetType() != GRAPHIC_NONE ) + if( aGraphic.GetType() != GraphicType::NONE ) { rFilterObject.SetGraphic( aGraphic ); nRet = SVX_GRAPHICFILTER_ERRCODE_NONE; diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 0b71adc0f7ba..f7c86ab81f0e 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -494,7 +494,7 @@ void GalleryTransferable::AddSupportedFormats() { AddFormat( SotClipboardFormatId::SVXB ); - if( mpGraphicObject->GetType() == GRAPHIC_GDIMETAFILE ) + if( mpGraphicObject->GetType() == GraphicType::GdiMetafile ) { AddFormat( SotClipboardFormatId::GDIMETAFILE ); AddFormat( SotClipboardFormatId::BITMAP ); diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 81393ea2098d..d83c1e747960 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -93,7 +93,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) { bool bRet = false; - if( rGraphic.GetType() == GRAPHIC_BITMAP ) + if( rGraphic.GetType() == GraphicType::Bitmap ) { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); Size aBmpSize( aBmpEx.GetSizePixel() ); @@ -144,7 +144,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) } } } - else if( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) + else if( rGraphic.GetType() == GraphicType::GdiMetafile ) { const Size aPrefSize( rGraphic.GetPrefSize() ); const double fFactor = (double)aPrefSize.Width() / (double)aPrefSize.Height(); diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index bd3ea97c6e7f..507d990c36b3 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -843,7 +843,7 @@ bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPo { bool bRet = false; - if( rGraphic.GetType() != GRAPHIC_NONE ) + if( rGraphic.GetType() != GraphicType::NONE ) { ConvertDataFormat nExportFormat = ConvertDataFormat::Unknown; const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() ); @@ -872,7 +872,7 @@ bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPo } else { - if( rGraphic.GetType() == GRAPHIC_BITMAP ) + if( rGraphic.GetType() == GraphicType::Bitmap ) { if( rGraphic.IsAnimated() ) nExportFormat = ConvertDataFormat::GIF; diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index e76f47d704a5..ba0988978df7 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -426,7 +426,7 @@ namespace sdr return true; // draft when no graphic - if(GRAPHIC_NONE == rGraphicObject.GetType() || GRAPHIC_DEFAULT == rGraphicObject.GetType()) + if(GraphicType::NONE == rGraphicObject.GetType() || GraphicType::Default == rGraphicObject.GetType()) return true; return false; diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 79fdbf9f61fd..0452910b5e5a 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -629,7 +629,7 @@ namespace drawinglayer { Graphic aGraphic(static_cast<const XFillBitmapItem&>(rSet.Get(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic()); - if(!(GRAPHIC_BITMAP == aGraphic.GetType() || GRAPHIC_GDIMETAFILE == aGraphic.GetType())) + if(!(GraphicType::Bitmap == aGraphic.GetType() || GraphicType::GdiMetafile == aGraphic.GetType())) { // no content if not bitmap or metafile OSL_ENSURE(false, "No fill graphic in SfxItemSet (!)"); @@ -641,7 +641,7 @@ namespace drawinglayer if(!aPrefSize.Width() || !aPrefSize.Height()) { // if there is no logical size, create a size from pixel size and set MapMode accordingly - if(GRAPHIC_BITMAP == aGraphic.GetType()) + if(GraphicType::Bitmap == aGraphic.GetType()) { aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel()); aGraphic.SetPrefMapMode(MAP_PIXEL); diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index 235c0a62ec73..276f68d98452 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -51,14 +51,14 @@ namespace drawinglayer } } #ifdef _WIN32 // Little point in displaying the "broken OLE" graphic on OSes that don't have real OLE, maybe? - if(GRAPHIC_NONE == aGraphic.GetType()) + if(GraphicType::NONE == aGraphic.GetType()) { // no source, use fallback resource empty OLE graphic aGraphic = SdrOle2Obj::GetEmptyOLEReplacementGraphic(); bScaleContent = true; } #endif - if(GRAPHIC_NONE != aGraphic.GetType()) + if(GraphicType::NONE != aGraphic.GetType()) { const GraphicObject aGraphicObject(aGraphic); const GraphicAttr aGraphicAttr; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index fc96f3d74f5c..2a636e190912 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -3787,7 +3787,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) // This part of code handles the case where pSdrObject is SdrGrafObj SdrGrafObj* pObj = dynamic_cast<SdrGrafObj*>( pSdrObject ); - if( !pObj || (pObj->GetGraphicType() == GRAPHIC_NONE) || (pObj->GetGraphicType() == GRAPHIC_DEFAULT) ) + if( !pObj || (pObj->GetGraphicType() == GraphicType::NONE) || (pObj->GetGraphicType() == GraphicType::Default) ) return false; const GraphicObject& rGraphicObject = pObj->GetGraphicObject(); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index c67599d3a8a3..6655c4f88f34 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -481,14 +481,14 @@ Graphic SdrGrafObj::GetTransformedGraphic( SdrGrafObjTransformsAttrs nTransformF const Size aDestSize( GetLogicRect().GetSize() ); const bool bMirror = bool( nTransformFlags & SdrGrafObjTransformsAttrs::MIRROR ); const bool bRotate = bool( nTransformFlags & SdrGrafObjTransformsAttrs::ROTATE ) && - ( aGeo.nRotationAngle && aGeo.nRotationAngle != 18000 ) && ( GRAPHIC_NONE != eType ); + ( aGeo.nRotationAngle && aGeo.nRotationAngle != 18000 ) && ( GraphicType::NONE != eType ); // Need cropping info earlier const_cast<SdrGrafObj*>(this)->ImpSetAttrToGrafInfo(); GraphicAttr aActAttr; if( SdrGrafObjTransformsAttrs::NONE != nTransformFlags && - GRAPHIC_NONE != eType ) + GraphicType::NONE != eType ) { // Actually transform the graphic only in this case. // Cropping always happens, though. @@ -595,8 +595,8 @@ void SdrGrafObj::ForceSwapIn() const pGraphic->FireSwapInRequest(); if( pGraphic->IsSwappedOut() || - ( pGraphic->GetType() == GRAPHIC_NONE ) || - ( pGraphic->GetType() == GRAPHIC_DEFAULT ) ) + ( pGraphic->GetType() == GraphicType::NONE ) || + ( pGraphic->GetType() == GraphicType::Default ) ) { Graphic aDefaultGraphic; aDefaultGraphic.SetDefaultType(); @@ -659,7 +659,7 @@ bool SdrGrafObj::IsLinkedGraphic() const void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { - bool bNoPresGrf = ( pGraphic->GetType() != GRAPHIC_NONE ) && !bEmptyPresObj; + bool bNoPresGrf = ( pGraphic->GetType() != GraphicType::NONE ) && !bEmptyPresObj; rInfo.bResizeFreeAllowed = aGeo.nRotationAngle % 9000 == 0 || aGeo.nRotationAngle % 18000 == 0 || @@ -733,7 +733,7 @@ OUString SdrGrafObj::TakeObjNameSingul() const { switch( pGraphic->GetType() ) { - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || static_cast<const SdrGrafTransparenceItem&>( GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) : @@ -743,11 +743,11 @@ OUString SdrGrafObj::TakeObjNameSingul() const } break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNameSingulGRAFMTFLNK : STR_ObjNameSingulGRAFMTF)); break; - case GRAPHIC_NONE: + case GraphicType::NONE: sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNameSingulGRAFNONELNK : STR_ObjNameSingulGRAFNONE)); break; @@ -786,7 +786,7 @@ OUString SdrGrafObj::TakeObjNamePlural() const { switch( pGraphic->GetType() ) { - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || static_cast<const SdrGrafTransparenceItem&>( GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) : @@ -796,11 +796,11 @@ OUString SdrGrafObj::TakeObjNamePlural() const } break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNamePluralGRAFMTFLNK : STR_ObjNamePluralGRAFMTF)); break; - case GRAPHIC_NONE: + case GraphicType::NONE: sName.append(ImpGetResStr(IsLinkedGraphic() ? STR_ObjNamePluralGRAFNONELNK : STR_ObjNamePluralGRAFNONE)); break; @@ -1027,12 +1027,12 @@ void SdrGrafObj::StartAnimation( OutputDevice* /*pOutDev*/, const Point& /*rPoin bool SdrGrafObj::HasGDIMetaFile() const { - return( pGraphic->GetType() == GRAPHIC_GDIMETAFILE ); + return( pGraphic->GetType() == GraphicType::GdiMetafile ); } bool SdrGrafObj::isEmbeddedSvg() const { - return GRAPHIC_BITMAP == GetGraphicType() && GetGraphic().getSvgData().get(); + return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getSvgData().get(); } GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const @@ -1073,16 +1073,16 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const // use the old converter path over the MetaFile mechanism. Create Metafile from Svg // primitives here pretty directly aMtf = getMetafileFromEmbeddedSvg(); - aGraphicType = GRAPHIC_GDIMETAFILE; + aGraphicType = GraphicType::GdiMetafile; } - else if(GRAPHIC_GDIMETAFILE == aGraphicType) + else if(GraphicType::GdiMetafile == aGraphicType) { aMtf = GetTransformedGraphic(SdrGrafObjTransformsAttrs::COLOR|SdrGrafObjTransformsAttrs::MIRROR).GetGDIMetaFile(); } switch(aGraphicType) { - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { // Sort into group and return ONLY those objects that can be created from the MetaFile. ImpSdrGDIMetaFileImport aFilter(*GetModel(), GetLayer(), maRect); @@ -1168,7 +1168,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const break; } - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { // create basic object and add fill pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText); @@ -1188,8 +1188,8 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const } break; } - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: { pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText); break; diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index c50cd7fee065..6e7cc853e543 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -455,7 +455,7 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked) const SdrObject* pGrafObjTmp = GetMarkedObjectByIndex( 0 ); SdrGrafObj* pGrafObj = dynamic_cast<SdrGrafObj*>( pGrafObjTmp ); - if( pGrafObj && ( pGrafObj->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pGrafObj && ( pGrafObj->GetGraphicType() == GraphicType::Bitmap ) ) { aBmp = pGrafObj->GetTransformedGraphic().GetBitmapEx(); } @@ -630,7 +630,7 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* } // if graphic could not be retrieved => go the hard way and create a MetaFile - if( ( GRAPHIC_NONE == aRet.GetType() ) || ( GRAPHIC_DEFAULT == aRet.GetType() ) ) + if( ( GraphicType::NONE == aRet.GetType() ) || ( GraphicType::Default == aRet.GetType() ) ) { ScopedVclPtrInstance< VirtualDevice > pOut; GDIMetaFile aMtf; diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 27b23b8840ff..c4a10e74d2ff 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -657,8 +657,8 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) SdrGrafObj* pObj = static_cast<SdrGrafObj*>( rMarkList.GetMark( 0 )->GetMarkedSdrObj() ); if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && - ( pObj->GetGraphicType() != GRAPHIC_NONE ) && - ( pObj->GetGraphicType() != GRAPHIC_DEFAULT ) ) + ( pObj->GetGraphicType() != GraphicType::NONE ) && + ( pObj->GetGraphicType() != GraphicType::Default ) ) { SfxItemSet aGrfAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, 0 ); const SfxMapUnit eOldMetric = rPool.GetMetric( 0 ); @@ -833,8 +833,8 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( i )->GetMarkedSdrObj() ); if( !pGrafObj || - ( pGrafObj->GetGraphicType() == GRAPHIC_NONE ) || - ( pGrafObj->GetGraphicType() == GRAPHIC_DEFAULT )) + ( pGrafObj->GetGraphicType() == GraphicType::NONE ) || + ( pGrafObj->GetGraphicType() == GraphicType::Default )) { bEnableColors = bEnableTransparency = bEnableCrop = false; break; diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 061ca7acfc59..8dd270a08969 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -834,7 +834,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && !static_cast<SdrGrafObj*>(pObj)->HasText() ) { aGraphic = static_cast<SdrGrafObj*>(pObj)->GetTransformedGraphic(); - if ( aGraphic.GetType() == GRAPHIC_BITMAP ) + if ( aGraphic.GetType() == GraphicType::Bitmap ) { Size aSizePixel( aGraphic.GetSizePixel() ); if( rSettings.mnWidth && rSettings.mnHeight && diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index fef98fb558c4..ca484bc93a1e 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -292,7 +292,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt const XFillBitmapItem& rBmpItm = static_cast< const XFillBitmapItem& >(rSourceSet.Get(XATTR_FILLBITMAP, bSearchInParents)); const Graphic aGraphic(rBmpItm.GetGraphicObject().GetGraphic()); - // continue idependent of evtl. GRAPHIC_NONE as aGraphic.GetType(), we still need to rescue positions + // continue idependent of evtl. GraphicType::NONE as aGraphic.GetType(), we still need to rescue positions SvxGraphicPosition aSvxGraphicPosition(GPOS_NONE); const XFillBmpStretchItem& rStretchItem = static_cast< const XFillBmpStretchItem& >(rSourceSet.Get(XATTR_FILLBMP_STRETCH, bSearchInParents)); const XFillBmpTileItem& rTileItem = static_cast< const XFillBmpTileItem& >(rSourceSet.Get(XATTR_FILLBMP_TILE, bSearchInParents)); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 246ec629ab38..1bf2fa472fbc 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1567,7 +1567,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxIte { const Graphic& rGraphic = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic(); - if(rGraphic.GetType() != GRAPHIC_GDIMETAFILE) + if(rGraphic.GetType() != GraphicType::GdiMetafile) { // pack object in a bitmap Reference< css::awt::XBitmap > xBitmap( VCLUnoHelper::CreateBitmap(static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic().GetBitmapEx()) ); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 28f6b4733dff..a7bbd7418cb6 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -102,7 +102,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) maTmp.EnableKillingFile(); - if( aGrfObject.GetType() != GRAPHIC_NONE ) + if( aGrfObject.GetType() != GraphicType::NONE ) { SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( maTmp.GetURL(), StreamMode::WRITE | StreamMode::TRUNC ); @@ -119,7 +119,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) } else { - if( aGraphic.GetType() == GRAPHIC_BITMAP ) + if( aGraphic.GetType() == GraphicType::Bitmap ) { GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); OUString aFormat; @@ -131,7 +131,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) bRet = ( rFilter.ExportGraphic( aGraphic, "", *pStm, rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 ); } - else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) + else if( aGraphic.GetType() == GraphicType::GdiMetafile ) { pStm->SetVersion( SOFFICE_FILEFORMAT_8 ); pStm->SetCompressMode( SvStreamCompressFlags::ZBITMAP ); @@ -277,7 +277,7 @@ void SAL_CALL SvXMLGraphicOutputStream::closeOutput() const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() { - if( mbClosed && ( maGrfObj.GetType() == GRAPHIC_NONE ) && mpOStm ) + if( mbClosed && ( maGrfObj.GetType() == GraphicType::NONE ) && mpOStm ) { Graphic aGraphic; @@ -335,7 +335,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() } maGrfObj = aGraphic; - if( maGrfObj.GetType() != GRAPHIC_NONE ) + if( maGrfObj.GetType() != GraphicType::NONE ) { delete mpOStm; mpOStm = nullptr; @@ -516,7 +516,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, GraphicObject aGrfObject( OUStringToOString(rGraphicId, RTL_TEXTENCODING_ASCII_US) ); bool bRet = false; - if( aGrfObject.GetType() != GRAPHIC_NONE ) + if( aGrfObject.GetType() != GraphicType::NONE ) { SvxGraphicHelperStream_Impl aStream( ImplGetGraphicStream( rPictureStorageName, rPictureStreamName ) ); if( aStream.xStream.is() ) @@ -566,7 +566,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, pStream->Write( aGfxLink.GetData(), aGfxLink.GetDataSize() ); else { - if( aGraphic.GetType() == GRAPHIC_BITMAP ) + if( aGraphic.GetType() == GraphicType::Bitmap ) { GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); OUString aFormat; @@ -579,7 +579,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, bRet = ( rFilter.ExportGraphic( aGraphic, "", *pStream, rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 ); } - else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) + else if( aGraphic.GetType() == GraphicType::GdiMetafile ) { pStream->SetVersion( SOFFICE_FILEFORMAT_8 ); pStream->SetCompressMode( SvStreamCompressFlags::ZBITMAP ); @@ -639,7 +639,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt { const GraphicObject aObj( ImplReadGraphic( aPictureStorageName, aPictureStreamName ) ); - if( aObj.GetType() != GRAPHIC_NONE ) + if( aObj.GetType() != GraphicType::NONE ) { maGrfObjs.push_back( aObj ); OUString aBaseURL( XML_GRAPHICOBJECT_URL_BASE ); @@ -655,7 +655,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt { const OString aAsciiObjectID(OUStringToOString(aPictureStreamName, RTL_TEXTENCODING_ASCII_US)); const GraphicObject aGrfObject( aAsciiObjectID ); - if( aGrfObject.GetType() != GRAPHIC_NONE ) + if( aGrfObject.GetType() != GraphicType::NONE ) { OUString aStreamName( aPictureStreamName ); Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() ); @@ -699,14 +699,14 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt } else { - if( aGrfObject.GetType() == GRAPHIC_BITMAP ) + if( aGrfObject.GetType() == GraphicType::Bitmap ) { if( aGrfObject.IsAnimated() ) aExtension = ".gif"; else aExtension = ".png"; } - else if( aGrfObject.GetType() == GRAPHIC_GDIMETAFILE ) + else if( aGrfObject.GetType() == GraphicType::GdiMetafile ) { // SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() ); diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 8750a2d15087..3cad60b39290 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -119,7 +119,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam const OUString& rFilterName, const XOutFlags nFlags, const Size* pMtfSize_100TH_MM ) { - if( rGraphic.GetType() != GRAPHIC_NONE ) + if( rGraphic.GetType() != GraphicType::NONE ) { INetURLObject aURL( rFileName ); Graphic aGraphic; @@ -177,7 +177,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam if( ( nFlags & XOutFlags::UseNativeIfPossible ) && !( nFlags & XOutFlags::MirrorHorz ) && !( nFlags & XOutFlags::MirrorVert ) && - ( rGraphic.GetType() != GRAPHIC_GDIMETAFILE ) && rGraphic.IsLink() ) + ( rGraphic.GetType() != GraphicType::GdiMetafile ) && rGraphic.IsLink() ) { // try to write native link const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() ); @@ -249,7 +249,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam aGraphic = rGraphic; else { - if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GRAPHIC_BITMAP ) ) + if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); @@ -282,7 +282,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } else { - if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GRAPHIC_BITMAP ) ) + if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) ); @@ -310,7 +310,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam aGraphic = MirrorGraphic( aGraphic, nBmpMirrorFlags ); } - if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) ) + if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GraphicType::NONE ) ) { if( !(nFlags & XOutFlags::DontAddExtension) ) aURL.setExtension( aExt ); diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 9fc5d04cb8ed..3e8dbf75ab6b 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -481,11 +481,11 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) if( bSetURL ) { GraphicObject aGraphicObject = GraphicObject::CreateGraphicObjectFromURL(aURL); - if( aGraphicObject.GetType() != GRAPHIC_NONE ) + if( aGraphicObject.GetType() != GraphicType::NONE ) maGraphicObject = aGraphicObject; // #121194# Prefer GraphicObject over bitmap object if both are provided - if(bSetBitmap && GRAPHIC_NONE != maGraphicObject.GetType()) + if(bSetBitmap && GraphicType::NONE != maGraphicObject.GetType()) { bSetBitmap = false; } diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index d918b5696148..47afea423e08 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -601,7 +601,7 @@ public: const GraphicObject* GetGraphicObj() const; bool IsLinkedGrfSwapOut() const; - sal_uInt16 GetGraphicType() const; + GraphicType GetGraphicType() const; const tools::PolyPolygon *GetGraphicPolygon() const; void SetGraphicPolygon( const tools::PolyPolygon *pPoly ); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index b32f3b857060..9ce7d1ec6647 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -189,7 +189,7 @@ void Test::testLinkedGraphicRT() } const GraphicObject& rGraphicObj = pGrfNode->GetGrfObj(true); CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), !rGraphicObj.IsSwappedOut()); - CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), GRAPHIC_BITMAP, rGraphicObj.GetType()); + CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), int(GraphicType::Bitmap), int(rGraphicObj.GetType())); CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), static_cast<sal_uLong>(864900), rGraphicObj.GetSizeBytes()); bImageFound = true; } diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 4f8ec0e227b0..4491f11f734c 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -77,10 +77,10 @@ DECLARE_HTMLIMPORT_TEST(testInlinedImage, "inlined_image.html") if (SwGrfNode *pGrfNode = pNode->GetGrfNode()) { // FIXME? For some reason without the fix in 72703173066a2db5c977d422ace - // I was getting GRAPHIC_NONE from SwEditShell::GetGraphicType() when + // I was getting GraphicType::NONE from SwEditShell::GetGraphicType() when // running LibreOffice but cannot reproduce that in a unit test here. :-( // So, this does not really test anything. - CPPUNIT_ASSERT(pGrfNode->GetGrfObj().GetType() != GRAPHIC_NONE); + CPPUNIT_ASSERT(pGrfNode->GetGrfObj().GetType() != GraphicType::NONE); break; } } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index d391bfa4534c..acf0a32a341e 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -889,8 +889,8 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr } // #i85717#, #i90395# - check, if asynchronous retrieval // if input stream for the graphic is possible - else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT || - rGrfObj.GetType() == GRAPHIC_NONE ) && + else if ( ( rGrfObj.GetType() == GraphicType::Default || + rGrfObj.GetType() == GraphicType::NONE ) && pGrfNd->IsLinkedFile() && pGrfNd->IsAsyncRetrieveInputStreamPossible() ) { @@ -957,7 +957,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr { sal_uInt16 nResId = 0; - if( GRAPHIC_NONE == rGrfObj.GetType() ) + if( GraphicType::NONE == rGrfObj.GetType() ) nResId = STR_COMCORE_READERROR; else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() ) nResId = STR_COMCORE_CANT_SHOW; @@ -1031,7 +1031,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr Size aSize(aAlignedGrfArea.SSize()); const Graphic* pGraphic = pOLENd->GetGraphic(); - if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE ) + if ( pGraphic && pGraphic->GetType() != GraphicType::NONE ) { pGraphic->Draw( pOut, aPosition, aSize ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index fbe68e41ea15..d823ea5a12ed 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -148,12 +148,12 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) Graphic aGrf; if( sfx2::LinkManager::GetGraphicFromAny( rMimeType, rValue, aGrf ) && - ( GRAPHIC_DEFAULT != aGrf.GetType() || - GRAPHIC_DEFAULT != rGrfObj.GetType() ) ) + ( GraphicType::Default != aGrf.GetType() || + GraphicType::Default != rGrfObj.GetType() ) ) { aGrfSz = ::GetGraphicSizeTwip( aGrf, nullptr ); - if( bGraphicPieceArrived && GRAPHIC_DEFAULT != aGrf.GetType() && + if( bGraphicPieceArrived && GraphicType::Default != aGrf.GetType() && ( !aOldSz.Width() || !aOldSz.Height() ) ) { // If only a part arrives, but the size is not set @@ -237,7 +237,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if( pBLink != this && ( !bSwapIn || - GRAPHIC_DEFAULT == pGrfNd->GetGrfObj().GetType())) + GraphicType::Default == pGrfNd->GetGrfObj().GetType())) { Size aPreArriveSize(pGrfNd->GetTwipSize()); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 894614ea5fe7..43aa82fab6e2 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -237,7 +237,7 @@ const Graphic* SwEditShell::GetGraphic( bool bWait ) const const Graphic* pGrf( nullptr ); if ( pGrfNode ) { - pGrf = &(pGrfNode->GetGrf(bWait && GRAPHIC_DEFAULT == pGrfNode->GetGrf().GetType())); + pGrf = &(pGrfNode->GetGrf(bWait && GraphicType::Default == pGrfNode->GetGrf().GetType())); } return pGrf; } @@ -247,7 +247,7 @@ bool SwEditShell::IsLinkedGrfSwapOut() const SwGrfNode *pGrfNode = GetGrfNode_(); return pGrfNode && ( pGrfNode->IsLinkedFile() && - ( GRAPHIC_DEFAULT == pGrfNode->GetGrfObj().GetType() || + ( GraphicType::Default == pGrfNode->GetGrfObj().GetType() || pGrfNode->GetGrfObj().IsSwappedOut())); } @@ -257,10 +257,10 @@ const GraphicObject* SwEditShell::GetGraphicObj() const return pGrfNode ? &(pGrfNode->GetGrfObj()) : nullptr; } -sal_uInt16 SwEditShell::GetGraphicType() const +GraphicType SwEditShell::GetGraphicType() const { SwGrfNode *pGrfNode = GetGrfNode_(); - return static_cast<sal_uInt16>(pGrfNode ? pGrfNode->GetGrfObj().GetType() : GRAPHIC_NONE); + return pGrfNode ? pGrfNode->GetGrfObj().GetType() : GraphicType::NONE; } // returns the size of a graphic in <rSz> if CurrentCursor->GetPoint() points to a SwGrfNode and @@ -585,7 +585,7 @@ Graphic SwEditShell::GetIMapGraphic() const if( rNd.IsGrfNode() ) { SwGrfNode & rGrfNode(static_cast<SwGrfNode&>(rNd)); - aRet = rGrfNode.GetGrf(GRAPHIC_DEFAULT == rGrfNode.GetGrf().GetType()); + aRet = rGrfNode.GetGrf(GraphicType::Default == rGrfNode.GetGrf().GetType()); } else if ( rNd.IsOLENode() ) { diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 5506cb9b8e58..b5ebf1502225 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1213,7 +1213,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf ) Graphic aGrf( *pGrf ); if( SotClipboardFormatId::GDIMETAFILE == nFormat ) { - if( GRAPHIC_BITMAP != aGrf.GetType() ) + if( GraphicType::Bitmap != aGrf.GetType() ) { rGrf = aGrf; bConvert = false; @@ -1240,7 +1240,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf ) rGrf = aMtf; } } - else if( GRAPHIC_BITMAP == aGrf.GetType() ) + else if( GraphicType::Bitmap == aGrf.GetType() ) { rGrf = aGrf; bConvert = false; @@ -1468,7 +1468,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt ) // for SdrGrafObj, use the graphic as fill style argument const Graphic& rGraphic = pSdrGrafObj->GetGraphic(); - if(GRAPHIC_NONE != rGraphic.GetType() && GRAPHIC_DEFAULT != rGraphic.GetType()) + if(GraphicType::NONE != rGraphic.GetType() && GraphicType::Default != rGraphic.GetType()) { aSet.Put(XFillBitmapItem(OUString(), rGraphic)); aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index eabdb9f21bd6..7b513136c254 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -234,7 +234,7 @@ bool SwGrfNode::ReRead( bReadGrf = true; } // Was the graphic already loaded? - else if( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() ) + else if( !bNewGrf && GraphicType::NONE != maGrfObj.GetType() ) return true; else { @@ -523,15 +523,15 @@ bool SwGrfNode::SwapIn( bool bWaitForData ) if( pLink ) { - if( GRAPHIC_NONE == maGrfObj.GetType() || - GRAPHIC_DEFAULT == maGrfObj.GetType() ) + if( GraphicType::NONE == maGrfObj.GetType() || + GraphicType::Default == maGrfObj.GetType() ) { // link was not loaded yet if( pLink->SwapIn( bWaitForData ) ) { bRet = true; } - else if( GRAPHIC_DEFAULT == maGrfObj.GetType() ) + else if( GraphicType::Default == maGrfObj.GetType() ) { // no default bitmap anymore, thus re-paint delete mpReplacementGraphic; @@ -603,8 +603,8 @@ bool SwGrfNode::SwapIn( bool bWaitForData ) bool SwGrfNode::SwapOut() { - if( maGrfObj.GetType() != GRAPHIC_DEFAULT && - maGrfObj.GetType() != GRAPHIC_NONE && + if( maGrfObj.GetType() != GraphicType::Default && + maGrfObj.GetType() != GraphicType::NONE && !maGrfObj.IsSwappedOut() && !bInSwapIn ) { if( refLink.Is() ) @@ -900,7 +900,7 @@ SvStream* SwGrfNode::GetStreamForEmbedGrf( if ( !_refPics->hasByName( sStreamName ) || !_refPics->isStreamElement( sStreamName ) ) { - if ( GetGrfObj().GetType() != GRAPHIC_NONE ) + if ( GetGrfObj().GetType() != GraphicType::NONE ) { const sal_Int32 nExtPos = sStreamName.indexOf('.'); const OUString aExtStr = (nExtPos>=0) ? sStreamName.copy( nExtPos ) : OUString(); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 66c131d80f6d..65ba952f6245 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2476,7 +2476,7 @@ bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour, bGrfObjCreated = true; } OSL_ENSURE( pGrfObj, "SwFlyFrame::GetContour() - No Graphic/GraphicObject found at <SwNoTextNode>." ); - if ( pGrfObj && pGrfObj->GetType() != GRAPHIC_NONE ) + if ( pGrfObj && pGrfObj->GetType() != GraphicType::NONE ) { if( !pNd->HasContour() ) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index ff9dc0229d6a..a7e5a63db87b 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1794,7 +1794,7 @@ static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, // (3) intrinsic graphic is transparent OR intrinsic graphic doesn't exists if ( !_bNumberingGraphic && !_bBackgrdAlreadyDrawn && - ( _rGraphicObj.IsTransparent() || _rGraphicObj.GetType() == GRAPHIC_NONE ) + ( _rGraphicObj.IsTransparent() || _rGraphicObj.GetType() == GraphicType::NONE ) ) { lcl_implDrawGraphicBackgrd( _rBackgrdBrush, _pOut, _rAlignedPaintRect, _rGraphicObj, properties ); @@ -1991,7 +1991,7 @@ void DrawGraphic( referer = sh->GetMedium()->GetName(); } const Graphic* pGrf = pBrush->GetGraphic(referer); - if( pGrf && GRAPHIC_NONE != pGrf->GetType() ) + if( pGrf && GraphicType::NONE != pGrf->GetType() ) { ePos = pBrush->GetGraphicPos(); if( pGrf->IsSupportedGraphic() ) diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 8ce58c3a01d6..cb44b34033c6 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1731,7 +1731,7 @@ static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& r { if( rHTMLWrt.GetOrigFileName() ) GraphicURL = *rHTMLWrt.GetOrigFileName(); - if( aGraphic.GetType() == GRAPHIC_NONE || + if( aGraphic.GetType() == GraphicType::NONE || XOutBitmap::WriteGraphic( aGraphic, GraphicURL, "JPG", (XOutFlags::UseGifIfPossible| diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index b6eebc9f6d17..e0ee720cc0b0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3833,7 +3833,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat const Graphic& rGraphic(pGrfNode->GetGrf()); // If there is no graphic there is not much point in parsing it - if (rGraphic.GetType()==GRAPHIC_NONE) + if (rGraphic.GetType()==GraphicType::NONE) return; ConvertDataFormat aConvertDestinationFormat = ConvertDataFormat::WMF; @@ -3885,9 +3885,9 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat if (!pGraphicAry) { if (ERRCODE_NONE == GraphicConverter::Export(aStream, rGraphic, - (eGraphicType == GRAPHIC_BITMAP) ? ConvertDataFormat::PNG : ConvertDataFormat::WMF)) + (eGraphicType == GraphicType::Bitmap) ? ConvertDataFormat::PNG : ConvertDataFormat::WMF)) { - pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ? + pBLIPType = (eGraphicType == GraphicType::Bitmap) ? OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; aStream.Seek(STREAM_SEEK_TO_END); nSize = aStream.Tell(); @@ -3895,7 +3895,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } } - Size aMapped(eGraphicType == GRAPHIC_BITMAP ? rGraphic.GetSizePixel() : rGraphic.GetPrefSize()); + Size aMapped(eGraphicType == GraphicType::Bitmap ? rGraphic.GetSizePixel() : rGraphic.GetPrefSize()); const SwCropGrf& rCr = static_cast<const SwCropGrf&>(pGrfNode->GetAttr(RES_GRFATR_CROPGRF)); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 37cb677378e2..9d7c88de6003 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -3058,7 +3058,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj // correction of fix for issue #i10939#: // One of the two conditions have to be true to insert the graphic // as a linked graphic - - if (GRAPHIC_NONE == eType || CanUseRemoteLink(aGrfName)) + if (GraphicType::NONE == eType || CanUseRemoteLink(aGrfName)) { pRetFrameFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, aGrfName, OUString(), nullptr, &rFlySet, &aGrSet, nullptr); diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 56a0b76b4413..940d3a3710de 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -295,8 +295,8 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, pFormat = m_rDoc.getIDocumentContentOperations().InsertDrawObj(*m_pPaM, *pRet, *pFlySet ); } else if ( - GRAPHIC_GDIMETAFILE == aGraph.GetType() || - GRAPHIC_BITMAP == aGraph.GetType() + GraphicType::GdiMetafile == aGraph.GetType() || + GraphicType::Bitmap == aGraph.GetType() ) { pFormat = m_rDoc.getIDocumentContentOperations().Insert(*m_pPaM, OUString(), OUString(), &aGraph, pFlySet, @@ -404,8 +404,8 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, } } - if (GRAPHIC_GDIMETAFILE == rGraph.GetType() || - GRAPHIC_BITMAP == rGraph.GetType()) + if (GraphicType::GdiMetafile == rGraph.GetType() || + GraphicType::Bitmap == rGraph.GetType()) { ::SetProgressState(m_nProgress, m_pDocShell); // Update diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx index ec9c2cbb4971..8c69be9d56a7 100644 --- a/sw/source/filter/xml/xmlbrsh.cxx +++ b/sw/source/filter/xml/xmlbrsh.cxx @@ -121,7 +121,7 @@ SvXMLImportContext *SwXMLBrushItemImportContext::CreateChildContext( if( !xBase64Stream.is() && pItem->GetGraphicLink().isEmpty() ) { const GraphicObject *pGrObj = pItem->GetGraphicObject(); - if( !pGrObj || GRAPHIC_NONE == pGrObj->GetType() ) + if( !pGrObj || GraphicType::NONE == pGrObj->GetType() ) { xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64(); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 8b7a175b82db..ecd238d24af7 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2596,8 +2596,8 @@ IMPL_LINK_NOARG_TYPED(SwGrfExtPage, BrowseHdl, Button*, void) (void)GraphicFilter::LoadGraphic(pGrfDlg->GetPath(), OUString(), aGraphic); m_pBmpWin->SetGraphic(aGraphic); - bool bEnable = GRAPHIC_BITMAP == aGraphic.GetType() || - GRAPHIC_GDIMETAFILE == aGraphic.GetType(); + bool bEnable = GraphicType::Bitmap == aGraphic.GetType() || + GraphicType::GdiMetafile == aGraphic.GetType(); m_pMirrorVertBox->Enable(bEnable); m_pMirrorHorzBox->Enable(bEnable); m_pAllPagesRB->Enable(bEnable); diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index d20fa3b880ae..533c7b1e4888 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -180,7 +180,7 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet) { int nSelType = m_pWrtSh->GetSelectionType(); if( ( nSelType & nsSelectionType::SEL_GRF ) || - ( nSelType & nsSelectionType::SEL_OLE && GRAPHIC_NONE != + ( nSelType & nsSelectionType::SEL_OLE && GraphicType::NONE != m_pWrtSh->GetIMapGraphic().GetType() )) bShowCB = true; } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ab8d5f476290..10c4f2d6235d 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2265,7 +2265,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, if(rData.GetSotStorageStream(SotClipboardFormatId::SVXB, xStm)) { ReadGraphic( *xStm, aGraphic ); - bRet = (GRAPHIC_NONE != aGraphic.GetType() && GRAPHIC_DEFAULT != aGraphic.GetType()); + bRet = (GraphicType::NONE != aGraphic.GetType() && GraphicType::Default != aGraphic.GetType()); } break; diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 551d92200942..7edbca93dc7d 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -166,7 +166,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) { Graphic aGrf( rSh.GetIMapGraphic() ); GraphicType nGrfType = aGrf.GetType(); - void* pEditObj = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType + void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType ? rSh.GetIMapInventor() : nullptr; std::unique_ptr<TargetList> pList(new TargetList); rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); @@ -182,7 +182,7 @@ static bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel ) { Graphic aGraf( rSh.GetIMapGraphic() ); GraphicType nGrfType = aGraf.GetType(); - bool bRet = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType; + bool bRet = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType; if( bRet ) { OUString aGrfName; @@ -1233,10 +1233,10 @@ void SwBaseShell::Execute(SfxRequest &rReq) IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void) { - sal_uInt16 nGrfType; + GraphicType nGrfType; SwWrtShell &rSh = GetShell(); if( CNT_GRF == rSh.SwEditShell::GetCntType() && - GRAPHIC_NONE != ( nGrfType = rSh.GetGraphicType() ) && + GraphicType::NONE != ( nGrfType = rSh.GetGraphicType() ) && !aGrfUpdateSlots.empty() ) { bool bProtect = FlyProtectFlags::NONE != rSh.IsSelObjProtected(FlyProtectFlags::Content|FlyProtectFlags::Parent); @@ -1311,7 +1311,7 @@ IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void) case SID_GRFFILTER_POPART: case SID_GRFFILTER_SEPIA: case SID_GRFFILTER_SOLARIZE: - bSetState = bState = GRAPHIC_BITMAP == nGrfType; + bSetState = bState = GraphicType::Bitmap == nGrfType; break; } @@ -1444,7 +1444,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if ( !bHas && ( !bFrameSel || ( bIsGraphicSelection && - rSh.GetGraphicType() == GRAPHIC_NONE ) ) ) + rSh.GetGraphicType() == GraphicType::NONE ) ) ) { rSet.DisableItem( nWhich ); } @@ -1531,9 +1531,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) // #i75481# // apply fix #i59688# only for selected graphics if ( nSel & nsSelectionType::SEL_GRF ) - bDisable = GRAPHIC_NONE == rSh.GetGraphicType(); + bDisable = GraphicType::NONE == rSh.GetGraphicType(); else - bDisable = GRAPHIC_NONE == rSh.GetIMapGraphic().GetType(); + bDisable = GraphicType::NONE == rSh.GetIMapGraphic().GetType(); } if( bDisable ) @@ -1718,7 +1718,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) // #i102253# applied patch from OD (see task) bDisable = nSel & nsSelectionType::SEL_FRM || - GRAPHIC_NONE == rSh.GetIMapGraphic().GetType(); + GraphicType::NONE == rSh.GetIMapGraphic().GetType(); } } bSet = !bDisable && rWrap.IsContour(); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index a056e9af88e8..ae5f8388725d 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -494,10 +494,10 @@ void SwGrfShell::Execute(SfxRequest &rReq) void SwGrfShell::ExecAttr( SfxRequest &rReq ) { - sal_uInt16 nGrfType; + GraphicType nGrfType; if( CNT_GRF == GetShell().GetCntType() && - ( GRAPHIC_BITMAP == ( nGrfType = GetShell().GetGraphicType()) || - GRAPHIC_GDIMETAFILE == nGrfType )) + ( GraphicType::Bitmap == ( nGrfType = GetShell().GetGraphicType()) || + GraphicType::GdiMetafile == nGrfType )) { SfxItemSet aGrfSet( GetShell().GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END -1 ); @@ -620,7 +620,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) case SID_GRFFILTER_POPART: case SID_GRFFILTER_SEPIA: case SID_GRFFILTER_SOLARIZE: - if( GRAPHIC_BITMAP == nGrfType ) + if( GraphicType::Bitmap == nGrfType ) { // #119353# - robust const GraphicObject* pFilterObj( GetShell().GetGraphicObj() ); @@ -676,7 +676,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) case SID_SAVE_GRAPHIC: case SID_EXTERNAL_EDIT: - if( rSh.GetGraphicType() == GRAPHIC_NONE ) + if( rSh.GetGraphicType() == GraphicType::NONE ) bDisable = true; break; @@ -758,7 +758,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) if ( pGrafObj ) { if( pGrafObj->IsAnimated() || - GRAPHIC_GDIMETAFILE == pGrafObj->GetType() ) + GraphicType::GdiMetafile == pGrafObj->GetType() ) bDisable = true; else rSet.Put( SfxUInt16Item( nWhich, static_cast<const SwTransparencyGrf&>( @@ -797,9 +797,9 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) // #i59688# load graphic only if type is unknown else { - const sal_uInt16 eGraphicType( rSh.GetGraphicType() ); - if ( ( eGraphicType == GRAPHIC_NONE || - eGraphicType == GRAPHIC_DEFAULT ) && + const GraphicType eGraphicType( rSh.GetGraphicType() ); + if ( ( eGraphicType == GraphicType::NONE || + eGraphicType == GraphicType::Default ) && rSh.IsLinkedGrfSwapOut() ) { rSet.DisableItem( nWhich ); @@ -808,7 +808,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) } else { - bDisable = eGraphicType != GRAPHIC_BITMAP; + bDisable = eGraphicType != GraphicType::Bitmap; } } } @@ -817,7 +817,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) case SID_OBJECT_CROP: { bDisable = FlyProtectFlags::NONE != rSh.IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ); - if( rSh.GetGraphicType() == GRAPHIC_NONE ) + if( rSh.GetGraphicType() == GraphicType::NONE ) bDisable = true; } break; @@ -909,7 +909,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) { case SID_ROTATE_GRAPHIC_LEFT: case SID_ROTATE_GRAPHIC_RIGHT: - if( rShell.GetGraphicType() == GRAPHIC_NONE ) + if( rShell.GetGraphicType() == GraphicType::NONE ) { bDisable = true; } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 2fc190ba9110..aff8f04c9855 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -821,7 +821,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r sal_Int32 nLogicalWidth = rConfigItem.ReadInt32( "LogicalWidth", 0 ); sal_Int32 nLogicalHeight = rConfigItem.ReadInt32( "LogicalHeight", 0 ); - if ( rGraphic.GetType() != GRAPHIC_NONE ) + if ( rGraphic.GetType() != GraphicType::NONE ) { sal_Int32 nMode = rConfigItem.ReadInt32( "ExportMode", -1 ); @@ -843,7 +843,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r nLogicalWidth = aOriginalSize.Width(); if ( !nLogicalHeight ) nLogicalHeight = aOriginalSize.Height(); - if( rGraphic.GetType() == GRAPHIC_BITMAP ) + if( rGraphic.GetType() == GraphicType::Bitmap ) { // Resolution is set @@ -1879,7 +1879,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString if( pConfig->IsExportPixelFormat( nFormat ) ) { - if( eType != GRAPHIC_BITMAP ) + if( eType != GraphicType::Bitmap ) { Size aSizePixel; sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem; @@ -2183,7 +2183,7 @@ IMPL_LINK_TYPED( GraphicFilter, FilterCallback, ConvertData&, rData, bool ) default: break; } - if( GRAPHIC_NONE == rData.maGraphic.GetType() || rData.maGraphic.GetContext() ) // Import + if( GraphicType::NONE == rData.maGraphic.GetType() || rData.maGraphic.GetContext() ) // Import { // Import nFormat = GetImportFormatNumberForShortName( OStringToOUString( aShortName, RTL_TEXTENCODING_UTF8) ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index b46efa024dad..c5a7901e25ca 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -299,7 +299,7 @@ bool Graphic::operator!=( const Graphic& rGraphic ) const bool Graphic::operator!() const { - return( GRAPHIC_NONE == mpImpGraphic->ImplGetType() ); + return( GraphicType::NONE == mpImpGraphic->ImplGetType() ); } void Graphic::Clear() @@ -368,7 +368,7 @@ uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const { uno::Reference< graphic::XGraphic > xRet; - if( GetType() != GRAPHIC_NONE ) + if( GetType() != GraphicType::NONE ) { uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference< graphic::XGraphicProvider > xProv( graphic::GraphicProvider::create( xContext ) ); @@ -433,7 +433,7 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const { Size aRet; - if( GRAPHIC_BITMAP == mpImpGraphic->ImplGetType() ) + if( GraphicType::Bitmap == mpImpGraphic->ImplGetType() ) aRet = mpImpGraphic->ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel(); else aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() ); @@ -454,7 +454,7 @@ void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const { - if( GRAPHIC_DEFAULT == mpImpGraphic->ImplGetType() ) + if( GraphicType::Default == mpImpGraphic->ImplGetType() ) ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, nullptr, rDestPt, rDestSz ); else mpImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 7abbb650679f..d2ce7646075f 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -94,7 +94,7 @@ ImpGraphic::ImpGraphic() : mpContext ( nullptr ), mpSwapFile ( nullptr ), mpGfxLink ( nullptr ), - meType ( GRAPHIC_NONE ), + meType ( GraphicType::NONE ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -140,7 +140,7 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) : mpContext ( nullptr ), mpSwapFile ( nullptr ), mpGfxLink ( nullptr ), - meType ( !rBitmap.IsEmpty() ? GRAPHIC_BITMAP : GRAPHIC_NONE ), + meType ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -155,7 +155,7 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : mpContext ( nullptr ), mpSwapFile ( nullptr ), mpGfxLink ( nullptr ), - meType ( !rBitmapEx.IsEmpty() ? GRAPHIC_BITMAP : GRAPHIC_NONE ), + meType ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -169,7 +169,7 @@ ImpGraphic::ImpGraphic(const SvgDataPtr& rSvgDataPtr) mpContext( nullptr ), mpSwapFile( nullptr ), mpGfxLink( nullptr ), - meType( rSvgDataPtr.get() ? GRAPHIC_BITMAP : GRAPHIC_NONE ), + meType( rSvgDataPtr.get() ? GraphicType::Bitmap : GraphicType::NONE ), mnSizeBytes( 0UL ), mnRefCount( 1UL ), mbSwapOut( false ), @@ -185,7 +185,7 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) : mpContext ( nullptr ), mpSwapFile ( nullptr ), mpGfxLink ( nullptr ), - meType ( GRAPHIC_BITMAP ), + meType ( GraphicType::Bitmap ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -200,7 +200,7 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) : mpContext ( nullptr ), mpSwapFile ( nullptr ), mpGfxLink ( nullptr ), - meType ( GRAPHIC_GDIMETAFILE ), + meType ( GraphicType::GdiMetafile ), mnSizeBytes ( 0UL ), mnRefCount ( 1UL ), mbSwapOut ( false ), @@ -271,18 +271,18 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const { switch( meType ) { - case GRAPHIC_NONE: + case GraphicType::NONE: bRet = true; break; - case GRAPHIC_GDIMETAFILE: + case GraphicType::GdiMetafile: { if( rImpGraphic.maMetaFile == maMetaFile ) bRet = true; } break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get()) { @@ -391,7 +391,7 @@ void ImpGraphic::ImplClear() // cleanup ImplClearGraphics( false ); - meType = GRAPHIC_NONE; + meType = GraphicType::NONE; mnSizeBytes = 0; } @@ -399,19 +399,19 @@ void ImpGraphic::ImplClear() void ImpGraphic::ImplSetDefaultType() { ImplClear(); - meType = GRAPHIC_DEFAULT; + meType = GraphicType::Default; } bool ImpGraphic::ImplIsSupportedGraphic() const { - return( meType != GRAPHIC_NONE ); + return( meType != GraphicType::NONE ); } bool ImpGraphic::ImplIsTransparent() const { bool bRet(true); - if( meType == GRAPHIC_BITMAP && !maSvgData.get()) + if( meType == GraphicType::Bitmap && !maSvgData.get()) { bRet = ( mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent() ); } @@ -427,7 +427,7 @@ bool ImpGraphic::ImplIsAlpha() const { bRet = true; } - else if( meType == GRAPHIC_BITMAP ) + else if( meType == GraphicType::Bitmap ) { bRet = ( nullptr == mpAnimation ) && maEx.IsAlpha(); } @@ -442,7 +442,7 @@ bool ImpGraphic::ImplIsAnimated() const bool ImpGraphic::ImplIsEPS() const { - return( ( meType == GRAPHIC_GDIMETAFILE ) && + return( ( meType == GraphicType::GdiMetafile ) && ( maMetaFile.GetActionSize() > 0 ) && ( maMetaFile.GetAction( 0 )->GetType() == MetaActionType::EPS ) ); } @@ -451,7 +451,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) { Bitmap aRetBmp; - if( meType == GRAPHIC_BITMAP ) + if( meType == GraphicType::Bitmap ) { if(maSvgData.get() && maEx.IsEmpty()) { @@ -467,7 +467,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) if(rParameters.getSizePixel().Width() || rParameters.getSizePixel().Height()) aRetBmp.Scale(rParameters.getSizePixel()); } - else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() ) + else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() ) { if(maEx.IsEmpty()) { @@ -503,7 +503,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) // need to be extended when hairlines are on the right or bottom edge Size aPixelSize(aDrawSize); - if(GRAPHIC_GDIMETAFILE == ImplGetType()) + if(GraphicType::GdiMetafile == ImplGetType()) { // get hairline and full bound rect Rectangle aHairlineRect; @@ -559,7 +559,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet { BitmapEx aRetBmpEx; - if( meType == GRAPHIC_BITMAP ) + if( meType == GraphicType::Bitmap ) { if(maSvgData.get() && maEx.IsEmpty()) { @@ -576,7 +576,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet rParameters.getScaleHighQuality() ? BmpScaleFlag::Interpolate : BmpScaleFlag::Fast); } } - else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() ) + else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() ) { if(maEx.IsEmpty()) { @@ -604,13 +604,13 @@ Animation ImpGraphic::ImplGetAnimation() const const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const { - if (GRAPHIC_BITMAP == meType && !maMetaFile.GetActionSize()) + if (GraphicType::Bitmap == meType && !maMetaFile.GetActionSize()) { // #i119735# // Use the local maMetaFile as container for a metafile-representation // of the bitmap graphic. This will be done only once, thus be buffered. // I checked all usages of maMetaFile, it is only used when type is not - // GRAPHIC_BITMAP. In operator= it will get copied, thus buffering will + // GraphicType::Bitmap. In operator= it will get copied, thus buffering will // survive copying (change this if not wanted) ImpGraphic* pThat = const_cast< ImpGraphic* >(this); @@ -650,11 +650,11 @@ Size ImpGraphic::ImplGetPrefSize() const { switch( meType ) { - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get() && maEx.IsEmpty()) { @@ -691,11 +691,11 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize ) { switch( meType ) { - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { //UUUU used when importing a writer FlyFrame with SVG as graphic, added conversion // to allow setting the PrefSize at the BitmapEx to hold it @@ -735,11 +735,11 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const { switch( meType ) { - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get() && maEx.IsEmpty()) { @@ -772,11 +772,11 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode ) { switch( meType ) { - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get()) { @@ -810,7 +810,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const { if( 0 == mnSizeBytes ) { - if( meType == GRAPHIC_BITMAP ) + if( meType == GraphicType::Bitmap ) { if(maSvgData.get()) { @@ -821,7 +821,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maEx.GetSizeBytes(); } } - else if( meType == GRAPHIC_GDIMETAFILE ) + else if( meType == GraphicType::GdiMetafile ) { mnSizeBytes = maMetaFile.GetSizeBytes(); } @@ -836,10 +836,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const { switch( meType ) { - case GRAPHIC_DEFAULT: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get() && !maEx) { @@ -872,10 +872,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, { switch( meType ) { - case GRAPHIC_DEFAULT: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get() && maEx.IsEmpty()) { @@ -1011,9 +1011,9 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) meType = (GraphicType) nType; - if( meType ) + if( meType != GraphicType::NONE ) { - if( meType == GRAPHIC_BITMAP ) + if( meType == GraphicType::Bitmap ) { if(maSvgData.get() && maEx.IsEmpty()) { @@ -1035,7 +1035,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) maMetaFile.SetPrefSize( aSize ); } - if( meType == GRAPHIC_BITMAP || meType == GRAPHIC_GDIMETAFILE ) + if( meType == GraphicType::Bitmap || meType == GraphicType::GdiMetafile ) { ReadImpGraphic( rIStm, *this ); bRet = ( rIStm.GetError() == 0UL ); @@ -1064,7 +1064,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) bRet = ( rIStm.GetError() == 0UL ); } else - meType = GRAPHIC_DEFAULT; + meType = GraphicType::Default; } if( bRet ) @@ -1085,7 +1085,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) { bool bRet = false; - if( ( meType != GRAPHIC_NONE ) && ( meType != GRAPHIC_DEFAULT ) && !ImplIsSwapOut() ) + if( ( meType != GraphicType::NONE ) && ( meType != GraphicType::Default ) && !ImplIsSwapOut() ) { const MapMode aMapMode( ImplGetPrefMapMode() ); const Size aSize( ImplGetPrefSize() ); @@ -1103,7 +1103,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) // write new style header VersionCompat* pCompat = new VersionCompat( rOStm, StreamMode::WRITE, 1 ); - rOStm.WriteInt32( meType ); + rOStm.WriteInt32( (sal_Int32)meType ); // data size is updated later nDataFieldPos = rOStm.Tell(); @@ -1117,7 +1117,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) else { // write old style (<=4.0) header - rOStm.WriteInt32( meType ); + rOStm.WriteInt32( (sal_Int32)meType ); // data size is updated later nDataFieldPos = rOStm.Tell(); @@ -1373,10 +1373,10 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const { switch( meType ) { - case GRAPHIC_DEFAULT: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(maSvgData.get() && maEx.IsEmpty()) { @@ -1609,11 +1609,11 @@ SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic ) switch( rImpGraphic.ImplGetType() ) { - case GRAPHIC_NONE: - case GRAPHIC_DEFAULT: + case GraphicType::NONE: + case GraphicType::Default: break; - case GRAPHIC_BITMAP: + case GraphicType::Bitmap: { if(rImpGraphic.getSvgData().get()) { diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 9f6274660c45..1a5d258db281 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -97,7 +97,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz } bool bIsJpeg = false, bIsPng = false; - if( i_Graphic.GetType() != GRAPHIC_NONE && i_Graphic.GetBitmapEx() == aBitmapEx ) + if( i_Graphic.GetType() != GraphicType::NONE && i_Graphic.GetBitmapEx() == aBitmapEx ) { GfxLinkType eType = i_Graphic.GetLink().GetType(); bIsJpeg = (eType == GFX_LINK_TYPE_NATIVE_JPG); |