Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23269 → Rev 23268

/trunk/Scribus/scribus/selection.cpp
109,7 → 109,7
(*it)->setSelected(false);
}
m_SelList = other.m_SelList;
if (m_isGUISelection)
if (m_isGUISelection && !m_SelList.isEmpty())
m_sigSelectionChanged = true;
if (emptyOther)
other.clear();
145,26 → 145,28
 
bool Selection::connectItemToGUI()
{
bool ret = false;
if (!m_isGUISelection || m_SelList.isEmpty())
return false;
 
QPointer<PageItem> pi = m_SelList.first();
//Quick check to see if the pointer is nullptr, if its nullptr, we should remove it from the list now
while (pi.isNull())
return ret;
if (m_SelList.count() == 1)
{
m_SelList.removeAll(pi);
if (m_SelList.isEmpty())
break;
pi = m_SelList.first();
QPointer<PageItem> pi = m_SelList.first();
//Quick check to see if the pointer is nullptr, if its nullptr, we should remove it from the list now
if (pi.isNull())
{
m_SelList.removeAll(pi);
return ret;
}
ret = pi->connectToGUI();
pi->emitAllToGUI();
m_sigSelectionChanged = true;
}
 
if (pi.isNull())
return false;
 
bool ret = pi->connectToGUI();
pi->emitAllToGUI();
m_sigSelectionChanged = true;
 
else
{
ret = m_SelList.first()->connectToGUI();
m_SelList.first()->emitAllToGUI();
m_sigSelectionChanged = true;
}
sendSignals(false);
return ret;
}
228,23 → 230,24
return true;
}
 
bool Selection::prependItem(PageItem *item)
bool Selection::prependItem(PageItem *item, bool /*doEmit*/)
{
if (item == nullptr)
return false;
if (m_SelList.contains(item))
return false;
 
if (m_isGUISelection && !m_SelList.isEmpty())
m_SelList[0]->disconnectFromGUI();
m_SelList.prepend(item);
if (m_isGUISelection)
if (!m_SelList.contains(item))
{
item->setSelected(true);
m_sigSelectionChanged = true;
}
sendSignals();
return true;
if (m_isGUISelection && !m_SelList.isEmpty())
m_SelList[0]->disconnectFromGUI();
m_SelList.prepend(item);
if (m_isGUISelection /*&& doEmit*/)
{
item->setSelected(true);
m_sigSelectionChanged = true;
}
sendSignals();
return true;
}
return false;
}
 
PageItem *Selection::itemAt_(int index)
/trunk/Scribus/scribus/selection.h
92,7 → 92,7
* @param doEmit call emitAllToGUI()
* @return If the item was added
*/
bool prependItem(PageItem *item);
bool prependItem(PageItem *item, bool doEmit=true);
 
bool containsItem(PageItem *item) const { return m_SelList.contains(item); }