tdf#144155: Revert "tdf#36383 sc AutoFilter: fix changing row height"

This reverts commit 3678e0efcb8bedc58dd329a430da0ac3b1572df8.

Conflicts: sc/qa/uitest/autofilter/tdf36383.py
Change-Id: Ie1abd0cdea013571a27b187ffcb20125a0656442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121512
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121550
(cherry picked from commit 91eb9e16cd73df2249a24f949ea8bef62bbe2d09)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121555
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
diff --git a/sc/qa/uitest/autofilter/tdf36383.py b/sc/qa/uitest/autofilter/tdf36383.py
deleted file mode 100644
index d55db21..0000000
--- a/sc/qa/uitest/autofilter/tdf36383.py
+++ /dev/null
@@ -1,68 +0,0 @@
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row

#Bug 36383 - EDITING auto row height or change row height removes AutoFilter result

class tdf36383(UITestCase):
    def test_tdf36383_row_height(self):
        self.ui_test.create_doc_in_start_center("calc")
        document = self.ui_test.get_component()
        calcDoc = self.xUITest.getTopFocusWindow()
        gridwin = calcDoc.getChild("grid_window")
        document = self.ui_test.get_component()

        enter_text_to_cell(gridwin, "A1", "A")
        enter_text_to_cell(gridwin, "A2", "1")
        enter_text_to_cell(gridwin, "A3", "2")
        enter_text_to_cell(gridwin, "A4", "3")

        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))

        self.xUITest.executeCommand(".uno:DataFilterAutoFilter")

        gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
        xFloatWindow = self.xUITest.getFloatWindow()
        xCheckListMenu = xFloatWindow.getChild("check_list_menu")
        xList = xCheckListMenu.getChild("check_list_box")
        xEntry = xList.getChild("1")
        xEntry.executeAction("CLICK", tuple())

        xOkButton = xFloatWindow.getChild("ok")
        xOkButton.executeAction("CLICK", tuple())

        row = get_row(document, 2)
        self.assertFalse(row.getPropertyValue("IsVisible"))

        #row height
        self.ui_test.execute_dialog_through_command(".uno:RowHeight")
        xDialog = self.xUITest.getTopFocusWindow()
        xvalue = xDialog.getChild("value")
        xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
        xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
        xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))

        xOk = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOk)

        self.assertFalse(row.getPropertyValue("IsVisible"))

        #optimal row height
        self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight")
        xDialog = self.xUITest.getTopFocusWindow()

        xOk = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOk)

        self.assertFalse(row.getPropertyValue("IsVisible"))

        self.ui_test.close_doc()

# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 718d8cd..50606d8 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2177,17 +2177,7 @@ void ScViewFunc::SetWidthOrHeight(
                    aCxt.setExtraHeight(nSizeTwips);
                    rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab, true);
                    if (bAll)
                    {
                        for (SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow)
                        {
                            SCROW nLastRow = nRow;
                            // tdf#36383 skip consecutive rows hidden by AutoFilter
                            if (rDoc.RowFiltered(nRow, nTab, nullptr, &nLastRow))
                                nRow = nLastRow;
                            else
                                rDoc.ShowRow(nRow, nTab, true);
                        }
                    }
                        rDoc.ShowRows( nStartNo, nEndNo, nTab, true );

                    //  Manual-Flag already (re)set in SetOptimalHeight in case of bAll=sal_True
                    //  (set for Extra-Height, else reset).
@@ -2200,15 +2190,7 @@ void ScViewFunc::SetWidthOrHeight(
                        rDoc.SetManualHeight( nStartNo, nEndNo, nTab, true );          // height was set manually
                    }

                    for (SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow)
                    {
                        SCROW nLastRow = nRow;
                        // tdf#36383 skip consecutive rows hidden by AutoFilter
                        if (rDoc.RowFiltered(nRow, nTab, nullptr, &nLastRow))
                            nRow = nLastRow;
                        else
                            rDoc.ShowRow(nRow, nTab, nSizeTwips != 0);
                    }
                    rDoc.ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );

                    if (!bShow && nStartNo <= nCurY && nCurY <= nEndNo && nTab == nCurTab)
                    {