diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-25 14:55:18 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-25 15:06:46 +0200 |
commit | 93011580b743078a0612ba4bfe0094804003a75b (patch) | |
tree | 5ba3045af84af8a8ef24b6a670e8ff349744dc26 | |
parent | 74a0782166c6afd9bd2352e12ef1ce7d4dccaa5c (diff) |
SwView::EnterDrawTextMode: refuse to edit editeng text if texbox is attached
Change-Id: If1b3e9807414e90341199eabfa937376084c097d
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index d282eb45bcbe..5c895ae64028 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 ); |