Summary: | kpdf crashes when zooming to 12.5. 33.33 and 66.67 per cent | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Arnout Boelens <a.m.p.boelens> |
Component: | general | Assignee: | Christophe Devriese <oelewapperke> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch to Kpdf part
Fixes crash, uses locale decimal symbol for zoom values |
Description
Arnout Boelens
2004-06-05 13:20:46 UTC
I have this too but it seems that it's not the specific percentages - whenever I enter the zoom value as nn.n (ie 50.5) then KPDF crashes. If I enter the value as nn,n (ie 50,5) then KPDF doesn't crash. Also it seems that regional settings don't affect this issue (ie KPDF always crashes when zoom value is fractional and decimal delimiter is '.', even if decimal delimiter is '.' in regional settings) KPDF version is v0.3 (KDE 3.3.0-1 Red Hat), I'm using Fedora Core 3 test1 (updated to the latest development packages). Generally it seems that whenever a non-numeric zoom value is entered KPDF crashes. Kpdf compiled from CVS has the same issue. Created attachment 7372 [details]
patch to Kpdf part
- uses KLocale formatNumber to populate the zoom combo box
- if entered zoom value is not a number then don't resize the view
Created attachment 7377 [details]
Fixes crash, uses locale decimal symbol for zoom values
- use locale decimal symbol when populating zoom combo box
- retain fractional zoom values
- if entered zoom value is not a number do nothing instead of crashing
CVS commit by aacid: Thanks Antti for the patch CCMAIL:82877-done@bugs.kde.org M +14 -4 kpdf_part.cpp 1.51.2.3 --- kdegraphics/kpdf/kpdf/kpdf_part.cpp #1.51.2.2:1.51.2.3 @@ -123,9 +123,14 @@ Part::Part(QWidget *parentWidget, const QStringList translated; + QString localValue; + QString double_oh("00"); int idx = 0; int cur = 0; for ( int i = 0; i < 10;i++) { - translated << QString( "%1%" ).arg( zoomValue[i] * 100.0 ); + localValue = KGlobal::locale()->formatNumber( zoomValue[i] * 100.0, 2 ); + localValue.remove( KGlobal::locale()->decimalSymbol()+double_oh ); + + translated << QString( "%1%" ).arg( localValue ); if ( zoomValue[i] == 1.0 ) idx = cur; @@ -162,7 +167,12 @@ void Part::slotZoom( const QString&nz ) double zoom; z.remove( z.find( '%' ), 1 ); - zoom = KGlobal::locale()->readNumber( z ) / 100; + bool isNumber = true; + zoom = KGlobal::locale()->readNumber( z, &isNumber ) / 100; + + if ( isNumber ) + { kdDebug() << "ZOOM = " << nz << ", setting zoom = " << zoom << endl; m_outputDev->zoomTo( zoom ); + } } |