summaryrefslogtreecommitdiffstats
path: root/src/ui/previewholder.cpp
diff options
context:
space:
mode:
authorDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
committerDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
commitaeb9c1bde66de096910757abb17dedb94ad74207 (patch)
treec0adf97685b0fa8af1553b14d20601f280492762 /src/ui/previewholder.cpp
parentFixed some math, so that the objects now line up correctly (diff)
parentAdding checks to prevent null pointer dereferences (diff)
downloadinkscape-aeb9c1bde66de096910757abb17dedb94ad74207.tar.gz
inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.zip
Trunk merge
(bzr r11073.1.29)
Diffstat (limited to 'src/ui/previewholder.cpp')
-rw-r--r--src/ui/previewholder.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index cce7da103..d89df1104 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -208,8 +208,9 @@ void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation )
if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
Gtk::Requisition req;
-#if WITH_GTKMM_3_0
- _insides->get_preferred_size(&req, NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ Gtk::Requisition req_natural;
+ _insides->get_preferred_size(req, req_natural);
#else
req = _insides->size_request();
#endif
@@ -239,8 +240,9 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
if ( _anchor == SP_ANCHOR_SOUTH || _anchor == SP_ANCHOR_NORTH ) {
Gtk::Requisition req;
-#if WITH_GTKMM_3_0
- _scroller->get_preferred_size(&req, NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ Gtk::Requisition req_natural;
+ _scroller->get_preferred_size(req, req_natural);
#else
req = _scroller->size_request();
#endif
@@ -249,13 +251,19 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
req.width = currW;
}
+#if GTK_CHECK_VERSION(3,0,0)
+ Gtk::Scrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
+#else
Gtk::HScrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
+#endif
+
if ( hs ) {
Gtk::Requisition scrollReq;
-#if WITH_GTKMM_3_0
- hs->get_preferred_size(&req, NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ Gtk::Requisition scrollReq_natural;
+ hs->get_preferred_size(scrollReq, scrollReq_natural);
#else
- req = hs->size_request();
+ scrollReq = hs->size_request();
#endif
// the +8 is a temporary hack
@@ -263,8 +271,9 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
}
Gtk::Requisition req2;
-#if WITH_GTKMM_3_0
- const_cast<Gtk::Widget*>(thing)->get_preferred_size(&req2, NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ Gtk::Requisition req2_natural;
+ const_cast<Gtk::Widget*>(thing)->get_preferred_size(req2, req2_natural);
#else
req2 = const_cast<Gtk::Widget*>(thing)->size_request();
#endif