editeng/source/editeng/editeng.cxx | 1 editeng/source/editeng/impedit3.cxx | 2 editeng/source/outliner/outliner.cxx | 1 sc/source/ui/inc/viewdata.hxx | 4 - sc/source/ui/unoobj/docuno.cxx | 8 +-- sc/source/ui/view/gridwin.cxx | 88 +++++++++++++++++++++-------------- sc/source/ui/view/gridwin2.cxx | 37 ++++++++++++-- sc/source/ui/view/gridwin4.cxx | 18 +++---- sc/source/ui/view/viewdata.cxx | 10 +++ svx/source/svdraw/svdedxv.cxx | 10 +++ 10 files changed, 116 insertions(+), 63 deletions(-)
New commits: commit 95b2c1d86511b69eebe45aa398a4513f0dfc1662 Author: Jan Holesovsky <[email protected]> Date: Wed Apr 1 17:48:29 2015 +0200 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 diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 22674a1..108f36f 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 65a457f..367cd8f 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); commit f604218e3e8f54aae3aa8d7768081e87b7e13afc Author: Jan Holesovsky <[email protected]> Date: Wed Apr 1 17:48:09 2015 +0200 Kill some whitespace found during debugging. Change-Id: I456aff9ab6d7469c88f21b0b2f6b922feddc9f50 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index acc0b85..21bdec0 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -235,7 +235,6 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos, bool bClip ) { - #if defined( DBG_UTIL ) || (OSL_DEBUG_LEVEL > 1) if ( bDebugPaint ) EditDbg::ShowEditEngineData( this, false ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 069a393..972c997 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3811,7 +3811,6 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev pTarget->SetMapMode( aOldMapMode ); } - pView->DrawSelection(pView->GetEditSelection(), 0, pTarget); } else @@ -3856,7 +3855,6 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev pView->DrawSelection(pView->GetEditSelection(), 0, pTarget); } - } void ImpEditEngine::InsertContent( ContentNode* pNode, sal_Int32 nPos ) diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index b30bd95..e0b05e1 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1749,7 +1749,6 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I const Color& rOverlineColor, const Color& rTextLineColor) { - if(aDrawPortionHdl.IsSet()) { DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, nIndex, pDXArray, pWrongSpellVector, commit b11c58889cde10f43a9f239a959eb2c252dc4db7 Author: Jan Holesovsky <[email protected]> Date: Tue Mar 31 14:51:36 2015 +0200 sc tiled editing: This got fixed by the recent changes. Change-Id: I6a87657749f3dfa494985893fd8c97ffda13581b diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index dd7b43d..22674a1 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -891,10 +891,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // set the correct mapmode Rectangle aBackground(aStart, aEnd); if (bIsTiledRendering) - { - aBackground += Point(nScrX, nScrY); rDevice.SetMapMode(aDrawMode); - } else rDevice.SetMapMode(pViewData->GetLogicMode()); commit 901a0282672456987b6de8e515baada8ba8ac070 Author: Jan Holesovsky <[email protected]> Date: Tue Mar 31 14:35:17 2015 +0200 sc tiled editing: Don't show the cell selection when editing text in shape. Change-Id: I1ddaa02e64a912c880faec9f907e9526432f6bcd diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1027a29..a04bac9 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5764,6 +5764,22 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD void ScGridWindow::UpdateCursorOverlay() { + ScDocument* pDoc = pViewData->GetDocument(); + bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering(); + + // in the tiled rendering case, exit early if we are not supposed to draw + // the cell cursor: + // - there is a selection (either cell selection, or graphic object) + // - the user is typing inside a shape or so + if (bIsTiledRendering && + (pViewData->GetMarkData().IsMarked() || pViewData->GetMarkData().IsMultiMarked() || + pViewData->GetViewShell()->GetScDrawView()->IsMarking() || + pViewData->GetViewShell()->GetScDrawView()->IsTextEdit() || + pViewData->HasEditView(eWhich))) + { + return; + } + MapMode aDrawMode = GetDrawMapMode(); MapMode aOldMode = GetMapMode(); if ( aOldMode != aDrawMode ) @@ -5782,7 +5798,6 @@ void ScGridWindow::UpdateCursorOverlay() SCCOL nX = pViewData->GetCurX(); SCROW nY = pViewData->GetCurY(); - ScDocument* pDoc = pViewData->GetDocument(); const ScPatternAttr* pPattern = pDoc->GetPattern(nX,nY,nTab); if (!maVisibleRange.isInside(nX, nY)) @@ -5840,7 +5855,6 @@ void ScGridWindow::UpdateCursorOverlay() } // in the tiled rendering case, don't limit to the screen size - bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering(); if (bMaybeVisible || bIsTiledRendering) { long nSizeXPix; @@ -5925,15 +5939,8 @@ void ScGridWindow::UpdateCursorOverlay() mpOOCursors.reset(new sdr::overlay::OverlayObjectList); mpOOCursors->append(*pOverlay); - // notify the LibreOfficeKit too, but only if there's no - // selection yet (either cell selection, or graphic object), - // to avoid setting the LOK selection twice - // (once for the cell only, and then for the selection) - if (!pViewData->GetMarkData().IsMarked() && !pViewData->GetMarkData().IsMultiMarked() && - !pViewData->GetViewShell()->GetScDrawView()->IsMarking()) - { - updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects); - } + // notify the LibreOfficeKit too + updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects); } } commit 169c25dc48ee3c53e2ccc32d75fc9f4465057cc3 Author: Jan Holesovsky <[email protected]> Date: Tue Mar 31 14:13:09 2015 +0200 sc tiled editing: Don't resize the gridwin to the entire document. Instead: * resize it only to the tile size * adjust the view area (to the entire document) * never set the "top left cell of the view" Change-Id: I5d9c784315549025cd77042c4763a53e020bcf03 diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 634eb93..b5348cd 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -133,8 +133,8 @@ private: SCROW nCurY; SCCOL nOldCurX; SCROW nOldCurY; - SCCOL nPosX[2]; - SCROW nPosY[2]; + SCCOL nPosX[2]; ///< X position of the top left cell of the visible area. + SCROW nPosY[2]; ///< Y position of the top left cell of the visible area. bool bShowGrid; // per sheet show grid lines option. bool mbOldCursorValid; // "virtual" Cursor position when combined diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 35566dc..1d0684f 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -471,10 +471,10 @@ void ScModelObj::paintTile( VirtualDevice& rDevice, ScViewData* pViewData = ScDocShell::GetViewData(); ScGridWindow* pGridWindow = pViewData->GetActiveWin(); - // Set the viewport size to document size - const MapMode aMapTwip( MAP_TWIP ); - Size aDocSize = getDocumentSize(); - pGridWindow->SetOutputSizePixel( pGridWindow->LogicToPixel(aDocSize, aMapTwip) ); + // update the size of the area we are painting + Size aTileSize(nOutputWidth, nOutputHeight); + if (pGridWindow->GetOutputSizePixel() != aTileSize) + pGridWindow->SetOutputSizePixel(Size(nOutputWidth, nOutputHeight)); pGridWindow->PaintTile( rDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight ); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 4a66bbf..60b27ac 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -588,12 +588,37 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu() bool ScGridWindow::UpdateVisibleRange() { - SCCOL nPosX = pViewData->GetPosX(eHWhich); - SCROW nPosY = pViewData->GetPosY(eVWhich); - SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich); - if (nXRight > MAXCOL) nXRight = MAXCOL; - SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich); - if (nYBottom > MAXROW) nYBottom = MAXROW; + ScDocument& rDoc = pViewData->GetDocShell()->GetDocument(); + + SCCOL nPosX = 0; + SCROW nPosY = 0; + SCCOL nXRight = MAXCOL; + SCROW nYBottom = MAXROW; + + if (rDoc.GetDrawLayer()->isTiledRendering()) + { + // entire table in the tiled rendering case + SCTAB nTab = pViewData->GetTabNo(); + SCCOL nEndCol = 0; + SCROW nEndRow = 0; + + if (rDoc.GetPrintArea(nTab, nEndCol, nEndRow, false)) + { + nXRight = nEndCol; + nYBottom = nEndRow; + } + } + else + { + nPosX = pViewData->GetPosX(eHWhich); + nPosY = pViewData->GetPosY(eVWhich); + nXRight = nPosX + pViewData->VisibleCellsX(eHWhich); + if (nXRight > MAXCOL) + nXRight = MAXCOL; + nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich); + if (nYBottom > MAXROW) + nYBottom = MAXROW; + } // Store the current visible range. bool bChanged = maVisibleRange.set(nPosX, nPosY, nXRight, nYBottom); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 2037f82..ced26de 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1868,7 +1868,8 @@ void ScViewData::GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich, void ScViewData::SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ) { - if (nNewPosX != 0) + // in the tiled rendering case, nPosX [the leftmost visible column] must be 0 + if (nNewPosX != 0 && !GetDocument()->GetDrawLayer()->isTiledRendering()) { SCCOL nOldPosX = pThisTab->nPosX[eWhich]; long nTPosX = pThisTab->nTPosX[eWhich]; @@ -1895,15 +1896,18 @@ void ScViewData::SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ) pThisTab->nPixPosX[eWhich] = nPixPosX; } else + { pThisTab->nPixPosX[eWhich] = pThisTab->nTPosX[eWhich] = pThisTab->nMPosX[eWhich] = pThisTab->nPosX[eWhich] = 0; + } } void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ) { - if (nNewPosY != 0) + // in the tiled rendering case, nPosY [the topmost visible row] must be 0 + if (nNewPosY != 0 && !GetDocument()->GetDrawLayer()->isTiledRendering()) { SCROW nOldPosY = pThisTab->nPosY[eWhich]; long nTPosY = pThisTab->nTPosY[eWhich]; @@ -1934,10 +1938,12 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ) pThisTab->nPixPosY[eWhich] = nPixPosY; } else + { pThisTab->nPixPosY[eWhich] = pThisTab->nTPosY[eWhich] = pThisTab->nMPosY[eWhich] = pThisTab->nPosY[eWhich] = 0; + } } void ScViewData::RecalcPixPos() // after zoom changes commit e6a9389b254ddef69b5b8acb9f55e8b928bdacb5 Author: Jan Holesovsky <[email protected]> Date: Tue Mar 31 13:15:23 2015 +0200 sc tiled editing: Show the cell cursor as a rect, not as a frame. Change-Id: I323f38fffb354b8f5701780b9078aefbfe3e8040 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 5c301f0..1027a29 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5838,7 +5838,10 @@ void ScGridWindow::UpdateCursorOverlay() Size aOutSize = GetOutputSizePixel(); bMaybeVisible = ( aScrPos.X() <= aOutSize.Width() + 2 && aScrPos.Y() <= aOutSize.Height() + 2 ); } - if ( bMaybeVisible ) + + // in the tiled rendering case, don't limit to the screen size + bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering(); + if (bMaybeVisible || bIsTiledRendering) { long nSizeXPix; long nSizeYPix; @@ -5847,36 +5850,46 @@ void ScGridWindow::UpdateCursorOverlay() if (bLayoutRTL) aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring - Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1) ); + if (bIsTiledRendering) + { + // just forward the area to LOK + Rectangle aRect(aScrPos, Size(nSizeXPix, nSizeYPix)); + aPixelRects.push_back(aRect); + } + else + { + // show the cursor as 4 (thin) rectangles + Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1)); - sal_Int32 nScale = GetDPIScaleFactor(); + sal_Int32 nScale = GetDPIScaleFactor(); - long aCursorWidth = 1 * nScale; + long aCursorWidth = 1 * nScale; - Rectangle aLeft = Rectangle(aRect); - aLeft.Top() -= aCursorWidth; - aLeft.Bottom() += aCursorWidth; - aLeft.Right() = aLeft.Left(); - aLeft.Left() -= aCursorWidth; + Rectangle aLeft = Rectangle(aRect); + aLeft.Top() -= aCursorWidth; + aLeft.Bottom() += aCursorWidth; + aLeft.Right() = aLeft.Left(); + aLeft.Left() -= aCursorWidth; - Rectangle aRight = Rectangle(aRect); - aRight.Top() -= aCursorWidth; - aRight.Bottom() += aCursorWidth; - aRight.Left() = aRight.Right(); - aRight.Right() += aCursorWidth; + Rectangle aRight = Rectangle(aRect); + aRight.Top() -= aCursorWidth; + aRight.Bottom() += aCursorWidth; + aRight.Left() = aRight.Right(); + aRight.Right() += aCursorWidth; - Rectangle aTop = Rectangle(aRect); - aTop.Bottom() = aTop.Top(); - aTop.Top() -= aCursorWidth; + Rectangle aTop = Rectangle(aRect); + aTop.Bottom() = aTop.Top(); + aTop.Top() -= aCursorWidth; - Rectangle aBottom = Rectangle(aRect); - aBottom.Top() = aBottom.Bottom(); - aBottom.Bottom() += aCursorWidth; + Rectangle aBottom = Rectangle(aRect); + aBottom.Top() = aBottom.Bottom(); + aBottom.Bottom() += aCursorWidth; - aPixelRects.push_back(aLeft); - aPixelRects.push_back(aRight); - aPixelRects.push_back(aTop); - aPixelRects.push_back(aBottom); + aPixelRects.push_back(aLeft); + aPixelRects.push_back(aRight); + aPixelRects.push_back(aTop); + aPixelRects.push_back(aBottom); + } } } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
