Kaydet (Commit) 484d904d authored tarafından Miklos Vajna's avatar Miklos Vajna

sd: initial ViewShell::libreOfficeKitCallback()

With this, typing into an empty document + pressing Esc makes those
typed characters visible.

Change-Id: I57d05f40d1bb6afa2b8c68ce1d10906203aa4bc8
üst acde4399
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <vcl/ITiledRenderable.hxx>
#include <sfx2/viewsh.hxx> #include <sfx2/viewsh.hxx>
#include <vcl/prntypes.hxx> #include <vcl/prntypes.hxx>
#include <svtools/transfer.hxx> #include <svtools/transfer.hxx>
...@@ -443,6 +444,11 @@ public: ...@@ -443,6 +444,11 @@ public:
SdPage* pPage, SdPage* pPage,
const sal_Int32 nInsertPosition = -1); 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; class Implementation;
protected: protected:
...@@ -576,6 +582,9 @@ private: ...@@ -576,6 +582,9 @@ private:
/** Create the rulers. /** Create the rulers.
*/ */
void SetupRulers (void); void SetupRulers (void);
LibreOfficeKitCallback mpLibreOfficeKitCallback;
void* mpLibreOfficeKitData;
}; };
SdrView* ViewShell::GetDrawView (void) const SdrView* ViewShell::GetDrawView (void) const
......
...@@ -240,8 +240,10 @@ public: ...@@ -240,8 +240,10 @@ public:
virtual OUString getPartName( int nPart ) SAL_OVERRIDE; virtual OUString getPartName( int nPart ) SAL_OVERRIDE;
virtual void setPartMode( LibreOfficeKitPartMode ePartMode ) SAL_OVERRIDE; virtual void setPartMode( LibreOfficeKitPartMode ePartMode ) SAL_OVERRIDE;
/// @see ITiledRenderable::initializeForTiledRendering(). /// @see vcl::ITiledRenderable::initializeForTiledRendering().
virtual void initializeForTiledRendering() SAL_OVERRIDE; virtual void initializeForTiledRendering() SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::registerCallback().
virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) SAL_OVERRIDE;
// XComponent // XComponent
......
...@@ -2354,6 +2354,12 @@ void SdXImpressDocument::initializeForTiledRendering() ...@@ -2354,6 +2354,12 @@ void SdXImpressDocument::initializeForTiledRendering()
mpDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD); mpDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
} }
void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
{
SolarMutexGuard aGuard;
mpDocShell->GetViewShell()->registerLibreOfficeKitCallback(pCallback, pData);
}
uno::Reference< i18n::XForbiddenCharacters > SdXImpressDocument::getForbiddenCharsTable() uno::Reference< i18n::XForbiddenCharacters > SdXImpressDocument::getForbiddenCharsTable()
{ {
uno::Reference< i18n::XForbiddenCharacters > xForb(mxForbidenCharacters); uno::Reference< i18n::XForbiddenCharacters > xForb(mxForbidenCharacters);
......
...@@ -992,6 +992,7 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion) ...@@ -992,6 +992,7 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion)
sRectangle = "EMPTY"; sRectangle = "EMPTY";
else else
sRectangle = pRegion->GetBoundRect().toString(); sRectangle = pRegion->GetBoundRect().toString();
mpViewShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
} }
} // end of namespace sd } // end of namespace sd
......
...@@ -137,6 +137,8 @@ ViewShell::ViewShell( SfxViewFrame*, vcl::Window* pParentWindow, ViewShellBase& ...@@ -137,6 +137,8 @@ ViewShell::ViewShell( SfxViewFrame*, vcl::Window* pParentWindow, ViewShellBase&
: SfxShell(&rViewShellBase) : SfxShell(&rViewShellBase)
, mbCenterAllowed(bAllowCenter) , mbCenterAllowed(bAllowCenter)
, mpParentWindow(pParentWindow) , mpParentWindow(pParentWindow)
, mpLibreOfficeKitCallback(0)
, mpLibreOfficeKitData(0)
{ {
construct(); construct();
} }
...@@ -1448,6 +1450,18 @@ void ViewShell::NotifyAccUpdate( ) ...@@ -1448,6 +1450,18 @@ void ViewShell::NotifyAccUpdate( )
GetViewShellBase().GetDrawController().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 } // end of namespace sd
//===== ViewShellObjectBarFactory ============================================= //===== ViewShellObjectBarFactory =============================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment