void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{ if (rHint.GetId() == SfxHintId::ScPaint) // draw new
{ const ScPaintHint* pPaintHint = static_cast<const ScPaintHint*>(&rHint);
PaintPartFlags nParts = pPaintHint->GetParts();
SCTAB nTab = GetViewData().GetTabNo(); if (pPaintHint->GetStartTab() <= nTab && pPaintHint->GetEndTab() >= nTab)
{ if (nParts & PaintPartFlags::Extras) // first if table vanished !!! if (PaintExtras())
nParts = PaintPartFlags::All;
// if the current sheet has pending row height updates (sheet links refreshed), // execute them before invalidating the window
GetViewData().GetDocShell().UpdatePendingRowHeights( GetViewData().GetTabNo() );
// #i84689# call UpdateAllOverlays here instead of in ScTabView::PaintArea if (nParts & ( PaintPartFlags::Left | PaintPartFlags::Top )) // only if widths or heights changed
UpdateAllOverlays();
HideNoteOverlay();
}
} elseif (rHint.GetId() == SfxHintId::ScEditView) // create Edit-View
{ // ScEditViewHint is only received at active view auto pEditViewHint = static_cast<const ScEditViewHint*>(&rHint);
ScSplitPos eActive = GetViewData().GetActivePart(); if ( GetViewData().HasEditView(eActive) )
{ // MakeEditView will fail, if the cursor is outside the screen. // Then GetEditView will return a none-active view, therefore // calling HasEditView.
EditView* pView = GetViewData().GetEditView(eActive); // isn't zero
SetEditShell(pView, true);
}
}
}
} elseif (rHint.GetId() == SfxHintId::ScTables) // table insert / deleted
{ auto pTablesHint = static_cast<const ScTablesHint*>(&rHint); // first fetch current table (can be changed during DeleteTab on ViewData)
SCTAB nActiveTab = GetViewData().GetTabNo();
SCTAB nTab1 = pTablesHint->GetTab1();
SCTAB nTab2 = pTablesHint->GetTab2();
sal_uInt16 nId = pTablesHint->GetTablesHintId(); switch (nId)
{ case SC_TAB_INSERTED:
GetViewData().InsertTab( nTab1 ); break; case SC_TAB_DELETED:
GetViewData().DeleteTab( nTab1 ); break; case SC_TAB_MOVED:
GetViewData().MoveTab( nTab1, nTab2 ); break; case SC_TAB_COPIED:
GetViewData().CopyTab( nTab1, nTab2 ); break; case SC_TAB_HIDDEN: break; case SC_TABS_INSERTED:
GetViewData().InsertTabs( nTab1, nTab2 ); break; case SC_TABS_DELETED:
GetViewData().DeleteTabs( nTab1, nTab2 ); break; default:
OSL_FAIL("unknown ScTablesHint");
}
// No calling of IsActive() here, because the actions can be coming from Basic // and then also the active view has to be switched.
SCTAB nNewTab = nActiveTab; bool bStayOnActiveTab = true; switch (nId)
{ case SC_TAB_INSERTED: if ( nTab1 <= nNewTab ) // insert before
++nNewTab; break; case SC_TAB_DELETED: if ( nTab1 < nNewTab ) // deleted before
--nNewTab; elseif ( nTab1 == nNewTab ) // deleted current
bStayOnActiveTab = false; break; case SC_TAB_MOVED: if ( nNewTab == nTab1 ) // moved table
nNewTab = nTab2; elseif ( nTab1 < nTab2 ) // moved back
{ if ( nNewTab > nTab1 && nNewTab <= nTab2 ) // succeeding area
--nNewTab;
} else// move in front
{ if ( nNewTab >= nTab2 && nNewTab < nTab1 ) // succeeding area
++nNewTab;
} break; case SC_TAB_COPIED: if ( nNewTab >= nTab2 ) // insert before
++nNewTab; break; case SC_TAB_HIDDEN: if ( nTab1 == nNewTab ) // current is hidden
bStayOnActiveTab = false; break; case SC_TABS_INSERTED: if ( nTab1 <= nNewTab )
nNewTab += nTab2; break; case SC_TABS_DELETED: if ( nTab1 < nNewTab )
nNewTab -= nTab2; break;
}
case SfxHintId::ScRefModeChanged:
{ bool bRefMode = ScModule::get()->IsFormulaMode(); if (!bRefMode)
StopRefMode(); else
GetSelEngine()->Reset();
} break;
case SfxHintId::ScKillEditView: case SfxHintId::ScKillEditViewNoPaint: if (!comphelper::LibreOfficeKit::isActive()
|| this == SfxViewShell::Current()
|| bInPrepareClose
|| bInDispose)
{
StopEditShell();
KillEditView( nSlot == SfxHintId::ScKillEditViewNoPaint );
} break;
case SfxHintId::DocChanged:
{
ScDocument& rDoc = GetViewData().GetDocument(); if (!rDoc.HasTable( GetViewData().GetTabNo() ))
{
SetTabNo(0);
}
} break;
case SfxHintId::ScDrawLayerNew:
MakeDrawView(TRISTATE_INDET); break;
case SfxHintId::ScDocSaved:
{ // "Save as" can make a write-protected document writable, // therefore the Layer-Locks anew (#39884#) // (Invalidate etc. is happening already from Sfx) // by SID_EDITDOC no SfxHintId::TitleChanged will occur, that // is why the own hint from DoSaveCompleted //! what is with SfxHintId::SAVECOMPLETED ?
UpdateLayerLocks();
// Would be too much to change Design-Mode with every save // (when saving under the name, it should remain unchanged) // Therefore only by SfxHintId::ModeChanged (from ViewFrame)
} break;
case SfxHintId::ModeChanged: // Since you can no longer rely on it where this hint was coming // from, always switch the design mode when the ReadOnly state // really was changed:
if ( GetViewData().GetSfxDocShell().IsReadOnly() != bReadOnly )
{
bReadOnly = GetViewData().GetSfxDocShell().IsReadOnly();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.