Bug 98493 - UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)" displaying wrong sheet after double-click on scenario
Summary: UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)" displaying wrong sheet a...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Alexis PAQUIN
URL:
Whiteboard: target:5.3.0 target:5.2.6 target:7.0.0
Keywords:
Depends on:
Blocks: Scenarios
  Show dependency treegraph
 
Reported: 2016-03-07 11:57 UTC by Alexis PAQUIN
Modified: 2020-05-19 12:43 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example File (7.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-07 11:57 UTC, Alexis PAQUIN
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis PAQUIN 2016-03-07 11:57:47 UTC
Created attachment 123371 [details]
Example File

Hi,

So this bug is related with scenario and LO navigator.

To reproduce him, you have to create few sheets in spreadsheet document.
Then, create some scenarios several sheets.

Now you can show the LO navigator. You can see sheet and scenario of your document in the "grouping sheet".

The bug is here, when you double-click on an scenario, it always display the wrong sheet.

For example in the attach file : when you double-click on Sheet1_Scenario_1, it display the sheet2 although the scenario is attach on sheet1.


I have find a fix to this, i'll share it soon as possible.


Regards.
Comment 1 Alexis PAQUIN 2016-03-07 16:08:23 UTC
I find a fix to this bug.

I have modify the navipi.cxx file. (/sources/libo-core/sc/sources/navipi/navipi.cxx).

The method to modify is :
void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName )

the orignal code was :

line 957

void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName )
{
    if (!GetViewData()) return;

    ScDocument* pDoc = pViewData->GetDocument();
    SCTAB nCount     = pDoc->GetTableCount();
    OUString aTabName;

    for ( SCTAB i=0; i<nCount; i++ )
    {
        pDoc->GetName( i, aTabName );
        if ( aTabName.equals(rName) )
        {
            SetCurrentTable( i );
            return;
        }
    }
}


and the fix is :


void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName )
{
    if (!GetViewData()) return;

    ScDocument* pDoc = pViewData->GetDocument();
    SCTAB nCount     = pDoc->GetTableCount();
    OUString aTabName;
	SCTAB aLastSheet;

    for ( SCTAB i=0; i<nCount; i++ )
    {
        pDoc->GetName( i, aTabName );
        if ( aTabName.equals(rName) )
        {
			/*check if this is a scenario*/
			if ( pDoc->IsScenario(i) )
			{
				SetCurrentTable(aLastSheet);
				return;
			}
			else
			{
				SetCurrentTable(i);
				return;
			}
        }
		else
		{
			if ( !pDoc->IsScenario(i) )
				aLastSheet = i;
		}		
    }
}


Do this fix can be integrate to LO ?

Best regards.
Comment 2 Julien Nabet 2016-03-07 20:02:33 UTC
Which LO version have you used?

Perhaps you might be interested in submitting your patch to LO gerrit.
If yes, this link will guide you:
https://wiki.documentfoundation.org/Development/GetInvolved
(knowing that you've already done it a good part of it: find a bug, build LO, create a patch, there are just a few steps left)
Comment 3 Alexis PAQUIN 2016-03-08 15:51:22 UTC
I found this on LO-5-0-4, didn't tried on earlier version.

Thanks Julien, i'll do it.

Best regards
Comment 4 Buovjaga 2016-03-13 19:28:50 UTC
Confirmed.
Refer to this bug like tdf#98493 in your patch commit message.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016
Comment 5 Alexis PAQUIN 2016-09-06 16:22:38 UTC
Hey,

There here is : https://gerrit.libreoffice.org/28697

Sorry for the delay :/

Bests regards

Alexis
Comment 6 Commit Notification 2016-09-16 15:02:40 UTC
sll committed a patch related to this issue.
It has been pushed to "master":

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

tdf#98493 UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)"

It will be available in 5.3.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 7 Xisco Faulí 2016-10-23 12:36:29 UTC
Hello Alexis,
Is this bug already fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 8 Alexis PAQUIN 2016-11-07 14:09:46 UTC
Hello Xisco,

I try the build master and the bug is fix.

I close this on RESOLVED FIXED.

Best regards.

Alexis
Comment 9 Alexis PAQUIN 2016-11-07 14:10:31 UTC
Hello Xisco,

I try the last build master (5.3 dev) and the bug is fix.

I close this on RESOLVED FIXED.

Best regards.

Alexis
Comment 10 Xisco Faulí 2016-11-07 15:10:10 UTC
Hi Alexis,
In order to change the status of this bug, change it in the dropdown box below the comment's textbox.
Looking forward to seeing more bugs coming from you.
Thanks for your help
Comment 11 Alexis PAQUIN 2016-11-07 15:12:16 UTC
An other bug fix :)
Comment 12 Commit Notification 2017-02-15 16:44:36 UTC
sll committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=95c1c7d3b085541735f964ac3c1fff9d286baa16&h=libreoffice-5-2

tdf#98493 UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)"

It will be available in 5.2.6.

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 13 Commit Notification 2020-05-19 12:43:33 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4435a3b02525067700ee494dbd91d84df985b001

tdf#98493, tdf#133079: sc: Add UItest

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.