use mdds position hint (tdf#131716)

Otherwise this is the usual case of possible quadratic mdds slowness.

Change-Id: I5b33df65e127702c011517d79b9cd41a7e820ca0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91553
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 03787f7..47e39f0 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -42,6 +42,7 @@
#include <tokenarray.hxx>
#include <scmatrix.hxx>
#include <brdcst.hxx>
#include <mtvelements.hxx>

#include <formula/opcode.hxx>
#include <o3tl/safeint.hxx>
@@ -2454,6 +2455,8 @@
            {
                for (SCCOL nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); ++nCol)
                {
                    sc::ColumnBlockPosition hint;
                    m_pDocument->InitColumnBlockPosition( hint, nTab, nCol );
                    for (SCROW nRow = aRange.aStart.Row(); nRow <= aRange.aEnd.Row(); ++nRow)
                    {
                        bool bColHidden = m_pDocument->ColHidden(nCol, nTab, nullptr, &nLastCol);
@@ -2473,7 +2476,7 @@
                        ScAddress aAdr(nCol, nRow, nTab);
                        aItem.maString = m_pDocument->GetString(aAdr);

                        ScRefCellValue aCell(*m_pDocument, aAdr);
                        ScRefCellValue aCell(*m_pDocument, aAdr, hint);
                        switch (aCell.meType)
                        {
                            case CELLTYPE_VALUE: