mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 20:09:59 +00:00
Fix for preferences crash by Vincent van Ravesteijn.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26054 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6c591d9fd0
commit
5861442f6f
@ -117,15 +117,20 @@ void PanelStack::setCurrentPanel(QString const & name)
|
||||
void PanelStack::switchPanel(QTreeWidgetItem * item,
|
||||
QTreeWidgetItem * previous)
|
||||
{
|
||||
// do nothing when clicked on whitespace (item=NULL)
|
||||
if( !item )
|
||||
return;
|
||||
|
||||
// if we have a category, expand the tree and go to the
|
||||
// first item
|
||||
if (item->childCount() > 0) {
|
||||
item->setExpanded(true);
|
||||
if (previous != item->child(0))
|
||||
list_->setCurrentItem(item->child(0));
|
||||
if (previous && previous->parent() != item)
|
||||
switchPanel( item->child(0), previous );
|
||||
}
|
||||
if (QWidget * w = widget_map_.value(item, 0))
|
||||
stack_->setCurrentWidget(w);
|
||||
else
|
||||
if (QWidget * w = widget_map_.value(item, 0))
|
||||
stack_->setCurrentWidget(w);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user