diff options
Diffstat (limited to 'sc/source/ui/drawfunc/fuins1.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index c7fd4c96c8ae..9dc65bf03c61 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -23,6 +23,7 @@ #include <svx/svdpage.hxx> #include <svx/svdpagv.hxx> #include <svx/svdview.hxx> +#include <svx/svdundo.hxx> #include <svx/linkwarn.hxx> #include <vcl/graphicfilter.hxx> #include <svl/stritem.hxx> @@ -41,6 +42,10 @@ #include "sc.hrc" #include "globstr.hrc" +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> +#include <sfx2/lokhelper.hxx> + using namespace ::com::sun::star; void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage ) @@ -251,6 +256,28 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh, if ( nError == GRFILTER_OK ) { lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, true, pViewSh, pWindow, pView ); + + // FIXME HACK: The ViewObjectContact sdr thing is not set up well + // enough for the invalidate to work here automagically, because + // we set it up for each tile, and it does not survive for too + // long. Luckily for inserting an image, we can live with a full + // invalidate, so let's just do it for now. + if (comphelper::LibreOfficeKit::isActive()) + { + std::stringstream ss; + ss << "EMPTY"; + if (comphelper::LibreOfficeKit::isPartInInvalidation()) + ss << ", " << pViewSh->getPart(); + OString aPayload = ss.str().c_str(); + + SfxViewShell* pCurView = SfxViewShell::GetFirst(); + while (pCurView) + { + pCurView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aPayload.getStr()); + + pCurView = SfxViewShell::GetNext(*pCurView); + } + } } } else |