[LyX/master] Avoid static members zoom_min_ and zoom_max_
Stephan Witt
st.witt at gmx.net
Wed Feb 9 11:24:25 UTC 2022
Am 09.02.2022 um 12:17 schrieb Kornel Benko <kornel at lyx.org>:
>
> Am Wed, 9 Feb 2022 10:27:06 +0100 (CET)
> schrieb Stephan Witt <switt at lyx.org>:
>
>> commit cd995a2bc6449c8d9d3dee494ecffcf9abdcb50f
>> Author: Stephan Witt <switt at lyx.org>
>> Date: Wed Feb 9 10:59:18 2022 +0100
>>
>> Avoid static members zoom_min_ and zoom_max_
>>
>> Some compilers cannot use static class members by reference. std::min() and
>> std::max() are passing parameters by const reference. ---
>> src/frontends/qt/GuiView.h | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
>> index bd39d26..27d230b 100644
>> --- a/src/frontends/qt/GuiView.h
>> +++ b/src/frontends/qt/GuiView.h
>> @@ -519,9 +519,9 @@ private:
>> /// from the default zoom pref
>> double zoom_ratio_ = 1.0;
>> /// Minimum zoom percentage
>> - static int const zoom_min_ = 10;
>> + int const zoom_min_ = 10;
>> /// Maximum zoom percentage
>> - static int const zoom_max_ = 1000;
>> + int const zoom_max_ = 1000;
>>
>> // movability flag of all toolbars
>> bool toolbarsMovable_;
>
> I still think we should keep 'const', but do the initialization in GuiView.cpp
This is the alternate solution.
My patch was ready - therefore I put it in.
I prefer the assignment at declaration approach. But the other one works too.
The third one would be the declaration of an inline function.
Please change it at your taste…
BR, Stephan
More information about the lyx-devel
mailing list