File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -959,7 +959,26 @@ void ROOT::RFieldBase::ConnectPageSource(ROOT::Internal::RPageSource &pageSource
959
959
if (!fDescription .empty ())
960
960
throw RException (R__FAIL (" setting description only valid when connecting to a page sink" ));
961
961
962
- BeforeConnectPageSource (pageSource);
962
+ auto substitute = BeforeConnectPageSource (pageSource);
963
+ if (substitute) {
964
+ const RFieldBase *itr = this ;
965
+ while (itr->GetParent ()) {
966
+ itr = itr->GetParent ();
967
+ }
968
+ if (typeid (*itr) == typeid (RFieldZero) && static_cast <const RFieldZero *>(itr)->GetAllowFieldSubstitutions ()) {
969
+ for (auto &f : fParent ->fSubfields ) {
970
+ if (f.get () != this )
971
+ continue ;
972
+
973
+ f = std::move (substitute);
974
+ f->ConnectPageSource (pageSource);
975
+ return ;
976
+ }
977
+ R__ASSERT (false ); // never here
978
+ } else {
979
+ throw RException (R__FAIL (" invalid attempt to substitute field " + GetQualifiedFieldName ()));
980
+ }
981
+ }
963
982
964
983
if (!fIsArtificial ) {
965
984
R__ASSERT (fOnDiskId != kInvalidDescriptorId );
You can’t perform that action at this time.
0 commit comments