Ticket #9376: Limit text width in the editor window (non-fullscreen mode)

Daniel xracoonx at gmx.de
Sun Aug 2 06:52:21 UTC 2020


On 2020-08-01 14:04, racoon wrote:
> On 2020-08-01 13:42, Stephan Witt wrote:
>> Am 01.08.2020 um 12:50 schrieb racoon <xracoonx at gmx.de>:
>>>
>>> On 2020-08-01 12:43, Stephan Witt wrote:
>>>> Am 01.08.2020 um 09:48 schrieb Daniel <xracoonx at gmx.de>:
>>>>>
>>>>> I am trying to fix Ticket #9376. My attempt so far is attached. 
>>>>> However, I have hit a little road block in that the clang compiler 
>>>>> does not give me useful information (for me at least):
>>>>>
>>>>> CXXLD    lyx
>>>>> Undefined symbols for architecture x86_64:
>>>>>   "std::__1::basic_string<char, std::__1::char_traits<char>, 
>>>>> std::__1::allocator<char> > 
>>>>> lyx::convert<std::__1::basic_string<char, 
>>>>> std::__1::char_traits<char>, std::__1::allocator<char> >, 
>>>>> lyx::Length>(lyx::Length)", referenced from:
>>>>>       lyx::LyXRC::write(std::__1::basic_ostream<char, 
>>>>> std::__1::char_traits<char> >&, bool, std::__1::basic_string<char, 
>>>>> std::__1::char_traits<char>, std::__1::allocator<char> > const&) 
>>>>> const in liblyxcore.a(LyXRC.o)
>>>>> ld: symbol(s) not found for architecture x86_64
>>>>> clang: error: linker command failed with exit code 1 (use -v to see 
>>>>> invocation)
>>>>> make[4]: *** [lyx] Error 1
>>>>> make[3]: *** [all-recursive] Error 1
>>>>> make[2]: *** [all] Error 2
>>>>> make[1]: *** [all-recursive] Error 1
>>>>> make: *** [all] Error 2
>>>>> ERROR: Cannot build and install lyx for x86_64.
>>>>>
>>>>>
>>>>> Maybe someone knows what I might be doing wrong?
>>>>
>>>> IMO, it’s the change from int for full_screen_width to Length for 
>>>> screen_width.
>>>> In LyXRC::write() the operator << is not implemented for Length, 
>>>> probably.
>>>
>>> Sounds plausible. So, short of implementing << for length, I should
>>> probably store the length in some other format, like string. Length
>>> seems to have a function for that: asString().
>>
>> Yes, the lyxrc file stores strings only anyway :)
>>
>> You have a similar problem with the opposite direction.
>> The "lexrc >> screen_width“ construct may not lead to errors at 
>> compile or link time.
>> But may result in dataloss silently if the >> operator doesn’t do the 
>> right thing.
>>
>> Furthermore the move from „\fullscreen_width“ to „\screen_width“ in rc 
>> file requires
>> the appropriate converter for existing rc files to the new syntax.
> 
> Yes, a pref2pref conversion is necessary anyway, since the new version
> should store a length and a unit while the previous one only stored a
> length.
> 
> Okay, I give up for now.
> 
> I tried to do it properly with strings this time. However, I can't
> figure out how to get a Length from a string. From the name
> 
> Length::Length(string const & data)
> 
> seemed promising but I don't think it's the right function. (By the way
> "widgetsToLength" also does not what the name suggests, i.e. it returns
> a string rather than a Length.)
> 
> I am still getting the linker failure with the patch attached.

Some more bisecting later... I cannot even add this line to LyXRC.h 
without getting the linker failure:


std::string x = Length("7in").asString();


(And with


std::string x = Length(7, Length::IN).asString();


and


Length x = Length(7, Length::IN);)


Maybe someone can enlighten me one day how to get a string from Length. 
Anyway, I just entered the string directly, i.e.


screen_width = "7in"


instead of


screen_width = Length("7in").asString(),


and it worked: https://www.lyx.org/trac/ticket/9376#comment:27.

Daniel



More information about the lyx-devel mailing list