Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16739 → Rev 16740

/trunk/Scribus/scribus/scribusdoc.cpp
5403,6 → 5403,8
}
QRectF sR = m_Selection->getGroupRect();
moveGroup(-sR.x() + addedPage->xOffset(), -sR.y() + addedPage->yOffset());
if (Items->at(0)->isGroup())
Items->at(0)->asGroupFrame()->adjustXYPosition();
m_Selection->clear();
m_Selection->delaySignalsOff();
m_ScMW->changeLayer(0);
5418,6 → 5420,7
{
itemAdd(PageItem::Group, PageItem::Rectangle, addedPage->xOffset(), addedPage->yOffset(), 10, 10, 0, CommonStrings::None, CommonStrings::None, true);
PageItem *groupItem = Items->takeLast();
groupItem->setLayer(0);
Items->insert(0, groupItem);
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
5434,6 → 5437,8
maxx = qMax(maxx, x2);
maxy = qMax(maxy, y2);
}
Items->clear();
Items->append(groupItem);
for (int em = 0; em < groupItem->groupItemList.count(); ++em)
{
PageItem* currItem = groupItem->groupItemList.at(em);
5446,6 → 5451,8
groupItem->setWidthHeight(maxx - minx, maxy - miny, true);
groupItem->groupWidth = maxx - minx;
groupItem->groupHeight = maxy - miny;
groupItem->gWidth = maxx - minx;
groupItem->gHeight = maxy - miny;
groupItem->SetRectFrame();
groupItem->ClipEdited = true;
groupItem->FrameType = 3;
5453,6 → 5460,7
groupItem->AutoName = false;
groupItem->setFillTransparency(0);
groupItem->setLineTransparency(0);
groupItem->asGroupFrame()->adjustXYPosition();
GroupCounter++;
renumberItemsInListOrder();
}
12278,6 → 12286,7
int d = Items->indexOf(currItem);
groupItem->groupItemList.append(Items->takeAt(d));
}
groupItem->asGroupFrame()->adjustXYPosition();
renumberItemsInListOrder();
itemSelection->clear();
itemSelection->addItem(groupItem);
12333,6 → 12342,7
currItem->gHeight = maxy - miny;
}
renumberItemsInListOrder();
groupItem->asGroupFrame()->adjustXYPosition();
GroupCounter++;
itemList.clear();
itemList.append(groupItem);
12373,6 → 12383,7
}
renumberItemsInListOrder();
GroupCounter++;
groupItem->asGroupFrame()->adjustXYPosition();
itemList.clear();
itemList.append(groupItem);
}
12444,7 → 12455,7
miny = qMin(miny, y1);
maxx = qMax(maxx, x2);
maxy = qMax(maxy, y2);
}
}
double gx = minx;
double gy = miny;
double gw = maxx - minx;
12467,6 → 12478,7
groupItem->groupItemList.append(Items->takeAt(d));
}
renumberItemsInListOrder();
groupItem->asGroupFrame()->adjustXYPosition();
itemSelection->clear();
itemSelection->addItem(groupItem);
selectedItemCount = itemSelection->count();
/trunk/Scribus/scribus/scribusdoc.h
832,6 → 832,9
/*** Is the document in symbol edit mode? */
bool symbolEditMode() const { return m_symbolEditMode; }
/*** get the name of the symbol currently in editing */
QString getEditedSymbol() const { return currentEditedSymbol; }
 
/**
* @brief Add a section to the document sections list
* Set number to -1 to add in the default section if the map is empty
/trunk/Scribus/scribus/ui/outlinepalette.cpp
637,9 → 637,12
emit selectElementByItem(pgItem, true);
break;
case 2:
pg = item->PageObject->pageNr();
m_MainWindow->closeActiveWindowMasterPageEditor();
emit selectPage(pg);
if (!currDoc->symbolEditMode())
{
pg = item->PageObject->pageNr();
m_MainWindow->closeActiveWindowMasterPageEditor();
emit selectPage(pg);
}
break;
case 3:
case 4:
678,117 → 681,151
freeObjects = 0;
PageItem* pgItem;
QString tmp;
for (int a = 0; a < static_cast<int>(currDoc->MasterPages.count()); ++a)
if (currDoc->symbolEditMode())
{
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
page->PageObject = currDoc->MasterPages.at(a);
page->type = 0;
QString pageNam = currDoc->MasterPages.at(a)->pageName();
page->PageObject = currDoc->Pages->at(0);
page->type = 2;
pagep = page;
for (int b = 0; b < currDoc->MasterItems.count(); ++b)
for (int b = 0; b < currDoc->Items->count(); ++b)
{
pgItem = currDoc->MasterItems.at(b);
if (((pgItem->OwnPage == a) || (pgItem->OnMasterPage == pageNam)))
pgItem = currDoc->Items->at(b);
if (!pgItem->isGroup())
{
if (!pgItem->isGroup())
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 1;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
}
else
{
OutlineTreeItem * object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 1;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 1);
}
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
}
else
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 3);
}
}
page->setText(0, currDoc->MasterPages.at(a)->pageName());
page->setText(0, currDoc->getEditedSymbol());
}
for (int a = 0; a < static_cast<int>(currDoc->DocPages.count()); ++a)
else
{
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
page->PageObject = currDoc->DocPages.at(a);
page->type = 2;
pagep = page;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
for (int a = 0; a < static_cast<int>(currDoc->MasterPages.count()); ++a)
{
pgItem = currDoc->DocItems.at(b);
if (pgItem->OwnPage == a)
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
page->PageObject = currDoc->MasterPages.at(a);
page->type = 0;
QString pageNam = currDoc->MasterPages.at(a)->pageName();
pagep = page;
for (int b = 0; b < currDoc->MasterItems.count(); ++b)
{
if (!pgItem->isGroup())
pgItem = currDoc->MasterItems.at(b);
if (((pgItem->OwnPage == a) || (pgItem->OnMasterPage == pageNam)))
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
if (!pgItem->isGroup())
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 1;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
}
else
{
OutlineTreeItem * object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 1;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 1);
}
}
else
}
page->setText(0, currDoc->MasterPages.at(a)->pageName());
}
for (int a = 0; a < static_cast<int>(currDoc->DocPages.count()); ++a)
{
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
page->PageObject = currDoc->DocPages.at(a);
page->type = 2;
pagep = page;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
{
pgItem = currDoc->DocItems.at(b);
if (pgItem->OwnPage == a)
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 3);
if (!pgItem->isGroup())
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
}
else
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 3;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 3);
}
}
}
page->setText(0, tr("Page ")+tmp.setNum(a+1));
}
page->setText(0, tr("Page ")+tmp.setNum(a+1));
}
bool hasfreeItems = false;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
{
if (currDoc->DocItems.at(b)->OwnPage == -1)
bool hasfreeItems = false;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
{
hasfreeItems = true;
break;
if (currDoc->DocItems.at(b)->OwnPage == -1)
{
hasfreeItems = true;
break;
}
}
}
if (hasfreeItems)
{
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
pagep = page;
freeObjects = page;
page->type = -3;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
if (hasfreeItems)
{
pgItem = currDoc->DocItems.at(b);
if (pgItem->OwnPage == -1)
OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
pagep = page;
freeObjects = page;
page->type = -3;
for (int b = 0; b < currDoc->DocItems.count(); ++b)
{
if (!pgItem->isGroup())
pgItem = currDoc->DocItems.at(b);
if (pgItem->OwnPage == -1)
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 4;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
if (!pgItem->isGroup())
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 4;
object->setText(0, pgItem->itemName());
setItemIcon(object, pgItem);
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
}
else
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 4;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 4);
}
}
else
{
OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
object->PageItemObject = pgItem;
object->type = 4;
object->setText(0, pgItem->itemName());
object->setIcon( 0, groupIcon );
object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
parseSubGroup(object, &pgItem->groupItemList, 4);
}
}
page->setText(0, tr("Free Objects"));
}
page->setText(0, tr("Free Objects"));
}
if (storeVals)
reopenTree();
/trunk/Scribus/scribus/scribus.cpp
7423,8 → 7423,11
view->requestMode(submodeEndNodeEdit);
activateWindow();
view->Deselect(true);
if ((ite->OwnPage != -1) && (ite->OwnPage != static_cast<int>(doc->currentPage()->pageNr())))
view->GotoPage(ite->OwnPage);
if (!doc->symbolEditMode())
{
if ((ite->OwnPage != -1) && (ite->OwnPage != static_cast<int>(doc->currentPage()->pageNr())))
view->GotoPage(ite->OwnPage);
}
doc->m_Selection->delaySignalsOn();
view->SelectItem(ite, true, single);
doc->m_Selection->delaySignalsOff();
8528,6 → 8531,8
symbolPalette->editingStart(patternsDependingOnThis);
propertiesPalette->Cpal->hideEditedPatterns(patternsDependingOnThis);
propertiesPalette->Tpal->hideEditedPatterns(patternsDependingOnThis);
if (outlinePalette->isVisible())
outlinePalette->BuildTree(false);
updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp));
}
}
8581,6 → 8586,8
propertiesPalette->updateColorList();
symbolPalette->editingFinished();
layerPalette->setEnabled(true);
if (outlinePalette->isVisible())
outlinePalette->BuildTree(false);
updateActiveWindowCaption(doc->DocName);
}