[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - include/vcl sd/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Mar 26 07:39:08 PDT 2015


 include/vcl/ITiledRenderable.hxx |    2 +-
 sd/source/ui/inc/unomodel.hxx    |    2 ++
 sd/source/ui/unoidl/unomodel.cxx |   23 +++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 27f599d1c63d007977604c8b8893e7dea14e91b7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 26 15:37:45 2015 +0100

    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

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 0717635..a10e448 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -124,7 +124,7 @@ public:
     /**
      * @see lok::Document::resetSelection().
      */
-    virtual void resetSelection() { }
+    virtual void resetSelection() = 0;
 };
 
 } // namespace vcl
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index fe5679b..409b620 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 4305b9b..0a1a955 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);


More information about the Libreoffice-commits mailing list