Le 21/04/2013 21:24, pdv a écrit :
Of course, but I wanted a fully functional patch before posting.
As far as I have tested the functionality should be largely OK now (at
least the User's Guide and some of my documents are displayed and
handled correctly).
There might still be problems with the coding style ...
I have compilation problems with your patch, that are solved by
including <support/doctring.H> instead of strfwd.h in BufferView.h.
Also, one should use char_type instead of wchar_t in the code.
When running the code with stdlib-debug enables, I get the assertion
below on user guide. There is a "i + 1 < end" test missing around line
1020 of TextMetrics.cpp.
JMarc
/usr/include/c++/4.7/bits/basic_string.h:845: std::basic_string<Char,
Traits, Alloc>::reference std::basic_string<Char, Traits,
Alloc>::operator[](std::basic_string<Char, Traits, Alloc>::size_type)
[with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc =
std::allocator<wchar_t>; std::basic_string<Char, Traits,
Alloc>::reference = wchar_t&; std::basic_string<Char, Traits,
Alloc>::size_type = unsigned int]: Assertion '__pos < size()' failed.
Program received signal SIGABRT, Aborted.
0xb7fdd424 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fdd424 in __kernel_vsyscall ()
#1 0xb6f1e1df in __GI_raise (sig=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0xb6f21825 in __GI_abort () at abort.c:91
#3 0x08081d1a in std::__replacement_assert (
__file=0x88a3f34 "/usr/include/c++/4.7/bits/basic_string.h",
__line=845,
__function=0x88a4aa0 <std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::operator[](unsigned int)::__PRETTY_FUNCTION__>
"std::basic_string<Char, Traits, Alloc>::reference
std::basic_string<Char, Traits,
Alloc>::operator[](std::basic_string<Char, Traits, Alloc>::size_type)
[with _CharT = wchar_t; _Traits = std::char_trai"...,
__condition=0x88a3f5d "__pos < size()")
at /usr/include/c++/4.7/i686-linux-gnu/bits/c++config.h:361
#4 0x080841a2 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::operator[] (this=0x973861c, __pos=20)
at /usr/include/c++/4.7/bits/basic_string.h:845
#5 0x0828d7af in lyx::Paragraph::isLineSeparator (this=0x9756658, pos=20)
at ../../master/src/Paragraph.cpp:2994
#6 0x082fc113 in lyx::TextMetrics::rowBreakPoint (this=0xa16b114,
width=628,
pit=0, pos=0) at ../../master/src/TextMetrics.cpp:1020