diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-11 18:36:47 +0200 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2013-10-17 15:55:20 +0000 |
commit | 4898ccc561af302db3b947f3a7b983e7f4c08566 (patch) | |
tree | f36c114b92952399ce690307369d3bc0ec576377 | |
parent | 640e86b4ba06a7c8381857d79627ec43416d72b3 (diff) |
fdo#67796: sw: fix table cursor when setting language in status bar
Unfortunately it turns out that the neat hack in commit
b227a8e4d65e4bbfe991aed9342fe3e30eca8639 does not work unless something
actually _deletes_ the current m_pTblCrsr between Push() and Pop(),
e.g. by calling SwCrsrShell::ClearMark() or KillPams().
It would be possible to do some invalidation of m_pTblCrsr in
SwCrsrShell::ClearUpCrsrs() or UpdateCrsr(), to set it's bChg flag
or perhaps call ParkTblCrsr(); not sure if doing that is an improvement;
certainly it shouldn't be tried in a 4.0.6 backport.
So work around the problem locally in SwTextShell::Execute().
Conflicts:
sw/source/ui/shells/textsh1.cxx
Change-Id: I2981506b3065e824532deda28d21dad4a5734a8c
(cherry picked from commit 9533e01713c0170bdae030429de38756d9c5ca74)
Reviewed-on: https://gerrit.libreoffice.org/6224
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index c351e3847a0b..373731eab276 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -311,8 +311,6 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.StartAction(); // prevent view from jumping because of (temporary) selection changes rWrtSh.LockView( sal_True ); - // save selection for later restoration - rWrtSh.Push(); // setting the new language... if (aNewLangTxt.Len() > 0) @@ -352,6 +350,12 @@ void SwTextShell::Execute(SfxRequest &rReq) bForSelection = false; } + if (bForParagraph || !bForSelection) + { + rWrtSh.Push(); // save selection for later restoration + rWrtSh.ClearMark(); // fdo#67796: invalidate table crsr + } + if (bForParagraph) SwLangHelper::SelectCurrentPara( rWrtSh ); @@ -366,10 +370,12 @@ void SwTextShell::Execute(SfxRequest &rReq) SwLangHelper::ResetLanguages( rWrtSh, bForSelection ); else SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, bForSelection, aCoreSet ); - } - // restore selection... - rWrtSh.Pop( sal_False ); + if (bForParagraph || !bForSelection) + { + rWrtSh.Pop(false); // restore selection... + } + } rWrtSh.LockView( sal_False ); rWrtSh.EndAction(); |