Bug 74981 - EDITING: input field duplicated when I press Enter in front of it
Summary: EDITING: input field duplicated when I press Enter in front of it
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Björn Michaelsen
URL:
Whiteboard: target:4.3.0 target:4.2.4 target:4.5....
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-02-14 14:09 UTC by Anton Derbenev
Modified: 2014-12-15 21:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
possible fix (523 bytes, patch)
2014-03-23 13:44 UTC, Björn Michaelsen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Derbenev 2014-02-14 14:09:55 UTC
Steps to reproduce:
1. Create new empty writer document;
2. Press Ctrl+F2, switch to Functions tab, select Input Field, enter "test" (w/o quotes) in Reference, press Insert;
3. Enter any text in Input Field query window, press OK (or Ctrl+Enter);
4. Close in Fields window (not required, for the convenience);
5. Set cursor in front of the input field (press Home), press Enter for the new line.

Current behavior:
input field duplicated to the new line

Expected behavior:
newline inserted before the input field

Operating System: Windows XP
Last worked in: 4.1.3.2 release
Comment 1 tommy27 2014-02-15 16:04:10 UTC
tested under Win7 64bit

reproducible in LibO 4.2.0.4 and 4.3alpha 31 jan build

not reproducible in LibO 4.1.4.2, hence regression.

I add Writer expert to CC list.
Comment 2 Björn Michaelsen 2014-03-23 11:59:55 UTC
Hmm, not reproducable here on master 1d9d11c6e596365c66f756e8f62f0fcfb32b3b88 from 2013-03-19. Can you please recheck if this still happens on master?
Comment 3 Björn Michaelsen 2014-03-23 12:07:50 UTC
(daily builds are available from http://dev-builds.libreoffice.org/daily/ )
Comment 4 Björn Michaelsen 2014-03-23 12:12:32 UTC
Whoops, it _is_ reproducable on master (and on 4.2.3~rc1). I selected "placeholder" instead of "input field" in the functions tab.
Comment 5 Björn Michaelsen 2014-03-23 13:44:56 UTC
Created attachment 96237 [details]
possible fix

So attached patch does fix the issue, but it very lowlevel. Cutting out something with zero length should be a noop in general, but it still does stuff -- even though I cant imagine it does something sensible.
Now it might very well be that something using the cut implementation depends (or works around) on any funky behavior cutting nothing has and would cause trouble if this patch is applied.
Running subsequentcheck/slowcheck/unitcheck on this right now to see if there are any obvious issues with this.
Comment 6 Commit Notification 2014-03-23 14:02:30 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31b76e83d70718c95ac7913469629ea2c0294bfe

fdo#74981: cutting nothing should do nothing, should fix field dupes



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Björn Michaelsen 2014-03-24 10:07:10 UTC
Patched on master and review request for LibreOffice 4.2 at: https://gerrit.libreoffice.org/#/c/8730/
Comment 8 Commit Notification 2014-03-25 20:22:24 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f384598d8eec91c3c0f84a07ff3e59b8e3e13b3f&h=libreoffice-4-2

fdo#74981: cutting nothing should do nothing, should fix field dupes


It will be available in LibreOffice 4.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2014-03-25 23:13:23 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8bf22e7fe67b3321e2b2dcc8fb98882ef0eef4ca

related fdo#74981: add a unittest for kicks



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2014-12-15 21:25:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a1718045bd6218e07caebda7c4cacdcb853eabd3

fdo#74981: sw: fix input field handling when splitting paragraphs

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2014-12-15 21:28:01 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5152c52de76bc650cceb6fcf2fce060b3e765f86&h=libreoffice-4-4

fdo#74981: sw: fix input field handling when splitting paragraphs

It will be available in 4.4.0.0.beta3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.