summaryrefslogtreecommitdiff
path: root/src/glibext/linecolumn.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-03-21 18:45:37 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-03-21 18:45:37 (GMT)
commit88e34a085a69d23da262a92641a80f409931ea82 (patch)
tree1a918d76943ed06bba249a74cfaa57dd35add93b /src/glibext/linecolumn.c
parent02993e7f7d215ae29a041941d686ceab965d0b97 (diff)
Displayed the first line content of each entry point again.
Diffstat (limited to 'src/glibext/linecolumn.c')
-rw-r--r--src/glibext/linecolumn.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/glibext/linecolumn.c b/src/glibext/linecolumn.c
index 0c4a77d..0d38b90 100644
--- a/src/glibext/linecolumn.c
+++ b/src/glibext/linecolumn.c
@@ -28,6 +28,9 @@
#include <malloc.h>
+#include "../common/extstr.h"
+
+
/******************************************************************************
* *
@@ -429,6 +432,47 @@ void draw_line_column_segments(const line_column *column, cairo_t *cairo, gint x
/******************************************************************************
* *
+* Paramètres : column = colonne de ligne de texte à venir consulter. *
+* markup = indique si le texte doit être décoré ou non. *
+* *
+* Description : Donne le texte représenté par une colonne de ligne de texte. *
+* *
+* Retour : Texte à libérer de la mémoire après usage. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+char *get_line_column_text(const line_column *column, bool markup)
+{
+ char *result; /* Construction à retourner */
+ size_t i; /* Boucle de parcours */
+ char *extra; /* Contenu à intégrer au texte */
+
+ result = NULL;
+
+ for (i = 0; i < column->count; i++)
+ {
+ extra = get_line_segment_text(column->segments[i], markup);
+
+ if (result == NULL)
+ result = extra;
+
+ else
+ {
+ result = stradd(result, extra);
+ free(extra);
+ }
+
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : column = colonne de ligne de texte à manipuler. *
* ctx = éléments à disposition pour l'exportation. *
* type = type d'exportation attendue. *