Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 23174 → Rev 23175

/trunk/Scribus/scribus/scribus.cpp
4346,7 → 4346,7
m_styleManager->setDoc(nullptr);
marksManager->setDoc(nullptr);
nsEditor->setDoc(nullptr);
layerPalette->ClearInhalt();
layerPalette->clearContent();
docCheckerPalette->buildErrorList(nullptr);
HaveDoc--;
delete doc;
/trunk/Scribus/scribus/selection.cpp
276,10 → 276,10
 
bool Selection::removeItem(PageItem *item)
{
bool removeOk(false);
if (!m_SelList.isEmpty() && m_SelList.contains(item))
{
removeOk = (m_SelList.removeAll(item)==1);
if (m_SelList.isEmpty() || !m_SelList.contains(item))
return false;
 
bool removeOk = (m_SelList.removeAll(item) == 1);
if (removeOk)
{
if (m_isGUISelection)
297,13 → 297,46
}
return removeOk;
}
return removeOk;
 
bool Selection::removeItemsOfLayer(int layedID)
{
if (m_SelList.isEmpty())
return false;
 
int oldSelCount = m_SelList.count();
 
delaySignalsOn();
int selIndex = 0;
while (selIndex < m_SelList.count())
{
QPointer<PageItem> pi = m_SelList.at(selIndex);
if (pi.isNull())
{
removeItem(itemAt(selIndex));
continue;
}
 
if (pi->m_layerID != layedID)
{
++selIndex;
continue;
}
 
removeItem(itemAt(selIndex));
}
 
delaySignalsOff();
 
bool itemsRemoved = (oldSelCount != m_SelList.count());
return itemsRemoved;
}
 
PageItem* Selection::takeItem(int itemIndex)
{
if (!m_SelList.isEmpty() && itemIndex<m_SelList.count())
{
if (m_SelList.isEmpty() || itemIndex >= m_SelList.count())
return nullptr;
 
PageItem *item = m_SelList[itemIndex];
bool removeOk = (m_SelList.removeAll(item) == 1);
if (removeOk)
319,7 → 352,6
sendSignals();
return item;
}
}
return nullptr;
}
 
/trunk/Scribus/scribus/selection.h
98,6 → 98,10
*/
bool removeItem(PageItem *item);
/**
* \briefRemove items from specified layer
*/
bool removeItemsOfLayer(int layedID);
/**
* \brief Remove the first item from the list
* @return If the remove was successful
*/
/trunk/Scribus/scribus/ui/layers.cpp
35,6 → 35,7
#include "sccombobox.h"
#include "scribus.h"
#include "scribusdoc.h"
#include "selection.h"
#include "ui/scrspinbox.h"
#include "undomanager.h"
 
145,7 → 146,7
LayerPaletteLayout->addLayout( Layout1 );
containerWidget->setLayout( LayerPaletteLayout );
setWidget( containerWidget );
ClearInhalt();
clearContent();
languageChange();
 
connect(newLayerButton, SIGNAL(clicked()), this, SLOT(addLayer()));
159,7 → 160,7
connect(header, SIGNAL(sectionClicked(int)), this, SLOT(toggleAllfromHeader(int)));
}
 
void LayerPalette::ClearInhalt()
void LayerPalette::clearContent()
{
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changeBlendMode(int)));
disconnect(opacitySpinBox, SIGNAL(valueChanged(double)), this, SLOT(changeOpacity()));
421,7 → 422,10
const QObject* senderBox=sender();
if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
{
m_Doc->setLayerVisible(layerID,((QCheckBox*)(senderBox))->isChecked());
bool isLayerVisible = ((QCheckBox*)(senderBox))->isChecked();
m_Doc->setLayerVisible(layerID, isLayerVisible);
if (!isLayerVisible)
m_Doc->m_Selection->removeItemsOfLayer(layerID);
setActiveLayer(Table->currentRow(), -1);
emit LayerChanged();
}
455,8 → 459,11
const QObject* senderBox=sender();
if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
{
m_Doc->setLayerLocked(layerID,((QCheckBox*)(senderBox))->isChecked());
deleteLayerButton->setEnabled(!((QCheckBox*)(senderBox))->isChecked());
bool isLayerLocked = ((QCheckBox*)(senderBox))->isChecked();
m_Doc->setLayerLocked(layerID, isLayerLocked);
if (isLayerLocked)
m_Doc->m_Selection->removeItemsOfLayer(layerID);
deleteLayerButton->setEnabled(!isLayerLocked);
setActiveLayer(Table->currentRow(), -1);
}
m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
507,7 → 514,8
const QObject* senderBox=sender();
if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
{
m_Doc->setLayerSelectable(layerID,((QCheckBox*)(senderBox))->isChecked());
bool isLayerSelectable = ((QCheckBox*)(senderBox))->isChecked();
m_Doc->setLayerSelectable(layerID, isLayerSelectable);
emit LayerChanged();
setActiveLayer(Table->currentRow(), -1);
}
/trunk/Scribus/scribus/ui/layers.h
61,7 → 61,7
void changeOpacity();
void changeBlendMode(int blend);
void setActiveLayer(int row, int col);
void ClearInhalt();
void clearContent();
void markActiveLayer(int layerID=-1);
void languageChange();
 
/trunk/Scribus/scribus/ui/outlinepalette.cpp
624,7 → 624,10
 
void OutlinePalette::setLayerVisible(int layerID)
{
currDoc->setLayerVisible(layerID, !currDoc->layerVisible(layerID));
bool isLayerVisible = !currDoc->layerVisible(layerID);
currDoc->setLayerVisible(layerID, isLayerVisible);
if (!isLayerVisible)
currDoc->m_Selection->removeItemsOfLayer(layerID);
currDoc->scMW()->showLayer();
currDoc->scMW()->layerPalette->rebuildList();
currDoc->scMW()->layerPalette->markActiveLayer();
632,7 → 635,10
 
void OutlinePalette::setLayerLocked(int layerID)
{
currDoc->setLayerLocked(layerID, !currDoc->layerLocked(layerID));
bool isLayerLocked = !currDoc->layerLocked(layerID);
currDoc->setLayerLocked(layerID, isLayerLocked);
if (isLayerLocked)
currDoc->m_Selection->removeItemsOfLayer(layerID);
currDoc->scMW()->layerPalette->rebuildList();
currDoc->scMW()->layerPalette->markActiveLayer();
}