summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-13 16:49:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-13 20:27:51 +0200
commit2ea385a54b53797ab3960869012f3ce3268eab2c (patch)
tree093e38182845f63f362d10165591029eded820c7 /editeng/source/editeng/impedit.cxx
parente12c9b41012e44275761b35795b83ec4bc838d42 (diff)
sw draw text: emit LOK_CALLBACK_TEXT_VIEW_SELECTION from registerCallback()
With this, in case the first view has an active text edit selection and a new view is created, then the text selection is instantly visible in the second view, even if the first view's text selection does not change later. Change-Id: I3255febd5d65d6576ddbc57cf96836bdf0b06a72
Diffstat (limited to 'editeng/source/editeng/impedit.cxx')
-rw-r--r--editeng/source/editeng/impedit.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index c0d920197a40..b04a4918e5ba 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -377,8 +377,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
aOrigin = pOutWin->GetMapMode().GetOrigin();
OString sRectangle;
- // If we are not in selection mode, then the exported selection should be empty.
- if (pEditEngine->pImpEditEngine->IsInSelectionMode())
+ // If we are not in selection mode, then the exported own selection should be empty.
+ if (pEditEngine->pImpEditEngine->IsInSelectionMode() || mpOtherShell)
{
std::vector<Rectangle> aRectangles;
pRegion->GetRegionRectangles(aRectangles);
@@ -413,8 +413,17 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
sRectangle = comphelper::string::join("; ", v);
}
- mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr());
- mpViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRectangle);
+ if (mpOtherShell)
+ {
+ // An other shell wants to know about our existing selection.
+ if (mpViewShell != mpOtherShell)
+ mpViewShell->NotifyOtherView(mpOtherShell, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRectangle);
+ }
+ else
+ {
+ mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr());
+ mpViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRectangle);
+ }
pOutWin->Pop();
}