[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - desktop/source sd/source sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Feb 24 08:46:02 PST 2015
desktop/source/lib/init.cxx | 13 +++++++++++++
sd/source/ui/view/sdwindow.cxx | 13 ++++++++++++-
sw/source/core/view/viewsh.cxx | 13 -------------
3 files changed, 25 insertions(+), 14 deletions(-)
New commits:
commit e8fbf505bdc878fa185271bf5d288a84d59443a6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Feb 24 17:43:42 2015 +0100
sd::Window::LogicInvalidate: add missing mm100 -> twips conversion
The method assumed that the map mode of the output device is twips, but
that's not true for Impress. If paintTile() does the twips -> mm100
conversion, then LogicInvalidate() has to do the reverse of that.
This fixes typing into the main placeholder shape of an empty Impress
document: with our 256x256px tiles only the 3rd and 4th row was
repainted previously, while the interesting content is in the 2nd row.
Change-Id: I8bda113e73335e465c1c4626a58b6be2b232a190
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 1c5bdd7..6c70e19 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -992,7 +992,18 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion)
if (!pRegion)
sRectangle = "EMPTY";
else
- sRectangle = pRegion->GetBoundRect().toString();
+ {
+ Rectangle aRectangle = pRegion->GetBoundRect();
+ if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+ {
+ // Conversion to twips is necessary.
+ aRectangle.Left() = convertMm100ToTwip(aRectangle.Left());
+ aRectangle.Top() = convertMm100ToTwip(aRectangle.Top());
+ aRectangle.Right() = convertMm100ToTwip(aRectangle.Right());
+ aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom());
+ }
+ sRectangle = aRectangle.toString();
+ }
mpViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
}
commit 6c98f15e3466fab2984eb2b7c41da7495a2d32d2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Feb 24 17:04:24 2015 +0100
desktop: move tiled rendering debug code from sw
So that the size / position is more clear in other apps as well.
Change-Id: If1fd9ac8e6ddc83b41c06e3b88ae34765a5c7c75
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3acb7bf..4aea3d0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -628,6 +628,19 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
(void) pRowStride;
#endif
+ static bool bDebug = getenv("LOK_DEBUG") != 0;
+ if (bDebug)
+ {
+ // Draw a small red rectangle in the top left corner so that it's easy to see where a new tile begins.
+ Rectangle aRect(0, 0, 5, 5);
+ aRect = aDevice.PixelToLogic(aRect);
+ aDevice.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
+ aDevice.SetFillColor(COL_LIGHTRED);
+ aDevice.SetLineColor();
+ aDevice.DrawRect(aRect);
+ aDevice.Pop();
+ }
+
#else
(void) pBuffer;
(void) nCanvasWidth;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7739c92..e74f326 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1828,19 +1828,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
mpOut = pSaveOut;
mbInLibreOfficeKitCallback = false;
mbTiledRendering = bTiledRendering;
-
- static bool bDebug = getenv("SW_DEBUG_TILEDRENDERING") != 0;
- if (bDebug)
- {
- // Draw a small red rectangle in the top left corner so that it's easy to see where a new tile begins.
- Rectangle aRect(0, 0, 5, 5);
- aRect = rDevice.PixelToLogic(aRect);
- rDevice.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
- rDevice.SetFillColor(COL_LIGHTRED);
- rDevice.SetLineColor();
- rDevice.DrawRect(aRect);
- rDevice.Pop();
- }
}
#if !HAVE_FEATURE_DESKTOP
More information about the Libreoffice-commits
mailing list