Templates: fix indention for generated "images" block

fix T2971
This commit is contained in:
Mykyta Biliavskyi 2015-12-30 11:36:09 +09:00
parent bce72d3f44
commit 39ddc2da33
2 changed files with 23 additions and 5 deletions

View File

@ -44,7 +44,22 @@ image_description_add(edit_data *ed)
}
else
{
elm_entry_entry_insert(edit_entry, TEMPLATE_IMG_BLOCK);
int space = edit_cur_indent_depth_get(ed);
//Alloc Empty spaces
char *p = alloca(space + 1);
memset(p, ' ', space);
p[space] = '\0';
int i;
for (i = 0; i < (TEMPLATE_IMG_BLOCK_LINE_CNT - 1); i++)
{
elm_entry_entry_insert(edit_entry, p);
elm_entry_entry_insert(edit_entry, TEMPLATE_IMG_BLOCK[i]);
}
elm_entry_entry_insert(edit_entry, p);
elm_entry_entry_insert(edit_entry, TEMPLATE_IMG_BLOCK[i]);
edit_line_increase(ed, TEMPLATE_IMG_BLOCK_LINE_CNT);
cursor_pos2 = elm_entry_cursor_pos_get(edit_entry);
edit_redoundo_region_push(ed, cursor_pos1, cursor_pos2);

View File

@ -165,10 +165,13 @@ const char *TEMPLATE_IMG[TEMPLATE_IMG_LINE_CNT] =
#define TEMPLATE_IMG_BLOCK_LINE_CNT 4
const char *TEMPLATE_IMG_BLOCK = "/* TODO: Please replace embedded image files to your application image files. */<br/>"
" images {<br/>"
" image: \"ENVENTOR_EMBEDDED_LOGO.png\" COMP;<br/>"
" }<br/>";
const char *TEMPLATE_IMG_BLOCK[TEMPLATE_IMG_BLOCK_LINE_CNT] =
{
"/* TODO: Please replace embedded image files to your application image files. */<br/>",
"images {<br/>",
" image: \"ENVENTOR_EMBEDDED_LOGO.png\" COMP;<br/>",
"}<br/>"
};
#define TEMPLATE_TEXTBLOCK_STYLE_LINE_CNT 3