summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2021-04-21 18:28:13 +0200
committerAndras Timar <andras.timar@collabora.com>2021-05-12 10:51:44 +0200
commit72b2761984cb6f2440997ca37e3a1defa31cc5cf (patch)
tree23c9749e6fbdedbffd1ebc2ef91b3c88a9e6176c
parentfc38b964dc96027e277b34597cbb1f9bec9c03d0 (diff)
lok: calc: formula breaking to multiple lines partly shown in edit mode
visible cells report wrong number because of the wrong grid size is retrieved that in turn is due to the fact that the size of the visible area in Online is used to set up only the active pane, So when we have windows splitting, even though there is no real split, the height can be computed using a non active pane whose size is not be synchronized with Online. Until we lack that synchronization, we use the implemented workaround for fixing the problem. Change-Id: I9df9e4b0ef77a2a8a5847ce77fe90d83ec75019d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114465 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--sc/source/ui/view/tabview3.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 1498204de148..92bc95326f9c 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2964,6 +2964,17 @@ void ScTabView::UpdateInputContext()
long ScTabView::GetGridWidth( ScHSplitPos eWhich )
{
+ // at present only the size of the current pane is synchronized with
+ // the size of the visible area in Online;
+ // as a workaround we use the same width for all panes independently
+ // from the eWhich value
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScGridWindow* pGridWindow = aViewData.GetActiveWin();
+ if (pGridWindow)
+ return pGridWindow->GetSizePixel().Width();
+ }
+
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_LEFT ) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
if (pGridWin[eGridWhich])
return pGridWin[eGridWhich]->GetSizePixel().Width();
@@ -2975,6 +2986,17 @@ long ScTabView::GetGridWidth( ScHSplitPos eWhich )
long ScTabView::GetGridHeight( ScVSplitPos eWhich )
{
+ // at present only the size of the current pane is synchronized with
+ // the size of the visible area in Online;
+ // as a workaround we use the same height for all panes independently
+ // from the eWhich value
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScGridWindow* pGridWindow = aViewData.GetActiveWin();
+ if (pGridWindow)
+ return pGridWindow->GetSizePixel().Height();
+ }
+
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
if (pGridWin[eGridWhich])
return pGridWin[eGridWhich]->GetSizePixel().Height();