Related: tdf#137577 Update Name Box range name list on sheet rename
... for sheet-local names that include the sheet name.
Introduce SfxHintId::ScTablesRenamed for this as the existing
ScTablesChanged is fired quite too often.
Change-Id: I94c3479bba4d4cc8b75905e3fa4f35d9a8737870
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113391
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index 314b4f8..284ebe7 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -73,6 +73,7 @@
ScDbAreasChanged,
ScAreasChanged,
ScTablesChanged,
ScTablesRenamed,
ScDrawChanged,
ScDocNameChanged,
ScAreaLinksChanged,
@@ -164,6 +165,7 @@
case SfxHintId::ScDbAreasChanged: return stream << "ScDbAreasChanged";
case SfxHintId::ScAreasChanged: return stream << "ScAreasChanged";
case SfxHintId::ScTablesChanged: return stream << "ScTablesChanged";
case SfxHintId::ScTablesRenamed: return stream << "ScTablesRenamed";
case SfxHintId::ScDrawChanged: return stream << "ScDrawChanged";
case SfxHintId::ScDocNameChanged: return stream << "ScDocNameChanged";
case SfxHintId::ScAreaLinksChanged: return stream << "ScAreaLinksChanged";
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2b5a48c..d69aac2 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2291,7 +2291,8 @@
else
{
const SfxHintId nHintId = rHint.GetId();
if ( nHintId == SfxHintId::ScAreasChanged || nHintId == SfxHintId::ScNavigatorUpdateAll)
if (nHintId == SfxHintId::ScAreasChanged || nHintId == SfxHintId::ScNavigatorUpdateAll
|| nHintId == SfxHintId::ScTablesRenamed)
FillRangeNames();
}
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 951048e..e1498dd 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3512,6 +3512,7 @@
rDocShell.PostPaintExtras();
aModificator.SetDocumentModified();
SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesRenamed ) );
bSuccess = true;
}
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 85c2708..0002fef 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -432,6 +432,7 @@
rDoc.RenameTab( nTabP, rName );
SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesRenamed ) ); // Name Box
pDocShell->PostPaintGridAll();
pDocShell->PostPaintExtras();