Kaydet (Commit) 9533e017 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#67796: sw: fix table cursor when setting language in status bar

Unfortunately it turns out that the neat hack in commit
b227a8e4 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().

Change-Id: I2981506b3065e824532deda28d21dad4a5734a8c
üst 2731092c
...@@ -322,9 +322,6 @@ void SwTextShell::Execute(SfxRequest &rReq) ...@@ -322,9 +322,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
// prevent view from jumping because of (temporary) selection changes // prevent view from jumping because of (temporary) selection changes
rWrtSh.LockView( sal_True ); rWrtSh.LockView( sal_True );
// save selection for later restoration
rWrtSh.Push();
// setting the new language... // setting the new language...
if (!aNewLangTxt.isEmpty()) if (!aNewLangTxt.isEmpty())
{ {
...@@ -363,6 +360,12 @@ void SwTextShell::Execute(SfxRequest &rReq) ...@@ -363,6 +360,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
bForSelection = false; bForSelection = false;
} }
if (bForParagraph || !bForSelection)
{
rWrtSh.Push(); // save selection for later restoration
rWrtSh.ClearMark(); // fdo#67796: invalidate table crsr
}
if (bForParagraph) if (bForParagraph)
SwLangHelper::SelectCurrentPara( rWrtSh ); SwLangHelper::SelectCurrentPara( rWrtSh );
...@@ -381,11 +384,12 @@ void SwTextShell::Execute(SfxRequest &rReq) ...@@ -381,11 +384,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, bForSelection, aCoreSet ); SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, bForSelection, aCoreSet );
rWrtSh.EndUndo(); rWrtSh.EndUndo();
if (bForParagraph || !bForSelection)
{
rWrtSh.Pop(false); // restore selection...
}
} }
// restore selection...
rWrtSh.Pop( sal_False );
rWrtSh.LockView( sal_False ); rWrtSh.LockView( sal_False );
rWrtSh.EndAction(); rWrtSh.EndAction();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment