diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 11:28:55 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-27 10:00:59 +0100 |
commit | 981eafbb347f2e5aed8e7a4953891f439a4ffffd (patch) | |
tree | 172137fd4dc095fda6e996fde4416b780c6f6d3f /sw | |
parent | eb1ef5b12eb6fb01bf1c2b929fe836bbb8b2c697 (diff) |
lok::Document::paste: check if the given mime type is supported
(cherry picked from commit 7efbbe98d7fe951909234dcacd37f67975f00da2)
Conflicts:
sw/inc/unotxdoc.hxx
Change-Id: Ib59ea43700815c53cdd4be819e2e9cf35c6f89e9
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unotxdoc.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index f8af2cc29245..e590e2da3ce4 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -436,6 +436,8 @@ public: virtual OUString getPartPageRectangles() SAL_OVERRIDE; /// @see vcl::ITiledRenderable::getWindow(). virtual vcl::Window* getWindow() SAL_OVERRIDE; + /// @see vcl::ITiledRenderable::isMimeTypeSupported(). + virtual bool isMimeTypeSupported() SAL_OVERRIDE; // ::com::sun::star::tiledrendering::XTiledRenderable virtual void SAL_CALL paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, ::std::exception) SAL_OVERRIDE; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 6b182134e2ea..94cd065334f0 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3195,6 +3195,16 @@ vcl::Window* SwXTextDocument::getWindow() return &pDocShell->GetView()->GetEditWin(); } +bool SwXTextDocument::isMimeTypeSupported() +{ + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + if (!pWrtShell) + return false; + + TransferableDataHelper aDataHelper(TransferableDataHelper::CreateFromSystemClipboard(&pWrtShell->GetView().GetEditWin())); + return aDataHelper.GetXTransferable().is() && SwTransferable::IsPaste(*pWrtShell, aDataHelper); +} + int SwXTextDocument::getPart() { SolarMutexGuard aGuard; |