[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Jun 25 06:07:23 PDT 2014


 sw/source/uibase/uiview/viewdraw.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 93011580b743078a0612ba4bfe0094804003a75b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 25 14:55:18 2014 +0200

    SwView::EnterDrawTextMode: refuse to edit editeng text if texbox is attached
    
    Change-Id: If1b3e9807414e90341199eabfa937376084c097d

diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index d282eb4..5c895ae 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -31,6 +31,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <doc.hxx>
 #include <IDocumentDeviceAccess.hxx>
+#include <textboxhelper.hxx>
 #include <editeng/langitem.hxx>
 #include <linguistic/lngprops.hxx>
 #include <editeng/unolingu.hxx>
@@ -459,6 +460,16 @@ void SwView::NoRotate()
 
 // Enable DrawTextEditMode
 
+static bool lcl_isTextBox(SdrObject* pObject)
+{
+    if (SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(pObject->GetUserCall()))
+    {
+        if (SwFrmFmt* pFmt = pDrawContact->GetFmt())
+            return SwTextBoxHelper::findTextBox(pFmt);
+    }
+    return false;
+}
+
 bool SwView::EnterDrawTextMode(const Point& aDocPos)
 {
     SdrObject* pObj;
@@ -483,7 +494,9 @@ bool SwView::EnterDrawTextMode(const Point& aDocPos)
 
         !m_pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
     {
-        bReturn = BeginTextEdit( pObj, pPV, m_pEditWin, false );
+        // Refuse to edit editeng text of the shape if it has textbox attached.
+        if (!lcl_isTextBox(pObj))
+            bReturn = BeginTextEdit( pObj, pPV, m_pEditWin, false );
     }
 
     pSdrView->SetHitTolerancePixel( nOld );


More information about the Libreoffice-commits mailing list