From 05c9f6824d14012a71528bd204bcdd4e6624db29 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 11 Oct 2012 12:34:08 +0900 Subject: Fix for 426763 : Cancelling import leads to error message (bzr r11777) --- src/extension/internal/pdfinput/pdf-input.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 6b6107444..d2d594017 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -588,12 +588,19 @@ void PdfImportDialog::_setPreviewPage(int page) { //////////////////////////////////////////////////////////////////////////////// +bool +PdfInput::wasCancelled () { + return _cancelled; +} + /** * Parses the selected page of the given PDF document using PdfParser. */ SPDocument * PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + _cancelled = false; + // Initialize the globalParams variable for poppler if (!globalParams) { globalParams = new GlobalParams(); @@ -648,6 +655,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { if (inkscape_use_gui()) { dlg = new PdfImportDialog(pdf_doc, uri); if (!dlg->showDialog()) { + _cancelled = true; delete dlg; delete pdf_doc; return NULL; -- cgit v1.2.3 From 4af19c56cf90e31a0d800821e8daf7fb08108e94 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 26 Nov 2012 10:33:19 +0000 Subject: Drop support for GTK+ < 2.24 Fixed bugs: - https://launchpad.net/bugs/1069024 (bzr r11907) --- src/extension/internal/pdfinput/pdf-input.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index d2d594017..688e3f612 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -111,11 +111,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) _cropTypeCombo = Gtk::manage(new class Gtk::ComboBoxText()); int num_crop_choices = sizeof(crop_setting_choices) / sizeof(crop_setting_choices[0]); for ( int i = 0 ; i < num_crop_choices ; i++ ) { -#if WITH_GTKMM_2_24 _cropTypeCombo->append(_(crop_setting_choices[i])); -#else - _cropTypeCombo->append_text(_(crop_setting_choices[i])); -#endif } _cropTypeCombo->set_active_text(_(crop_setting_choices[0])); _cropTypeCombo->set_sensitive(false); @@ -140,11 +136,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) // Text options _labelText = Gtk::manage(new class Gtk::Label(_("Text handling:"))); _textHandlingCombo = Gtk::manage(new class Gtk::ComboBoxText()); -#if WITH_GTKMM_2_24 _textHandlingCombo->append(_("Import text as text")); -#else - _textHandlingCombo->append_text(_("Import text as text")); -#endif _textHandlingCombo->set_active_text(_("Import text as text")); _localFontsCheck = Gtk::manage(new class Gtk::CheckButton(_("Replace PDF fonts by closest-named installed fonts"))); -- cgit v1.2.3 From 8ee9827502fadcae0b02fec434799e94ee115357 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 25 Dec 2012 22:50:08 +0000 Subject: Convert a load more C-style pointer casts to GObject or C++ casts (merry christmas\!) (bzr r11986) --- src/extension/internal/pdfinput/pdf-input.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 688e3f612..2c66c0daf 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -245,7 +245,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) this->get_vbox()->pack_start(*hbox1); this->set_title(_("PDF Import Settings")); this->set_modal(true); - sp_transientize((GtkWidget *)this->gobj()); //Make transient + sp_transientize(GTK_WIDGET(this->gobj())); //Make transient this->property_window_position().set_value(Gtk::WIN_POS_NONE); this->set_resizable(true); this->property_destroy_with_parent().set_value(false); @@ -446,7 +446,7 @@ static void copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, cairo_height = gdk_pixbuf_get_height (pixbuf); for (y = 0; y < cairo_height; y++) { - src = (unsigned int *) (cairo_data + y * cairo_rowstride); + src = reinterpret_cast(cairo_data + y * cairo_rowstride); dst = pixbuf_data + y * pixbuf_rowstride; for (x = 0; x < cairo_width; x++) { @@ -603,7 +603,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { PDFDoc *pdf_doc = new PDFDoc(filename_goo, NULL, NULL, NULL); // TODO: Could ask for password //delete filename_goo; #else - wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL); + wchar_t *wfilename = static_cast(g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL)); if (wfilename == NULL) { return NULL; -- cgit v1.2.3 From f1865ade3ac1287dfc91073941bc3c27ea5321aa Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 26 Dec 2012 18:14:16 +0100 Subject: Win32. Fixing invalid cast (introduced rev.11986). (bzr r11989) --- src/extension/internal/pdfinput/pdf-input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 2c66c0daf..90d53c6b0 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -603,7 +603,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { PDFDoc *pdf_doc = new PDFDoc(filename_goo, NULL, NULL, NULL); // TODO: Could ask for password //delete filename_goo; #else - wchar_t *wfilename = static_cast(g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL)); + wchar_t *wfilename = reinterpret_cast(g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL)); if (wfilename == NULL) { return NULL; -- cgit v1.2.3 From 909c15499d8bebfb484d05063ee3c3813b9bfe73 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 7 Mar 2013 22:41:53 +0000 Subject: Fix deprecated Gtkmm symbols in preferences widget (bzr r12178) --- src/extension/internal/pdfinput/pdf-input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 90d53c6b0..535deafce 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -124,7 +124,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) #if WITH_GTKMM_3_0 _fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10); - _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(_fallbackPrecisionSlider_adj)); + _fallbackPrecisionSlider = Gtk::manage(new class Gtk::Scale(_fallbackPrecisionSlider_adj)); #else _fallbackPrecisionSlider_adj = Gtk::manage(new class Gtk::Adjustment(2, 1, 256, 1, 10, 10)); _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(*_fallbackPrecisionSlider_adj)); -- cgit v1.2.3 From 1d3f07d09370bf8fefa7968706375ae3669dbd1c Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 8 Mar 2013 01:44:43 +0000 Subject: Drop deprecated get_vbox method in Gtk::Dialog (bzr r12181) --- src/extension/internal/pdfinput/pdf-input.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 535deafce..531cda20a 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -240,9 +240,17 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) vbox1->pack_start(*_importSettingsFrame, Gtk::PACK_EXPAND_PADDING, 0); hbox1->pack_start(*vbox1); hbox1->pack_start(*_previewArea, Gtk::PACK_EXPAND_WIDGET, 4); + +#if WITH_GTKMM_3_0 + get_content_area()->set_homogeneous(false); + get_content_area()->set_spacing(0); + get_content_area()->pack_start(*hbox1); +#else this->get_vbox()->set_homogeneous(false); this->get_vbox()->set_spacing(0); this->get_vbox()->pack_start(*hbox1); +#endif + this->set_title(_("PDF Import Settings")); this->set_modal(true); sp_transientize(GTK_WIDGET(this->gobj())); //Make transient -- cgit v1.2.3 From bbed1f9dd7d55af001daf43393b974fe85618672 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 15 Mar 2013 12:24:39 +0000 Subject: Fix missing Gtkmm/Glib headers for Gtk+ 3 build (bzr r12209) --- src/extension/internal/pdfinput/pdf-input.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/extension/internal/pdfinput/pdf-input.cpp') diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 531cda20a..b04c9782f 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -32,6 +32,7 @@ #endif #include +#include #include #include #include -- cgit v1.2.3