summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-08 12:36:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-10 12:02:44 +0200
commit366d08f2f6d4de922f6099c62bb81b49d89e0a68 (patch)
treeb232884af6e844c2f0994859e4b42efbc1ce654c /vcl
parent75a2257a5bd716a9f937abe5e53f305c983afd5d (diff)
new loplugin:simplifypointertobool
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gendata.hxx2
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx2
-rw-r--r--vcl/qt5/Qt5Bitmap.cxx18
-rw-r--r--vcl/qt5/Qt5Frame.cxx4
-rw-r--r--vcl/source/app/svapp.cxx2
-rw-r--r--vcl/source/gdi/bitmapex.cxx2
-rw-r--r--vcl/source/gdi/print3.cxx4
-rw-r--r--vcl/source/treelist/treelist.cxx4
-rw-r--r--vcl/source/window/winproc.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx2
-rw-r--r--vcl/unx/kf5/KF5SalFrame.cxx2
11 files changed, 22 insertions, 22 deletions
diff --git a/vcl/inc/unx/gendata.hxx b/vcl/inc/unx/gendata.hxx
index 5efb34a8f73f..f06dda35cb2e 100644
--- a/vcl/inc/unx/gendata.hxx
+++ b/vcl/inc/unx/gendata.hxx
@@ -83,7 +83,7 @@ public:
if (!m_pPrintFontManager)
InitPrintFontManager();
// PrintFontManager needs the FreetypeManager
- assert(m_pFreetypeManager.get());
+ assert(m_pFreetypeManager);
return m_pPrintFontManager.get();
}
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index ab5333498649..a57add56a292 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -415,7 +415,7 @@ void PdfExportTest::testTdf107868()
SvMemoryStream aMemory;
aMemory.WriteStream(aFile);
DocumentHolder pPdfDocument(FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
- if (!pPdfDocument.get())
+ if (!pPdfDocument)
// Printing to PDF failed in a non-interesting way, e.g. CUPS is not
// running, there is no printer defined, etc.
return;
diff --git a/vcl/qt5/Qt5Bitmap.cxx b/vcl/qt5/Qt5Bitmap.cxx
index b698046ae307..01c6ebc4dd2b 100644
--- a/vcl/qt5/Qt5Bitmap.cxx
+++ b/vcl/qt5/Qt5Bitmap.cxx
@@ -71,7 +71,7 @@ bool Qt5Bitmap::Create(const Size& rSize, sal_uInt16 nBitCount, const BitmapPale
m_aPalette = rPal;
auto count = rPal.GetEntryCount();
- if (nBitCount != 4 && count && m_pImage.get())
+ if (nBitCount != 4 && count && m_pImage)
{
QVector<QRgb> aColorTable(count);
for (unsigned i = 0; i < count; ++i)
@@ -84,7 +84,7 @@ bool Qt5Bitmap::Create(const Size& rSize, sal_uInt16 nBitCount, const BitmapPale
bool Qt5Bitmap::Create(const SalBitmap& rSalBmp)
{
const Qt5Bitmap* pBitmap = static_cast<const Qt5Bitmap*>(&rSalBmp);
- if (pBitmap->m_pImage.get())
+ if (pBitmap->m_pImage)
{
m_pImage.reset(new QImage(*pBitmap->m_pImage));
m_pBuffer.reset();
@@ -124,7 +124,7 @@ bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount)
&& "Unsupported BitCount!");
const Qt5Bitmap* pBitmap = static_cast<const Qt5Bitmap*>(&rSalBmp);
- if (pBitmap->m_pBuffer.get())
+ if (pBitmap->m_pBuffer)
{
if (nNewBitCount != 32)
return false;
@@ -188,18 +188,18 @@ void Qt5Bitmap::Destroy()
Size Qt5Bitmap::GetSize() const
{
- if (m_pBuffer.get())
+ if (m_pBuffer)
return m_aSize;
- else if (m_pImage.get())
+ else if (m_pImage)
return toSize(m_pImage->size());
return Size();
}
sal_uInt16 Qt5Bitmap::GetBitCount() const
{
- if (m_pBuffer.get())
+ if (m_pBuffer)
return 4;
- else if (m_pImage.get())
+ else if (m_pImage)
return getFormatBits(m_pImage->format());
return 0;
}
@@ -208,12 +208,12 @@ BitmapBuffer* Qt5Bitmap::AcquireBuffer(BitmapAccessMode /*nMode*/)
{
static const BitmapPalette aEmptyPalette;
- if (!(m_pImage.get() || m_pBuffer.get()))
+ if (!(m_pImage || m_pBuffer))
return nullptr;
BitmapBuffer* pBuffer = new BitmapBuffer;
- if (m_pBuffer.get())
+ if (m_pBuffer)
{
pBuffer->mnWidth = m_aSize.Width();
pBuffer->mnHeight = m_aSize.Height();
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 2d780c7bd4ee..daa930ff6b82 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -308,7 +308,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
if (m_bUseCairo)
{
- if (!m_pOurSvpGraphics.get() || m_bGraphicsInvalid)
+ if (!m_pOurSvpGraphics || m_bGraphicsInvalid)
{
m_pOurSvpGraphics.reset(new Qt5SvpGraphics(this));
InitQt5SvpGraphics(m_pOurSvpGraphics.get());
@@ -318,7 +318,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
}
else
{
- if (!m_pQt5Graphics.get() || m_bGraphicsInvalid)
+ if (!m_pQt5Graphics || m_bGraphicsInvalid)
{
m_pQt5Graphics.reset(new Qt5Graphics(this));
m_pQImage.reset(
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index db0a09ddb2db..fe650087d026 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -962,7 +962,7 @@ IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData, void )
break;
}
- if( pData->mpWin && pData->mpWin->mpWindowImpl->mpFrameWindow.get() && pEventData )
+ if( pData->mpWin && pData->mpWin->mpWindowImpl->mpFrameWindow && pEventData )
ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow.get(), nEvent, pEventData );
// remove this event from list of posted events, watch for destruction of internal data
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index f4add8ef1bb2..cf46607f14a1 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -776,7 +776,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
const Size &rSize )
{
uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
- if( xFastPropertySet.get() )
+ if( xFastPropertySet )
{
// 0 means get BitmapEx
uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 5ed1f4ca33ca..cb326ae9d31a 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -795,7 +795,7 @@ void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter )
bool bSavedSizeOrientation = false;
// #tdf 126744 Transfer paper size and orientation settings to newly selected printer
- if ( xPrinter.get() )
+ if ( xPrinter )
{
aPaperSize = xPrinter->GetPaperSize();
eOrientation = xPrinter->GetOrientation();
@@ -835,7 +835,7 @@ void PrinterController::setupPrinter( weld::Window* i_pParent )
// Important to hold printer alive while doing setup etc.
VclPtr< Printer > xPrinter = mpImplData->mxPrinter;
- if( xPrinter.get() )
+ if( xPrinter )
{
xPrinter->Push();
xPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 2f99060ac1ea..4f2cd1dfee0c 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -225,7 +225,7 @@ sal_uLong SvTreeList::Move(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetPa
// Release the original.
std::unique_ptr<SvTreeListEntry> pOriginal(std::move(*itSrcPos));
- assert(pOriginal.get());
+ assert(pOriginal);
rSrc.erase(itSrcPos);
// Determine the insertion position.
@@ -247,7 +247,7 @@ sal_uLong SvTreeList::Move(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetPa
std::advance(itDstPos, nListPos);
}
std::unique_ptr<SvTreeListEntry> pOriginal(std::move(*itSrcPos));
- assert(pOriginal.get());
+ assert(pOriginal);
rSrc.erase(itSrcPos);
rDst.insert(itDstPos, std::move(pOriginal));
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index e2613b3da9ec..2c77f7069456 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1495,7 +1495,7 @@ bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
pSVData->mpWinData->mpLastWheelWindow = Dispatch(xMouseWindow);
- return pSVData->mpWinData->mpLastWheelWindow.get();
+ return pSVData->mpWinData->mpLastWheelWindow;
}
namespace {
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 96b437c0ed98..01a5e7637827 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -703,7 +703,7 @@ bool X11SalBitmap::Create(
) {
css::uno::Reference< css::beans::XFastPropertySet > xFastPropertySet( rBitmapCanvas, css::uno::UNO_QUERY );
- if( xFastPropertySet.get() ) {
+ if( xFastPropertySet ) {
sal_Int32 depth;
css::uno::Sequence< css::uno::Any > args;
diff --git a/vcl/unx/kf5/KF5SalFrame.cxx b/vcl/unx/kf5/KF5SalFrame.cxx
index cc08b9c07748..1aa0b9008de7 100644
--- a/vcl/unx/kf5/KF5SalFrame.cxx
+++ b/vcl/unx/kf5/KF5SalFrame.cxx
@@ -169,7 +169,7 @@ SalGraphics* KF5SalFrame::AcquireGraphics()
m_bGraphicsInUse = true;
- if (!m_pKF5Graphics.get())
+ if (!m_pKF5Graphics)
{
m_pKF5Graphics.reset(new Qt5SvpGraphics(this));
Qt5Frame::InitQt5SvpGraphics(m_pKF5Graphics.get());