[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 9 11:58:43 UTC 2018
vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
New commits:
commit 73f9100a3d3f28ebfd676b42a833bba4ba9f05f1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 2 12:48:26 2018 +0100
Commit: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Tue Oct 9 13:58:22 2018 +0200
filename may be null
Change-Id: I373886d3613607b8ee8e96d8c0314865f3991a92
Reviewed-on: https://gerrit.libreoffice.org/61251
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index e4f5ac395b8d..16a845eabe81 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -1496,17 +1496,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,
pobjFP->m_PreviewImageWidth,
pobjFP->m_PreviewImageHeight, nullptr );
More information about the Libreoffice-commits
mailing list