Bug 39151 - Sorting values in a copy of a sorted copied sheet changes focus to source sheet.
Summary: Sorting values in a copy of a sorted copied sheet changes focus to source sheet.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.1 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.5 target:3.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-11 15:42 UTC by djosiasmp
Modified: 2011-12-23 14:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test document (8.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-07-12 11:11 UTC, djosiasmp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description djosiasmp 2011-07-11 15:42:13 UTC
Hello,

I encountered this problem but could not find it in the bugs by a search.

In Calc a daughter sheet [DS] is generated duplicating an existing (parent) sheet [PS]. SORT operation is requested on DS but it is carried out on PS. 

If the document is saved, closed and re-opened SORT behaves normally. Also, if instead of duplicating, a new sheet is inserted and the values of PS copy-pasted over SORT behaviour is normal.

Cheers

David
Comment 1 Rainer Bielefeld Retired 2011-07-11 23:06:00 UTC
NOT Reproducible with "LibreOffice 3.4.1  – WIN7  Home Premium  (64bit) English UI [OOO340m1 (Build:103)]". 

My steps to reproduce:
1. Open new Calc document
2. Type "1" to A1
3. Use fill handle to fill down, so that I get 1 ... 16 in 'A1:A16'
4. Right click tab "Sheet1", 'Move/Copy Sheet -> Copy -> 
   Insert "Sheet1_2" before Sheet2'
   New sheet will be created, focus is on new sheet
5. Click 'Sheet1_2:A1, drag with pushed mouse button to A16 to select all 
   Cells with contents
6. Menu 'Data -> sort > Column A -> Desencing 
   (Options: only "Include Formats" checked') <ok>
   contents will be sorted as expected
7. Check Sheet1, nothing changed as expected.

Same result when I create new sheet by drag/Drop Sheet1 with pushed <ctrl> key.

LINUX related?

@mdjosiasmp@hotmail.com:
Unfortunately your report is much to rare, any useful information is missing. May I ask you to read  hints on <http://wiki.documentfoundation.org/BugReport> carefully?
Then please:
- Attach a sample document 
- Attach screenshots with comments (you can add information using LibO DRAW
  and then attach your screenshot with comments as PDF) if necessary
- Contribute a step by step instruction containing every key press and every 
  mouse click how to reproduce your problem
- add information 
  -- what exactly is unexpected
  -- and why do you believe it's unexpected
  -- concerning your PC 
  -- concerning your OS
  -- concerning your LibO  localization (UI language)
  –- Libo settings that might be related to your problems 
  -- how you launch LibO and how you opened the sample document
  -- everything else crossing your mind after you read a.m. URL

Can you please file Bug reports with status UNCONFIRMED if your are not absolutely sure that you contributed all required background information and that the problem will be reproducible with information you can provide? 
Thank you!
Comment 2 djosiasmp 2011-07-12 11:11:52 UTC
Created attachment 49020 [details]
test document
Comment 3 djosiasmp 2011-07-12 11:37:01 UTC
Unfortunately this is a real bug. I could reproduce it in LO3.4.1 on a Windows XP system at work

- Attach a sample document
* Done

- Attach screenshots with comments (you can add information using LibO DRAW
  and then attach your screenshot with comments as PDF) if necessary
* The document should be enough

- Contribute a step by step instruction containing every key press and every 
  mouse click how to reproduce your problem
a) Open new Calc document
b) Type 1 in Sheet1:A1 and drag to fill column values {1...20}
c) Right-click on sheet name to create a copy {Sheet1_2)
d) Sort Sheet1_2 descending {everything works OK}
e) Right-click on sheet name to create a copy {Sheet1_2_2}
f) Select Data->Sort while on Sheet1_2_2 and focus changes to Sheet1_2
g) Type 1 in Sheet2:A1 and drag to fill column values {1...20}
d) Sort Sheet2 descending {everything works OK}
e) Right-click on sheet name to create a copy {Sheet2_2}
f) Select Data->Sort while on Sheet2_2 and focus changes to Sheet2
* This does not happen if the data is copied over to a new sheet (instead of a right-click copy/move) it happens when a sheet is copied after a sort has been performed

- add information 
  -- what exactly is unexpected
   * SORT should happen on the sheet it is invoked, not change focus to the parent sheet.
  -- and why do you believe it's unexpected
   * the current behaviour is stupid, it doesn't let you create a family of sheets that are just varying by a small amount easily.
  -- concerning your PC 
   * this is not PC related; I have this behaviour in a Lenovo X61 and a Dell Optiplex
  -- concerning your OS
   * X61 is running PCLinuxOS, Optiplex has Windows XP; both have the problem.
  -- concerning your LibO  localization (UI language)
   * En(GB)
  –- Libo settings that might be related to your problems 
   * none that I'm aware
  -- how you launch LibO and how you opened the sample document
   * Start menu and opened new Calc document.
  -- everything else crossing your mind after you read a.m. URL
   * this is NOT A LINUX PROBLEM
Comment 4 Rainer Bielefeld Retired 2011-07-13 06:28:31 UTC
[Reproducible] with "LibO-dev 3.4.5  – WIN7  Home Premium  (64bit) English UI 
[(Build ID:d337f79-a24c961-2865670-9752b71-7f8fd43
	2fdd60d-fd28b6a-fd7bf20-aa369cb-28da3fb
	6a9633a-931d089-ecd263f-c9b55e9-b31b807
	82ff335-599f7e9-bc6a545-1926fdf)]"
And

[Reproducible] with "LibreOffice 3.4.1  - WIN7  Home Premium (64bit) German UI [OOO340m1 (Build:103)]" 

Following reporter's instruction I can reproduce the problem with his sample and with own documents from the scratch:
1. Open new CALC document with row 1-20
2. Created daughter sheet by copy, insert it at the end
3. sort numbers in row in daughter sheet descending
4. Created granddaughter sheet by copy and insert it at the end
5. again select 20-1
6. click Menu 'Data'
7. click 'Sort'
  As expected: sort dialog opens
  Unexpected: sheet focus changes to daughter sheet

@djosiasmp:
Good catch!

@Kohei:
Please feel free to reassign if it’s not your area
Comment 5 Markus Mohrhard 2011-08-02 12:34:15 UTC
I'm taking it
Comment 6 Markus Mohrhard 2011-08-02 18:00:07 UTC
pushed a fix to master and sent patch for 3.4 to ML