| 5155 | } |
| 5156 | |
| 5157 | void Document::registerView(View *view) |
| 5158 | { |
| 5159 | if (!view) { |
| 5160 | return; |
| 5161 | } |
| 5162 | |
| 5163 | Document *viewDoc = view->viewDocument(); |
| 5164 | if (viewDoc) { |
| 5165 | // check if already registered for this document |
| 5166 | if (viewDoc == this) { |
| 5167 | return; |
| 5168 | } |
| 5169 | |
| 5170 | viewDoc->unregisterView(view); |
| 5171 | } |
| 5172 | |
| 5173 | d->m_views.insert(view); |
| 5174 | view->d_func()->document = d; |
| 5175 | } |
| 5176 | |
| 5177 | void Document::unregisterView(View *view) |
| 5178 | { |
no test coverage detected