diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-24 17:11:25 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-24 17:47:40 +0200 |
commit | 7596e26fd259ce5445212949403e7cd32303b2bd (patch) | |
tree | cda3ea0acb777fa8ce97e1b8485648e62078ca53 /sw/source/uibase | |
parent | Save debug mail merge documents (diff) | |
download | core-7596e26fd259ce5445212949403e7cd32303b2bd.tar.gz core-7596e26fd259ce5445212949403e7cd32303b2bd.zip |
Add SwTextBoxHelper::findShapes
It builds a textbox -> shape map, so methods interested to pick the
shape instead of a shape's textbox can call it and act accordingly if
their textbox is in the map.
Change-Id: I0f30d64a284eb461f462ed6c0a36c88271153f04
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index e1fda396a3a2..6887cd06b1c1 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -76,6 +76,8 @@ #include <wrtsh.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentDrawModelAccess.hxx> +#include <textboxhelper.hxx> +#include <dcontact.hxx> #include <fldbas.hxx> #include <swmodule.hxx> #include <docsh.hxx> @@ -4241,8 +4243,21 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) SdrPageView* pPV; if (pSdrView->PickObj(aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER )) { - pSdrView->UnmarkAllObj(); - pSdrView->MarkObj(pObj,pPV,false,false); + std::map<SwFrmFmt*, SwFrmFmt*> aTextBoxShapes = SwTextBoxHelper::findShapes(rSh.GetDoc()); + SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); + SwFrmFmt* pFmt = pDrawContact->GetFmt(); + if (aTextBoxShapes.find(pFmt) == aTextBoxShapes.end()) + { + pSdrView->UnmarkAllObj(); + pSdrView->MarkObj(pObj,pPV,false,false); + } + else + { + // If the fly frame is a textbox of a shape, then select the shape instead. + SdrObject* pShape = aTextBoxShapes[pFmt]->FindSdrObject(); + pSdrView->UnmarkAllObj(); + pSdrView->MarkObj(pShape, pPV, false, false); + } } } ReleaseMouse(); |