Bug 46843 - EDITING: Queries loose sorting-order when reopening for editing
Summary: EDITING: Queries loose sorting-order when reopening for editing
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.1 RC1
Hardware: Other All
: high critical
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:3.5.2 target:3.6.0
Keywords: regression
Depends on:
Blocks: mab3.5 47370
  Show dependency treegraph
 
Reported: 2012-03-01 12:02 UTC by Robert Großkopf
Modified: 2012-03-20 03:10 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
When reopening the queries for editing in GUI-Mode sorting has gone (3.97 KB, application/vnd.sun.xml.base)
2012-03-01 12:02 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2012-03-01 12:02:40 UTC
Created attachment 57874 [details]
When reopening the queries for editing in GUI-Mode sorting has gone

When you open both queries of the attachment you see: they are sorted. First by names, second by jobs. When opening for editing in GUI-mode you could see nothing of this sorting. Changing from design-mode to sql-mode shows: the sorting of the queries has gone.
If somebody would change any other thing of the query and does not recognise this he saves a query without sorting.
Comment 1 Petr Mladek 2012-03-02 03:02:26 UTC
I have reproduced the problem with LO-3.5.1-rc1 on SLED11-SP1-x86_64.

Lionel, could you please have a look?
Comment 2 Petr Mladek 2012-03-02 03:09:15 UTC
It is annoying, so I added it into most annoying bugs. We should fix it soon but it does not cause a real data loss, so it should not block the 3.5.1 release => lowering the severity a bit.
Comment 3 Julien Nabet 2012-03-04 13:33:45 UTC
dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx, in OSelectionBrowseBox::GetCellText, line 2223, print pEntry->GetOrderDir() in gdb shows it's equal to ORDER_NONE.

It seems the problem is in dbaccess/source/ui/querydesign/QueryDesignView.cxx, in GetOrderCriteria function, we don't enter in "if (!pParseRoot->getChild(3)->getChild(4)->isLeaf())", so SetOrderDir is never called, it could explain why pEntry->GetOrderDir() can't retrieve the order.
Comment 4 Not Assigned 2012-03-15 10:46:24 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "master":

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

fdo#46843 look for order by clause as fifth child of select_statement
Comment 5 Lionel Elie Mamane 2012-03-15 11:09:08 UTC
Julien, I'd like to again thank you for the very precise code pointer. That's very helpful and allows to very quickly make a fix.
Comment 6 Not Assigned 2012-03-20 02:15:10 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=73a5ef4cb245acb120f02d487ba7c3aeb40f4fad&g=libreoffice-3-5

fdo#46843 look for order by clause as fifth child of select_statement


It will be available in LibreOffice 3.5.2.