sc/inc/docuno.hxx | 22 +++++++-- sc/source/ui/app/inputhdl.cxx | 9 +++ sc/source/ui/inc/gridwin.hxx | 3 + sc/source/ui/inc/inputhdl.hxx | 2 sc/source/ui/inc/tabvwsh.hxx | 1 sc/source/ui/unoobj/docuno.cxx | 12 +++++ sc/source/ui/view/gridwin4.cxx | 44 ++++++++++++++++++ sc/source/ui/view/tabvwsh4.cxx | 95 +++++++++++++++++++---------------------- 8 files changed, 133 insertions(+), 55 deletions(-)
New commits: commit 4a497408d4b7a1bfe27109dacd046d43c822af78 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Feb 25 16:01:30 2015 +0100 Clean up not needed ScTabViewShell LOK methods Change-Id: Ic834d61cccdd422af96bd1b5933eb1a77e8efc16 diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index b0afcde..7f1fd84 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -181,9 +181,6 @@ private: OUString maName; OUString maScope; - LibreOfficeKitCallback mpLibreOfficeKitCallback; - void* mpLibreOfficeKitData; - private: void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); @@ -416,12 +413,6 @@ public: // #i123629# bool GetForceFocusOnCurCell() const { return bForceFocusOnCurCell; } void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; } - - /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API. - void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); - - /// Invokes the registered callback, if there are any. - void libreOfficeKitCallback(int nType, const char* pPayload) const; }; #endif diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index c530855..4ff2727 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -513,7 +513,7 @@ Size ScModelObj::getDocumentSize() void ScModelObj::registerCallback(LibreOfficeKitCallback pCallback, void* pData) { SolarMutexGuard aGuard; - pDocShell->GetBestViewShell()->registerLibreOfficeKitCallback(pCallback, pData); + pDocShell->GetDocument().GetDrawLayer()->registerLibreOfficeKitCallback(pCallback, pData); } void ScModelObj::initializeForTiledRendering() diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index dc88981..54dee5f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -994,7 +994,7 @@ void ScGridWindow::LogicInvalidate(const ::vcl::Region* pRegion) sRectangle = "EMPTY"; else sRectangle = pRegion->GetBoundRect().toString(); - pViewData->GetViewShell()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } void ScGridWindow::CheckNeedsRepaint() diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index ef4f9f0..e657c47 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1695,9 +1695,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, bForceFocusOnCurCell(false), nCurRefDlgId(0), pAccessibilityBroadcaster(NULL), - mbInSwitch(false), - mpLibreOfficeKitCallback(NULL), - mpLibreOfficeKitData(NULL) + mbInSwitch(false) { const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 1f20316..bc5cff7 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -477,16 +477,4 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( return pResult; } -void ScTabViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) -{ - mpLibreOfficeKitCallback = pCallback; - mpLibreOfficeKitData = pData; -} - -void ScTabViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const -{ - if (mpLibreOfficeKitCallback) - mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 3abf5949be96473646ab77f9d1706e49eba06a44 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Feb 25 15:38:40 2015 +0100 ScInputHandler::ImplCreateEditEngine: don't invalidate unconditionally In the desktop case we still have to Paint() directly. This fixes the small rendering delay in the desktop case introduced by the previous commit. Change-Id: If07e2d47f62cbe17816439d18c45f129be6ce210 diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index a5ae0d2..f277efc 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -391,6 +391,9 @@ public: // @see vcl::ITiledRenderable::registerCallback(). virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) SAL_OVERRIDE; + + /// @see vcl::ITiledRenderable::initializeForTiledRendering(). + virtual void initializeForTiledRendering() SAL_OVERRIDE; }; class ScDrawPagesObj : public cppu::WeakImplHelper2< diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 623ee34..b3478dd 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -631,9 +631,12 @@ void ScInputHandler::ImplCreateEditEngine() // set the EditEngine so that it invalidates the view instead of direct // paint - EditView *pEditView = pEngine->GetActiveView(); - if (pEditView && !pEditView->isTiledRendering()) - pEditView->setTiledRendering(true); + if (pActiveViewSh) + { + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); + if (EditView* pEditView = pEngine->GetActiveView()) + pEditView->setTiledRendering(rDoc.GetDrawLayer()->isTiledRendering()); + } } void ScInputHandler::UpdateAutoCorrFlag() diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 7ca131c..c530855 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -516,6 +516,12 @@ void ScModelObj::registerCallback(LibreOfficeKitCallback pCallback, void* pData) pDocShell->GetBestViewShell()->registerLibreOfficeKitCallback(pCallback, pData); } +void ScModelObj::initializeForTiledRendering() +{ + SolarMutexGuard aGuard; + pDocShell->GetDocument().GetDrawLayer()->setTiledRendering(true); +} + uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException, std::exception) { commit ce35e601619a8b675699363bb9ce8dcd1bdc1602 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Feb 25 15:06:00 2015 +0100 sc: Make characters appear during tiled rendering as they are typed. TODO FIXME proof-of-concept cut'n'paste This entire ScGridWindow::PaintTile() must share code with ScGridWindow::Draw(), that's the only way how to get also the shapes, charts and everything. Change-Id: I72d7363edc0c46a9920c3ca0d5d51c982e748a77 diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 180c864..623ee34 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -628,6 +628,12 @@ void ScInputHandler::ImplCreateEditEngine() pEngine->SetControlWord( pEngine->GetControlWord() | EE_CNTRL_AUTOCORRECT ); pEngine->SetModifyHdl( LINK( this, ScInputHandler, ModifyHdl ) ); } + + // set the EditEngine so that it invalidates the view instead of direct + // paint + EditView *pEditView = pEngine->GetActiveView(); + if (pEditView && !pEditView->isTiledRendering()) + pEditView->setTiledRendering(true); } void ScInputHandler::UpdateAutoCorrFlag() diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index cb119c5..dc88981 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -954,6 +954,37 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, aOutData.DrawEdit(true); rDevice.SetMapMode(aOldMapMode); + + EditView* pEditView = NULL; + { + SCCOL nEditCol; + SCROW nEditRow; + pViewData->GetEditView( eWhich, pEditView, nEditCol, nEditRow ); + } + // InPlace Edit-View + // moved after EndDrawLayers() to get it outside the overlay buffer and + // on top of everything + if (pEditView) + { + //! use pContentDev for EditView? + rDevice.SetMapMode(MAP_PIXEL); + SCCOL nEditCol1 = pViewData->GetEditStartCol(); + SCROW nEditRow1 = pViewData->GetEditStartRow(); + SCCOL nEditCol2 = pViewData->GetEditEndCol(); + SCROW nEditRow2 = pViewData->GetEditEndRow(); + rDevice.SetLineColor(); + rDevice.SetFillColor( pEditView->GetBackgroundColor() ); + Point aStart = pViewData->GetScrPos( nEditCol1, nEditRow1, eWhich ); + Point aEnd = pViewData->GetScrPos( nEditCol2+1, nEditRow2+1, eWhich ); + aEnd.X() -= 2; // don't overwrite grid + aEnd.Y() -= 2; + rDevice.DrawRect( Rectangle( aStart,aEnd ) ); + + rDevice.SetMapMode(pViewData->GetLogicMode()); + pEditView->Paint( PixelToLogic( Rectangle( Point( fTilePosXPixel, fTilePosYPixel ), + Size( aOutData.GetScrW(), aOutData.GetScrH() ) ) ), &rDevice ); + rDevice.SetMapMode(MAP_PIXEL); + } } void ScGridWindow::LogicInvalidate(const ::vcl::Region* pRegion) commit f4b963cf764491a0f06f7d3b9ffb4d34f1e9b300 Author: Jan Holesovsky <ke...@collabora.com> Date: Tue Feb 24 13:58:55 2015 +0100 sc: Initial support for tiled editing in Calc. Change-Id: Ifa5f84934a68fec86d4f30ee998bf75edfe331c5 diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 9f7ed0a..a5ae0d2 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -368,7 +368,7 @@ public: virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // ITiledRenderable + // @see vcl::ITiledRenderable::paintTile(). virtual void paintTile( VirtualDevice& rDevice, int nOutputWidth, int nOutputHeight, @@ -376,10 +376,21 @@ public: int nTilePosY, long nTileWidth, long nTileHeight ) SAL_OVERRIDE; + + // @see vcl::ITiledRenderable::getDocumentSize(). virtual Size getDocumentSize() SAL_OVERRIDE; - virtual void setPart( int nPart ) SAL_OVERRIDE; - virtual int getPart() SAL_OVERRIDE; - virtual int getParts() SAL_OVERRIDE; + + // @see vcl::ITiledRenderable::setPart(). + virtual void setPart(int nPart) SAL_OVERRIDE; + + // @see vcl::ITiledRenderable::getPart(). + virtual int getPart() SAL_OVERRIDE; + + // @see vcl::ITiledRenderable::getParts(). + virtual int getParts() SAL_OVERRIDE; + + // @see vcl::ITiledRenderable::registerCallback(). + virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) SAL_OVERRIDE; }; class ScDrawPagesObj : public cppu::WeakImplHelper2< diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index e7f9c41..712fb72 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -322,6 +322,9 @@ public: int nTilePosX, int nTilePosY, long nTileWidth, long nTileHeight ); + /// @see OutputDevice::LogicInvalidate(). + void LogicInvalidate(const ::vcl::Region* pRegion) SAL_OVERRIDE; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE; void FakeButtonUp(); diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 65ea47c..829ec97 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -56,7 +56,7 @@ class ScInputHandler : boost::noncopyable private: ScInputWindow* pInputWin; - ScEditEngineDefaulter* pEngine; // edited data in the sheet + ScEditEngineDefaulter* pEngine; ///< Edited data in the sheet (when the user clicks into the sheet, and starts writing there). EditView* pTableView; // associated active EditView EditView* pTopView; // EditView in dthe input row diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 2272663..b0afcde 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -180,6 +180,10 @@ private: bool mbInSwitch; OUString maName; OUString maScope; + + LibreOfficeKitCallback mpLibreOfficeKitCallback; + void* mpLibreOfficeKitData; + private: void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); @@ -412,6 +416,12 @@ public: // #i123629# bool GetForceFocusOnCurCell() const { return bForceFocusOnCurCell; } void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; } + + /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API. + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + + /// Invokes the registered callback, if there are any. + void libreOfficeKitCallback(int nType, const char* pPayload) const; }; #endif diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 8fe2368..7ca131c 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -510,6 +510,12 @@ Size ScModelObj::getDocumentSize() return aSize; } +void ScModelObj::registerCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + SolarMutexGuard aGuard; + pDocShell->GetBestViewShell()->registerLibreOfficeKitCallback(pCallback, pData); +} + uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException, std::exception) { diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 07a5d62..cb119c5 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -29,6 +29,9 @@ #include <sfx2/printer.hxx> #include <vcl/settings.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKitEnums.h> + #include <svx/svdview.hxx> #include "tabvwsh.hxx" @@ -953,6 +956,16 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, rDevice.SetMapMode(aOldMapMode); } +void ScGridWindow::LogicInvalidate(const ::vcl::Region* pRegion) +{ + OString sRectangle; + if (!pRegion) + sRectangle = "EMPTY"; + else + sRectangle = pRegion->GetBoundRect().toString(); + pViewData->GetViewShell()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); +} + void ScGridWindow::CheckNeedsRepaint() { // called at the end of painting, and from timer after background text width calculation diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 2563bdf..ef4f9f0 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1449,53 +1449,6 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent ) return TabKeyInput( rKeyEvent ); } -#define __INIT_ScTabViewShell \ - eCurOST(OST_NONE), \ - nDrawSfxId(0), \ - nCtrlSfxId(USHRT_MAX), \ - nFormSfxId(USHRT_MAX), \ - pDrawShell(NULL), \ - pDrawTextShell(NULL), \ - pEditShell(NULL), \ - pPivotShell(NULL), \ - pAuditingShell(NULL), \ - pDrawFormShell(NULL), \ - pCellShell(NULL), \ - pOleObjectShell(NULL), \ - pChartShell(NULL), \ - pGraphicShell(NULL), \ - pMediaShell(NULL), \ - pPageBreakShell(NULL), \ - pExtrusionBarShell(NULL), \ - pFontworkBarShell(NULL), \ - pFormShell(NULL), \ - pInputHandler(NULL), \ - pCurFrameLine(NULL), \ - aTarget( this ), \ - pDialogDPObject(NULL), \ - pNavSettings(NULL), \ - bActiveDrawSh(false), \ - bActiveDrawTextSh(false), \ - bActivePivotSh(false), \ - bActiveAuditingSh(false), \ - bActiveDrawFormSh(false), \ - bActiveOleObjectSh(false), \ - bActiveChartSh(false), \ - bActiveGraphicSh(false), \ - bActiveMediaSh(false), \ - bActiveEditSh(false), \ - bFormShellAtTop(false), \ - bDontSwitch(false), \ - bInFormatDialog(false), \ - bPrintSelected(false), \ - bReadOnly(false), \ - pScSbxObject(NULL), \ - bChartAreaValid(false), \ - bForceFocusOnCurCell(false),\ - nCurRefDlgId(0), \ - pAccessibilityBroadcaster(NULL), \ - mbInSwitch(false) - void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode ) { SfxApplication* pSfxApp = SfxGetpApp(); @@ -1698,7 +1651,53 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, SfxViewShell* pOldSh ) : SfxViewShell( pViewFrame, SFX_VIEW_CAN_PRINT | SFX_VIEW_HAS_PRINTOPTIONS ), ScDBFunc( &pViewFrame->GetWindow(), static_cast<ScDocShell&>(*pViewFrame->GetObjectShell()), this ), - __INIT_ScTabViewShell + eCurOST(OST_NONE), + nDrawSfxId(0), + nCtrlSfxId(USHRT_MAX), + nFormSfxId(USHRT_MAX), + pDrawShell(NULL), + pDrawTextShell(NULL), + pEditShell(NULL), + pPivotShell(NULL), + pAuditingShell(NULL), + pDrawFormShell(NULL), + pCellShell(NULL), + pOleObjectShell(NULL), + pChartShell(NULL), + pGraphicShell(NULL), + pMediaShell(NULL), + pPageBreakShell(NULL), + pExtrusionBarShell(NULL), + pFontworkBarShell(NULL), + pFormShell(NULL), + pInputHandler(NULL), + pCurFrameLine(NULL), + aTarget(this), + pDialogDPObject(NULL), + pNavSettings(NULL), + bActiveDrawSh(false), + bActiveDrawTextSh(false), + bActivePivotSh(false), + bActiveAuditingSh(false), + bActiveDrawFormSh(false), + bActiveOleObjectSh(false), + bActiveChartSh(false), + bActiveGraphicSh(false), + bActiveMediaSh(false), + bActiveEditSh(false), + bFormShellAtTop(false), + bDontSwitch(false), + bInFormatDialog(false), + bPrintSelected(false), + bReadOnly(false), + pScSbxObject(NULL), + bChartAreaValid(false), + bForceFocusOnCurCell(false), + nCurRefDlgId(0), + pAccessibilityBroadcaster(NULL), + mbInSwitch(false), + mpLibreOfficeKitCallback(NULL), + mpLibreOfficeKitData(NULL) { const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); @@ -1744,8 +1743,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, MakeDrawLayer(); } -#undef __INIT_ScTabViewShell - ScTabViewShell::~ScTabViewShell() { ScDocShell* pDocSh = GetViewData().GetDocShell(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index bc5cff7..1f20316 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -477,4 +477,16 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( return pResult; } +void ScTabViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + mpLibreOfficeKitCallback = pCallback; + mpLibreOfficeKitData = pData; +} + +void ScTabViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const +{ + if (mpLibreOfficeKitCallback) + mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits