r16156 by fschmid - Adapted almost all loops which iterate over all items in a document to the new group storage.

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 22 18:04:18 CET 2010


Author: fschmid
Date: Wed Dec 22 17:04:17 2010
New Revision: 16156

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16156
Log:
Adapted almost all loops which iterate over all items in a document to the new group storage.

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/annot.cpp
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/outlinepalette.h
    trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
    trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/selfield.cpp
    trunk/Scribus/scribus/ui/tabpdfoptions.cpp
    trunk/Scribus/scribus/ui/tocindexprefs.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Wed Dec 22 17:04:17 2010
@@ -436,6 +436,12 @@
 				currClip.closeSubpath();
 				if (currPath.intersects(mouseArea) || currClip.intersects(mouseArea))
 				{
+					if (currItem->isGroup() && allowInGroup)
+					{
+						PageItem* ret = itemInGroup(currItem, itemPos, mouseArea);
+						if (ret != NULL)
+							return ret;
+					}
 					return currItem;
 				}
 			}

Modified: trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp Wed Dec 22 17:04:17 2010
@@ -184,47 +184,50 @@
 
 
 	PageItem *pItem;
-
-	for ( int i = 0; i < srcDoc->MasterItems.count(); ++i )
-	{
-		pItem = srcDoc->MasterItems.at ( i );
-
-		if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( !pItem->asLatexFrame() ) )
-		{
-			QString itemText;
-
-			if ( pItem->PictureIsAvailable )
-			{
-				itemText = QString ( "Frame %1" ).arg ( i+1 );
-			}
-			else
-			{
-				itemText = QString ( "Frame %1 (empty)" ).arg ( i+1 );
-			}
-
-			insertFramesCombobox->addItem ( itemText, 0 );
-		}
-	}
-
-	for ( int i = 0; i < srcDoc->Items->count(); ++i )
-	{
-		pItem = srcDoc->Items->at ( i );
-
-		if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( !pItem->asLatexFrame() ) )
-		{
-			QString itemText;
-
-			if ( pItem->PictureIsAvailable )
-			{
-				itemText = QString ( "Frame %1" ).arg ( i+1 );
-			}
-			else
-			{
-				itemText = QString ( "Frame %1 (empty)" ).arg ( i+1 );
-			}
-
-			insertFramesCombobox->addItem ( itemText, 0 );
-		}
+	QList<PageItem*> allItems;
+	for (int a = 0; a < srcDoc->MasterItems.count(); ++a)
+	{
+		PageItem *currItem = srcDoc->MasterItems.at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			pItem = allItems.at(ii);
+			if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( !pItem->asLatexFrame() ) )
+			{
+				QString itemText;
+				if ( pItem->PictureIsAvailable )
+					itemText = QString ( "Frame %1" ).arg ( pItem->itemName() );
+				else
+					itemText = QString ( "Frame %1 (empty)" ).arg ( pItem->itemName() );
+				insertFramesCombobox->addItem ( itemText, 0 );
+			}
+		}
+		allItems.clear();
+	}
+	for (int a = 0; a < srcDoc->Items->count(); ++a)
+	{
+		PageItem *currItem = srcDoc->Items->at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			pItem = allItems.at(ii);
+			if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( !pItem->asLatexFrame() ) )
+			{
+				QString itemText;
+				if ( pItem->PictureIsAvailable )
+					itemText = QString ( "Frame %1" ).arg ( pItem->itemName() );
+				else
+					itemText = QString ( "Frame %1 (empty)" ).arg ( pItem->itemName() );
+				insertFramesCombobox->addItem ( itemText, 0 );
+			}
+		}
+		allItems.clear();
 	}
 
 
@@ -603,34 +606,47 @@
 {
 	PageItem *pItem;
 	QStringList imageFiles;
-
 	int id = item->data ( 0, Qt::UserRole ).toInt();
-
-
-	for ( int i = 0; i < srcDoc->MasterItems.count(); ++i )
-	{
-		pItem = srcDoc->MasterItems.at ( i );
-
-		if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( pItem->PictureIsAvailable ) && ( !pItem->asLatexFrame() ) )
-		{
-			if ( ( id == 0 ) || ( ( id-1 ) == pItem->OwnPage ) )
-			{
-				imageFiles.append ( pItem->Pfile );
-			}
-		}
-	}
-
-	for ( int i = 0; i < srcDoc->Items->count(); ++i )
-	{
-		pItem = srcDoc->Items->at ( i );
-
-		if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( pItem->PictureIsAvailable ) && ( !pItem->asLatexFrame() ) )
-		{
-			if ( ( id == 0 ) || ( ( id-1 ) == pItem->OwnPage ) )
-			{
-				imageFiles.append ( pItem->Pfile );
-			}
-		}
+	QList<PageItem*> allItems;
+	for (int a = 0; a < srcDoc->MasterItems.count(); ++a)
+	{
+		PageItem *currItem = srcDoc->MasterItems.at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			pItem = allItems.at(ii);
+			if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( pItem->PictureIsAvailable ) && ( !pItem->asLatexFrame() ) )
+			{
+				if ( ( id == 0 ) || ( ( id-1 ) == pItem->OwnPage ) )
+				{
+					imageFiles.append ( pItem->Pfile );
+				}
+			}
+		}
+		allItems.clear();
+	}
+	for (int a = 0; a < srcDoc->Items->count(); ++a)
+	{
+		PageItem *currItem = srcDoc->Items->at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			pItem = allItems.at(ii);
+			if ( ( pItem->itemType() == PageItem::ImageFrame ) && ( pItem->PictureIsAvailable ) && ( !pItem->asLatexFrame() ) )
+			{
+				if ( ( id == 0 ) || ( ( id-1 ) == pItem->OwnPage ) )
+				{
+					imageFiles.append ( pItem->Pfile );
+				}
+			}
+		}
+		allItems.clear();
 	}
 
 //todo: check if item is selected: item->isSelected()

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp Wed Dec 22 17:04:17 2010
@@ -115,32 +115,16 @@
 	bool ret = ScActionPlugin::handleSelection(doc, SelectedType);
 	if (!ret)
 	{
-		if (doc->m_Selection->count() > 1)
+		if (doc->m_Selection->count() == 2)
 		{
-			bool isGroup = true;
-			int firstElem = -1;
 			PageItem *currItem = doc->m_Selection->itemAt(0);
-			if (currItem->Groups.count() != 0)
-			{
-				firstElem = currItem->Groups.top();
-				for (int bx = 0; bx < doc->m_Selection->count() - 1; ++bx)
-				{
-					PageItem* bxi = doc->m_Selection->itemAt(bx);
-					if (bxi->Groups.count() != 0)
-					{
-						if (bxi->Groups.top() != firstElem)
-							isGroup = false;
-						if (currItem->itemType() == PageItem::Line)
-							isGroup = false;
-					}
-					else
-						isGroup = false;
-				}
-				currItem = doc->m_Selection->itemAt(doc->m_Selection->count() - 1);
+			if (currItem->isGroup())
+			{
+				currItem = doc->m_Selection->itemAt(1);
 				if (currItem->itemType() != PageItem::PolyLine)
 					ret = false;
 				else
-					ret = isGroup;
+					ret = true;
 			}
 			else
 			{
@@ -149,23 +133,9 @@
 				else
 				{
 					currItem = doc->m_Selection->itemAt(1);
-					if (currItem->Groups.count() != 0)
+					if (currItem->isGroup())
 					{
-						firstElem = currItem->Groups.top();
-						for (int bx = 1; bx < doc->m_Selection->count(); ++bx)
-						{
-							PageItem* bxi = doc->m_Selection->itemAt(bx);
-							if (bxi->Groups.count() != 0)
-							{
-								if (bxi->Groups.top() != firstElem)
-									isGroup = false;
-								if (currItem->itemType() == PageItem::Line)
-									isGroup = false;
-							}
-							else
-								isGroup = false;
-						}
-						ret = isGroup;
+						ret = true;
 					}
 				}
 			}
@@ -187,11 +157,11 @@
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 1)
 	{
-		if ((currDoc->m_Selection->itemAt(0)->Groups.count() != 0) || (currDoc->m_Selection->itemAt(1)->Groups.count() != 0))
+		if ((currDoc->m_Selection->itemAt(0)->isGroup()) || (currDoc->m_Selection->itemAt(1)->isGroup()))
 		{
 			selOffs = 0;
 			selCount = currDoc->m_Selection->count() - 1;
-			if (currDoc->m_Selection->itemAt(0)->Groups.count() == 0)
+			if (!currDoc->m_Selection->itemAt(0)->isGroup())
 			{
 				pathItem = currDoc->m_Selection->itemAt(0);
 				selOffs = 1;
@@ -202,14 +172,21 @@
 			QTransform mp;
 			mp.rotate(pathItem->rotation());
 			effectPath.map(mp);
-			for (int bx = 0; bx < selCount; ++bx)
-			{
-				PageItem* bxi = currDoc->m_Selection->itemAt(bx + selOffs);
-				originalPathG.append(bxi->PoLine.copy());
-				originalXPosG.append(bxi->xPos());
-				originalYPosG.append(bxi->yPos());
-				originalRotG.append(bxi->rotation());
-				patternItemG.append(bxi);
+			PageItem* bxi = currDoc->m_Selection->itemAt(selOffs);
+			originalPathG.append(bxi->PoLine.copy());
+			originalXPosG.append(bxi->xPos());
+			originalYPosG.append(bxi->yPos());
+			originalRotG.append(bxi->rotation());
+			patternItemG.append(bxi);
+			QList<PageItem*> bxiL = bxi->getItemList();
+			for (int bx = 0; bx < bxiL.count(); ++bx)
+			{
+				PageItem* cIte = bxiL.at(bx);
+				originalPathG.append(cIte->PoLine.copy());
+				originalXPosG.append(cIte->xPos());
+				originalYPosG.append(cIte->yPos());
+				originalRotG.append(cIte->rotation());
+				patternItemG.append(cIte);
 			}
 			QPainterPath tmpPath = effectPath.toQPainterPath(false);
 			PathDialog *dia = new PathDialog(currDoc->scMW(), currDoc->unitIndex(), tmpPath.length(), true);
@@ -286,7 +263,7 @@
 			bxi->FrameType = 3;
 			bxi->setXYPos(originalXPosG[bx], originalYPosG[bx]);
 			bxi->setRotation(originalRotG[bx]);
-			currDoc->AdjustItemSize(bxi);
+			currDoc->AdjustItemSize(bxi, true);
 			bxi->OldB2 = bxi->width();
 			bxi->OldH2 = bxi->height();
 			bxi->updateClip();
@@ -329,9 +306,21 @@
 			bxi->ClipEdited = true;
 			bxi->FrameType = 3;
 			bxi->setXYPos(pathItem->xPos()+deltaX, pathItem->yPos()+deltaY);
-			currDoc->AdjustItemSize(bxi);
+			if (!bxi->isGroup())
+			{
+				bxi->gXpos = deltaX;
+				bxi->gYpos = deltaY;
+			}
+			double oW = bxi->width();
+			double oH = bxi->height();
+			currDoc->AdjustItemSize(bxi, true);
 			bxi->OldB2 = bxi->width();
 			bxi->OldH2 = bxi->height();
+			if (bxi->isGroup())
+			{
+				bxi->groupWidth = bxi->groupWidth * (bxi->OldB2 / oW);
+				bxi->groupHeight = bxi->groupHeight * (bxi->OldH2 / oH);
+			}
 			bxi->updateClip();
 			bxi->ContourLine = bxi->PoLine.copy();
 		}
@@ -379,7 +368,7 @@
 		patternItem->setXYPos(pathItem->xPos(), pathItem->yPos());
 		patternItem->setRotation(0);
 	}
-	currDoc->AdjustItemSize(patternItem);
+	currDoc->AdjustItemSize(patternItem, true);
 	patternItem->OldB2 = patternItem->width();
 	patternItem->OldH2 = patternItem->height();
 	patternItem->updateClip();

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Dec 22 17:04:17 2010
@@ -588,7 +588,7 @@
 	connect(docCheckerPalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
-	connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
+//	connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
 	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
@@ -5896,10 +5896,20 @@
 	if (doc)
 	{
 		doc->guidesPrefs().showPic = !doc->guidesPrefs().showPic;
-		for (int b=0; b<doc->Items->count(); ++b)
-		{
-			if (doc->Items->at(b)->asImageFrame())
-				doc->Items->at(b)->setImageShown(doc->guidesPrefs().showPic);
+		QList<PageItem*> allItems;
+		for (int a = 0; a < doc->Items->count(); ++a)
+		{
+			PageItem *currItem = doc->Items->at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				PageItem* item = allItems.at(ii);
+				if (item->asImageFrame())
+					item->setImageShown(doc->guidesPrefs().showPic);
+			}
 		}
 		view->DrawNew();
 	}

Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Wed Dec 22 17:04:17 2010
@@ -1208,13 +1208,24 @@
 		return;
 	}
 	bool found = false;
-	for (int b = 0; b < view->Doc->Items->count(); ++b)
-	{
-		if ((NameNew == view->Doc->Items->at(b)->itemName()) && (view->Doc->Items->at(b) != item))
+	QList<PageItem*> allItems;
+	for (int a = 0; a < view->Doc->Items->count(); ++a)
+	{
+		PageItem *currItem = view->Doc->Items->at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
 		{
-			found = true;
-			break;
-		}
+			PageItem* ite = allItems.at(ii);
+			if ((NameNew == ite->itemName()) && (ite != item))
+			{
+				found = true;
+				break;
+			}
+		}
+		allItems.clear();
 	}
 	if (found)
 	{

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Wed Dec 22 17:04:17 2010
@@ -296,13 +296,24 @@
 				else
 				{
 					bool found = false;
-					for (int b = 0; b < currDoc->Items->count(); ++b)
+					QList<PageItem*> allItems;
+					for (int a = 0; a < currDoc->Items->count(); ++a)
 					{
-						if ((NameNew == currDoc->Items->at(b)->itemName()) && (currDoc->Items->at(b) != item->PageItemObject))
+						PageItem *currItem = currDoc->Items->at(a);
+						if (currItem->isGroup())
+							allItems = currItem->getItemList();
+						else
+							allItems.append(currItem);
+						for (int ii = 0; ii < allItems.count(); ii++)
 						{
-							found = true;
-							break;
+							PageItem* ite = allItems.at(ii);
+							if ((NameNew == ite->itemName()) && (ite != item->PageItemObject))
+							{
+								found = true;
+								break;
+							}
 						}
+						allItems.clear();
 					}
 					if (found)
 					{
@@ -612,15 +623,9 @@
 			if (!currDoc->masterPageMode())
 				emit selectMasterPage(item->PageItemObject->OnMasterPage);
 			if (item->PageItemObject->isGroup())
-				emit selectElement(-1, item->PageItemObject->ItemNr, false);
+				emit selectElementByItem(pgItem, false);
 			else
-			{
-				pgItem = item->PageItemObject;
-				if (item->PageItemObject->isGroup())
-					emit selectElement(-1, item->PageItemObject->ItemNr, false);
-				else
-					emit selectElementByItem(pgItem, true);
-			}
+				emit selectElementByItem(pgItem, true);
 			break;
 		case 2:
 			pg = item->PageObject->pageNr();
@@ -632,14 +637,9 @@
 			pgItem = item->PageItemObject;
 			m_MainWindow->closeActiveWindowMasterPageEditor();
 			if (pgItem->isGroup())
-				emit selectElement(pgItem->OwnPage, pgItem->ItemNr, false);
+				emit selectElementByItem(pgItem, false);
 			else
-			{
-				if (pgItem->isGroup())
-					emit selectElement(pgItem->OwnPage, pgItem->ItemNr, false);
-				else
-					emit selectElementByItem(pgItem, true);
-			}
+				emit selectElementByItem(pgItem, true);
 			break;
 		default:
 			break;

Modified: trunk/Scribus/scribus/ui/outlinepalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/outlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.h Wed Dec 22 17:04:17 2010
@@ -76,7 +76,6 @@
 
 signals:
 	void ToggleAllPalettes();
-	void selectElement(int, int, bool);
 	void selectElementByItem(PageItem *, bool);
 	void selectPage(int);
 	void selectMasterPage(QString);

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.cpp Wed Dec 22 17:04:17 2010
@@ -238,23 +238,51 @@
 	{
 //	Build a list of all Fonts used in Annotations;
 		PageItem *pgit;
-		for (int c = 0; c < m_doc->FrameItems.count(); ++c)
-		{
-			pgit=m_doc->FrameItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
-		}
-		for (int c = 0; c < m_doc->MasterItems.count(); ++c)
-		{
-			pgit=m_doc->MasterItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
-		}
-		for (int c = 0; c < m_doc->DocItems.count(); ++c)
-		{
-			pgit=m_doc->DocItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+		QList<PageItem*> allItems;
+		for (int a = 0; a < m_doc->FrameItems.count(); ++a)
+		{
+			PageItem *currItem = m_doc->FrameItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
+		}
+		for (int a = 0; a < m_doc->MasterItems.count(); ++a)
+		{
+			PageItem *currItem = m_doc->MasterItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
+		}
+		for (int a = 0; a < m_doc->DocItems.count(); ++a)
+		{
+			PageItem *currItem = m_doc->DocItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
 		}
 		QMap<QString,int>::const_iterator it;
 		availableFontsListWidget->clear();

Modified: trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp Wed Dec 22 17:04:17 2010
@@ -106,10 +106,21 @@
 	itemDestFrameComboBox->addItem(CommonStrings::tr_None);
 	if (m_Doc!=NULL)
 	{
-		for (int d = 0; d < m_Doc->DocItems.count(); ++d)
-		{
-			if (m_Doc->DocItems.at(d)->itemType()==PageItem::TextFrame)
-				itemDestFrameComboBox->addItem(m_Doc->DocItems.at(d)->itemName());
+		QList<PageItem*> allItems;
+		for (int a = 0; a < m_Doc->DocItems.count(); ++a)
+		{
+			PageItem *currItem = m_Doc->DocItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				currItem = allItems.at(ii);
+				if (currItem->itemType() == PageItem::TextFrame)
+					itemDestFrameComboBox->addItem(currItem->itemName());
+			}
+			allItems.clear();
 		}
 	}
 	else

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Wed Dec 22 17:04:17 2010
@@ -4698,13 +4698,24 @@
 		return;
 	}
 	bool found = false;
-	for (int b = 0; b < doc->Items->count(); ++b)
-	{
-		if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
-		{
-			found = true;
-			break;
-		}
+	QList<PageItem*> allItems;
+	for (int a = 0; a < doc->Items->count(); ++a)
+	{
+		PageItem *currItem = doc->Items->at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			PageItem* item = allItems.at(ii);
+			if ((NameNew == item->itemName()) && (item != CurItem))
+			{
+				found = true;
+				break;
+			}
+		}
+		allItems.clear();
 	}
 	if (found)
 	{

Modified: trunk/Scribus/scribus/ui/selfield.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/selfield.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/selfield.cpp (original)
+++ trunk/Scribus/scribus/ui/selfield.cpp Wed Dec 22 17:04:17 2010
@@ -40,19 +40,29 @@
 	Layout1->addWidget( Text1 );
 	AvailFields = new QListWidget( this );
 	AvailFields->setMinimumSize( QSize( 130, 180 ) );
-	for (int se = 0; se < Doc->Items->count(); ++se)
+	QList<PageItem*> allItems;
+	for (int a = 0; a < Doc->Items->count(); ++a)
 	{
-		PageItem* item = Doc->Items->at(se);
-		if (Art < 2)
+		PageItem *currItem = Doc->Items->at(a);
+		if (currItem->isGroup())
+			allItems = currItem->getItemList();
+		else
+			allItems.append(currItem);
+		for (int ii = 0; ii < allItems.count(); ii++)
 		{
-			if ((item->isAnnotation()) && ((item->annotation().Type() > 1) && (item->annotation().Type() < 12)))
-				AvailFields->addItem(item->itemName());
+			PageItem* item = allItems.at(ii);
+			if (Art < 2)
+			{
+				if ((item->isAnnotation()) && ((item->annotation().Type() > 1) && (item->annotation().Type() < 12)))
+					AvailFields->addItem(item->itemName());
+			}
+			else
+			{
+				if ((item->isAnnotation()) && (item->annotation().Type() == Art) && (item->itemName() != Own))
+					AvailFields->addItem(item->itemName());
+			}
 		}
-		else
-		{
-			if ((item->isAnnotation()) && (item->annotation().Type() == Art) && (item->itemName() != Own))
-				AvailFields->addItem(item->itemName());
-		}
+		allItems.clear();
 	}
 	Layout1->addWidget( AvailFields );
 	Layout5->addLayout( Layout1 );

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp Wed Dec 22 17:04:17 2010
@@ -1060,23 +1060,51 @@
 	{
 //	Build a list of all Fonts used in Annotations;
 		PageItem *pgit;
-		for (int c = 0; c < doc->FrameItems.count(); ++c)
-		{
-			pgit = doc->FrameItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
-		}
-		for (int c = 0; c < doc->MasterItems.count(); ++c)
-		{
-			pgit = doc->MasterItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
-		}
-		for (int c = 0; c < doc->DocItems.count(); ++c)
-		{
-			pgit = doc->DocItems.at(c);
-			if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-				AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+		QList<PageItem*> allItems;
+		for (int a = 0; a < doc->FrameItems.count(); ++a)
+		{
+			PageItem *currItem = doc->FrameItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
+		}
+		for (int a = 0; a < doc->MasterItems.count(); ++a)
+		{
+			PageItem *currItem = doc->MasterItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
+		}
+		for (int a = 0; a < doc->DocItems.count(); ++a)
+		{
+			PageItem *currItem = doc->DocItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				pgit = allItems.at(ii);
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
+					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+			}
+			allItems.clear();
 		}
 		QMap<QString,int>::const_iterator it;
 		AvailFlist->clear();

Modified: trunk/Scribus/scribus/ui/tocindexprefs.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16156&path=/trunk/Scribus/scribus/ui/tocindexprefs.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tocindexprefs.cpp (original)
+++ trunk/Scribus/scribus/ui/tocindexprefs.cpp Wed Dec 22 17:04:17 2010
@@ -159,10 +159,21 @@
 	itemDestFrameComboBox->addItem(trStrNone);
 	if (currDoc!=NULL)
 	{
-		for (int d = 0; d < currDoc->DocItems.count(); ++d)
-		{
-			if (currDoc->DocItems.at(d)->itemType()==PageItem::TextFrame)
-				itemDestFrameComboBox->addItem(currDoc->DocItems.at(d)->itemName());
+		QList<PageItem*> allItems;
+		for (int a = 0; a < currDoc->DocItems.count(); ++a)
+		{
+			PageItem *currItem = currDoc->DocItems.at(a);
+			if (currItem->isGroup())
+				allItems = currItem->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				currItem = allItems.at(ii);
+				if (currItem->itemType() == PageItem::TextFrame)
+					itemDestFrameComboBox->addItem(currItem->itemName());
+			}
+			allItems.clear();
 		}
 	}
 	else




More information about the scribus-commit mailing list