summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw/edtwin.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-24 17:11:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-24 17:47:40 +0200
commit7596e26fd259ce5445212949403e7cd32303b2bd (patch)
treecda3ea0acb777fa8ce97e1b8485648e62078ca53 /sw/source/uibase/docvw/edtwin.cxx
parent212dce21b62a4cfb85406bebe54ee07545516e21 (diff)
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/docvw/edtwin.cxx')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx19
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();