summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-16 16:48:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-17 07:47:57 +0200
commit0a910746b19f10f184f6ff8f41c868994a472ca9 (patch)
treeb6d1e0260d0f02f51d1e7946fb9faff57676359f /avmedia
parent25764ffd4db0e5db6f9cc9f3da8691e607f48b83 (diff)
Clarify checking o_pbLink directly, versus missing dereferencing
But given 18ab7abaa9426cd27092125637fdf5fb849b4a04 "MediaWindow::executeMediaURLDialog: add link button" documents that parameter as "if not 0, this is an 'insert' dialog", it looks plausible that all these places indeed want to check the pointer-to-bool for non-nullness, rather than checking the dereferenced bool. Change-Id: Ifbd5e4b711bee97f3ba0b6aab556f533574d21c6 Reviewed-on: https://gerrit.libreoffice.org/52992 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/viewer/mediawindow.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index 2b2f0937f562..0fd10f508bca 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -211,7 +211,7 @@ void MediaWindow::getMediaFilters( FilterNameVector& rFilterNameVector )
bool MediaWindow::executeMediaURLDialog(weld::Window* pParent, OUString& rURL, bool *const o_pbLink)
{
- ::sfx2::FileDialogHelper aDlg(o_pbLink
+ ::sfx2::FileDialogHelper aDlg(o_pbLink != nullptr
? ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW
: ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
FileDialogFlags::NONE, pParent);
@@ -220,7 +220,7 @@ bool MediaWindow::executeMediaURLDialog(weld::Window* pParent, OUString& rURL, b
static const char aSeparator[] = ";";
OUString aAllTypes;
- aDlg.SetTitle( AvmResId( o_pbLink
+ aDlg.SetTitle( AvmResId( o_pbLink != nullptr
? AVMEDIA_STR_INSERTMEDIA_DLG : AVMEDIA_STR_OPENMEDIA_DLG ) );
getMediaFilters( aFilters );
@@ -261,7 +261,7 @@ bool MediaWindow::executeMediaURLDialog(weld::Window* pParent, OUString& rURL, b
uno::Reference<ui::dialogs::XFilePicker3> const xFP(aDlg.GetFilePicker());
uno::Reference<ui::dialogs::XFilePickerControlAccess> const xCtrlAcc(xFP,
uno::UNO_QUERY_THROW);
- if (o_pbLink)
+ if (o_pbLink != nullptr)
{
// for video link should be the default
xCtrlAcc->setValue(
@@ -278,7 +278,7 @@ bool MediaWindow::executeMediaURLDialog(weld::Window* pParent, OUString& rURL, b
const INetURLObject aURL( aDlg.GetPath() );
rURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous );
- if (o_pbLink)
+ if (o_pbLink != nullptr)
{
uno::Any const any = xCtrlAcc->getValue(
ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);