diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-03-18 13:11:36 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-23 09:19:03 +0100 |
commit | 83f2516af8a49bfdddf1b416f23b748a66d29545 (patch) | |
tree | bcb07f7e0a792a1034c065446b2ed6a1711cd1c1 /sc | |
parent | 61ebb1b21c37f50b8231472e37af2d88918e1bc3 (diff) |
sc tiled editing: Clear the right area behind the editeng.
Based on a patch by Henry Castro.
Change-Id: Ic463c97577d521e3c2e4d6bc904c517aa564edca
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 99a8f1c32590..63249332d5f8 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -866,13 +866,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI } } - // InPlace Edit-View - // moved after EndDrawLayers() to get it outside the overlay buffer and - // on top of everything + // In-place editing - when the user is typing, we need to paint the text + // using the editeng. + // It's being done after EndDrawLayers() to get it outside the overlay + // buffer and on top of everything. if ( bEditMode && (pViewData->GetRefTabNo() == pViewData->GetTabNo()) ) { - //! use pContentDev for EditView? - rDevice.SetMapMode(MAP_PIXEL); + // get the coordinates of the area we need to clear (overpaint by + // the background) SCCOL nCol1 = pViewData->GetEditStartCol(); SCROW nRow1 = pViewData->GetEditStartRow(); SCCOL nCol2 = pViewData->GetEditEndCol(); @@ -882,12 +883,25 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI Point aStart = pViewData->GetScrPos( nCol1, nRow1, eWhich ); Point aEnd = pViewData->GetScrPos( nCol2+1, nRow2+1, eWhich ); + // don't overwrite grid long nLayoutSign = bLayoutRTL ? -1 : 1; - aEnd.X() -= 2 * nLayoutSign; // don't overwrite grid + aEnd.X() -= 2 * nLayoutSign; aEnd.Y() -= 2; - rDevice.DrawRect(Rectangle(aStart, aEnd)); - rDevice.SetMapMode(bIsTiledRendering? aDrawMode: pViewData->GetLogicMode()); + // set the correct mapmode + Rectangle aBackground(aStart, aEnd); + if (bIsTiledRendering) + { + aBackground += Point(nScrX, nScrY); + rDevice.SetMapMode(aDrawMode); + } + else + rDevice.SetMapMode(pViewData->GetLogicMode()); + + // paint the background + rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); + + // paint the editeng text pEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()))), &rDevice); rDevice.SetMapMode(MAP_PIXEL); } |