+#ifdef CAN_USE_REPORT_VIEW
+ wxListView * const list = GetListView();
+
+ // If imageList presence has changed, we update the list control view
+ if ( (imageList != NULL) != (GetImageList() != NULL) )
+ {
+ // Preserve the selection which is lost when changing the mode
+ const int oldSel = GetSelection();
+
+ // Update the style to use icon view for images, report view otherwise
+ long style = wxLC_SINGLE_SEL;
+ if ( imageList )
+ {
+ style |= GetListCtrlIconViewFlags();
+ }
+ else // no image list
+ {
+ style |= GetListCtrlReportViewFlags();
+ }
+
+ list->SetWindowStyleFlag(style);
+ if ( !imageList )
+ list->InsertColumn(0, wxT("Pages"));
+
+ // Restore selection
+ if ( oldSel != wxNOT_FOUND )
+ SetSelection(oldSel);
+ }