[Libreoffice-commits] core.git: vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 2 14:41:22 UTC 2018
vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
New commits:
commit 5c179fd747d78c04dde94e368aa6ca1c73d61399
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 2 12:48:26 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 2 16:40:59 2018 +0200
filename may be null
Change-Id: I373886d3613607b8ee8e96d8c0314865f3991a92
Reviewed-on: https://gerrit.libreoffice.org/61241
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 016c3d6cf49f..9ae62256a512 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -1495,17 +1495,14 @@ void SalGtkFilePicker::selection_changed_cb( GtkFileChooser *, SalGtkFilePicker
void SalGtkFilePicker::update_preview_cb( GtkFileChooser *file_chooser, SalGtkFilePicker* pobjFP )
{
- GtkWidget *preview;
- char *filename;
- GdkPixbuf *pixbuf;
gboolean have_preview = false;
- preview = pobjFP->m_pPreview;
- filename = gtk_file_chooser_get_preview_filename( file_chooser );
+ GtkWidget* preview = pobjFP->m_pPreview;
+ char* filename = gtk_file_chooser_get_preview_filename( file_chooser );
- if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( pobjFP->m_pToggles[PREVIEW] ) ) && g_file_test( filename, G_FILE_TEST_IS_REGULAR ) )
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pobjFP->m_pToggles[PREVIEW])) && filename && g_file_test(filename, G_FILE_TEST_IS_REGULAR))
{
- pixbuf = gdk_pixbuf_new_from_file_at_size(
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size(
filename,
g_PreviewImageWidth,
g_PreviewImageHeight, nullptr );
More information about the Libreoffice-commits
mailing list