diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-10-02 14:01:47 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-10-03 12:38:18 +0000 |
commit | ba64777045c9e34e24cccf83d74594092f6b0552 (patch) | |
tree | 2c56ad997bb0c82b51f820fe721de475fb3946c5 | |
parent | 051a9eb9ca205787e0763ef5118ef8e3c4b0aec9 (diff) |
LOK: Calc: clear cell background in other views on editing
Change-Id: Ia61bcdf7db0994b6681607403c56be707a9f17d9
Reviewed-on: https://gerrit.libreoffice.org/29456
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
(cherry picked from commit 1922c8b1d46e0067ed21a18d249f04da6f3b0160)
Reviewed-on: https://gerrit.libreoffice.org/29489
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 0aa4322e1c05..2e66fef6464f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -972,7 +972,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pCrsr->Show(); } - if (comphelper::LibreOfficeKit::isActive()) + // paint in-place editing on other views + if (bIsTiledRendering) { ScTabViewShell* pThisViewShell = pViewData->GetViewShell(); SfxViewShell* pViewShell = SfxViewShell::GetFirst(); @@ -999,14 +1000,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI EditView* pOtherEditView = rOtherViewData.GetEditView(eOtherWhich); if (pOtherEditView) { - // TODO: implement the RTL layout case - //Point aOtherScrPos = rOtherViewData.GetScrPos( nX1, nY1, eOtherWhich ); - //if ( bLayoutRTL ) - //{ - // long nEndPixel = rOtherViewData.GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X(); - // aOtherScrPos.X() = nEndPixel + 1; - //} - long nScreenX = aOutputData.nScrX; long nScreenY = aOutputData.nScrY; long nScreenW = aOutputData.GetScrW(); @@ -1024,27 +1017,25 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI Rectangle aBackground(aStart, aEnd); - aBackground += Point(nScreenX, nScreenY); + // Need to draw the background in absolute coords. + auto aOrigin = aOriginalMode.GetOrigin(); + aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScreenX); + aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScreenY); + aBackground += aOrigin; rDevice.SetMapMode(aDrawMode); + static const double twipFactor = 15 * 1.76388889; // 26.45833335 + aOrigin = Point(aOrigin.getX() * twipFactor, + aOrigin.getY() * twipFactor); + MapMode aNew = rDevice.GetMapMode(); + aNew.SetOrigin(aOrigin); + rDevice.SetMapMode(aNew); // paint the background rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); - if (bIsTiledRendering) - { - auto aOrigin = aOriginalMode.GetOrigin(); - aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX); - aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY); - static const double twipFactor = 15 * 1.76388889; // 26.45833335 - aOrigin = Point(aOrigin.getX() * twipFactor, - aOrigin.getY() * twipFactor); - MapMode aNew = rDevice.GetMapMode(); - aNew.SetOrigin(aOrigin); - rDevice.SetMapMode(aNew); - } - - pOtherEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH))), &rDevice); + Rectangle aEditRect(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH)); + pOtherEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); rDevice.SetMapMode(MAP_PIXEL); } } |