Summary: | goal seek ignores number format from locale | ||
---|---|---|---|
Product: | [Applications] calligrasheets | Reporter: | Ismael Orenstein <ismore> |
Component: | general | Assignee: | Laurent Montel <montel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.3.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Patch to enable locale in the goal seek dialog
A better way to fix the locale in the goal seek dialog |
Description
Ismael Orenstein
2004-09-30 22:35:15 UTC
Created attachment 7740 [details]
Patch to enable locale in the goal seek dialog
The attached patch is a suggestion to fix this bug.
I also changed the way to display the current value and new value string to
reflect the locale.
Created attachment 7744 [details]
A better way to fix the locale in the goal seek dialog
This patch uses m_pView->doc()->locale(), where m_pView is a KSpreadView object
and doc() returns a KSpreadDoc object.
The previous patch used KGlobal::locale()
CVS commit by mecir: Fixing bug #90569 (Goal seek ignores number format from locale). Patch sent by Tim Beaulen, tbscope <> gmail () com CCMAIL: 90569-done@bugs.kde.org M +4 -4 kspread_dlg_goalseek.cc 1.23 --- koffice/kspread/dialogs/kspread_dlg_goalseek.cc #1.22:1.23 @@ -271,5 +271,5 @@ void KSpreadGoalSeekDlg::buttonOkClicked bool ok = false; - double goal = m_targetValueEdit->text().toDouble( &ok ); + double goal = m_pView->doc()->locale()->readNumber(m_targetValueEdit->text(), &ok ); if ( !ok ) { @@ -471,6 +471,6 @@ void KSpreadGoalSeekDlg::startCalc(doubl m_resultText->setText( i18n( "Goal seeking with cell %1 found a solution:" ).arg( m_sourceEdit->text() ) ); - m_newValue->setText( QString::number( startA ) ); - m_currentValue->setText( QString::number( m_oldSource ) ); + m_newValue->setText( m_pView->doc()->locale()->formatNumber( startA ) ); + m_currentValue->setText( m_pView->doc()->locale()->formatNumber( m_oldSource ) ); m_restored = false; } @@ -484,5 +484,5 @@ void KSpreadGoalSeekDlg::startCalc(doubl m_resultText->setText( i18n( "Goal seeking with cell %1 has found NO solution." ).arg( m_sourceEdit->text() ) ); m_newValue->setText( "" ); - m_currentValue->setText( QString::number( m_oldSource ) ); + m_currentValue->setText( m_pView->doc()->locale()->formatNumber( m_oldSource ) ); m_restored = true; } |