https://bugs.documentfoundation.org/show_bug.cgi?id=164475

            Bug ID: 164475
           Summary: Spaces added when they shouldn't be in specific cases
                    when copy-pasting text, plus related inconsistent
                    behavior
           Product: LibreOffice
           Version: 24.8.3.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Description:
LibreOffice Writer tries to add spaces intelligently when copy-pasting whole
words with CTRL+C, CTRL+V. Usually it works like this:

Step 1. Open a new LO Writer document.
Step 2. Type this three-word line:
     start middle end
Step 3. Copy “middle” with CTRL+C.
Step 4. Place the cursor inside a word and paste with CTRL+V. Note that LO adds
both leading and trailing spaces. Undo.
Step 5. Place the cursor immediately before a word and paste with CTRL+V. Note
that LO adds a single trailing space to separate them. Undo.
Step 6. Place the cursor immediately after a word and paste with CTRL+V. Note
that LO adds a single leading space to separate them. Undo.
Step 7. Type two spaces anywhere, place the cursor between them, and paste with
CTRL+V. Note that LO doesn't add spaces (to avoid double spaces). Undo.

This behavior breaks in at least three cases (A, B, C).


Case A:

Instead of Step 3, copy either “start” or “end” with CTRL+C.
Step 4. Place the cursor inside a word and paste with CTRL+V. Observe results,
then undo.
Step 5. Place the cursor immediately before a word and paste with CTRL+V.
Observe results, then undo.
Step 6. Place the cursor immediately after a word and paste with CTRL+V.
Observe results, then undo.
Step 7. Type two spaces anywhere, place the cursor between them, and paste with
CTRL+V. Observe results, then undo.

Actual Results:
In each case, LO doesn't add any spaces.

Expected Results:
LO should add leading and/or trailing spaces as appropriate, as it would for
any other copied word or group of whole words.

(Comment: This behavior is at least inconsistent, and presumably a bug. It
happens specifically when the text selection starts at the start of a paragraph
or ends at the end of a paragraph, and contains only whole words and
punctuation.)


Case B:

Follow Steps 1-3.
Step 4: Type a space after “end”.
Step 5: Leave the cursor after the space and paste with CTRL+V.

Actual Results:
LO adds an unwanted leading space, resulting in two spaces.

Expected Results:
LO should not add another space.

(Comment: I encounter this bug frequently when I have copied a long word,
proper name, or phrase to use throughout a paragraph. When I come to use the
copied text, I type a space because I am about to insert a word that I have
copied without a leading space, then when I paste it I get two spaces. This is
bad enough, but Case A makes it worse because occasionally I happen to have
copied the word from the start or end of a paragraph, so I actually DO need to
type the space!)


Case C:

Follow Steps 1-3.
Step 1: Select the word “middle”, and paste with CTRL+V. Observe that LO
correctly replaces the word without adding any spaces. Undo.
Step 2: Select the word “end”, and paste with CTRL+V.

Actual Results:
LO adds a leading space, resulting in two spaces between the second and third
words of the line.

Expected Results:
LO should not add a space.

(Comment: This unwanted space is only created when copy-pasting over the words
at the end of a line, similarly to Case B. Note that if there is a period or
other symbol after “end”, then this bug occurs if the symbol is included in the
selection, and not otherwise. Multiple whole words at the end of a line can be
selected and this bug occurs. If the first or last words of a line are copied
and pasted, this bug does not occur, due to Case A.)

Steps to Reproduce:
Follow the steps for Cases A, B, and C.

Actual Results:
Case A: No spaces added.
Cases B,C: Unwanted spaces added.

Expected Results:
Case A: Spaces added consistently.
Cases B,C: No spaces added.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 48a6bac9e7e268aeb4c3483fcf825c94556d9f92
CPU threads: 12; OS: Windows 11 X86_64 (10.0 build 22631); UI render:
Skia/Raster; VCL: win
Locale: en-GB (en_NZ); UI: en-GB
Calc: CL threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to