summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-10-01 21:25:42 -0400
committerMarco Cecchetti <mrcekets@gmail.com>2016-10-03 12:24:57 +0000
commit051a9eb9ca205787e0763ef5118ef8e3c4b0aec9 (patch)
tree803ebe8bf2cad764086e061d5d64e9ed0edcee12
parentCalc: fixed bug in parallel cell editing (diff)
downloadcore-051a9eb9ca205787e0763ef5118ef8e3c4b0aec9.tar.gz
core-051a9eb9ca205787e0763ef5118ef8e3c4b0aec9.zip
Calc LOK: clear cell background when editing in parallel
Change-Id: Id8eccf00ec6555d62c49e06130e3aa3a0eaaddea Reviewed-on: https://gerrit.libreoffice.org/29450 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit b16ba7314ef93b657dea4d6dd676b2dfd265bcaa) Reviewed-on: https://gerrit.libreoffice.org/29486 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r--desktop/source/lib/init.cxx3
-rw-r--r--sc/source/ui/view/gridwin4.cxx20
2 files changed, 12 insertions, 11 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2de46cfe55b9..1b49e1f4ab8a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -267,7 +267,8 @@ static OUString getAbsoluteURL(const char* pURL)
if (!aWorkingDir.endsWith("/"))
aWorkingDir += "/";
- try {
+ try
+ {
return rtl::Uri::convertRelToAbs(aWorkingDir, aURL);
}
catch (const rtl::MalformedUriException &)
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 86889e1168da..0aa4322e1c05 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -936,15 +936,16 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
Rectangle aBackground(aStart, aEnd);
if (bIsTiledRendering)
{
- aBackground += Point(nScrX, nScrY);
+ // Need to draw the background in absolute coords.
+ auto aOrigin = aOriginalMode.GetOrigin();
+ aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX);
+ aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY);
+ aBackground += aOrigin;
rDevice.SetMapMode(aDrawMode);
}
else
rDevice.SetMapMode(pViewData->GetLogicMode());
- // paint the background
- rDevice.DrawRect(rDevice.PixelToLogic(aBackground));
-
if (bIsTiledRendering)
{
auto aOrigin = aOriginalMode.GetOrigin();
@@ -958,8 +959,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
rDevice.SetMapMode(aNew);
}
+ // 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);
+ Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()));
+ pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
rDevice.SetMapMode(MAP_PIXEL);
// restore the cursor it was originally visible
@@ -967,7 +972,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
pCrsr->Show();
}
-
if (comphelper::LibreOfficeKit::isActive())
{
ScTabViewShell* pThisViewShell = pViewData->GetViewShell();
@@ -1052,10 +1056,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
}
-
-
-
-
if (pViewData->HasEditView(eWhich))
{
// flush OverlayManager before changing the MapMode