Sets the default_xml_generator attribute to the provided listener. The listener is also added to the listener list and previous default_xml_generator is removed from it and deleted. The listener can also be NULL in which case it will not be added to the list. Does nothing if the previous and the current listener objects are the same.
| 6018 | // also be NULL in which case it will not be added to the list. Does |
| 6019 | // nothing if the previous and the current listener objects are the same. |
| 6020 | void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) { |
| 6021 | if (default_xml_generator_ != listener) { |
| 6022 | // It is an error to pass this method a listener that is already in the |
| 6023 | // list. |
| 6024 | delete Release(default_xml_generator_); |
| 6025 | default_xml_generator_ = listener; |
| 6026 | if (listener != nullptr) Append(listener); |
| 6027 | } |
| 6028 | } |
| 6029 | |
| 6030 | // Controls whether events will be forwarded by the repeater to the |
| 6031 | // listeners in the list. |