Version: 1.3.2 (using KDE 3.3.0, Gentoo) Compiler: gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6) OS: Linux (i686) release 2.6.8-gentoo-r3 I'm from Brazil, and here we use commas to separate decimal values. So, 15/10 is written as 1,5. My locale is configure this way and all over KDE (inclusive in kspread), this setting is respect. However, when using the Goal Seek function from KSpread, the "To value" input box doesn't respect this setting. If I enter 1,5 as the value, it says "target value is invalid". Using 1.5 it works correctly, although it is inconsistent with the rest of the system.
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; }