From 4cee8ccc2caff17b5cbecc5ae895dcc9fd974c2e Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Sat, 27 Oct 2018 17:15:35 +0000 Subject: [PATCH] lok: calc: fix needed when position caching is disabled In case it would be needed to disable position caching we can't retrieve the nTotalPixels value from the LOKHeight/WidthHelper. The new code works in both cases. Change-Id: I65562dd4458eee40c5db958067fc91af6b3eb79e Reviewed-on: https://gerrit.libreoffice.org/63039 Tested-by: Jenkins Reviewed-by: Jan Holesovsky --- dictionaries | 2 +- sc/source/ui/view/tabview.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dictionaries b/dictionaries index 86921a78c42f..6c85a19c887b 160000 --- a/dictionaries +++ b/dictionaries @@ -1 +1 @@ -Subproject commit 86921a78c42f4fd499d86a226e34ab97e8b85ed5 +Subproject commit 6c85a19c887b6147ec7d3a600b51cb2a44284fa2 diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 8f7f7e37c836..3444a7e36fdc 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2479,8 +2479,10 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) SCTAB nTab = aViewData.GetTabNo(); SCROW nStartRow = -1; SCROW nEndRow = -1; + long nStartHeightPx = 0; SCCOL nStartCol = -1; SCCOL nEndCol = -1; + long nStartWidthPx = 0; tools::Rectangle aOldVisArea( mnLOKStartHeaderCol + 1, mnLOKStartHeaderRow + 1, @@ -2493,7 +2495,6 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) if (rRectangle.Top() < rRectangle.Bottom()) { SAL_INFO("sc.lok.header", "Row Header: compute start/end rows."); - long nStartHeightPx = 0; long nEndHeightPx = 0; long nRectTopPx = rRectangle.Top() / TWIPS_PER_PIXEL; long nRectBottomPx = rRectangle.Bottom() / TWIPS_PER_PIXEL; @@ -2582,7 +2583,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) aBuffer.append("\"rows\": [\n"); - long nTotalPixels = aViewData.GetLOKHeightHelper().getPosition(nStartRow); + long nTotalPixels = nStartHeightPx; SAL_INFO("sc.lok.header", "Row Header: [create string data for rows]: start row: " << nStartRow << " start height: " << nTotalPixels); @@ -2637,7 +2638,6 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) if (rRectangle.Left() < rRectangle.Right()) { SAL_INFO("sc.lok.header", "Column Header: compute start/end columns."); - long nStartWidthPx = 0; long nEndWidthPx = 0; long nRectLeftPx = rRectangle.Left() / TWIPS_PER_PIXEL; long nRectRightPx = rRectangle.Right() / TWIPS_PER_PIXEL; @@ -2723,7 +2723,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) aBuffer.append("\"columns\": [\n"); - nTotalPixels = aViewData.GetLOKWidthHelper().getPosition(nStartCol); + nTotalPixels = nStartWidthPx; SAL_INFO("sc.lok.header", "Col Header: [create string data for cols]: start col: " << nStartRow << " start width: " << nTotalPixels);