Check IsRefMode() before accessing the ref range.

Else you'd end up with wrong ref range values.  Also in
selectAllAccessibleChildren(), the code is probably meant to select
all sheet, rather than setting the top-left reference position twice
in a row.

Change-Id: I895896418476ffea0862e8df4e03f6efc4c91dd2
This commit is contained in:
Kohei Yoshida
2013-12-16 15:04:09 -05:00
parent 087c2fddce
commit 70ce8987fe

View File

@@ -1131,7 +1131,7 @@ void SAL_CALL
ScViewData *pViewData = mpViewShell->GetViewData();
mpViewShell->InitRefMode( 0, 0, pViewData->GetTabNo(), SC_REFTYPE_REF );
pViewData->SetRefStart(0,0,pViewData->GetTabNo());
pViewData->SetRefStart(MAXCOL,MAXROW,pViewData->GetTabNo());
pViewData->SetRefEnd(MAXCOL,MAXROW,pViewData->GetTabNo());
mpViewShell->UpdateRef(MAXCOL, MAXROW, pViewData->GetTabNo());
}
else
@@ -1559,6 +1559,10 @@ void ScAccessibleSpreadsheet::FireFirstCellFocus()
void ScAccessibleSpreadsheet::NotifyRefMode()
{
ScViewData *pViewData = mpViewShell->GetViewData();
if (!pViewData->IsRefMode())
// Not in reference mode. Bail out.
return;
sal_uInt16 nRefStartX =pViewData->GetRefStartX();
sal_Int32 nRefStartY=pViewData->GetRefStartY();
sal_uInt16 nRefEndX=pViewData->GetRefEndX();