Bug 96234 - Type Formatting, primary key checkbox never checked
Summary: Type Formatting, primary key checkbox never checked
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.0.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0 target:5.1.0.1 target:5...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 23:11 UTC by Julien Nabet
Modified: 2016-10-25 19:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
table design step 1 (23.09 KB, image/png)
2015-12-04 07:52 UTC, Lionel Elie Mamane
Details
table design step 2 (21.91 KB, image/png)
2015-12-04 07:52 UTC, Lionel Elie Mamane
Details
paste dialog step 1 (13.97 KB, image/png)
2015-12-04 07:52 UTC, Lionel Elie Mamane
Details
paste dialog step 2 (12.95 KB, image/png)
2015-12-04 07:53 UTC, Lionel Elie Mamane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2015-12-03 23:11:39 UTC
Following tdf#96012, on pc Debian x86-64 with master sources updated today but also wit 5.0.3 Debian package, primary key checkbox in Type formatting is never checked.

Steps to reproduce:
1) Retrieve tsv file from https://bugs.documentfoundation.org/attachment.cgi?id=120744
2) Open tsv file (Calc launches), check "Comma", so you've got several columns
3) Copy all content of Calc sheet
4) Open new or existing hsqldb Base file
5) Go to Tables panel
6)  Edit Menu paste>Copy Table Window (options are definition and data and use first lines as columns> Next> Apply All columns> next> Type Formatting
7) Right click on a field in left panel
=> a popup box appears with a checkbox unchecked + "Primary key"
8) Check the box
=> a key appears to show the field is a primary key now
9) Right click again on the same field
=>  a popup box appears with a checkbox still unchecked

Expected behavior:
since the field is now a primary key, checkbox should be checked
Comment 1 Julien Nabet 2015-12-03 23:28:28 UTC
Lionel: would you have some time to take a look to https://gerrit.libreoffice.org/#/c/20386/ ?

With this patch, the only glitch I've seen was this situation:
a) Consider 2 fields: A and B
b) If A is the primary key but you select both fields, A and B
=> the primary checkbox in popup isn't checked. OK (should be checked only if the whole primary key is selected I suppose)
c) but then you check the primary checkbox
=> B is the primary key and A is no more a primary key
Is it wrong? Should A and B be a multiple fields primary key?
Comment 2 Lionel Elie Mamane 2015-12-04 07:48:26 UTC
IMO it should behave as it does in Table Design. I just tried it out and:

1) It is checked only if the selected columns are *exactly*
   all of the primary key, no more, no less.

2) When anything else than exactly the primary key is selected,
   clicking on "primary key" *sets* the primary key. No per-field
   toggle!
Comment 3 Lionel Elie Mamane 2015-12-04 07:52:00 UTC
Created attachment 121004 [details]
table design step 1
Comment 4 Lionel Elie Mamane 2015-12-04 07:52:25 UTC
Created attachment 121005 [details]
table design step 2
Comment 5 Lionel Elie Mamane 2015-12-04 07:52:45 UTC
Created attachment 121006 [details]
paste dialog step 1
Comment 6 Lionel Elie Mamane 2015-12-04 07:53:05 UTC
Created attachment 121007 [details]
paste dialog step 2
Comment 7 Lionel Elie Mamane 2015-12-04 07:53:56 UTC
Between step 1 and step 2, I right-clicked and chose "primary key". Note the difference in result.
Comment 8 Julien Nabet 2015-12-04 13:25:10 UTC
Thank you Lionel for your detailed feedback, I updated the patch and it seems ok now but perhaps I missed something.
Comment 9 Commit Notification 2015-12-05 09:22:30 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96234: Type Formatting, Primary key checkbox may be checked

It will be available in 5.2.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 10 Commit Notification 2015-12-05 09:24:28 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=82b0bf45d0527db84e11689dc8a15eefaa699409&h=libreoffice-5-1

tdf#96234: Type Formatting, Primary key checkbox may be checked

It will be available in 5.1.0.1.

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 Julien Nabet 2015-12-05 09:40:15 UTC
In review for 5.0: https://gerrit.libreoffice.org/#/c/20410/
Comment 12 Commit Notification 2015-12-05 12:18:24 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c21d081d0d3a66f0b7695c6c82910a7f0b588af2&h=libreoffice-5-0

tdf#96234: Type Formatting, Primary key checkbox may be checked

It will be available in 5.0.5.

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.