Kaydet (Commit) 34208a37 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 (PVS): redundant nullptr check; unsafe pointer dereference

V668 There is no sense in testing the 'mpTheme' pointer against null, as
     the memory was allocated using the 'new' operator. The exception
     will be generated in the case of memory allocation error.

V1004 The 'mpFont' pointer was used unsafely after it was verified
      against nullptr. Check lines: 879, 881.

Change-Id: I47627de2cd98d3bb36e1ced7346ebe9177c21e65
Reviewed-on: https://gerrit.libreoffice.org/62141
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 062401fe
......@@ -69,7 +69,7 @@ namespace {
awt::Rectangle RemoveBorder (
const awt::Rectangle& rBox,
drawing::framework::BorderType eBorderType) const;
Reference<rendering::XCanvasFont> const & GetFont (
Reference<rendering::XCanvasFont> GetFont (
const Reference<rendering::XCanvas>& rxCanvas) const;
SharedBitmapDescriptor mpTopLeft;
......@@ -304,7 +304,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva
bModified = true;
if (mpTheme != nullptr && bModified)
if (bModified)
if (mpRenderer == nullptr)
mpRenderer.reset(new Renderer(mxContext, mpTheme));
......@@ -872,12 +872,15 @@ awt::Rectangle RendererPaneStyle::RemoveBorder (
rBox.Height - pBorderSize->mnTop - pBorderSize->mnBottom);
Reference<rendering::XCanvasFont> const & RendererPaneStyle::GetFont (
Reference<rendering::XCanvasFont> RendererPaneStyle::GetFont (
const Reference<rendering::XCanvas>& rxCanvas) const
if (mpFont.get() != nullptr)
if (mpFont)
return mpFont->mxFont;
return mpFont->mxFont;
return Reference<rendering::XCanvasFont>();
void RendererPaneStyle::UpdateBorderSizes()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment