diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-19 18:13:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-19 18:00:53 +0000 |
commit | af7cbebd8eed82b81e00e6c2e0dc6c2c467ad8e2 (patch) | |
tree | 2172475e22afce046cb1e9b1fb6528574bc16cf4 /sd/source | |
parent | 69e9c082f07206a1a589c49f679f92c2162e830d (diff) |
LOK: return used format in Document::getTextSelection()
This allows requesting text/html, with falling back to plain text if
necessary.
Change-Id: Ie6d4e0e173311ba018553043b6a869abf193bf6f
Reviewed-on: https://gerrit.libreoffice.org/16377
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/inc/ViewShell.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index b0a868282453..bc962ca59810 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -452,7 +452,7 @@ public: /// Allows adjusting the point or mark of the selection to a document coordinate. void SetCursorMm100Position(const Point& rPosition, bool bPoint, bool bClearMark); /// Gets the currently selected text. - OString GetTextSelection(const OString& aMimeType); + OString GetTextSelection(const OString& aMimeType, OString& rUsedMimeType); /// Allows starting or ending a graphic move or resize action. void SetGraphicMm100Position(bool bStart, const Point& rPosition); diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 2793ca09617b..009fb672cf27 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -252,7 +252,7 @@ public: /// @see vcl::ITiledRenderable::setTextSelection(). virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE; /// @see vcl::ITiledRenderable::getTextSelection(). - virtual OString getTextSelection(const char* pMimeType) SAL_OVERRIDE; + virtual OString getTextSelection(const char* pMimeType, OString& rUsedMimeType) SAL_OVERRIDE; /// @see vcl::ITiledRenderable::setGraphicSelection(). virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE; /// @see lok::Document::resetSelection(). diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index c74f3b1ffdbb..4940b08ce810 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2446,7 +2446,7 @@ void SdXImpressDocument::setTextSelection(int nType, int nX, int nY) } } -OString SdXImpressDocument::getTextSelection(const char* pMimeType) +OString SdXImpressDocument::getTextSelection(const char* pMimeType, OString& rUsedMimeType) { SolarMutexGuard aGuard; @@ -2454,7 +2454,7 @@ OString SdXImpressDocument::getTextSelection(const char* pMimeType) if (!pViewShell) return OString(); - return pViewShell->GetTextSelection(pMimeType); + return pViewShell->GetTextSelection(pMimeType, rUsedMimeType); } void SdXImpressDocument::setGraphicSelection(int nType, int nX, int nY) diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index f8c45b5a912f..396a796e833a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -553,7 +553,7 @@ void ViewShell::SetCursorMm100Position(const Point& rPosition, bool bPoint, bool } } -OString ViewShell::GetTextSelection(const OString& _aMimeType) +OString ViewShell::GetTextSelection(const OString& _aMimeType, OString& rUsedMimeType) { SdrView* pSdrView = GetView(); if (!pSdrView) @@ -585,6 +585,9 @@ OString ViewShell::GetTextSelection(const OString& _aMimeType) else aFlavor.DataType = cppu::UnoType< uno::Sequence<sal_Int8> >::get(); + if (!xTransferable->isDataFlavorSupported(aFlavor)) + return OString(); + uno::Any aAny(xTransferable->getTransferData(aFlavor)); OString aRet; @@ -604,6 +607,7 @@ OString ViewShell::GetTextSelection(const OString& _aMimeType) aRet = OString(reinterpret_cast<sal_Char*>(aSequence.getArray()), aSequence.getLength()); } + rUsedMimeType = _aMimeType; return aRet; } |