[pangomm] Context::get_font_map(): Fix reference count



commit e7ef7b7023d34caa17ba122954c67c97637a981a
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Feb 22 09:56:03 2022 +0100

    Context::get_font_map(): Fix reference count
    
    pango_context_get_font_map() returns "(transfer none)".
    See https://mail.gnome.org/archives/gtkmm-list/2022-February/msg00031.html

 pango/src/context.ccg | 5 ++---
 pango/src/context.hg  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/pango/src/context.ccg b/pango/src/context.ccg
index a8e54a1..3d50764 100644
--- a/pango/src/context.ccg
+++ b/pango/src/context.ccg
@@ -35,7 +35,7 @@ std::vector<Glib::RefPtr<FontFamily>> Context::list_families() const
 
 Pango::FontMetrics Context::get_metrics(const FontDescription& desc) const
 {
-  return FontMetrics(pango_context_get_metrics(const_cast<PangoContext*>(gobj()), desc.gobj(), 0));
+  return FontMetrics(pango_context_get_metrics(const_cast<PangoContext*>(gobj()), desc.gobj(), nullptr));
 }
 
 struct ItemTraits
@@ -57,7 +57,7 @@ std::vector<Item> Context::itemize(const Glib::ustring& text, const AttrList& at
   return ListHandler_Item::list_to_vector(
       pango_itemize(const_cast<PangoContext*>(gobj()),
                     text.c_str(), 0, text.bytes(),
-                    const_cast<PangoAttrList*>(attrs.gobj()), 0),
+                    const_cast<PangoAttrList*>(attrs.gobj()), nullptr),
       Glib::OWNERSHIP_DEEP);
 }
 
@@ -89,4 +89,3 @@ Matrix Context::get_matrix() const
 }
 
 } /* namespace Pango */
-
diff --git a/pango/src/context.hg b/pango/src/context.hg
index 47dc9d8..3eddfa4 100644
--- a/pango/src/context.hg
+++ b/pango/src/context.hg
@@ -86,8 +86,8 @@ public:
 
   _WRAP_METHOD(void set_font_map(const Glib::RefPtr<FontMap>& font_map), pango_context_set_font_map)
 
-  _WRAP_METHOD(Glib::RefPtr<FontMap> get_font_map(), pango_context_get_font_map)
-  _WRAP_METHOD(Glib::RefPtr<const FontMap> get_font_map() const, pango_context_get_font_map)
+  _WRAP_METHOD(Glib::RefPtr<FontMap> get_font_map(), pango_context_get_font_map, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const FontMap> get_font_map() const, pango_context_get_font_map, refreturn, 
constversion)
 
   _WRAP_METHOD(guint get_serial() const, pango_context_get_serial)
 
@@ -172,4 +172,3 @@ public:
 };
 
 } /* namespace Pango */
-


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]