cui/source/dialogs/screenshotannotationdlg.cxx |   58 +++++++++----------------
 1 file changed, 23 insertions(+), 35 deletions(-)

New commits:
commit ee2fe6acdba158d48d1166562ce02752d35524d2
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Feb 9 17:33:19 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Feb 10 07:38:01 2026 +0100

    cui: Drop superfluous null checks in ScreenshotAnnotationDlg_Impl
    
    All of these are known to be non-null, for which there
    are even asserts a few line further up.
    
    (`git show --ignore-space-change` can help to see the
    "actual change" more easily.)
    
    Change-Id: I5e8ea0e202bd06e92ed64bec73fb6033c44e97c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199007
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx 
b/cui/source/dialogs/screenshotannotationdlg.cxx
index bd817eaafce0..ac3483cb0cda 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -278,51 +278,39 @@ 
ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
 
 
     // set screenshot image at DrawingArea, resize, set event listener
-    if (mxPicture)
-    {
-        maAllChildren = mrParentDialog.collect_screenshot_data();
+    maAllChildren = mrParentDialog.collect_screenshot_data();
 
-        // to make clear that maParentDialogBitmap is a background image, 
adjust
-        // luminance a bit for maDimmedDialogBitmap - other methods may be 
applied
-        maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0);
+    // to make clear that maParentDialogBitmap is a background image, adjust
+    // luminance a bit for maDimmedDialogBitmap - other methods may be applied
+    maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0);
 
-        // init paint buffering VirtualDevice
-        mxVirtualBufferDevice = 
VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 
DeviceFormat::WITHOUT_ALPHA);
-        mxVirtualBufferDevice->SetOutputSizePixel(maParentDialogSize);
-        mxVirtualBufferDevice->SetFillColor(COL_TRANSPARENT);
+    // init paint buffering VirtualDevice
+    mxVirtualBufferDevice = 
VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 
DeviceFormat::WITHOUT_ALPHA);
+    mxVirtualBufferDevice->SetOutputSizePixel(maParentDialogSize);
+    mxVirtualBufferDevice->SetFillColor(COL_TRANSPARENT);
 
-        // initially set image for picture control
-        mxVirtualBufferDevice->DrawBitmap(Point(0, 0), maDimmedDialogBitmap);
+    // initially set image for picture control
+    mxVirtualBufferDevice->DrawBitmap(Point(0, 0), maDimmedDialogBitmap);
 
-        // set size for picture control, this will re-layout so that
-        // the picture control shows the whole dialog
-        maPicture.SetOutputSizePixel(maParentDialogSize);
-        mxPicture->set_size_request(maParentDialogSize.Width(), 
maParentDialogSize.Height());
+    // set size for picture control, this will re-layout so that
+    // the picture control shows the whole dialog
+    maPicture.SetOutputSizePixel(maParentDialogSize);
+    mxPicture->set_size_request(maParentDialogSize.Width(), 
maParentDialogSize.Height());
 
-        mxPicture->queue_draw();
-    }
+    mxPicture->queue_draw();
 
     // set some test text at VclMultiLineEdit and make read-only - only
     // copying content to clipboard is allowed
-    if (mxText)
-    {
-        mxText->set_size_request(400, mxText->get_height_rows(10));
-        OUString aHelpId = mrParentDialog.get_help_id();
-        Size aSizeCm = 
Application::GetDefaultDevice()->PixelToLogic(maParentDialogSize, 
MapMode(MapUnit::MapCM));
-        maMainMarkupText = lcl_ParagraphWithImage( aHelpId, aSizeCm );
-        mxText->set_text( maMainMarkupText );
-        mxText->set_editable(false);
-    }
+    mxText->set_size_request(400, mxText->get_height_rows(10));
+    OUString aHelpId = mrParentDialog.get_help_id();
+    Size aSizeCm = 
Application::GetDefaultDevice()->PixelToLogic(maParentDialogSize, 
MapMode(MapUnit::MapCM));
+    maMainMarkupText = lcl_ParagraphWithImage( aHelpId, aSizeCm );
+    mxText->set_text( maMainMarkupText );
+    mxText->set_editable(false);
 
     // set click handler for save button
-    if (mxSave)
-    {
-        mxSave->connect_clicked(LINK(this, ScreenshotAnnotationDlg_Impl, 
saveButtonHandler));
-    }
-    if(mxCopy)
-    {
-        mxCopy->connect_clicked(LINK(this, ScreenshotAnnotationDlg_Impl, 
copyButtonHandler));
-    }
+    mxSave->connect_clicked(LINK(this, ScreenshotAnnotationDlg_Impl, 
saveButtonHandler));
+    mxCopy->connect_clicked(LINK(this, ScreenshotAnnotationDlg_Impl, 
copyButtonHandler));
 }
 
 ScreenshotAnnotationDlg_Impl::~ScreenshotAnnotationDlg_Impl()

Reply via email to