Kaydet (Commit) a012483e authored tarafından Caolán McNamara's avatar Caolán McNamara

small optimization, don't get selection unless it gets used

Change-Id: Ibc359a8dbb26ef066dc43535eaf9835c4c7e9314
üst 5d3cec6a
......@@ -2115,20 +2115,27 @@ static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel )
void ScInputHandler::SyncViews( EditView* pSourceView )
{
ESelection aSel;
if (pSourceView)
{
aSel = pSourceView->GetSelection();
bool bSelectionForTopView = false;
if (pTopView && pTopView != pSourceView)
pTopView->SetSelection( aSel );
bSelectionForTopView = true;
bool bSelectionForTableView = false;
if (pTableView && pTableView != pSourceView)
lcl_SetTopSelection( pTableView, aSel );
bSelectionForTableView = true;
if (bSelectionForTopView || bSelectionForTableView)
{
ESelection aSel(pSourceView->GetSelection());
if (bSelectionForTopView)
pTopView->SetSelection(aSel);
if (bSelectionForTableView)
lcl_SetTopSelection(pTableView, aSel);
}
}
// Only sync selection from topView if we are actually editiing there
else if (pTopView && pTableView)
{
aSel = pTopView->GetSelection();
ESelection aSel(pTopView->GetSelection());
lcl_SetTopSelection( pTableView, aSel );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment