From 272c7a2e25c3ec39f43f60eaef28b6f7e0309921 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Thu, 17 Jan 2013 16:58:45 -0500 Subject: [PATCH] bug fix: read css file name instread of content in cre:setStyleSheet --- cre.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cre.cpp b/cre.cpp index 47998a13b..6b9e02ef7 100644 --- a/cre.cpp +++ b/cre.cpp @@ -408,9 +408,13 @@ static int setDefaultInterlineSpace(lua_State *L) { static int setStyleSheet(lua_State *L) { CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); - const char* style_sheet_data = luaL_checkstring(L, 2); + const char* style_sheet = luaL_checkstring(L, 2); + lString8 css; + + if (LVLoadStylesheetFile(lString16(style_sheet), css)){ + doc->text_view->setStyleSheet(css); + } - doc->text_view->setStyleSheet(lString8(style_sheet_data)); return 0; }