diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-26 15:37:45 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:53 +0200 |
commit | 84793d11152fc0eb308cf29475ae2c2a86d40967 (patch) | |
tree | 1a321173f0d43fda6ae74a0f5ac29cb0f0ec4334 /sd | |
parent | 62d03f6c6109755375a93681ffcc7196827cfd0c (diff) |
SdXImpressDocument: implement resetSelection()
With this, when editing is finished, no text edit is active, also both
editeng and sdr selections are reset.
Change-Id: If953e1d8683171c1f1ed8c7d97ae34a163d14765
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index fe5679bfb7f4..409b62021b3d 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -250,6 +250,8 @@ public: virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE; /// @see vcl::ITiledRenderable::setGraphicSelection(). virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE; + /// @see lok::Document::resetSelection(). + virtual void resetSelection() SAL_OVERRIDE; // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 4305b9b8ac58..0a1a95525bcd 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2451,6 +2451,29 @@ void SdXImpressDocument::setGraphicSelection(int nType, int nX, int nY) } } +void SdXImpressDocument::resetSelection() +{ + SolarMutexGuard aGuard; + + DrawViewShell* pViewShell = GetViewShell(); + if (!pViewShell) + return; + + SdrView* pSdrView = pViewShell->GetView(); + if (!pSdrView) + return; + + if (pSdrView->IsTextEdit()) + { + // Reset the editeng selection. + pSdrView->UnmarkAll(); + // Finish editing. + pSdrView->SdrEndTextEdit(); + } + // Reset graphic selection. + pSdrView->UnmarkAll(); +} + uno::Reference< i18n::XForbiddenCharacters > SdXImpressDocument::getForbiddenCharsTable() { uno::Reference< i18n::XForbiddenCharacters > xForb(mxForbidenCharacters); |