Kaydet (Commit) 632bc11c authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

tdf#117017 Pasting into the formula bar shouldn't retain formatting

This is (kind of) regression from the previous commit
a860c94f ("tdf#117017 Make modifier
keys not trigger the InputChanged handler").

Reset of formatting when pasting into the formula bar via a keyboard
shortcut, was actually a side effect of the gtk auto-accelerator
work. In particual, bibisect (of the 5.2 cycle) points to commit
8d53d01f ("tdf#96739: Send Ctrl-Left/
RightShift events to correct window"). The behavior was later changed
back with commit 0321dbb9
("Resolves: tdf#99324 let sidebar toggle auto-mnemonics on/off with
alt"), but introduced again upon request of tdf#113894, with commit
d90dcf35 ("tdf#113894 release ctrl of
ctrl+v in input line should strip formatting"). Now it's broken again
with the previous commit of this bug.

However, even if not retaining formatting is the desired behavior,
triggering it on a modifier key release isn't a good idea. So keep
the previous commit, and implement tdf#113894 differently. In
addition, make sure to get identical behavior regardless of the
pasting method, be it via a keyboard shortcut, a toolbar button or a
menu/context menu command. And users can still override this behavior
with the usual paste special dialog, or the toolbar dropdown.

Change-Id: Icd801d62ceeead066484256d60f9585f2e7ebaec
Reviewed-on: https://gerrit.libreoffice.org/53516Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst 2815499d
......@@ -3400,9 +3400,15 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
{
if (pTableView)
{
EVControlBits nControl = pTableView->GetControlWord();
if (pTopView)
pTableView->SetControlWord(nControl | EVControlBits::SINGLELINEPASTE);
vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : nullptr;
if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
bUsed = true;
pTableView->SetControlWord(nControl);
}
if (pTopView)
if ( pTopView->PostKeyEvent( rKEvt ) )
......
......@@ -217,10 +217,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
break;
case SID_PASTE:
pTableView->PasteSpecial();
{
EVControlBits nControl = pTableView->GetControlWord();
if (pTopView)
{
pTopView->Paste();
break;
pTableView->SetControlWord(nControl | EVControlBits::SINGLELINEPASTE);
}
pTableView->PasteSpecial();
pTableView->SetControlWord(nControl);
}
break;
case SID_DELETE:
pTableView->DeleteSelected();
......
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