diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-02-24 13:58:55 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-02 08:50:54 +0100 |
commit | 75a186ac43768ec4dfca8710072a667a7800453b (patch) | |
tree | 3a018a64e8ac50f6443d9cbc8869e0b4a8eaf96c /sc/source/ui | |
parent | cffef0927fdc5c8a1d32ccc80cb60298128bc3ce (diff) |
sc: Initial support for tiled editing in Calc.
Change-Id: Ifa5f84934a68fec86d4f30ee998bf75edfe331c5
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/inputhdl.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 10 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 97 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 12 |
7 files changed, 92 insertions, 51 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index e7f9c418f972..712fb7245c62 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 65ea47c3c927..829ec975f875 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 22726636d92d..b0afcded72fc 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 478787402aed..ff56c2576494 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -512,6 +512,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 8c0805dd0752..b6bf539cc9e5 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 2563bdf8a056..ef4f9f0fcc2c 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 bc5cff707733..1f20316dc543 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: */ |