From 06a1cbf7b0055fe45c86409b736cdd669a3f7ba9 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 1 Apr 2015 17:48:29 +0200 Subject: sc tiled editing: Make the editing of text in shapes in Calc work. I suspect the change in svdedxv.cxx is a hack and that the root cause is that we should initialize the pDrawView somehow more / better wrt. the output device that we are passing to BeginDrawLayers. [Probably the AddPaintWindowToPageView() called in ScGridWindow::PaintTile() is not enough.] But otherwise this makes the situation much better, and also makes the code even more on par with the non-tiled-rendering case, so let's live with that for now. Change-Id: I347b0af9e21acacc9aff4ebb7155246abd3beb43 --- sc/source/ui/view/gridwin4.cxx | 15 ++++++++------- svx/source/svdraw/svdedxv.cxx | 10 +++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 22674a1b0a2c..108f36f93545 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -634,7 +634,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI OutputDevice* pContentDev = &rDevice; // device for document content, used by overlay manager SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly - if (!bIsTiledRendering) { // init redraw ScTabViewShell* pTabViewShell = pViewData->GetViewShell(); @@ -649,13 +648,16 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI { // #i74769# Use new BeginDrawLayers() interface vcl::Region aDrawingRegion(aDrawingRectLogic); - pTargetPaintWindow = pDrawView->BeginDrawLayers(this, aDrawingRegion); + pTargetPaintWindow = pDrawView->BeginDrawLayers(pContentDev, aDrawingRegion); OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)"); - // #i74769# get target device from SdrPaintWindow, this may be the prerender - // device now, too. - pContentDev = &(pTargetPaintWindow->GetTargetOutputDevice()); - aOutputData.SetContentDevice( pContentDev ); + if (!bIsTiledRendering) + { + // #i74769# get target device from SdrPaintWindow, this may be the prerender + // device now, too. + pContentDev = &(pTargetPaintWindow->GetTargetOutputDevice()); + aOutputData.SetContentDevice(pContentDev); + } } pContentDev->SetMapMode(aCurrentMapMode); @@ -845,7 +847,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI } } - if (!bIsTiledRendering) { // end redraw ScTabViewShell* pTabViewShell = pViewData->GetViewShell(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 65a457f51e51..367cd8fbedea 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -328,7 +328,15 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectang Rectangle aBlankRect(rOutlView.GetOutputArea()); aBlankRect.Union(aMinTextEditArea); Rectangle aPixRect(rTargetDevice.LogicToPixel(aBlankRect)); - aBlankRect.Intersection(rRect); + + // in the tiled rendering case, the setup is incomplete, and we very + // easily get an empty rRect on input - that will cause that everything is + // clipped; happens in case of editing text inside a shape in Calc. + // FIXME would be better to complete the setup so that we don't get an + // empty rRect here + if (!GetModel()->isTiledRendering() || !rRect.IsEmpty()) + aBlankRect.Intersection(rRect); + rOutlView.GetOutliner()->SetUpdateMode(true); // Bugfix #22596# rOutlView.Paint(aBlankRect, &rTargetDevice); -- cgit