From: <xf...@us...> - 2014-01-30 11:17:52
|
Revision: 1893 http://sourceforge.net/p/scstudio/code/1893 Author: xfarmad Date: 2014-01-30 11:17:49 +0000 (Thu, 30 Jan 2014) Log Message: ----------- feature #52 implemented Modified Paths: -------------- trunk/src/data/exporttex/exportTex.cpp trunk/src/data/exporttex/exportTex.h Modified: trunk/src/data/exporttex/exportTex.cpp =================================================================== --- trunk/src/data/exporttex/exportTex.cpp 2014-01-29 17:41:31 UTC (rev 1892) +++ trunk/src/data/exporttex/exportTex.cpp 2014-01-30 11:17:49 UTC (rev 1893) @@ -2443,7 +2443,7 @@ return 1; // unexpected pointer } -std::string ExportTex::print_wchar(const std::wstring &value) +std::string ExportTex::print_wchar(const std::wstring &value, bool remove_white) { std::string new_value; // performance optimalization: allocate buffer for all characters @@ -2451,11 +2451,29 @@ //if it is begin of math mode printed bool math_mode = false; bool slash = false; + bool new_line = false; // step 1: character transliteration for(std::wstring::const_iterator pos = value.begin(); pos != value.end(); pos++) { + if(new_line && isspace(*pos)) + continue; + if(!new_line && *pos == '\n') + { + if(math_mode) + { + new_value.push_back('$'); + math_mode = false; + } + new_value.push_back('\\'); + new_value.push_back('\\'); + new_line = true; + } + else + { + new_line = false; + } if( *pos == '+' || *pos == '=' || *pos == '|' || *pos == '<' || *pos == '>' || *pos == '^' || *pos == L'¬' || *pos == L'°' || *pos == L'±' || *pos == L'µ' ) { Modified: trunk/src/data/exporttex/exportTex.h =================================================================== --- trunk/src/data/exporttex/exportTex.h 2014-01-29 17:41:31 UTC (rev 1892) +++ trunk/src/data/exporttex/exportTex.h 2014-01-30 11:17:49 UTC (rev 1893) @@ -90,7 +90,7 @@ virtual std::string get_description() const { return "TeX Files"; } - static std::string print_wchar(const std::wstring &name); + static std::string print_wchar(const std::wstring &name, bool remove_white = false); static std::string print_string(const std::string &name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |