tdf#88109 improve autofill perf (2)

make SvxWeightItem sortable, which shaves off 1%

and turn the tree search off while performing this operation, which
shaves off about 25% of the time on my machine.

Change-Id: I94358ed565a0d9f1cc0ddb36b8349e83c9deb959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95369
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 9073a47b99e22585c6d1603dd747cb14f081fca1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95414
diff --git a/include/editeng/wghtitem.hxx b/include/editeng/wghtitem.hxx
index 121cfcf..6f5f4b3 100644
--- a/include/editeng/wghtitem.hxx
+++ b/include/editeng/wghtitem.hxx
@@ -59,6 +59,14 @@
    FontWeight              GetWeight() const { return GetValue(); }

    void dumpAsXml(xmlTextWriterPtr pWriter) const override;

    virtual bool IsSortable() const override { return true; }

    virtual bool operator<(const SfxPoolItem& rCmp) const override
    {
        auto const & other = static_cast<const SvxWeightItem&>(rCmp);
        return GetValue() < other.GetValue();
    }
};

#endif // INCLUDED_EDITENG_WGHTITEM_HXX
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 022a57f..16e6e5d 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -464,6 +464,8 @@

    ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument);

    mpRowHeights->enableTreeSearch(false);

    GetOptimalHeightsInColumn(rCxt, aCol, nStartRow, nEndRow, pProgress, nProgressStart);

    SetRowHeightRangeFunc aFunc(this, rCxt.getPPTY());
@@ -472,6 +474,8 @@
    if ( pProgress != pOuterProgress )
        delete pProgress;

    mpRowHeights->enableTreeSearch(true);

    return bChanged;
}