summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-29 15:50:02 +0200
committerTomaž Vajngerl <quikee@gmail.com>2019-04-30 04:57:21 +0200
commit7334034ae93b49fc93b5859a3c047a319d138282 (patch)
tree6216d895de7ede63bd946a0e75913a3b07e4c2b6 /svx
parentc0ff8a24365456383900ed7958c8fb9ea68043e9 (diff)
drop Graphic::operator bool
which tends to interact in very weird ways with other code, for example it makes Graphic appear to have an operator< Change-Id: I335fe8f3644b710bc61291e625cbca7334a37716 Reviewed-on: https://gerrit.libreoffice.org/71532 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/qa/unit/XTableImportExportTest.cxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx8
-rw-r--r--svx/source/unodraw/XPropertyTable.cxx2
-rw-r--r--svx/source/unodraw/unoshap2.cxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx2
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx2
7 files changed, 11 insertions, 11 deletions
diff --git a/svx/qa/unit/XTableImportExportTest.cxx b/svx/qa/unit/XTableImportExportTest.cxx
index cc86393577e3..bbbc67a314b2 100644
--- a/svx/qa/unit/XTableImportExportTest.cxx
+++ b/svx/qa/unit/XTableImportExportTest.cxx
@@ -76,7 +76,7 @@ CPPUNIT_TEST_FIXTURE(XTableImportExportTest, testImportExport)
uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
CPPUNIT_ASSERT(xGraphic.is());
Graphic aGraphic(xGraphic);
- CPPUNIT_ASSERT(aGraphic);
+ CPPUNIT_ASSERT(!aGraphic.IsNone());
Bitmap aBitmap = aGraphic.GetBitmapEx().GetBitmap();
CPPUNIT_ASSERT_EQUAL(aChecksum, aBitmap.GetChecksum());
}
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index c92c4041ae41..8aa991a74084 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -1056,7 +1056,7 @@ void GalleryBrowser2::DispatchAdd(
Graphic aGraphic;
bool bGraphic = mpCurTheme->GetGraphic( mnCurActionPos, aGraphic );
- if ( bGraphic && !!aGraphic )
+ if ( bGraphic && !aGraphic.IsNone() )
xGraphic.set( aGraphic.GetXGraphic() );
OSL_ENSURE( xGraphic.is(), "gallery item is graphic, but the reference is invalid!" );
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 56e3f75fd7c0..2d9d8b61fc75 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -993,10 +993,10 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
{
::SolarMutexGuard aGuard;
- if( !maGraphic && nullptr == mpUnoPage )
+ if( maGraphic.IsNone() && nullptr == mpUnoPage )
return false;
- if( !maGraphic && ( nullptr == mpUnoPage->GetSdrPage() || nullptr == mpDoc ) )
+ if( maGraphic.IsNone() && ( nullptr == mpUnoPage->GetSdrPage() || nullptr == mpDoc ) )
return false;
GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter();
@@ -1014,7 +1014,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
Graphic aGraphic = maGraphic;
ErrCode nStatus = ERRCODE_NONE;
- if (!maGraphic)
+ if (maGraphic.IsNone())
{
SvtOptionsDrawinglayer aOptions;
bool bAntiAliasing = aOptions.IsAntiAliasing();
@@ -1147,7 +1147,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
break;
maGraphic = Graphic(xGraphic);
- if (maGraphic)
+ if (!maGraphic.IsNone())
return;
else
break;
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx
index e9c16bc98bcb..31b000dd92aa 100644
--- a/svx/source/unodraw/XPropertyTable.cxx
+++ b/svx/source/unodraw/XPropertyTable.cxx
@@ -632,7 +632,7 @@ std::unique_ptr<XPropertyEntry> SvxUnoXBitmapTable::createEntry(const OUString&
return nullptr;
Graphic aGraphic(xGraphic);
- if (!aGraphic)
+ if (aGraphic.IsNone())
return nullptr;
GraphicObject aGraphicObject(aGraphic);
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 9e9fe4071a59..760b6eb4da6a 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1273,7 +1273,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
if (rValue >>= aURL)
{
Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
- if (aGraphic)
+ if (!aGraphic.IsNone())
{
static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
bOk = true;
@@ -1285,7 +1285,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
if (xGraphic.is())
{
Graphic aGraphic = xGraphic;
- if (aGraphic)
+ if (!aGraphic.IsNone())
{
static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
bOk = true;
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 4e99e87b21a5..b1a2a4b699fa 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -490,7 +490,7 @@ Graphic SvXMLGraphicHelper::ImplReadGraphic( const OUString& rPictureStorageName
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(aStream.xStream));
Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(*pStream);
- if (aGraphic)
+ if (!aGraphic.IsNone())
aReturnGraphic = aGraphic;
else
rGraphicFilter.ImportGraphic(aReturnGraphic, "", *pStream);
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 648a0ba8578f..e4b7bac69581 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -284,7 +284,7 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
if (bSetURL && !aURL.isEmpty())
{
Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
- if (aGraphic)
+ if (!aGraphic.IsNone())
{
maGraphicObject.SetGraphic(aGraphic.GetXGraphic());
}