Bug 159338 - Incorrect Copy and Paste (Formula)
Summary: Incorrect Copy and Paste (Formula)
Status: RESOLVED DUPLICATE of bug 156357
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-23 12:53 UTC by ktopyes
Modified: 2024-02-26 17:59 UTC (History)
1 user (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 ktopyes 2024-01-23 12:53:04 UTC
Description:
Copy and Paste into Notepad (or elsewhere) after 
Show Formula should copy the formula instead of Value.

However, LibreOffice Calc's copy and paste behaviour 
does not change when you toggle show formula.



Steps to Reproduce:
1. Control + ` (to toggle formula)
2. Control + C (to copy cell containing formula)
3. Control + P to Paste (elsewhere)

Actual Results:
Copy and Paste always copy Value regardless of Show Formula toggle.

Expected Results:
Expected result is to copy formula after toggling show formula
This is expected behavior on Excel.




Reproducible: Always


User Profile Reset: No

Additional Info:
Copy and Paste should copy Formula instead of Value after activating Show Formula.
Comment 1 ady 2024-01-23 14:27:19 UTC
There is something strange happening with this procedure.

Starting with the normal (values) view, the first time I go to menu View > Show Formula and then follow the select+copy+ paste_on_simple_text_editor, the result indeed is that the values are pasted instead of the formulas.

But, if I use menu Tools > Options > Calc > View > (Display) Formula, then the copy+paste works as expected, pasting the formulas to the text editor.

So, the problem seems to be the _first_ time the menu View > Show Formula is used before copying. There an additional problem: the inadequate situation can be replicated the other way around, trying to copy values but copying formulas instead.

A combination of all these factors would need testing in order to find what exactly triggers the initial problem, and what exactly makes the problem go away.

IOW, the menu View > Show Formula is inconsistent; the relevant Options menu/setting seems to "correct" the behavior, temporarily.

For now, setting to NEW.
Comment 2 ady 2024-02-24 22:24:28 UTC Comment hidden (obsolete)
Comment 3 ady 2024-02-24 22:32:43 UTC
Apologies. I am correcting a typo about the related bug report, instead of 159848, it was supposed to be tdf#159871.

(In reply to ady from comment #2)
> CC'ing Heiko.
> 
> This seems to be changing, at least partially. Please read carefully.
> 
> For LO 24.2.0.3, the UX difference I described in this tdf#159338 comment 1
> between:
> 
> * Calc > menu View > Show Formula
> 
> * Calc > menu Tools > Options > LibreOffice Calc > View > (Display) Formulas
> 
> 
> ..._seems_ to be solved, but the only way to actually know it is to know
> where in the source code these 2 items are located and how they were/are
> dealt with (so to know how to test this).
> 
> If indeed the difference went away between LO 7.6.0 and 24.2.0, then there
> must be some commit somewhere, and Heiko should be able to actually identify
> whether these items are now generating the same effect (as opposed to what
> they _seemed_ to be when I posted comment 1).
> 
> Which commit solved this difference? Is there one of these 2 settings being
> saved to the specific document in particular, while the other is for (the
> current installation/run of) Calc?
> 
> Now, all that is about UX. The bug described in comment 0 is only partially
> solved, by making both UI items work in the same way, but in tdf#159871
> there is still one point to improve:
> 
> * only Calc's functions and arguments are copied+pasted;
> 
> * not the entire path is copied+pasted, i.e. the worksheet name (and the
> full file name) that may be part of the formula are not completely
> copied+pasted.
Comment 4 Heiko Tietze 2024-02-26 08:58:33 UTC
I cannot reproduce a problem between either View > Show Formula or Tools > Options > Calc > View > Formulas. The actual issue from @ktopyes has been solved for bug 156357 and is available with the latest version 24.2.

*** This bug has been marked as a duplicate of bug 156357 ***
Comment 5 ady 2024-02-26 11:41:47 UTC
(In reply to Heiko Tietze from comment #4)
> I cannot reproduce a problem between either View > Show Formula or Tools >
> Options > Calc > View > Formulas.

@Heiko, I repro this with 7.6.5.2. Please follow these steps with 7.6.5.2, and then keep reading!

STR:

1. New Calc, with normal values View (not the formulas).
2. 
A1: 1
A2: =A1

3. Select A1:A2. Copy selection and paste on simple text editor.

Result of the paste action in the simple text editor:
1
1

4. Calc menu View > Show Formula (set it ON). Repeat step 3.

Result of the paste action in the simple text editor:
1
1

5. Calc menu View > Show Formula (set it OFF). Repeat step 3.

Result of the paste action in the simple text editor:
1
1

6. Calc menu Tools > Options > Calc > View > Formulas (set it ON). Repeat step 3.

Result of the paste action in the simple text editor:
1
=A1

7. Calc menu Tools > Options > Calc > View > Formulas (set it OFF). Repeat step 3.

Result of the paste action in the simple text editor:
1
1


CONCLUSION:
In LO 7.6.5.2, there is a difference between these 2 items:
* Calc menu View > Show Formula
* Calc menu Tools > Options > Calc > View > Formulas

This conclusion is based on the _effects_, which are _partially_ solved in 24.2, in which tdf#159871 shows that there is still something _else_ to solve.

The question remains... Are these 2 items really the same in LO 24.2, or, instead, do we still lack of the specific cases that would show the different effect of these 2 items?

Do you know where these 2 items could be found in the source code, so to compare the reason(s) for the aforementioned difference, and why this example is not repeatable in LO 24.2?
Comment 6 ady 2024-02-26 11:47:29 UTC
(In reply to ady from comment #5)

> The question remains... Are these 2 items really the same in LO 24.2, or,
> instead, do we still lack of the specific cases that would show the
> different effect of these 2 items?
> 
> Do you know where these 2 items could be found in the source code, so to
> compare the reason(s) for the aforementioned difference, and why this
> example is not repeatable in LO 24.2?

I guess the last question gets its answer by tdf#156357 comment10. I am not sure whether the answer for the first question is the same, considering that tdf#159871 remains in 24.2.0.
Comment 7 Heiko Tietze 2024-02-26 16:11:19 UTC
(In reply to ady from comment #5)
> I repro this with 7.6.5.2
Point is that it has changed with 24.2, see the duplicate (and I don't have 7.6 at hand anymore).
Comment 8 ady 2024-02-26 17:59:14 UTC
(In reply to Heiko Tietze from comment #7)
> (In reply to ady from comment #5)
> > I repro this with 7.6.5.2
> Point is that it has changed with 24.2, see the duplicate (and I don't have
> 7.6 at hand anymore).

@Heiko, I _have_ read the dupe (in which I participated with several comments and tests since its first comment). I also referred to it in my comments here. Additionally, I described the change that is seen in the _effect_ for 24.2.

My question/doubt remains, but maybe I am not being clear. I guess I'll have to wait for the resolution of tdf#159871, whenever that might happen.