diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 5 | ||||
-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 |
5 files changed, 12 insertions, 7 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 55c4426c05fc..a36cfba7324c 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -302,10 +302,11 @@ void SdTiledRenderingTest::testGetTextSelection() ESelection aWordSelection(0, 0, 0, 5); rEditView.SetSelection(aWordSelection); // Did we indeed manage to copy the selected text? - CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8")); + OString aUsedFormat; + CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat)); // Make sure returned RTF is not empty. - CPPUNIT_ASSERT(!OString(pXImpressDocument->getTextSelection("text/richtext")).isEmpty()); + CPPUNIT_ASSERT(!OString(pXImpressDocument->getTextSelection("text/richtext", aUsedFormat)).isEmpty()); } void SdTiledRenderingTest::testSetGraphicSelection() 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; } |