From 3c56f50cae98edb18d3ea8580dd9bb2fd715f658 Mon Sep 17 00:00:00 2001 From: HW Date: Sun, 4 Mar 2012 18:59:50 +0100 Subject: [PATCH] switched TOC entry sanitizing to Lua code --- pdf.c | 10 ---------- pdfreader.lua | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pdf.c b/pdf.c index c375f93e1..2551be985 100644 --- a/pdf.c +++ b/pdf.c @@ -105,16 +105,6 @@ static int walkTableOfContent(lua_State *L, fz_outline* ol, int *count, int dept lua_settable(L, -3); lua_pushstring(L, "title"); - /* workaround for misplaced carriage ret in toc entry */ - int i = 0; - while (ol->title[i]) { - if (ol->title[i] == 0x0d) { - ol->title[i] = ' '; - } - /*printf("%x|", ol->title[i]);*/ - i++; - } - lua_pushstring(L, ol->title); lua_settable(L, -3); diff --git a/pdfreader.lua b/pdfreader.lua index a825f569c..e162c28de 100644 --- a/pdfreader.lua +++ b/pdfreader.lua @@ -336,7 +336,7 @@ function PDFReader:showTOC() -- build menu items for _k,_v in ipairs(toc) do table.insert(menu_items, - (" "):rep(_v.depth-1).._v.title) + (" "):rep(_v.depth-1) .. _v.title:gsub("\13", "")) end toc_menu = SelectMenu:new{ menu_title = "Table of Contents",