]> saetta.ns0.it Git - reptool/libreptool/commitdiff
Enable linefeed in text source property with the html entity 
.
authorAndrea Zagli <azagli@libero.it>
Tue, 7 Sep 2010 12:52:29 +0000 (14:52 +0200)
committerAndrea Zagli <azagli@libero.it>
Tue, 7 Sep 2010 12:52:29 +0000 (14:52 +0200)
.gitignore
src/rptobjecttext.c
src/rptreport.c

index 04c6645381939e8eac747ecf074e1699cd5dbe03..a38016e62ae06d07d47884a1ece2e63cee60d2da 100644 (file)
@@ -48,6 +48,7 @@ tests/test_rptreport
 tests/test_rptreport_creation
 tests/test_report_created*
 tests/test_rptprint_mm.rptr
+tests/test_report_newline.rpt
 POTFILES
 mkinstalldirs
 stamp-it
index afad6fc6f2a139ae133377215f71ad42a71cf1f6..30152b25137a1c0f77589e9a89b91b70fd129901 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2007 Andrea Zagli <azagli@inwind.it>
+ * Copyright (C) 2006-2010 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -259,7 +259,8 @@ RptObject
                                        priv->font = rpt_common_get_font (xnode);
                                        priv->align = rpt_common_get_align (xnode);
 
-                                       g_object_set (rpt_obj_text, "source", xmlGetProp (xnode, "source"), NULL);
+                                       prop = (gchar *)xmlGetProp (xnode, "source");
+                                       g_object_set (rpt_obj_text, "source", prop, NULL);
 
                                        prop = (gchar *)xmlGetProp (xnode, "background-color");
                                        if (prop != NULL)
index 55a1d0d66269affb46ab578930457fb9f0dbfe32..9e492e83f31d7258af50e2635b7dd83755fcf2bd 100644 (file)
@@ -2078,6 +2078,11 @@ rpt_report_rptprint_parse_text_source (RptReport *rpt_report, RptObject *rptobj,
        yy_scan_string (source);
        yyparse (rpt_report, row, &ret);
 
+       if (g_strstr_len (ret, -1, "&#10;") != NULL)
+               {
+                       ret = g_strjoinv ("\n", g_strsplit (ret, "&#10;", -1));
+               }
+
        if (ret == NULL)
                {
                        xmlNodeSetContent (xnode, "");