diff --git a/src/laybasic/laybasic/layNetlistBrowserPage.cc b/src/laybasic/laybasic/layNetlistBrowserPage.cc index 2a58ea516..ee0474460 100644 --- a/src/laybasic/laybasic/layNetlistBrowserPage.cc +++ b/src/laybasic/laybasic/layNetlistBrowserPage.cc @@ -235,14 +235,19 @@ NetlistBrowserPage::set_highlight_style (QColor color, int line_width, int verte } void -NetlistBrowserPage::set_view (lay::LayoutView *view, unsigned int cv_index) +NetlistBrowserPage::set_view (lay::LayoutView *view, int cv_index) { if (mp_view) { mp_view->layer_list_changed_event.remove (this, &NetlistBrowserPage::layer_list_changed); } - mp_view = view; - m_cv_index = cv_index; + if (cv_index < 0) { + mp_view = 0; + m_cv_index = 0; + } else { + mp_view = view; + m_cv_index = (unsigned int) cv_index; + } if (mp_view) { mp_view->layer_list_changed_event.add (this, &NetlistBrowserPage::layer_list_changed); diff --git a/src/laybasic/laybasic/layNetlistBrowserPage.h b/src/laybasic/laybasic/layNetlistBrowserPage.h index 03db3b29d..2bde27cec 100644 --- a/src/laybasic/laybasic/layNetlistBrowserPage.h +++ b/src/laybasic/laybasic/layNetlistBrowserPage.h @@ -85,7 +85,7 @@ public: * If that pointer is non-null, the browser will attach itself to * the view and provide highlights for the selected markers inside the given cellview. */ - void set_view (lay::LayoutView *view, unsigned int cv_index); + void set_view (lay::LayoutView *view, int cv_index); /** * @brief Attaches the page to a L2N DB diff --git a/testdata/ruby/rdbTest.rb b/testdata/ruby/rdbTest.rb index 975f1155f..a6fa8ebd2 100644 --- a/testdata/ruby/rdbTest.rb +++ b/testdata/ruby/rdbTest.rb @@ -695,6 +695,8 @@ class RDB_TestClass < TestBase assert_equal(view.num_rdbs, 2) assert_equal(ot, 0) + mw.close_current_view + end # scan_... methods