Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23173 → Rev 23174

/trunk/Scribus/scribus/canvas.cpp
416,7 → 416,7
{
currItem = m_doc->currentPage()->FromMaster.at(currNr);
QTransform itemPos;
if (((currItem->m_layerID == m_doc->activeLayer()) || (m_doc->layerSelectable(currItem->m_layerID))) && (!m_doc->layerLocked(currItem->m_layerID)))
if (m_doc->canSelectItemOnLayer(currItem->m_layerID))
{
if (!currItem->ChangedMasterItem)
{
464,7 → 464,7
--currNr;
continue;
}
if (((currItem->m_layerID == m_doc->activeLayer()) || (m_doc->layerSelectable(currItem->m_layerID))) && (!m_doc->layerLocked(currItem->m_layerID)))
if (m_doc->canSelectItemOnLayer(currItem->m_layerID))
{
QTransform itemPos = currItem->getTransform();
QPainterPath currPath(itemPos.map(QPointF(0,0)));
/trunk/Scribus/scribus/canvasmode_edit.cpp
888,7 → 888,7
QRect apr2(docItem->getRedrawBounding(1.0));
if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
continue;
if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && ((docItem->m_layerID == m_doc->activeLayer()) || (m_doc->layerSelectable(docItem->m_layerID))) && (!m_doc->layerLocked(docItem->m_layerID)))
if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && m_doc->canSelectItemOnLayer(docItem->m_layerID))
{
bool redrawSelection=false;
m_view->SelectItemNr(a, redrawSelection);
/trunk/Scribus/scribus/canvasmode_normal.cpp
1166,7 → 1166,7
PageItem* docItem = m_doc->Items->at(a);
if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
continue;
if (((docItem->m_layerID == m_doc->activeLayer()) || (m_doc->layerSelectable(docItem->m_layerID))) && (!m_doc->layerLocked(docItem->m_layerID)))
if (m_doc->canSelectItemOnLayer(docItem->m_layerID))
{
// get current item rect/bounding box
QRect apr2 = m_canvas->canvasToLocal( docItem->getCurrentBoundingRect(docItem->lineWidth()) );
/trunk/Scribus/scribus/scribus.cpp
5111,12 → 5111,12
PageItem *currItem;
view->Deselect();
doc->m_Selection->delaySignalsOn();
int docItemsCount=doc->Items->count();
int docCurrentPage=doc->currentPageNumber();
int docItemsCount = doc->Items->count();
int docCurrentPage = doc->currentPageNumber();
for (int i = 0; i < docItemsCount; ++i)
{
currItem = doc->Items->at(i);
if (((currItem->m_layerID == doc->activeLayer()) || (doc->layerSelectable(currItem->m_layerID))) && (!doc->layerLocked(currItem->m_layerID)))
if (doc->canSelectItemOnLayer(currItem->m_layerID))
{
if (docWideSelect)
doc->m_Selection->addItem(currItem);
/trunk/Scribus/scribus/scribusdoc.cpp
2871,7 → 2871,7
const ScLayer* ll = Layers.layerByID(layerToActivate);
Q_ASSERT(ll);
if (ll)
m_ActiveLayer=layerToActivate;
m_ActiveLayer = layerToActivate;
return (ll != nullptr);
}
 
3395,11 → 3395,22
return found;
}
 
bool ScribusDoc::canSelectItemOnLayer(int layerID) const
{
if ((m_ActiveLayer != layerID) && !layerSelectable(layerID))
return false;
 
bool ScribusDoc::layerContainsItems(const int layerID)
bool canSelect = layerVisible(layerID);
if (!canSelect)
return false;
canSelect = !layerLocked(layerID);
return canSelect;
}
 
bool ScribusDoc::layerContainsItems(const int layerID) const
{
QList<PageItem*> allItems;
int masterItemsCount=MasterItems.count();
int masterItemsCount = MasterItems.count();
for (int i = 0; i < masterItemsCount; ++i)
{
PageItem* currItem = MasterItems.at(i);
3415,7 → 3426,8
}
allItems.clear();
}
int docItemsCount=DocItems.count();
 
int docItemsCount = DocItems.count();
for (int i = 0; i < docItemsCount; ++i)
{
PageItem* currItem = DocItems.at(i);
/trunk/Scribus/scribus/scribusdoc.h
486,11 → 486,21
*/
bool changeLayerName(const int layerID, const QString& newName);
/**
* @brief Test if items can be selected on a specific layer
*
* This function check if items can be selected on the specified layer
* by checking layer visibility and selectable property etc...
*
* @param layerID ID of the layer
* @return a boolean
*/
bool canSelectItemOnLayer(int layerID) const;
/**
* @brief Does the layer have items on it?
* @param layerID ID of the layer
* @return Layer contains items bool
*/
bool layerContainsItems(const int layerID);
bool layerContainsItems(const int layerID) const;
/**
* @brief Renumber a layer. Used in particular for reinsertion for undo/redo
* @param layerID old layer ID