summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-27 09:43:22 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-27 12:59:23 +0000
commit850a8d27ca696f18ce0c529346f8bb8505499545 (patch)
tree5641e81912760029683e1c544e01af25eee23523 /sc
parent6c974272423ca19c94d8d5e182fec46836309d60 (diff)
Convert GRAPHIC to scoped enum
Change-Id: I1fd09a729cbda00f99841532e0dd3fa66bce7bea Reviewed-on: https://gerrit.libreoffice.org/25534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/extras/sccondformats.cxx10
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx2
-rw-r--r--sc/source/filter/excel/xiescher.cxx6
-rw-r--r--sc/source/filter/excel/xipage.cxx2
-rw-r--r--sc/source/ui/app/drwtrans.cxx2
-rw-r--r--sc/source/ui/app/seltrans.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx24
-rw-r--r--sc/source/ui/view/printfun.cxx2
8 files changed, 25 insertions, 25 deletions
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