sc/qa/uitest/calc_tests/columns.py | 20 ++++++++++---------- sc/qa/uitest/calc_tests/rows.py | 12 ++++++------ sc/source/ui/view/cellsh3.cxx | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-)
New commits: commit ad8edac43e73555bc2055514300c5b81a1bb04ea Author: Winston Min Tjong <winstontj...@gmail.com> AuthorDate: Thu Apr 8 14:55:00 2021 -0700 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Thu Apr 22 18:23:32 2021 +0200 tdf#101217 Change row height and col width decimal places to 4 Bug 101217 - Setting the column width and height should not round the values causing compounding errors This patch fixes the problem caused by rounding errors by increasing the number of decimal places for row height, optimal row height, column width, and optimal column width to 4. Change-Id: Iefb5ef09af3bd81d429cf17386c8b1a54e111957 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113824 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/sc/qa/uitest/calc_tests/columns.py b/sc/qa/uitest/calc_tests/columns.py index a03ebda37ae2..28649d07f3c2 100644 --- a/sc/qa/uitest/calc_tests/columns.py +++ b/sc/qa/uitest/calc_tests/columns.py @@ -46,7 +46,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xCancel = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCancel) @@ -79,7 +79,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -87,7 +87,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -126,7 +126,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -236,7 +236,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -244,7 +244,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -252,7 +252,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -260,7 +260,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -268,7 +268,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -276,7 +276,7 @@ class CalcColumns(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) diff --git a/sc/qa/uitest/calc_tests/rows.py b/sc/qa/uitest/calc_tests/rows.py index f1ee519ba09a..b5e40fa1e327 100644 --- a/sc/qa/uitest/calc_tests/rows.py +++ b/sc/qa/uitest/calc_tests/rows.py @@ -46,7 +46,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xCancel = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCancel) @@ -79,7 +79,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -87,7 +87,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -127,7 +127,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -214,7 +214,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -222,7 +222,7 @@ class CalcRows(UITestCase): self.ui_test.execute_dialog_through_command(".uno:RowHeight") xDialog = self.xUITest.getTopFocusWindow() xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index c809c79fce60..433ce133997d 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -699,7 +699,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetFrameWeld(), "RowHeightDialog", nCurHeight, ScGlobal::nStdRowHeight, - eMetric, 2, MAX_ROW_HEIGHT)); + eMetric, 4, MAX_ROW_HEIGHT)); if ( pDlg->Execute() == RET_OK ) { @@ -736,7 +736,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetFrameWeld(), "OptimalRowHeightDialog", - ScGlobal::nLastRowHeightExtra, 0, eMetric, 1, MAX_EXTRA_HEIGHT)); + ScGlobal::nLastRowHeightExtra, 0, eMetric, 4, MAX_EXTRA_HEIGHT)); if ( pDlg->Execute() == RET_OK ) { tools::Long nVal = pDlg->GetInputValue(); @@ -797,7 +797,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight, - STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH)); + STD_COL_WIDTH, eMetric, 4, MAX_COL_WIDTH)); if ( pDlg->Execute() == RET_OK ) { tools::Long nVal = pDlg->GetInputValue(); @@ -833,7 +833,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg( pTabViewShell->GetFrameWeld(), "OptimalColWidthDialog", - ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 1, MAX_EXTRA_WIDTH)); + ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 4, MAX_EXTRA_WIDTH)); if ( pDlg->Execute() == RET_OK ) { tools::Long nVal = pDlg->GetInputValue(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits