diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-20 14:51:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-23 10:10:29 +0100 |
commit | ab44ada1471873997de3ae0349b258088b2ba71b (patch) | |
tree | 056dfd6612a7678dab3543ef73b26b0b2bcc2789 | |
parent | 532e77cd3886b985f6e61363f563cbaa6c1b4b6d (diff) |
sd::ViewShell -> SdrModel for LOK callback
One one hand, this fixes missing invalidations after typing characters
in editeng on Android. Previously it was assumed that there is only one
sd::ViewShell for one Impress document, but that's obviously not true.
On the other hand, this will be handy when later svx code wants to
invoke the LOK callback as well, when it was stored in sd, that wasn't
possible.
Change-Id: Id467be01ad008aecaaabdd85b2a6b29a14f1eb86
-rw-r--r-- | include/svx/svdmodel.hxx | 7 | ||||
-rw-r--r-- | sd/source/ui/inc/ViewShell.hxx | 9 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdwindow.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 14 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 14 |
6 files changed, 23 insertions, 25 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index a8a185acd9bd..375ad58cbfee 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -37,6 +37,7 @@ #include <svx/xtable.hxx> #include <svx/pageitem.hxx> #include <vcl/field.hxx> +#include <vcl/ITiledRenderable.hxx> class OutputDevice; #include <svx/svdtypes.hxx> @@ -171,6 +172,8 @@ protected: OutputDevice* pRefOutDev; // ReferenceDevice for the EditEngine /// Set if we are doing tiled rendering. bool mbTiledRendering; + LibreOfficeKitCallback mpLibreOfficeKitCallback; + void* mpLibreOfficeKitData; sal_uIntPtr nProgressAkt; // for the sal_uIntPtr nProgressMax; // ProgressBar- sal_uIntPtr nProgressOfs; // -Handler @@ -338,6 +341,10 @@ public: void setTiledRendering(bool bTiledRendering); /// Are we doing tiled rendering? bool isTiledRendering() const; + /// 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; // If a new MapMode is set on the RefDevice (or similar) void RefDeviceChanged(); // not yet implemented // default font heigth in logical units diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index e5f082c16b51..b4bd3331a30e 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -23,7 +23,6 @@ #include <rtl/ref.hxx> #include <vcl/field.hxx> -#include <vcl/ITiledRenderable.hxx> #include <sfx2/viewsh.hxx> #include <vcl/prntypes.hxx> #include <svtools/transfer.hxx> @@ -444,11 +443,6 @@ public: SdPage* pPage, const sal_Int32 nInsertPosition = -1); - /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API for Impress. - void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); - /// Invokes the registered callback, if there are any. - void libreOfficeKitCallback(int nType, const char* pPayload) const; - class Implementation; protected: @@ -582,9 +576,6 @@ private: /** Create the rulers. */ void SetupRulers (void); - - LibreOfficeKitCallback mpLibreOfficeKitCallback; - void* mpLibreOfficeKitData; }; SdrView* ViewShell::GetDrawView (void) const diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 267a983d301a..6f5edb31456f 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2358,7 +2358,7 @@ void SdXImpressDocument::initializeForTiledRendering() void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData) { SolarMutexGuard aGuard; - mpDocShell->GetViewShell()->registerLibreOfficeKitCallback(pCallback, pData); + mpDoc->registerLibreOfficeKitCallback(pCallback, pData); } uno::Reference< i18n::XForbiddenCharacters > SdXImpressDocument::getForbiddenCharsTable() diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index a94d8eecd4f8..60d51e69e2ea 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -992,7 +992,7 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion) sRectangle = "EMPTY"; else sRectangle = pRegion->GetBoundRect().toString(); - mpViewShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); + mpViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } } // end of namespace sd diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 77b024eacfdb..0581a7cb4238 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -137,8 +137,6 @@ ViewShell::ViewShell( SfxViewFrame*, vcl::Window* pParentWindow, ViewShellBase& : SfxShell(&rViewShellBase) , mbCenterAllowed(bAllowCenter) , mpParentWindow(pParentWindow) -, mpLibreOfficeKitCallback(0) -, mpLibreOfficeKitData(0) { construct(); } @@ -1450,18 +1448,6 @@ void ViewShell::NotifyAccUpdate( ) GetViewShellBase().GetDrawController().NotifyAccUpdate(); } -void ViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) -{ - mpLibreOfficeKitCallback = pCallback; - mpLibreOfficeKitData = pData; -} - -void ViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const -{ - if (mpLibreOfficeKitCallback) - mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); -} - } // end of namespace sd //===== ViewShellObjectBarFactory ============================================= diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index c444fa582b51..66f004e6e261 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -125,6 +125,8 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pHitTestOutliner=NULL; pRefOutDev=NULL; mbTiledRendering = false; + mpLibreOfficeKitCallback = 0; + mpLibreOfficeKitData = 0; nProgressAkt=0; nProgressMax=0; nProgressOfs=0; @@ -806,6 +808,18 @@ bool SdrModel::isTiledRendering() const return mbTiledRendering; } +void SdrModel::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + mpLibreOfficeKitCallback = pCallback; + mpLibreOfficeKitData = pData; +} + +void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const +{ + if (mpLibreOfficeKitCallback) + mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); +} + void SdrModel::ImpReformatAllTextObjects() { if( isLocked() ) |