Delete unused function gnucashsh_sheet_get_text_cursor_position.

This commit is contained in:
John Ralls 2020-05-24 13:34:30 -07:00
parent 608e700a24
commit 77a8f71da2

View File

@ -353,47 +353,6 @@ gnucash_sheet_get_text_offset (GnucashSheet *sheet, const VirtualLocation virt_l
return x_offset;
}
static gint
gnucash_sheet_get_text_cursor_position (GnucashSheet *sheet, const VirtualLocation virt_loc)
{
GncItemEdit *item_edit = GNC_ITEM_EDIT(sheet->item_editor);
Table *table = sheet->table;
const char *text = gnc_table_get_entry (table, virt_loc);
PangoLayout *layout;
PangoRectangle logical_rect;
GdkRectangle rect;
gint x, y, width, height;
gint index, trailing;
gboolean result;
gint x_offset = 0;
if ((text == NULL) || (*text == '\0'))
return 0;
// Get the item_edit position
gnc_item_edit_get_pixel_coords (item_edit, &x, &y, &width, &height);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (sheet), text);
// We don't need word wrap or line wrap
pango_layout_set_width (layout, -1);
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
gnucash_sheet_set_text_bounds (sheet, &rect, x, y, width, height);
x_offset = gnucash_sheet_get_text_offset (sheet, virt_loc,
rect.width, logical_rect.width);
pango_layout_xy_to_index (layout,
PANGO_SCALE * (sheet->button_x - rect.x - x_offset),
PANGO_SCALE * (height/2), &index, &trailing);
g_object_unref (layout);
return index + trailing;
}
static void
gnucash_sheet_activate_cursor_cell (GnucashSheet *sheet,
gboolean changed_cells)