[Libreoffice-commits] core.git: sc/qa sc/source vcl/source
sc/qa/uitest/calc_tests6/moveCopySheet.py | 13 + sc/source/ui/miscdlgs/mvtabdlg.cxx|1 - vcl/source/uitest/uiobject.cxx|1 + 3 files changed, 14 insertions(+), 1 deletion(-) New commits: commit a8d3b8985a79c216c3c132fb2e6bb0f85a27831a Author: Andreas Heinisch AuthorDate: Thu Jan 5 08:21:35 2023 +0100 Commit: Andreas Heinisch CommitDate: Thu Jan 5 16:06:06 2023 + tdf#56973 - Copy/paste (single) sheet is checked but not enabled Enable the "copy" radio button in the move/copy sheet dialog, if there is just a single sheet in a spreadsheet document. Otherwise, users get the impression that a single sheet cannot be copied because the "copy" radio button is selected but not enabled, i.e., greyed out. Change-Id: Icf98973585491b0c8c9a74aad3900f6cc2895d11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145064 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py b/sc/qa/uitest/calc_tests6/moveCopySheet.py index a80b7c329173..80bd9f830a27 100644 --- a/sc/qa/uitest/calc_tests6/moveCopySheet.py +++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py @@ -63,6 +63,19 @@ class moveCopySheet(UITestCase): self.assertEqual(document.Sheets[1].Name, "Sheet1") self.assertEqual(document.Sheets[2].Name, "moveName") +# tdf#56973 - copy/paste (single) sheet is checked but not enabled +def test_tdf56973_copy_paste_inactive(self): +with self.ui_test.create_doc_in_start_center("calc"): +with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: +# A single sheet can only be copied +xCopyButton = xDialog.getChild("copy") +self.assertEqual(get_state_as_dict(xCopyButton)["Checked"], "true") +self.assertEqual(get_state_as_dict(xCopyButton)["Enabled"], "true") +# A single sheet can not be moved +xMoveButton = xDialog.getChild("move") +self.assertEqual(get_state_as_dict(xMoveButton)["Checked"], "false") +self.assertEqual(get_state_as_dict(xMoveButton)["Enabled"], "false") + #tdf#139464 Set OK button label to selected action: Move or Copy def test_tdf139464_move_sheet(self): with self.ui_test.create_doc_in_start_center("calc"): diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 9cc587aa56e0..e64a29b6b471 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -74,7 +74,6 @@ void ScMoveTableDlg::SetForceCopyTable() { m_xBtnCopy->set_active(true); m_xBtnMove->set_sensitive(false); -m_xBtnCopy->set_sensitive(false); SetOkBtnLabel(); } diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 0b55d4c96857..9b8616c3906b 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1018,6 +1018,7 @@ StringMap RadioButtonUIObject::get_state() { StringMap aMap = WindowUIObject::get_state(); aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked()); +aMap["Enabled"] = OUString::boolean(mxRadioButton->IsEnabled()); return aMap; }
[Libreoffice-commits] core.git: sc/qa sc/source vcl/source
sc/qa/unit/ucalc.cxx |2 +- sc/qa/unit/uicalc/uicalc.cxx |2 +- sc/source/core/data/document.cxx |4 ++-- vcl/source/control/button.cxx|2 +- vcl/source/outdev/map.cxx|2 +- 5 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 5d172408dffd3e6f4b76254f0980b0fd1210bb2f Author: Andrea Gelmini AuthorDate: Fri Apr 23 22:33:48 2021 +0200 Commit: Andrea Gelmini CommitDate: Sat Apr 24 07:59:03 2021 +0200 Fix typos Change-Id: I0a8279429c9e0d884a5e8fbb8f22617832385a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114574 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 02988bdd5ff4..f03c8fe073d8 100755 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4170,7 +4170,7 @@ void Test::testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose() rEntry.bDoQuery = true; rEntry.nField = 0; rEntry.eOp = SC_GREATER_EQUAL; -rEntry.GetQueryItem().mfVal = 0; // filtering neative values -> filtering row 1 and 2 +rEntry.GetQueryItem().mfVal = 0; // filtering negative values -> filtering row 1 and 2 // add queryParam to database range. pDBData->SetQueryParam(aParam); diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index c756a75065a5..29417a3c4778 100755 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -465,7 +465,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706) CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0))); } -// Inspired from testTdf117706, test columns instad of rows +// Inspired from testTdf117706, test columns instead of rows CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMultiRangeCol) { mxComponent = loadFromDesktop("private:factory/scalc"); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 108c07e03705..89322ceb2cdf 100755 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2354,8 +2354,8 @@ void ScDocument::TransposeClip(ScDocument* pTransClip, InsertDeleteFlags nFlags, // and selection are in the same dimension (i.e. row). // The filtered row status and the selection ranges are not available at the same time, // handle this case specially, do not use GetClipParam().getWholeRange(), -// instead loop through the ranges, calculate the row offest and handle filtered rows and -// create in ScClipParam::transpose() an unified range. +// instead loop through the ranges, calculate the row offset and handle filtered rows and +// create in ScClipParam::transpose() a unified range. bool bIsMultiRangeRowFilteredTranspose = !bIncludeFiltered && GetClipParam().isMultiRange() && HasFilteredRows(aCombinedClipRange.aStart.Row(), aCombinedClipRange.aEnd.Row(), diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index bda053a97787..b08cc9772d62 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2020,7 +2020,7 @@ void Button::ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, DrawFlags // is pixel-oriented (all Paints of Controls are, historically), so // the minimum width should be '1' Pixel. // Hint: nImageSep is based on Zoom (using Window::CalcZoom) and -// MapModes (using Window::GetDrawPixel) - so potenially a wide range +// MapModes (using Window::GetDrawPixel) - so potentially a wide range // of unpredictable values is possible const tools::Long nWidthAdjust(rImageSize.Width() + nImageSep); aSize.setWidth(std::max(static_cast(1), aSize.getWidth() - nWidthAdjust)); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index e8f9d0dd7df2..4761062c820c 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -389,7 +389,7 @@ tools::Rectangle OutputDevice::ImplLogicToDevicePixel( const tools::Rectangle& r //tools::Long(1) == aRect.GetWidth() //tools::Long(0) == aRect.getWidth() // (remember: this means Left == Right == 1 -> GetWidth => 1, getWidth == 0) -// so indeed tthe 1's have to go uncommened/unchecked into the data body +// so indeed the 1's have to go uncommented/unchecked into the data body // of rectangle. Switching to (2) *is* needed, doing so tools::Rectangle aRetval; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa sc/source vcl/source
sc/qa/uitest/range_name/tdf86214.py | 10 ++ sc/source/ui/namedlg/namedefdlg.cxx | 34 +++--- vcl/source/uitest/uiobject.cxx |1 + 3 files changed, 22 insertions(+), 23 deletions(-) New commits: commit 58dcf2a88af215df4e912f0cfcb32908c6a298a0 Author: Andreas Heinisch AuthorDate: Fri Apr 2 13:23:46 2021 +0200 Commit: Heiko Tietze CommitDate: Mon Apr 12 08:39:47 2021 +0200 tdf#132869 - Show the error message in a tooltip In the define name dialog, the input itself should show the error message in a tooltip. In addition, the possibility to test the tooltip text in python was added. Change-Id: I9bd7d2b2be8300aa366971f8a1f115e8ae19fb98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113513 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sc/qa/uitest/range_name/tdf86214.py b/sc/qa/uitest/range_name/tdf86214.py index d529a47b9dd1..48817e0bcc64 100644 --- a/sc/qa/uitest/range_name/tdf86214.py +++ b/sc/qa/uitest/range_name/tdf86214.py @@ -39,16 +39,18 @@ class InvalidNames(UITestCase): select_all(xEdit) type_text(xEdit, name) -new_text = get_state_as_dict(xLabel)["Text"] -self.assertNotEqual(success_text, new_text) +# tdf#132869 - Without the fix in place, this test would have failed with +# - Expected: "Invalid name. Start with a letter, use only letters, numbers and underscore." +# - Actual : "" +self.assertNotEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"]) self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "false") select_all(xEdit) type_text(xEdit, "valid_name") -new_text = get_state_as_dict(xLabel)["Text"] -self.assertEqual(success_text, new_text) +self.assertEqual(success_text, get_state_as_dict(xLabel)["Text"]) +self.assertEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"]) self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "true") self.ui_test.close_dialog_through_button(xAddBtn) diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 25ff6e132a61..658026652c6b 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -120,6 +120,9 @@ bool ScNameDefDlg::IsNameValid() OUString aScope = m_xLbScope->get_active_text(); OUString aName = m_xEdName->get_text(); +bool bIsNameValid = true; +OUString aHelpText = maStrInfoDefault; + ScRangeName* pRangeName = nullptr; if(aScope == maGlobalNameStr) { @@ -131,46 +134,39 @@ bool ScNameDefDlg::IsNameValid() } ScRangeData::IsNameValidType eType; -m_xFtInfo->set_label_type(weld::LabelType::Normal); if ( aName.isEmpty() ) { -m_xBtnAdd->set_sensitive(false); -m_xFtInfo->set_label(maStrInfoDefault); -return false; +bIsNameValid = false; } else if ((eType = ScRangeData::IsNameValid(aName, mrDoc)) != ScRangeData::IsNameValidType::NAME_VALID) { -m_xFtInfo->set_label_type(weld::LabelType::Error); if (eType == ScRangeData::IsNameValidType::NAME_INVALID_BAD_STRING) { -m_xFtInfo->set_label(maErrInvalidNameStr); +aHelpText = maErrInvalidNameStr; } else if (eType == ScRangeData::IsNameValidType::NAME_INVALID_CELL_REF) { -m_xFtInfo->set_label(maErrInvalidNameCellRefStr); +aHelpText = maErrInvalidNameCellRefStr; } -m_xBtnAdd->set_sensitive(false); -return false; +bIsNameValid = false; } else if (pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName))) { -m_xFtInfo->set_label_type(weld::LabelType::Error); -m_xFtInfo->set_label(maErrNameInUse); -m_xBtnAdd->set_sensitive(false); -return false; +aHelpText = maErrNameInUse; +bIsNameValid = false; } if (!IsFormulaValid()) { -m_xFtInfo->set_label_type(weld::LabelType::Error); -m_xBtnAdd->set_sensitive(false); -return false; +bIsNameValid = false; } -m_xFtInfo->set_label(maStrInfoDefault); -m_xBtnAdd->set_sensitive(true); -return true; +m_xEdName->set_tooltip_text(aHelpText); +m_xEdName->set_message_type(bIsNameValid || aName.isEmpty() ? weld::EntryMessageType::Normal +: weld::EntryMessageType::Error); +m_xBtnAdd->set_sensitive(bIsNameValid); +return bIsNameValid; } void ScNameDefDlg::AddPushed() diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index fc72053074c6..4d8390e212a2 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -785,6 +785,7 @@
[Libreoffice-commits] core.git: sc/qa sc/source vcl/source
sc/qa/uitest/autofilter/autofilter.py | 27 +++ sc/source/ui/view/gridwin.cxx | 19 --- vcl/source/treelist/uiobject.cxx |1 + 3 files changed, 40 insertions(+), 7 deletions(-) New commits: commit fbcb6add21b889e20f67a7ef6e4e3c32ac1261d3 Author: Xisco Fauli AuthorDate: Thu Sep 24 21:16:05 2020 +0200 Commit: Xisco Fauli CommitDate: Fri Sep 25 13:14:33 2020 +0200 tdf#134351: do not apply autofilter if all entries are selected Change-Id: I33cdfe07cc53b579bbe16486f302daf7bd3da841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103352 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index 000ddaab77e3..abb776ea8b99 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -114,4 +114,31 @@ class AutofilterTest(UITestCase): self.ui_test.close_doc() +def test_tdf134351(self): +doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) + +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") +xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + +xFloatWindow = self.xUITest.getFloatWindow() +xCheckListMenu = xFloatWindow.getChild("check_list_menu") + +xTreeList = xCheckListMenu.getChild("check_tree_box") + +self.assertEqual(2, len(xTreeList.getChildren())) + self.assertTrue(get_state_as_dict(xTreeList.getChild('0'))['IsSelected']) + self.assertTrue(get_state_as_dict(xTreeList.getChild('1'))['IsSelected']) + +xOkBtn = xFloatWindow.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.assertFalse(is_row_hidden(doc, 0)) +# Without the fix in place, this test would have failed here +self.assertFalse(is_row_hidden(doc, 1)) +self.assertFalse(is_row_hidden(doc, 2)) +self.assertFalse(is_row_hidden(doc, 3)) +self.assertFalse(is_row_hidden(doc, 4)) + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index bb8cef1279f1..f6edb66554de 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -876,13 +876,18 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) if (aResult == aSaveAutoFilterResult) { SAL_INFO("sc.ui", "Apply autofilter to data when entries are the same"); -// Apply autofilter to data -ScQueryEntry* pEntry = aParam.FindEntryByField(rPos.Col(), true); -pEntry->bDoQuery = true; -pEntry->nField = rPos.Col(); -pEntry->eConnect = SC_AND; -pEntry->eOp = SC_EQUAL; -pViewData->GetView()->Query(aParam, nullptr, true); + +if (!rControl.isAllSelected()) +{ +// Apply autofilter to data +ScQueryEntry* pEntry = aParam.FindEntryByField(rPos.Col(), true); +pEntry->bDoQuery = true; +pEntry->nField = rPos.Col(); +pEntry->eConnect = SC_AND; +pEntry->eOp = SC_EQUAL; +pViewData->GetView()->Query(aParam, nullptr, true); +} + return; } } diff --git a/vcl/source/treelist/uiobject.cxx b/vcl/source/treelist/uiobject.cxx index 1c9146c51101..e7fb516b5d21 100644 --- a/vcl/source/treelist/uiobject.cxx +++ b/vcl/source/treelist/uiobject.cxx @@ -106,6 +106,7 @@ StringMap TreeListEntryUIObject::get_state() aMap["Text"] = mxTreeList->GetEntryText(mpEntry); aMap["Children"] = OUString::number(mxTreeList->GetLevelChildCount(mpEntry)); aMap["VisibleChildCount"] = OUString::number(mxTreeList->GetVisibleChildCount(mpEntry)); +aMap["IsSelected"] = OUString::boolean(mxTreeList->IsSelected(mpEntry)); return aMap; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits