[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 6 15:42:59 UTC 2020
sc/source/ui/view/viewdata.cxx | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 1cf5bd90873f5757663aa695642a5c7e514e28e6
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Wed Jun 3 14:02:44 2020 +0530
Commit: Dennis Francis <dennis.francis at collabora.com>
CommitDate: Mon Jul 6 17:42:24 2020 +0200
ScViewData::EditGrowY: keep EditView's print-twips data updated
Change-Id: I0207e65fc0386eb9a86de6ab4472780553eadd4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98062
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 38de247caa64..35d75e227245 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2048,6 +2048,10 @@ void ScViewData::EditGrowY( bool bInitial )
comphelper::FlagRestorationGuard aFlagGuard(bGrowing, true);
+ bool bLOKActive = comphelper::LibreOfficeKit::isActive();
+ bool bLOKPrintTwips = bLOKActive && comphelper::LibreOfficeKit::isCompatFlagSet(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+
ScSplitPos eWhich = GetActivePart();
ScVSplitPos eVWhich = WhichV(eWhich);
EditView* pCurView = pEditView[eWhich].get();
@@ -2067,11 +2071,21 @@ void ScViewData::EditGrowY( bool bInitial )
EditEngine* pEngine = pCurView->GetEditEngine();
vcl::Window* pWin = pCurView->GetWindow();
+ MapUnit eWinUnit = GetLogicMode(eWhich).GetMapUnit();
SCROW nBottom = GetPosY(eVWhich) + VisibleCellsY(eVWhich);
Size aSize = pEngine->GetPaperSize();
+ Size aSizePTwips;
tools::Rectangle aArea = pCurView->GetOutputArea();
+ tools::Rectangle aAreaPTwips;
+
+ if (bLOKPrintTwips)
+ {
+ aSizePTwips = OutputDevice::LogicToLogic(aSize, MapMode(eWinUnit), MapMode(MapUnit::MapTwip));
+ aAreaPTwips = pCurView->GetLOKSpecialOutputArea();
+ }
+
long nOldBottom = aArea.Bottom();
long nTextHeight = pEngine->GetTextHeight();
@@ -2098,12 +2112,17 @@ void ScViewData::EditGrowY( bool bInitial )
{
++nEditEndRow;
ScDocument* pLocalDoc = GetDocument();
- long nPix = ToPixel( pLocalDoc->GetRowHeight( nEditEndRow, nTabNo ), nPPTY );
+ long nRowHeight = pLocalDoc->GetRowHeight( nEditEndRow, nTabNo );
+ long nPix = ToPixel( nRowHeight, nPPTY );
aArea.AdjustBottom(pWin->PixelToLogic(Size(0,nPix)).Height() );
+ if (bLOKPrintTwips)
+ aAreaPTwips.AdjustBottom(nRowHeight);
if ( aArea.Bottom() > aArea.Top() + aSize.Height() - 1 )
{
aArea.SetBottom( aArea.Top() + aSize.Height() - 1 );
+ if (bLOKPrintTwips)
+ aAreaPTwips.SetBottom( aAreaPTwips.Top() + aSizePTwips.Height() - 1 );
bMaxReached = true; // don't occupy more cells beyond paper size
}
@@ -2114,6 +2133,8 @@ void ScViewData::EditGrowY( bool bInitial )
if (bChanged)
{
pCurView->SetOutputArea(aArea);
+ if (bLOKPrintTwips)
+ pCurView->SetLOKSpecialOutputArea(aAreaPTwips);
if (nEditEndRow >= nBottom || bMaxReached)
{
More information about the Libreoffice-commits
mailing list