diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-06-03 21:33:24 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2020-07-08 18:08:25 +0200 |
commit | 6907817b83e37d40be491cc10b2e5b99cc0f48fc (patch) | |
tree | cf0e12cd78780bc45fdb3f5a2ad57bc7b5e8ca12 /sc | |
parent | f3d21c378863a2a8756ded5dff6d1c18bc3c5db2 (diff) |
scPrintTwipsMsgs: Use print-twips paper-size
Paper size for the EditEngine is calculated based on per-cell pixel
alignment. So lets use the exact print-twips version whenever we need it
to compute/adjust output-area and visible-area of EditView.
Change-Id: I7da6db9363d09965315ff5ca9d01f0fea141a533
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98130
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 3469399f40b4..58ee76e99a1f 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1652,7 +1652,10 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, aPaperSizePTwips.setWidth(OutputDevice::LogicToLogic( aUtilRect.GetWidth(), MapUnit::Map100thMM, MapUnit::MapTwip)); } + pNewEngine->SetPaperSize( aPaperSize ); + if (bLOKPrintTwips) + pNewEngine->SetLOKSpecialPaperSize(aPaperSizePTwips); // sichtbarer Ausschnitt Size aPaper = pNewEngine->GetPaperSize(); @@ -1781,12 +1784,10 @@ void ScViewData::EditGrowX() SCCOL nLeft = GetPosX(eHWhich); SCCOL nRight = nLeft + VisibleCellsX(eHWhich); - MapUnit eWinUnit = GetLogicMode(eWhich).GetMapUnit(); Size aSize = pEngine->GetPaperSize(); Size aSizePTwips; - if (bLOKPrintTwips) - aSizePTwips = OutputDevice::LogicToLogic(aSize, MapMode(eWinUnit), MapMode(MapUnit::MapTwip)); + aSizePTwips = pEngine->GetLOKSpecialPaperSize(); tools::Rectangle aArea = pCurView->GetOutputArea(); tools::Rectangle aAreaPTwips; @@ -2074,7 +2075,6 @@ 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); @@ -2085,7 +2085,7 @@ void ScViewData::EditGrowY( bool bInitial ) if (bLOKPrintTwips) { - aSizePTwips = OutputDevice::LogicToLogic(aSize, MapMode(eWinUnit), MapMode(MapUnit::MapTwip)); + aSizePTwips = pEngine->GetLOKSpecialPaperSize(); aAreaPTwips = pCurView->GetLOKSpecialOutputArea(); } |