Bug 87290 - zoom percentage: locale problem?
Summary: zoom percentage: locale problem?
Status: RESOLVED WORKSFORME
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.15.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-16 13:48 UTC by Daniel Franke
Modified: 2012-10-16 06:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Use locale info to compose zoom values (2.04 KB, patch)
2004-09-16 21:11 UTC, Antti Markus
Details
Patch against KDE_3_3_0_RELEASE (2.04 KB, patch)
2004-09-17 20:03 UTC, Antti Markus
Details
patch against KDE_3_3_2_RELEASE (1.96 KB, patch)
2005-01-29 22:41 UTC, Andrey Golovizin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2004-08-16 13:48:50 UTC
Version:           0.20 (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:                Linux (i686) release 2.4.21-99-default

I'm using German locale (Control-Center -> Region Setting -> Country -> Germany), therefore the decimal separator is set to ',' instead of '.' as opposed to other countries.

KGhostView offers the zoom percentage of "66.67" percent in it's dropdown box. Selecting this results in a _really_ small display (using '-' or '+' buttons works fine, though). 
In short: any percentage "x.y" results in a tiny document, whereas 'x,y' gives the expected zoom level. 
Changing the country to "default" changes this behaviour, the "x.y" percentages work perfectly well.

Bug or feature?
Comment 1 Antti Markus 2004-09-16 21:11:57 UTC
Created attachment 7553 [details]
Use locale info to compose zoom values

Patch applies to kgv_view.cpp.
Uses locale specific decimal separator for fractional zoom values and if
entered zoom value is not a number does nothing instead of scaling document to
0%.
Comment 2 Antti Markus 2004-09-17 20:03:20 UTC
Created attachment 7563 [details]
Patch against KDE_3_3_0_RELEASE

- uses locale info to compose fractional zoom values
- if entered zoom value is not a number then does nothing instead of zooming to
0%
Comment 3 Daniel Franke 2005-01-14 13:09:41 UTC
Has the patch (20040917) already been applied? 
If not, please ignore the rest of this comment. 

--
KGhostView 0.20, KDE-3.3.91 (beta1), CVS 050113
> - uses locale info to compose fractional zoom values 
Seems to work =)

> - if entered zoom value is not a number then does nothing instead 
> of zooming to 0% 
Doesn't work. Zooms to 0% if invalid numbers (in the sense of the locale - or strings) are given as zoom values.
Comment 4 Andrey Golovizin 2005-01-29 20:22:01 UTC
> - uses locale info to compose fractional zoom values
Well, there's another problem here. Setting decimal separator to "," breaks zooming to values like 125%, while 100% and 200% still works.
Comment 5 Andrey Golovizin 2005-01-29 22:41:14 UTC
Created attachment 9350 [details]
patch against KDE_3_3_2_RELEASE

The problem with zooming to 125% was KGhostView using sprintf() to create
string arguments for XChangeProperty(). sprintf() formats numbers like "1.00"
or "1,00", depending on the locale settings, while XChangeProperty() expects
them to use dot (".") as decimal separator regardless of your locale. This
patch makes it use QString("%1")::arg() instead. The latter always formats
numbers according to POSIX locale => zooming always works as expected.
Comment 6 Daniel Franke 2005-10-30 15:02:23 UTC
Although a patch is available for a couple of months now, this bug is still valid in KDE-3.4.3 (gentoo) ...
Comment 7 Adrián Chaves (Gallaecio) 2012-10-16 06:01:24 UTC
Does not apply to Okular.