aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-03-16 22:59:39 +0100
committerThomas White <taw@bitwiz.org.uk>2015-03-16 22:59:39 +0100
commit729d6f9723ca39f2288adaa78af092e1e3261237 (patch)
tree44c62f05f077004292a35c007715854ddf7a5612
parent3829ff77e2c6060291ef95d4b54a12713952ee53 (diff)
Edit empty boxes
-rw-r--r--src/sc_parse.c4
-rw-r--r--src/shape.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index 4f8c4d3..ed7d7b8 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -429,7 +429,9 @@ SCBlock *sc_parse(const char *sc)
if ( sc == NULL ) return NULL;
if ( strlen(sc) == 0 ) {
- return sc_block_new();
+ SCBlock *bl = sc_block_new();
+ sc_block_set_contents(bl, strdup(""));
+ return bl;
}
bl = NULL;
diff --git a/src/shape.c b/src/shape.c
index 4ec870b..9320acd 100644
--- a/src/shape.c
+++ b/src/shape.c
@@ -271,7 +271,11 @@ int split_words(struct wrap_line *boxes, PangoContext *pc, SCBlock *bl,
if ( text == NULL ) return 1;
len_chars = g_utf8_strlen(text, -1);
- if ( len_chars == 0 ) return 1;
+ if ( len_chars == 0 ) {
+ add_wrap_boxes(boxes, text,
+ WRAP_SPACE_NONE, pc, scin, bl, 0, 0, editable);
+ return 1;
+ }
len_bytes = strlen(text);