[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source
Michael Stahl
mstahl at redhat.com
Mon Oct 14 03:41:44 PDT 2013
sw/source/ui/shells/textsh1.cxx | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 02a4d733ef24f4350f65179f46d144de7b948799
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Oct 11 18:36:47 2013 +0200
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
(cherry picked from commit 9533e01713c0170bdae030429de38756d9c5ca74)
Change-Id: I2981506b3065e824532deda28d21dad4a5734a8c
Reviewed-on: https://gerrit.libreoffice.org/6212
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 25976e9..b019604 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -328,8 +328,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)
@@ -369,6 +367,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 );
@@ -383,10 +387,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();
More information about the Libreoffice-commits
mailing list