summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/inc/editsh.hxx2
-rw-r--r--sw/qa/extras/globalfilter/globalfilter.cxx2
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx4
-rw-r--r--sw/source/core/doc/notxtfrm.cxx8
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx8
-rw-r--r--sw/source/core/edit/editsh.cxx10
-rw-r--r--sw/source/core/frmedt/fecopy.cxx6
-rw-r--r--sw/source/core/graphic/ndgrf.cxx14
-rw-r--r--sw/source/core/layout/fly.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx4
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx8
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx8
-rw-r--r--sw/source/filter/xml/xmlbrsh.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx4
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx2
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/uibase/shells/basesh.cxx18
-rw-r--r--sw/source/uibase/shells/grfsh.cxx24
20 files changed, 66 insertions, 66 deletions
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;
}