r17644 by craig - #10808 / Chelen: Fixes for #4832, #4833, #3414, #10452, #10809, #10810, #10811, #10812

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 27 19:08:13 UTC 2012


Author: craig
Date: Wed Jun 27 19:08:13 2012
New Revision: 17644

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17644
Log:
#10808 / Chelen: Fixes for #4832, #4833, #3414, #10452, #10809, #10810, #10811, #10812

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
    trunk/Scribus/scribus/undomanager.cpp
    trunk/Scribus/scribus/undomanager.h

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed Jun 27 19:08:13 2012
@@ -1490,6 +1490,13 @@
 
 void PageItem::setCornerRadius(double newRadius)
 {
+	if(RadRect==newRadius)
+		return;
+	SimpleState *state = new SimpleState(Um::RoundCorner,"",Um::IBorder);
+	state->set("CORNER_RADIUS","corner_radius");
+	state->set("OLD_RADIUS",RadRect);
+	state->set("NEW_RADIUS",newRadius);
+	undoManager->action(this,state);
 	RadRect=newRadius;
 	//emit cornerRadius(RadRect);
 }
@@ -3576,6 +3583,13 @@
 {
 	if (fillBlendmodeVal == newBlendmode)
 		return; // nothing to do -> return
+	if (UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::BlendMode, 0, Um::IGroup);
+		ss->set("FILLBLENDMODE", newBlendmode);
+		ss->set("FILLBLENDMODE_OLD", fillBlendmodeVal);
+		undoManager->action(this, ss);
+	}
 	fillBlendmodeVal = newBlendmode;
 }
 
@@ -3802,6 +3816,13 @@
 {
 	if (lineBlendmodeVal == newBlendmode)
 		return; // nothing to do -> return
+	if (UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::BlendMode, 0, Um::IGroup);
+		ss->set("LINEBLENDMODE", newBlendmode);
+		ss->set("LINEBLENDMODE_OLD", lineBlendmodeVal);
+		undoManager->action(this, ss);
+	}
 	lineBlendmodeVal = newBlendmode;
 }
 
@@ -3999,6 +4020,19 @@
 	AspectRatio = keepRatio;
 	AdjustPictScale();
 	update();
+}
+
+void PageItem::setOverprint(bool val) {
+	if(doOverprint==val)
+			return;
+
+	if (UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::Overprint, 0, Um::IGroup);
+		ss->set("OVERPRINT", val);
+		undoManager->action(this, ss);
+	}
+	doOverprint = val;
 }
 
 void PageItem::toggleLock()
@@ -4462,11 +4496,48 @@
 			restoreFirstLineOffset(ss,isUndo);
 		else if (ss->contains("PASTE_TEXT"))
 			restorePasteText(ss,isUndo);
+		else if (ss->contains("CORNER_RADIUS"))
+			restoreCornerRadius(ss,isUndo);
 		else if (ss->contains("IMAGEFLIPH"))
 		{
 			select();
 			m_Doc->itemSelection_FlipH();
 		}
+		else if (ss->contains("OVERPRINT"))
+		{
+			if (isUndo)
+				doOverprint=!ss->getBool("OVERPRINT");
+			else
+				doOverprint=ss->getBool("OVERPRINT");
+		}
+		else if (ss->contains("FILLBLENDMODE"))
+		{
+			if (isUndo)
+				fillBlendmodeVal=ss->getInt("FILLBLENDMODE_OLD");
+			else
+				fillBlendmodeVal=ss->getInt("FILLBLENDMODE");
+		}
+		else if (ss->contains("ACTIONPDFANNOTATION"))
+		{
+			if (isUndo)
+				m_isAnnotation=!ss->getBool("ACTIONPDFANNOTATION");
+			else
+				m_isAnnotation=ss->getBool("ACTIONPDFANNOTATION");
+		}
+		else if (ss->contains("ACTIONPDFBOOKMARK"))
+		{
+			if (isUndo)
+				isBookmark=!ss->getBool("ACTIONPDFBOOKMARK");
+			else
+				isBookmark=ss->getBool("ACTIONPDFBOOKMARK");
+		}
+		else if (ss->contains("LINEBLENDMODE"))
+		{
+			if (isUndo)
+				lineBlendmodeVal=ss->getInt("LINEBLENDMODE_OLD");
+			else
+				lineBlendmodeVal=ss->getInt("LINEBLENDMODE");
+		}
 		else if (ss->contains("IMAGEFLIPV"))
 		{
 			select();
@@ -4489,6 +4560,8 @@
 		}
 		else if (ss->contains("NEW_NAME"))
 			restoreName(ss, isUndo);
+		else if (ss->contains("SHOW_IMAGE"))
+			restoreShowImage(ss, isUndo);
 		else if (ss->contains("TRANSPARENCY"))
 			restoreFillTP(ss, isUndo);
 		else if (ss->contains("LINE_TRANSPARENCY"))
@@ -4523,6 +4596,8 @@
 			restorePoly(ss, isUndo, true);
 		else if (ss->contains("EDIT_SHAPE"))
 			restorePoly(ss, isUndo, false);
+		else if (ss->contains("RES_TYP"))
+			restoreResTyp(ss, isUndo);
 		else if (ss->contains("RESET_CONTOUR"))
 			restoreContourLine(ss, isUndo);
 		else if (ss->contains("CHANGE_SHAPE_TYPE"))
@@ -4578,117 +4653,111 @@
 void PageItem::restorePasteInline(SimpleState *is, bool isUndo)
 {
 	int start = is->getInt("START");
-	if(isUndo){
+	if (isUndo)
+	{
 		itemText.select(start,1);
 		asTextFrame()->deleteSelectedTextFromFrame();
-	} else {
+	}
+	else
 		itemText.insertObject(is->getInt("INDEX"));
-	}
 }
 
 void PageItem::restorePasteText(SimpleState *ss, bool isUndo)
 {
 	ScItemState<StoryText> *is = dynamic_cast<ScItemState<StoryText>*>(ss);
 	int start = is->getInt("START");
-	if(isUndo){
+	if (isUndo){
 		itemText.select(start,is->getItem().length());
 		asTextFrame()->deleteSelectedTextFromFrame();
-	} else {
+	}
+	else
 		itemText.insert(is->getItem());
-	}
 }
 
 void PageItem::restoreColumnsGap(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		ColGap = ss->getInt("OLD_COLUMNS");
-	} else {
+	else
 		ColGap = ss->getInt("NEW_COLUMNS");
-	}
 	update();
 }
 
 void PageItem::restoreLeftTextFrameDist(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		Extra = ss->getInt("OLD_DIST");
-	} else {
+	else
 		Extra = ss->getInt("NEW_DIST");
-	}
 	update();
 }
 
 void PageItem::restoreRightTextFrameDist(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		RExtra = ss->getInt("OLD_DIST");
-	} else {
+	else
 		RExtra = ss->getInt("NEW_DIST");
-	}
 	update();
 }
 
 void PageItem::restoreTopTextFrameDist(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		TExtra = ss->getInt("OLD_DIST");
-	} else {
+	else
 		TExtra = ss->getInt("NEW_DIST");
-	}
 	update();
 }
 
 void PageItem::restoreBottomTextFrameDist(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		BExtra = ss->getInt("OLD_DIST");
-	} else {
+	else
 		BExtra = ss->getInt("NEW_DIST");
-	}
 	update();
 }
 
 void PageItem::restoreColumns(SimpleState *ss, bool isUndo)
 {
-	if(isUndo){
+	if (isUndo)
 		Cols = ss->getInt("OLD_COLUMNS");
-	} else {
+	else
 		Cols = ss->getInt("NEW_COLUMNS");
-	}
 	update();
 }
 
 void PageItem::restoreFirstLineOffset(SimpleState *ss, bool isUndo)
 {
 	ScItemState<QPair<FirstLineOffsetPolicy, FirstLineOffsetPolicy > > *is = dynamic_cast<ScItemState<QPair<FirstLineOffsetPolicy, FirstLineOffsetPolicy> >*>(ss);
-	if(isUndo){
+	if (isUndo)
 		firstLineOffsetP = is->getItem().first;
-	} else {
+	else
 		firstLineOffsetP = is->getItem().second;
-	}
 	update();
 }
 
 void PageItem::restoreDefaultParagraphStyle(SimpleState *ss, bool isUndo)
 {
 	ScItemState<QPair<ParagraphStyle, ParagraphStyle > > *is = dynamic_cast<ScItemState<QPair<ParagraphStyle, ParagraphStyle> >*>(ss);
-	if(isUndo){
+	if (isUndo)
 		itemText.setDefaultStyle(is->getItem().second);
-	} else {
+	else
 		itemText.setDefaultStyle(is->getItem().first);
-	}
 }
 
 void PageItem::restoreParagraphStyle(SimpleState *ss, bool isUndo)
 {
 	ScItemState<QPair<ParagraphStyle, ParagraphStyle > > *is = dynamic_cast<ScItemState<QPair<ParagraphStyle, ParagraphStyle> >*>(ss);
 	int pos = is->getInt("POS");
-	if(isUndo){
+	if (isUndo)
+	{
 		itemText.eraseStyle(pos,is->getItem().first);
 		itemText.applyStyle(pos,is->getItem().second);
-	} else {
+	}
+	else
 		itemText.applyStyle(pos,is->getItem().first);
-	}
 }
 
 void PageItem::restoreCharStyle(SimpleState *ss, bool isUndo)
@@ -4696,12 +4765,13 @@
 	ScItemState<QPair<CharStyle, CharStyle > > *is = dynamic_cast<ScItemState<QPair<CharStyle, CharStyle> >*>(ss);
 	int length = is->getInt("LENGTH");
 	int start = is->getInt("START");
-	if(isUndo){
+	if (isUndo)
+	{
 		itemText.eraseCharStyle(start,length,is->getItem().first);
 		itemText.applyCharStyle(start,length,is->getItem().second);
-	} else {
+	}
+	else
 		itemText.applyCharStyle(start,length,is->getItem().first);
-	}
 }
 
 void PageItem::restoreSetCharStyle(SimpleState *ss, bool isUndo)
@@ -4709,39 +4779,39 @@
 	ScItemState<QPair<CharStyle, CharStyle > > *is = dynamic_cast<ScItemState<QPair<CharStyle, CharStyle> >*>(ss);
 	int length = is->getInt("LENGTH");
 	int start = is->getInt("START");
-	if(isUndo){
+	if (isUndo)
 		itemText.setCharStyle(start,length,is->getItem().second);
-	} else {
+	else
 		itemText.setCharStyle(start,length,is->getItem().first);
-	}
 }
 
 void PageItem::restoreSetParagraphStyle(SimpleState *ss, bool isUndo)
 {
 	ScItemState<QPair<ParagraphStyle, ParagraphStyle > > *is = dynamic_cast<ScItemState<QPair<ParagraphStyle, ParagraphStyle> >*>(ss);
 	int pos = is->getInt("POS");
-	if(isUndo){
+	if (isUndo)
 		itemText.setStyle(pos,is->getItem().second);
-	} else {
+	else
 		itemText.setStyle(pos,is->getItem().first);
-	}
 }
 
 void PageItem::restoreLoremIpsum(SimpleState *ss, bool isUndo)
 {
 	QString sampleText = ss->get("TEXT_STR");
-	if(isUndo){
+	if (isUndo)
+	{
 		itemText.selectAll();
 		asTextFrame()->deleteSelectedTextFromFrame();
-	} else {
+	}
+	else
 		itemText.insertChars(0,sampleText);
-	}
-}
-
-void PageItem::restoreDeleteFrameText(SimpleState *ss, bool isUndo){
+}
+
+void PageItem::restoreDeleteFrameText(SimpleState *ss, bool isUndo)
+{
 	QString text = ss->get("TEXT_STR");
 	int start = ss->getInt("START");
-	if(isUndo){
+	if (isUndo){
 		itemText.insertChars(start,text);
 	} else {
 		itemText.select(start,text.length());
@@ -4749,15 +4819,30 @@
 	}
 }
 
-void PageItem::restoreInsertFrameText(SimpleState *ss, bool isUndo){
+void PageItem::restoreInsertFrameText(SimpleState *ss, bool isUndo)
+{
 	QString text = ss->get("TEXT_STR");
 	int start = ss->getInt("START");
-	if(isUndo){
+	if (isUndo)
+	{
 		itemText.select(start,text.length());
 		asTextFrame()->deleteSelectedTextFromFrame();
-	} else {
+	}
+	else
 		itemText.insertChars(start,text);
-	}
+}
+
+void PageItem::restoreCornerRadius(SimpleState *state, bool isUndo)
+{
+	if (isUndo)
+		RadRect=state->getDouble("OLD_RADIUS");
+	else
+		RadRect=state->getDouble("NEW_RADIUS");
+	Selection tmpSelection(doc()->m_Selection);
+	doc()->m_Selection->clear();
+	doc()->m_Selection->addItem(this);
+	doc()->scMW()->view->SetFrameRounded();
+	*(doc()->m_Selection) = tmpSelection;
 }
 
 void PageItem::restoreMove(SimpleState *state, bool isUndo)
@@ -4851,6 +4936,16 @@
 	oldHeight = Height;
 }
 
+void PageItem::restoreShowImage(SimpleState *state, bool isUndo)
+{
+	bool old = state->getBool("OLD");
+	if (isUndo)
+		PicArt = old;
+	else
+		PicArt = !old;
+	update();
+}
+
 void PageItem::restoreFill(SimpleState *state, bool isUndo)
 {
 	QString fill = state->get("OLD_FILL");
@@ -4858,6 +4953,15 @@
 		fill = state->get("NEW_FILL");
 	select();
 	m_Doc->itemSelection_SetItemBrush(fill);
+}
+
+void PageItem::restoreResTyp(SimpleState *state, bool isUndo)
+{
+	if (isUndo)
+		setResolution(state->getInt("OLD_RES"));
+	else
+		setResolution(state->getInt("NEW_RES"));
+	doc()->updatePic();
 }
 
 void PageItem::restoreShade(SimpleState *state, bool isUndo)
@@ -5285,13 +5389,15 @@
 		{
 			this->FrameType = is->getInt("OLD_FRAME_TYPE");
 			this->PoLine = is->getItem().first;
+			ClipEdited = !(FrameType == 0 || FrameType == 1);
 		}
 		else
 		{
 			this->FrameType = is->getInt("NEW_FRAME_TYPE");
 			this->PoLine = is->getItem().second;
-		}
-		ClipEdited = true;
+			ClipEdited = (FrameType == 0 || FrameType == 1);
+		}
+		Clip = FlattenPath(PoLine,Segments);
 	}
 }
 
@@ -7291,9 +7397,44 @@
 
 void PageItem::setIsAnnotation(bool isAnnot)
 {
+	if (m_isAnnotation==isAnnot)
+		return; // nothing to do -> return
+	if (UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::ActionPDF, 0, Um::IGroup);
+		ss->set("ACTIONPDFANNOTATION", isAnnot);
+		undoManager->action(this, ss);
+	}
 	m_isAnnotation=isAnnot;
 }
 
+void PageItem::setIsBookMark(bool isBM)
+{
+	if (isBookmark==isBM)
+		return; // nothing to do -> return
+	if (UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::ActionPDF, 0, Um::IGroup);
+		ss->set("ACTIONPDFBOOKMARK", isBM);
+		undoManager->action(this, ss);
+	}
+	isBookmark=isBM;
+}
+
+void PageItem::setResolution(int id){
+	if(pixm.imgInfo.lowResType==id)
+		return;
+	if(UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::ResTyp,"",Um::IImageFrame);
+		ss->set("RES_TYP","res_typ");
+		ss->set("OLD_RES",pixm.imgInfo.lowResType);
+		ss->set("NEW_RES",id);
+		undoManager->action(this,ss);
+	}
+	pixm.imgInfo.lowResType = id;
+}
+
 void PageItem::setAnnotation(const Annotation& ad)
 {
 	m_annotation=ad;
@@ -7301,6 +7442,15 @@
 
 void PageItem::setImageShown(bool isShown)
 {
+	if(PicArt==isShown)
+		return;
+	if(UndoManager::undoEnabled())
+	{
+		SimpleState *ss = new SimpleState(Um::ResTyp,"",Um::IImageFrame);
+		ss->set("SHOW_IMAGE","show_image");
+		ss->set("OLD",PicArt);
+		undoManager->action(this,ss);
+	}
 	PicArt=isShown;
 }
 

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Wed Jun 27 19:08:13 2012
@@ -488,6 +488,7 @@
 	QString externalFile() const { return Pfile; }
 	void setExternalFile(QString val);
 	void setImagePagenumber(int num) { pixm.imgInfo.actualPageNumber = num; }
+	void setResolution(int);
 	
 	//FIXME: maybe these should go into annotation?
 	QString fileIconPressed() const { return Pfile2; }
@@ -703,7 +704,7 @@
 	void setFillEvenOdd(bool val) { fillRule = val; }
 	//
 	bool overprint() const { return doOverprint; }
-	void setOverprint(bool val) { doOverprint = val; }
+	void setOverprint(bool val);
 	// rect / oval / round / other
 	int frameType() const { return FrameType; }
 	void setFrameType(int val) { FrameType = val; }
@@ -1180,6 +1181,7 @@
 	
 	bool isAnnotation() const { return m_isAnnotation; }
 	void setIsAnnotation(bool);
+	void setIsBookMark(bool);
 	void setAnnotation(const Annotation& ad);
 	Annotation& annotation() { return m_annotation; }
 	const Annotation& annotation() const { return m_annotation; }
@@ -1226,6 +1228,9 @@
 	void restoreLoremIpsum(SimpleState *state, bool isUndo);
 	void restoreDeleteFrameText(SimpleState *state, bool isUndo);
 	void restoreInsertFrameText(SimpleState *state, bool isUndo);
+	void restoreCornerRadius(SimpleState *state, bool isUndo);
+	void restoreShowImage(SimpleState *state, bool isUndo);
+	void restoreResTyp(SimpleState *state, bool isUndo);
 	void restoreMove(SimpleState *state, bool isUndo);
 	void restoreResize(SimpleState *state, bool isUndo);
 	void restoreRotate(SimpleState *state, bool isUndo);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Jun 27 19:08:13 2012
@@ -9959,7 +9959,6 @@
 	uint docSelectionCount = doc->m_Selection->count();
 	QString patternName = "Pattern_"+doc->m_Selection->itemAt(0)->itemName();
 	patternName = patternName.trimmed().simplified().replace(" ", "_");
-	bool wasUndo = undoManager->undoEnabled();
 	undoManager->setUndoEnabled(false);
 	PageItem* currItem;
 	Selection itemSelection(this, false);
@@ -10066,7 +10065,7 @@
 	if (outlinePalette->isVisible())
 		outlinePalette->BuildTree();
 	view->DrawNew();
-	undoManager->setUndoEnabled(wasUndo);
+	undoManager->setUndoEnabled(true);
 }
 
 void ScribusMainWindow::managePaints()

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Jun 27 19:08:13 2012
@@ -1663,7 +1663,7 @@
 		if (ss->contains("GROUP"))
 			restoreGrouping(ss, isUndo);
 		else if (ss->contains("UNGROUP"))
-			restoreUngrouping(ss, isUndo);
+			restoreGrouping(ss, !isUndo);
 		else if (ss->contains("GUIDE_LOCK"))
 		{
 			if (isUndo)
@@ -1864,48 +1864,25 @@
 void ScribusDoc::restoreGrouping(SimpleState *state, bool isUndo)
 {
 	double x, y, w, h;
-	Selection tmpSelection(this, false);
-	int itemCount = state->getInt("itemcount");
+	ScItemState<QList<QPointer<PageItem> > > *is = dynamic_cast<ScItemState<QList<QPointer<PageItem> > >*>(state);
+	QList<QPointer<PageItem> > select = is->getItem();
 	m_Selection->setGroupRect();
 	m_Selection->getGroupRect(&x, &y, &w, &h);
 	m_Selection->delaySignalsOn();
-	m_Selection->clear();
-	for (int i = 0; i < itemCount; ++i)
-	{
-		int itemNr = getItemNrfromUniqueID(state->getUInt(QString("item%1").arg(i)));
-		if (Items->at(itemNr)->uniqueNr == state->getUInt(QString("item%1").arg(i)))
-			tmpSelection.addItem(Items->at(itemNr));
-	}
-	if (isUndo)
-		itemSelection_UnGroupObjects(&tmpSelection);
+	Selection tempSelect(this,false);
+	if(isUndo)
+	{
+		tempSelect.addItem(select.last());
+		itemSelection_UnGroupObjects(&tempSelect);
+	}
 	else
-		itemSelection_GroupObjects(false, false, &tmpSelection);
-	QRectF rect(x, y , w, h);
-	regionsChanged()->update(rect.adjusted(-10, -10, 20, 20));
-	m_Selection->delaySignalsOff();
-}
-
-void ScribusDoc::restoreUngrouping(SimpleState *state, bool isUndo)
-{
-	double x, y, w, h;
-	Selection tmpSelection(this, false);
-	int itemCount = state->getInt("itemcount");
-	m_Selection->setGroupRect();
-	m_Selection->getGroupRect(&x, &y, &w, &h);
-	m_Selection->delaySignalsOn();
-	m_Selection->clear();
-	for (int i = 0; i < itemCount; ++i)
-	{
-		int itemNr = getItemNrfromUniqueID(state->getUInt(QString("item%1").arg(i)));
-		if (Items->at(itemNr)->uniqueNr == state->getUInt(QString("item%1").arg(i)))
-		{
-			tmpSelection.addItem(Items->at(itemNr));
-		}
-	}
-	if (isUndo)
-		itemSelection_GroupObjects(false, false, &tmpSelection);
-	else
-		itemSelection_UnGroupObjects(&tmpSelection);
+	{
+		for (int i = 0; i < select.size()-1; ++i)
+			tempSelect.addItem(select.at(i));
+		select.removeLast();
+		select.append(itemSelection_GroupObjects(false, false,&tempSelect));
+		is->setItem(select);
+	}
 	QRectF rect(x, y , w, h);
 	regionsChanged()->update(rect.adjusted(-10, -10, 20, 20));
 	m_Selection->delaySignalsOff();
@@ -2419,9 +2396,8 @@
 		Items->at(z)->isAutoText = true;
 		Items->at(z)->Cols = qRound(PageSp);
 		Items->at(z)->ColGap = PageSpa;
-		if (LastAuto != 0) {
+		if (LastAuto != 0)
 			LastAuto->link(Items->at(z));
-		}	
 		else
 			FirstAuto = Items->at(z);
 		LastAuto = Items->at(z);
@@ -9743,7 +9719,8 @@
 		{
 			if (m_Selection->itemAt(i)!=NULL)
 			{
-				if (m_Selection->itemAt(i)->asLatexFrame()) {
+				if (m_Selection->itemAt(i)->asLatexFrame())
+				{
 					PageItem_LatexFrame *latexframe =
 						m_Selection->itemAt(i)->asLatexFrame();
 					latexframe->rerunApplication();
@@ -10130,9 +10107,9 @@
 	uint docSelectionCount=m_Selection->count();
 	if (docSelectionCount == 0)
 		return;
+	UndoTransaction trans(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipH, 0, Um::IFlipH));
 	if (docSelectionCount > 1)
 	{
-		UndoTransaction trans(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipH, 0, Um::IFlipH));
 		double gx, gy, gh, gw, ix, iy, iw, ih;
 		m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 		for (uint a = 0; a < docSelectionCount; ++a)
@@ -10182,55 +10159,52 @@
 				emit updateEditItem();
 			currItem->setRedrawBounding();
 		}
-		trans.commit();
 	}
 	else
 	{
-		for (uint a = 0; a < docSelectionCount; ++a)
-		{
-			PageItem* currItem=m_Selection->itemAt(a);
-			if (currItem->isImageFrame() || currItem->isTextFrame() || currItem->isLatexFrame() || currItem->isOSGFrame() || currItem->isSymbol() || currItem->isGroup() || currItem->isSpiral())
-				currItem->flipImageH();
-			if (currItem->itemType() != PageItem::Line)
-				MirrorPolyH(currItem);
-			else
-			{
-				double ix2, iy2, iw2, ih2, ix, iy, iw, ih;
-				currItem->getBoundingRect(&ix, &iy, &iw, &ih);
-				currItem->rotateBy(currItem->rotation() * -2.0);
-				currItem->setRedrawBounding();
-				currItem->getBoundingRect(&ix2, &iy2, &iw2, &ih2);
-				currItem->moveBy(ix-ix2, iy-iy2, true);
-				currItem->setRedrawBounding();
-			}
-			currItem->GrStartX = currItem->width() - currItem->GrStartX;
-			currItem->GrEndX = currItem->width() - currItem->GrEndX;
-			if (currItem->isArc())
-			{
-				PageItem_Arc *ar = currItem->asArc();
-				ar->arcStartAngle = (180 - ar->arcStartAngle) - ar->arcSweepAngle;
-				if (ar->arcStartAngle < 0)
-					ar->arcStartAngle += 360;
-				else if (ar->arcStartAngle > 360)
-					ar->arcStartAngle -= 360;
-				ar->recalcPath();
-				FPoint tp2(getMinClipF(&currItem->PoLine));
-				currItem->PoLine.translate(-tp2.x(), -tp2.y());
-				AdjustItemSize(currItem);
-				emit updateEditItem();
-			}
-			else if (currItem->isRegularPolygon())
-			{
-				PageItem_RegularPolygon *ar = currItem->asRegularPolygon();
-				ar->polyRotation *= -1;
-				ar->polyInnerRot *= -1;
-				ar->recalcPath();
-				emit updateEditItem();
-			}
-			else if (currItem->isSpiral())
-				emit updateEditItem();
-		}
-	}
+		PageItem* currItem=m_Selection->itemAt(0);
+		if (currItem->isImageFrame() || currItem->isTextFrame() || currItem->isLatexFrame() || currItem->isOSGFrame() || currItem->isSymbol() || currItem->isGroup() || currItem->isSpiral())
+			currItem->flipImageH();
+		if (currItem->itemType() != PageItem::Line)
+			MirrorPolyH(currItem);
+		else
+		{
+			double ix2, iy2, iw2, ih2, ix, iy, iw, ih;
+			currItem->getBoundingRect(&ix, &iy, &iw, &ih);
+			currItem->rotateBy(currItem->rotation() * -2.0);
+			currItem->setRedrawBounding();
+			currItem->getBoundingRect(&ix2, &iy2, &iw2, &ih2);
+			currItem->moveBy(ix-ix2, iy-iy2, true);
+			currItem->setRedrawBounding();
+		}
+		currItem->GrStartX = currItem->width() - currItem->GrStartX;
+		currItem->GrEndX = currItem->width() - currItem->GrEndX;
+		if (currItem->isArc())
+		{
+			PageItem_Arc *ar = currItem->asArc();
+			ar->arcStartAngle = (180 - ar->arcStartAngle) - ar->arcSweepAngle;
+			if (ar->arcStartAngle < 0)
+				ar->arcStartAngle += 360;
+			else if (ar->arcStartAngle > 360)
+				ar->arcStartAngle -= 360;
+			ar->recalcPath();
+			FPoint tp2(getMinClipF(&currItem->PoLine));
+			currItem->PoLine.translate(-tp2.x(), -tp2.y());
+			AdjustItemSize(currItem);
+			emit updateEditItem();
+		}
+		else if (currItem->isRegularPolygon())
+		{
+			PageItem_RegularPolygon *ar = currItem->asRegularPolygon();
+			ar->polyRotation *= -1;
+			ar->polyInnerRot *= -1;
+			ar->recalcPath();
+			emit updateEditItem();
+		}
+		else if (currItem->isSpiral())
+			emit updateEditItem();
+	}
+	trans.commit();
 	regionsChanged()->update(QRectF());
 	changed();
 	emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
@@ -10242,9 +10216,9 @@
 	uint docSelectionCount=m_Selection->count();
 	if (docSelectionCount == 0)
 		return;
+	UndoTransaction trans(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipV, 0, Um::IFlipV));
 	if (docSelectionCount > 1)
 	{
-		UndoTransaction trans(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipV, 0, Um::IFlipV));
 		double gx, gy, gh, gw, ix, iy, iw, ih;
 		m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 		for (uint a = 0; a < docSelectionCount; ++a)
@@ -10297,58 +10271,55 @@
 			currItem->setRedrawBounding();
 		}
 		regionsChanged()->update(QRectF());
-		trans.commit();
 	}
 	else
 	{
-		for (uint a = 0; a < docSelectionCount; ++a)
-		{
-			PageItem* currItem=m_Selection->itemAt(a);
-			if (currItem->isImageFrame() || currItem->isTextFrame() || currItem->isLatexFrame() || currItem->isOSGFrame() || currItem->isSymbol() || currItem->isGroup() || currItem->isSpiral())
-				currItem->flipImageV();
-			if (currItem->itemType() != PageItem::Line)
-				MirrorPolyV(currItem);
-			else
-			{
-				double ix2, iy2, iw2, ih2, ix, iy, iw, ih;
-				currItem->getBoundingRect(&ix, &iy, &iw, &ih);
-				currItem->rotateBy(currItem->rotation() * -2.0);
-				currItem->setRedrawBounding();
-				currItem->getBoundingRect(&ix2, &iy2, &iw2, &ih2);
-				currItem->moveBy(ix-ix2, iy-iy2, true);
-				currItem->setRedrawBounding();
-			}
-			currItem->GrStartY = currItem->height() - currItem->GrStartY;
-			currItem->GrEndY = currItem->height() - currItem->GrEndY;
-			if (currItem->isArc())
-			{
-				PageItem_Arc *ar = currItem->asArc();
-				ar->arcStartAngle *= -1;
-				ar->arcStartAngle -= ar->arcSweepAngle;
-				if (ar->arcStartAngle < 0)
-					ar->arcStartAngle += 360;
-				else if (ar->arcStartAngle > 360)
-					ar->arcStartAngle -= 360;
-				ar->recalcPath();
-				FPoint tp2(getMinClipF(&currItem->PoLine));
-				currItem->PoLine.translate(-tp2.x(), -tp2.y());
-				AdjustItemSize(currItem);
-				emit updateEditItem();
-			}
-			else if (currItem->isRegularPolygon())
-			{
-				PageItem_RegularPolygon *ar = currItem->asRegularPolygon();
-				ar->polyRotation = 180.0 - ar->polyRotation;
-				ar->polyRotation *= -1;
-				ar->polyInnerRot *= -1;
-				ar->recalcPath();
-				emit updateEditItem();
-			}
-			else if (currItem->isSpiral())
-				emit updateEditItem();
-		}
+		PageItem* currItem=m_Selection->itemAt(0);
+		if (currItem->isImageFrame() || currItem->isTextFrame() || currItem->isLatexFrame() || currItem->isOSGFrame() || currItem->isSymbol() || currItem->isGroup() || currItem->isSpiral())
+			currItem->flipImageV();
+		if (currItem->itemType() != PageItem::Line)
+			MirrorPolyV(currItem);
+		else
+		{
+			double ix2, iy2, iw2, ih2, ix, iy, iw, ih;
+			currItem->getBoundingRect(&ix, &iy, &iw, &ih);
+			currItem->rotateBy(currItem->rotation() * -2.0);
+			currItem->setRedrawBounding();
+			currItem->getBoundingRect(&ix2, &iy2, &iw2, &ih2);
+			currItem->moveBy(ix-ix2, iy-iy2, true);
+			currItem->setRedrawBounding();
+		}
+		currItem->GrStartY = currItem->height() - currItem->GrStartY;
+		currItem->GrEndY = currItem->height() - currItem->GrEndY;
+		if (currItem->isArc())
+		{
+			PageItem_Arc *ar = currItem->asArc();
+			ar->arcStartAngle *= -1;
+			ar->arcStartAngle -= ar->arcSweepAngle;
+			if (ar->arcStartAngle < 0)
+				ar->arcStartAngle += 360;
+			else if (ar->arcStartAngle > 360)
+				ar->arcStartAngle -= 360;
+			ar->recalcPath();
+			FPoint tp2(getMinClipF(&currItem->PoLine));
+			currItem->PoLine.translate(-tp2.x(), -tp2.y());
+			AdjustItemSize(currItem);
+			emit updateEditItem();
+		}
+		else if (currItem->isRegularPolygon())
+		{
+			PageItem_RegularPolygon *ar = currItem->asRegularPolygon();
+			ar->polyRotation = 180.0 - ar->polyRotation;
+			ar->polyRotation *= -1;
+			ar->polyInnerRot *= -1;
+			ar->recalcPath();
+			emit updateEditItem();
+		}
+		else if (currItem->isSpiral())
+			emit updateEditItem();
 		regionsChanged()->update(QRectF());
 	}
+	trans.commit();
 	changed();
 	emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
 }
@@ -10376,6 +10347,9 @@
 	uint selectedItemCount=m_Selection->count();
 	if (selectedItemCount != 0)
 	{
+		UndoTransaction* activeTransaction = NULL;
+		if(UndoManager::undoEnabled())
+			activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::Selection, Um::IGroup,Um::ResTyp, "", Um::IImageFrame));
 		PageItem *currItem;
 		bool found=false;
 		for (uint i = 0; i < selectedItemCount; ++i)
@@ -10384,23 +10358,20 @@
 			if (currItem!=NULL)
 				if (currItem->asImageFrame())
 				{
-					currItem->pixm.imgInfo.lowResType = id;
+					currItem->setResolution(id);
 					if (!found)
 						found=true;
 				}
 		}
+		if(activeTransaction)
+		{
+			activeTransaction->commit();
+			delete activeTransaction;
+			activeTransaction = NULL;
+		}
 		if (!found) //No image frames in the current selection!
 			return;
 		updatePic();
-		disconnect( m_ScMW->scrActions["itemPreviewLow"], SIGNAL(triggeredData(int)) , 0, 0 );
-		disconnect( m_ScMW->scrActions["itemPreviewNormal"], SIGNAL(triggeredData(int)) , 0, 0 );
-		disconnect( m_ScMW->scrActions["itemPreviewFull"], SIGNAL(triggeredData(int)) , 0, 0 );
-		m_ScMW->scrActions["itemPreviewLow"]->setChecked(id==m_ScMW->scrActions["itemPreviewLow"]->actionInt());
-		m_ScMW->scrActions["itemPreviewNormal"]->setChecked(id==m_ScMW->scrActions["itemPreviewNormal"]->actionInt());
-		m_ScMW->scrActions["itemPreviewFull"]->setChecked(id==m_ScMW->scrActions["itemPreviewFull"]->actionInt());
-		connect( m_ScMW->scrActions["itemPreviewLow"], SIGNAL(triggeredData(int)), this, SLOT(itemSelection_ChangePreviewResolution(int)) );
-		connect( m_ScMW->scrActions["itemPreviewNormal"], SIGNAL(triggeredData(int)), this, SLOT(itemSelection_ChangePreviewResolution(int)) );
-		connect( m_ScMW->scrActions["itemPreviewFull"], SIGNAL(triggeredData(int)), this, SLOT(itemSelection_ChangePreviewResolution(int)) );
 	}
 }
 
@@ -10831,6 +10802,9 @@
 	uint selectedItemCount=m_Selection->count();
 	if (selectedItemCount != 0)
 	{
+		UndoTransaction* activeTransaction = NULL;
+		if (UndoManager::undoEnabled())
+			activeTransaction = new UndoTransaction(undoManager->beginTransaction());
 		for (uint i = 0; i < selectedItemCount; ++i)
 		{
 			PageItem *currItem = m_Selection->itemAt(i);
@@ -10840,6 +10814,16 @@
 		}
 		regionsChanged()->update(QRectF());
 		changed();
+		if (activeTransaction)
+		{
+			activeTransaction->commit(Um::Selection,
+									  Um::IGroup,
+									  Um::BlendMode,
+									  "",
+									  Um::IGroup);
+			delete activeTransaction;
+			activeTransaction = NULL;
+		}
 	}
 }
 
@@ -10849,6 +10833,9 @@
 	uint selectedItemCount=m_Selection->count();
 	if (selectedItemCount != 0)
 	{
+		UndoTransaction* activeTransaction = NULL;
+		if (UndoManager::undoEnabled())
+			activeTransaction = new UndoTransaction(undoManager->beginTransaction());
 		for (uint i = 0; i < selectedItemCount; ++i)
 		{
 			PageItem *currItem = m_Selection->itemAt(i);
@@ -10856,6 +10843,16 @@
 		}
 		regionsChanged()->update(QRectF());
 		changed();
+		if (activeTransaction)
+		{
+			activeTransaction->commit(Um::Selection,
+									  Um::IGroup,
+									  Um::BlendMode,
+									  "",
+									  Um::IGroup);
+			delete activeTransaction;
+			activeTransaction = NULL;
+		}
 	}
 }
 
@@ -10931,11 +10928,24 @@
 	if (selectedItemCount == 0)
 		return;
 	m_updateManager.setUpdatesDisabled();
+	UndoTransaction* activeTransaction = NULL;
+	if (UndoManager::undoEnabled())
+		activeTransaction = new UndoTransaction(undoManager->beginTransaction());
 	for (uint i = 0; i < selectedItemCount; ++i)
 	{
 		PageItem* currItem = itemSelection->itemAt(i);
 		currItem->setOverprint(overprint);
 		currItem->update();
+	}
+	if (activeTransaction)
+	{
+		activeTransaction->commit(Um::Selection,
+								  Um::IGroup,
+								  Um::Overprint,
+								  "",
+								  Um::IGroup);
+		delete activeTransaction;
+		activeTransaction = NULL;
 	}
 	m_updateManager.setUpdatesEnabled();
 	changed();
@@ -11297,12 +11307,15 @@
 	double width=AObjects[i].x2-AObjects[i].x1;
 	bool resize = (how == alignByResizing && diff > -width);
 	for (int j = 0; j < AObjects[i].Objects.count(); ++j)
-		if (!AObjects[i].Objects.at(j)->locked()) {
-			if (resize) {
+		if (!AObjects[i].Objects.at(j)->locked())
+		{
+			if (resize)
+			{
 				AObjects[i].Objects.at(j)->resizeBy(diff, 0.0);
 				AObjects[i].Objects.at(j)->updateClip();
 			}
-			else AObjects[i].Objects.at(j)->moveBy(diff, 0.0);
+			else
+				AObjects[i].Objects.at(j)->moveBy(diff, 0.0);
 		}
 }
 
@@ -11312,9 +11325,11 @@
 	double width=AObjects[i].x2-AObjects[i].x1;
 	bool resize = (how == alignByResizing && -diff > -width);
 	for (int j = 0; j < AObjects[i].Objects.count(); ++j)
-		if (!AObjects[i].Objects.at(j)->locked()) {
+		if (!AObjects[i].Objects.at(j)->locked())
+		{
 			AObjects[i].Objects.at(j)->moveBy(diff, 0.0);
-			if (resize) {
+			if (resize)
+			{
 				AObjects[i].Objects.at(j)->resizeBy(-diff, 0.0);
 				AObjects[i].Objects.at(j)->updateClip();
 			}
@@ -11327,8 +11342,10 @@
 	double height=AObjects[i].y2-AObjects[i].y1;
 	bool resize = (how == alignByResizing && diff > -height);
 	for (int j = 0; j < AObjects[i].Objects.count(); ++j)
-		if (!AObjects[i].Objects.at(j)->locked()) {
-			if (resize) {
+		if (!AObjects[i].Objects.at(j)->locked())
+		{
+			if (resize)
+			{
 				AObjects[i].Objects.at(j)->resizeBy(0.0, diff);
 				AObjects[i].Objects.at(j)->updateClip();
 			}
@@ -11342,9 +11359,11 @@
 	double height=AObjects[i].y2-AObjects[i].y1;
 	bool resize = (how == alignByResizing && -diff > -height);
 	for (int j = 0; j < AObjects[i].Objects.count(); ++j)
-		if (!AObjects[i].Objects.at(j)->locked()) {
+		if (!AObjects[i].Objects.at(j)->locked())
+		{
 			AObjects[i].Objects.at(j)->moveBy(0.0, diff);
-			if (resize) {
+			if (resize)
+			{
 				AObjects[i].Objects.at(j)->resizeBy(0.0, -diff);
 				AObjects[i].Objects.at(j)->updateClip();
 			}
@@ -14025,7 +14044,7 @@
 	itemList.append(groupItem);
 }
 
-const PageItem * ScribusDoc::itemSelection_GroupObjects(bool changeLock, bool lock, Selection* customSelection)
+PageItem * ScribusDoc::itemSelection_GroupObjects(bool changeLock, bool lock, Selection* customSelection)
 {
 	Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
 	if (itemSelection->count() < 1)
@@ -14036,36 +14055,21 @@
 	PageItem *currItem;
 	PageItem* bb;
 	double x, y, w, h;
+	UndoTransaction activeTransaction(undoManager->beginTransaction(Um::Selection,Um::IGroup,Um::Group,"",Um::IGroup));
 	uint selectedItemCount = itemSelection->count();
 	QString tooltip = Um::ItemsInvolved + "\n";
 	if (selectedItemCount > Um::ItemsInvolvedLimit)
 		tooltip = Um::ItemsInvolved2 + "\n";
 	if (changeLock)
 	{
-		uint lockedCount=0;
-		for (uint a=0; a<selectedItemCount; ++a)
-		{
-			if (itemSelection->itemAt(a)->locked())
-				++lockedCount;
-		}
-		if (lockedCount!=0 && lockedCount!=selectedItemCount)
-		{
-			for (uint a=0; a<selectedItemCount; ++a)
-			{
-				currItem = itemSelection->itemAt(a);
-				if (currItem->locked())
-				{
-					for (uint c=0; c < selectedItemCount; ++c)
-					{
-						bb = itemSelection->itemAt(c);
-						bb->setLocked(lock);
-						if (m_ScMW && ScCore->usingGUI())
-							m_ScMW->scrActions["itemLock"]->setChecked(lock);
-						if (selectedItemCount <= Um::ItemsInvolvedLimit)
-							tooltip += "\t" + currItem->getUName() + "\n";
-					}
-				}
-			}
+		for (uint c=0; c < selectedItemCount; ++c)
+		{
+			bb = itemSelection->itemAt(c);
+			bb->setLocked(lock);
+			//if (m_ScMW && ScCore->usingGUI())
+			//	m_ScMW->scrActions["itemLock"]->setChecked(lock);
+			if (selectedItemCount <= Um::ItemsInvolvedLimit)
+				tooltip += "\t" + currItem->getUName() + "\n";
 		}
 	}
 	itemSelection->getVisualGroupRect(&x, &y, &w, &h);
@@ -14115,18 +14119,17 @@
 		currItem->Parent = groupItem;
 	}
 	groupItem->asGroupFrame()->adjustXYPosition();
+
+	ScItemState<QList<QPointer<PageItem> > > *is = new ScItemState<QList<QPointer<PageItem> > >(UndoManager::Group);
+	is->set("GROUP", "group");
+	itemSelection->addItem(groupItem,true);
+	is->setItem(itemSelection->selectionList());
+	undoManager->action(this, is);
+	activeTransaction.commit();
+
 	itemSelection->clear();
 	itemSelection->addItem(groupItem);
-	selectedItemCount = groupItem->groupItemList.count();
-	SimpleState *ss = new SimpleState(Um::Group, tooltip);
-	ss->set("GROUP", "group");
-	ss->set("itemcount", selectedItemCount + 1);
-	ss->set(QString("item%1").arg(0), groupItem->uniqueNr);
-	for (int a = 0; a < groupItem->groupItemList.count(); ++a)
-	{
-		currItem = groupItem->groupItemList.at(a);
-		ss->set(QString("item%1").arg(a + 1), currItem->uniqueNr);
-	}
+
 	GroupCounter++;
 	regionsChanged()->update(QRectF(gx-5, gy-5, gw+10, gh+10));
 	emit docChanged();
@@ -14136,7 +14139,6 @@
 		m_ScMW->scrActions["itemGroup"]->setEnabled(false);
 		m_ScMW->scrActions["itemUngroup"]->setEnabled(true);
 	}
-	undoManager->action(this, ss, Um::SelectionGroup, Um::IGroup);
 	return groupItem;
 }
 
@@ -14147,6 +14149,7 @@
 	{
 		uint docSelectionCount = itemSelection->count();
 		PageItem *currItem;
+		UndoTransaction activeTransaction(undoManager->beginTransaction(Um::Selection,Um::IGroup,Um::Ungroup,"",Um::IGroup));
 		QList<PageItem*> toDelete;
 		for (uint a=0; a < docSelectionCount; ++a)
 		{
@@ -14218,6 +14221,13 @@
 				setRedrawBounding(rItem);
 				rItem->OwnPage = OnPage(rItem);
 			}
+
+			ScItemState<QList<QPointer<PageItem> > > *is = new ScItemState<QList<QPointer<PageItem> > >(UndoManager::Ungroup);
+			is->set("UNGROUP", "ungroup");
+			tempSelection.addItem(currItem,true);
+			is->setItem(tempSelection.selectionList());
+			undoManager->action(this, is);
+
 			tempSelection.clear();
 			tempSelection.delaySignalsOff();
 		/*	currItem = toDelete.at(b);
@@ -14250,14 +14260,9 @@
 			currItem = toDelete.at(0);
 			delete currItem;
 		}
-
-		// Create undo actions
-/*		UndoTransaction* undoTransaction = NULL;
-		if (UndoManager::undoEnabled() && toDelete.count() > 1)
-		{
-			undoTransaction = new UndoTransaction(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::Ungroup, "", Um::IGroup));
-		}
-		QMap<int, QList<PageItem*> >::iterator groupIt;
+		activeTransaction.commit();
+
+/*		QMap<int, QList<PageItem*> >::iterator groupIt;
 		for (it = toDelete.begin(); it != toDelete.end(); ++it)
 		{
 //			PageItem* groupItem = it.key();
@@ -14266,32 +14271,7 @@
 			if (groupIt == groupObjects.end()) 
 				continue;
 			QList<PageItem*> groupItems = groupIt.value();
-
-			docSelectionCount = groupItems.count();
-			SimpleState *ss = new SimpleState(Um::Ungroup);
-			ss->set("UNGROUP", "ungroup");
-			ss->set("itemcount", docSelectionCount);
-			QString tooltip = Um::ItemsInvolved + "\n";
-			if (docSelectionCount > Um::ItemsInvolvedLimit)
-				tooltip = Um::ItemsInvolved2 + "\n";
-			for (uint a=0; a < docSelectionCount; ++a)
-			{
-				currItem = groupItems.at(a);
-				ss->set(QString("item%1").arg(a), currItem->uniqueNr);
-				ss->set(QString("tableitem%1").arg(a), currItem->isTableItem);
-				if (docSelectionCount <= Um::ItemsInvolvedLimit)
-					tooltip += "\t" + currItem->getUName() + "\n";
-				currItem->isTableItem = false;
-				currItem->setSelected(true);
-			}
-			undoManager->action(this, ss, Um::SelectionGroup, Um::IGroup);
-		}
-		if (undoTransaction)
-		{
-			undoTransaction->commit();
-			delete undoTransaction;
-			undoTransaction = NULL;
-		} */
+		}*/
 		double x, y, w, h;
 		itemSelection->connectItemToGUI();
 		itemSelection->getGroupRect(&x, &y, &w, &h);

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Wed Jun 27 19:08:13 2012
@@ -739,7 +739,6 @@
 	 * @brief Undo function for grouping/ungrouping
 	 */
 	void restoreGrouping(SimpleState *state, bool isUndo);
-	void restoreUngrouping(SimpleState *state, bool isUndo);
 	/**
 	 * @brief Undo function for level
 	 */
@@ -1015,7 +1014,7 @@
 	PageItem* groupObjectsSelection(Selection* customSelection=0);
 	PageItem* groupObjectsList(QList<PageItem*> &itemList);
 	void groupObjectsToItem(PageItem* groupItem, QList<PageItem*> &itemList);
-	const PageItem * itemSelection_GroupObjects  (bool changeLock, bool lock, Selection* customSelection=0);
+	PageItem * itemSelection_GroupObjects  (bool changeLock, bool lock, Selection* customSelection=0);
 	void itemSelection_UnGroupObjects(Selection* customSelection=0);
 	void addToGroup(PageItem* group, PageItem* item);
 	void removeFromGroup(PageItem* item);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Wed Jun 27 19:08:13 2012
@@ -1833,13 +1833,16 @@
 	{
 		for (uint a = 0; a < docSelectionCount; ++a)
 		{
+			UndoTransaction* activeTransaction = NULL;
+			if (UndoManager::undoEnabled())
+				activeTransaction = new UndoTransaction(undoManager->beginTransaction());
 			PageItem* currItem = Doc->m_Selection->itemAt(a);
 			if (currItem->asTextFrame())
 			{
 				if (currItem->OwnPage != -1)
 				{
 					bool old = currItem->isBookmark;
-					currItem->isBookmark = !currItem->isBookmark;
+					currItem->setIsBookMark(!currItem->isBookmark);
 					if (currItem->isBookmark)
 					{
 						currItem->setIsAnnotation(false);
@@ -1852,6 +1855,15 @@
 					}
 				}
 			}
+			if (activeTransaction){
+				activeTransaction->commit(Um::Selection,
+										  Um::IGroup,
+										  Um::ActionPDF,
+										  "",
+										  Um::IGroup);
+				delete activeTransaction;
+				activeTransaction = NULL;
+			}
 		}
 		m_ScMW->actionManager->setPDFActions(this);
 		emit DocChanged();
@@ -1865,6 +1877,9 @@
 	{
 		for (int a = 0; a < Doc->m_Selection->count(); ++a)
 		{
+			UndoTransaction* activeTransaction = NULL;
+			if (UndoManager::undoEnabled())
+				activeTransaction = new UndoTransaction(undoManager->beginTransaction());
 			PageItem* currItem = Doc->m_Selection->itemAt(a);
 			if (currItem->asTextFrame())
 			{
@@ -1883,6 +1898,15 @@
 						emit DelBM(currItem);
 					currItem->isBookmark = false;
 				}
+			}
+			if (activeTransaction){
+				activeTransaction->commit(Um::Selection,
+										  Um::IGroup,
+										  Um::ActionPDF,
+										  "",
+										  Um::IGroup);
+				delete activeTransaction;
+				activeTransaction = NULL;
 			}
 		}
 		m_ScMW->actionManager->setPDFActions(this);

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.cpp Wed Jun 27 19:08:13 2012
@@ -143,17 +143,8 @@
 {
 	PageItem *currentItem = NULL;
 
-	if (m_doc)
-	{
-		if (m_doc->m_Selection->count() > 1)
-		{
-			currentItem = m_doc->m_Selection->itemAt(0);
-		}
-		else if (m_doc->m_Selection->count() == 1)
-		{
-			currentItem = m_doc->m_Selection->itemAt(0);
-		}
-	}
+	if (m_doc && m_doc->m_Selection->count()>0)
+		currentItem = m_doc->m_Selection->itemAt(0);
 
 	return currentItem;
 }

Modified: trunk/Scribus/scribus/undomanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/undomanager.cpp
==============================================================================
--- trunk/Scribus/scribus/undomanager.cpp (original)
+++ trunk/Scribus/scribus/undomanager.cpp Wed Jun 27 19:08:13 2012
@@ -844,6 +844,9 @@
 	UndoManager::MoveHGuide         = tr("Move horizontal guide");
 	UndoManager::LockGuides         = tr("Lock guides");
 	UndoManager::UnlockGuides       = tr("Unlock guides");
+	UndoManager::Overprint          = tr("Change overprint");
+	UndoManager::BlendMode          = tr("Change blend mode");
+	UndoManager::ActionPDF          = tr("Change action PDF");
 	UndoManager::Move               = tr("Move");
 	UndoManager::NewMasterPage      = tr("Add master page");
 	UndoManager::DelMasterPage      = tr("Del master page");
@@ -880,6 +883,7 @@
 	UndoManager::FlipH              = tr("Flip horizontally");
 	UndoManager::FlipV              = tr("Flip vertically");
 	UndoManager::Lock               = tr("Lock");
+	UndoManager::ResTyp             = tr("Change image resolution");
 	UndoManager::UnLock             = tr("Unlock");
 	UndoManager::SizeLock           = tr("Lock size");
 	UndoManager::SizeUnLock         = tr("Unlock size");
@@ -892,6 +896,7 @@
 	UndoManager::ApplyMasterPage    = tr("Apply Master Page");
 	UndoManager::Paste              = tr("Paste");
 	UndoManager::Cut                = tr("Cut");
+	UndoManager::RoundCorner        = tr("Change round corner");
 	UndoManager::Transparency       = tr("Set fill color transparency");
 	UndoManager::LineTransparency   = tr("Set line color transparency");
 	UndoManager::LineStyle          = tr("Set line style");
@@ -949,6 +954,7 @@
 	UndoManager::NoObjectFrame      = tr("No object frame");
 	UndoManager::NoBoundingBox      = tr("No bounding box");
 	UndoManager::NoContourLine      = tr("No contour line");
+	UndoManager::ShowImage          = tr("Show image");
 	UndoManager::PageNmbr           = tr("Page %1");
 	UndoManager::ImageScaling       = tr("Set image scaling");
 	UndoManager::FrameSize          = tr("Frame size");
@@ -1083,6 +1089,9 @@
 QString UndoManager::SplitItem          = "";
 QString UndoManager::LockGuides         = "";
 QString UndoManager::UnlockGuides       = "";
+QString UndoManager::Overprint          = "";
+QString UndoManager::BlendMode          = "";
+QString UndoManager::ActionPDF          = "";
 QString UndoManager::Move               = "";
 QString UndoManager::NewMasterPage      = "";
 QString UndoManager::ImportMasterPage   = "";
@@ -1093,6 +1102,8 @@
 QString UndoManager::MoveFromTo         = "";
 QString UndoManager::ImageOffset        = "";
 QString UndoManager::ImageScale         = "";
+QString UndoManager::ResTyp             = "";
+QString UndoManager::ShowImage          = "";
 QString UndoManager::ImageOffsetFromTo  = "";
 QString UndoManager::ImageScaleFromTo   = "";
 QString UndoManager::ResizeFromTo       = "";
@@ -1100,6 +1111,7 @@
 QString UndoManager::Group              = "";
 QString UndoManager::SelectionGroup     = "";
 QString UndoManager::Create             = "";
+QString UndoManager::RoundCorner        = "";
 QString UndoManager::CreateTo           = "";
 QString UndoManager::AlignDistribute    = "";
 QString UndoManager::ItemsInvolved      = "";

Modified: trunk/Scribus/scribus/undomanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17644&path=/trunk/Scribus/scribus/undomanager.h
==============================================================================
--- trunk/Scribus/scribus/undomanager.h (original)
+++ trunk/Scribus/scribus/undomanager.h Wed Jun 27 19:08:13 2012
@@ -451,6 +451,9 @@
 	static QString MoveVGuide;
 	static QString MoveHGuide;
 	static QString UniteItem;
+	static QString Overprint;
+	static QString BlendMode;
+	static QString ActionPDF;
 	static QString SplitItem;
 	static QString RemoveAllGuides;
 	static QString RemoveAllPageGuides;
@@ -530,12 +533,15 @@
 	static QString ImageFrame;
 	static QString TextFrame;
 	static QString LatexFrame;
+	static QString ResTyp;
 	static QString Polygon;
 	static QString BezierCurve;
+	static QString ShowImage;
 	static QString Polyline;
 	static QString PathText;
 	static QString ConvertTo;
 	static QString ImportSVG;
+	static QString RoundCorner;
 	static QString ImportUniconv;
 	static QString ImportEPS;
 	static QString ImportBarcode;




More information about the scribus-commit mailing list