https://bugs.documentfoundation.org/show_bug.cgi?id=98893

            Bug ID: 98893
           Summary: Remove expensive calls to GetCellType +
                    GetValue/GetString/... in calc
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

In calc we have a common pattern based on the old calc core desing to call:

CellType eType = pDoc->GetCellType(aPos);
switch(eType)
{
    case CELLTYPE_VALUE:
       nVal = pDoc->GetValue(aPos);
    break;
    case CELLTYPE_STRING:
       aStr = pDoc->GetString(aPos);
    break;
    case CELL...
}

which calls two times with a slow call into mdds. Instead we should use
ScRefCellValue which only calls once.

The task is to grep for GetCellType in sc/source and find places where we use
that pattern and replace it with ScRefCellValue.

Examples for similar problems (not directly the same) are:

https://cgit.freedesktop.org/cgit/?url=libreoffice/core/commit/sc&id=d9c1921c5031e5b372ee9d8db1e00fe7211cdd31
https://cgit.freedesktop.org/cgit/?url=libreoffice/core/commit/sc&id=4518faa31dec03ffabee30437e6960558a940957
https://cgit.freedesktop.org/cgit/?url=libreoffice/core/commit/sc&id=ee98f0e691e3cf945725a9f1daa90542407e3358


Please note that the pDoc->GetString method actually is more complicated than
just returning the OUString instances from the ScRefCellValue and you might
need to use ScCellFormat::GetString.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to