Bug 117812 - Incorrect spaces are inserted before the punctuation marks (when cutting and pasting)
Summary: Incorrect spaces are inserted before the punctuation marks (when cutting and ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2018-05-26 00:26 UTC by Dimitry Perov
Modified: 2024-11-06 10:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Perov 2018-05-26 00:26:51 UTC
Description:
When you move words (Ctrl-X, Ctrl-V), spaces are inserted correctly between words. But when you insert a word before the punctuation mark, the space is inserted between the word and the punctuation mark, not between words.

Steps to Reproduce:
1. Type: "Sator Arepo tenet opera rotas."
2. Double-click the word "tenet"
3. Press Ctrl-X
4. Move cursor between "s" and dot
5. Press Ctrl-V

Actual Results:  
Sator Arepo opera rotastenet .

Expected Results:
Sator Arepo opera rotas tenet.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Dieter 2018-05-27 16:15:29 UTC
Reproducible for me with

Version: 6.1.0.0.beta1 (x64)
Build ID: 8c76dfe1284e211954c30f219b3a38dcdd82f8a0
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: de-DE (de_DE); Calc: CL

But LO always adds a space at the end of the word, if you paste i in this way. So I'm not sure, if it is possible to modify the behaviour only for the special case of a punctuation mark.
Comment 2 Dimitry Perov 2018-05-27 16:31:01 UTC
(In reply to Dieter Praas from comment #1)
> But LO always adds a space at the end of the word, if you paste i in this
> way. So I'm not sure, if it is possible to modify the behaviour only for the
> special case of a punctuation mark.

A space is added between words, right or left, according the cursor position. If the cursor is after "a" (opera) or before "r" (rotas), the result will be the same (Sator Arepo opera tenet rotas).
Comment 3 Dieter 2018-05-27 16:56:25 UTC
(In reply to Dimitry Perov from comment #2) 
> A space is added between words, right or left, according the cursor
> position. If the cursor is after "a" (opera) or before "r" (rotas), the
> result will be the same (Sator Arepo opera tenet rotas).

You're right, sorry. And if you past it within a word, free space left and right is added. So it should be possible to fix the bug.
Comment 4 Xisco Faulí 2018-05-31 15:56:57 UTC
Also reproduced in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 5 QA Administrators 2019-06-01 02:49:24 UTC Comment hidden (obsolete)
Comment 6 Dieter 2021-10-13 06:50:22 UTC
Still present in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 56883788d0090383dad58552f5a11044ffe64a44
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Following steps makes it more visible:
1. Type: "Sator Arepo tenet opera rotas."
2. Highlight space before "tenet"
3. Double-click the word "tenet"
4. Press Ctrl-X => highlighted space disappears
5. Move cursor between "s" and dot
6. Press Ctrl-V

Works as expected, if you drag and drop "tenet"

See also Bug 141738
Comment 7 LeroyG 2022-11-24 19:42:32 UTC
If the copied word is the first of a paragraph, no space/s is/are added.
Comment 8 Stéphane Guillou (stragu) 2023-12-01 10:05:19 UTC
Reproduced in recent trunk build:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5589659829f8a1cef8ca1c8a468732105bbe231b
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded