r17021 by jghali - merge trunk revisions up to r17001

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 24 22:37:34 UTC 2011


Author: jghali
Date: Thu Nov 24 22:37:33 2011
New Revision: 17021

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17021
Log:
merge trunk revisions up to r17001

Added:
    branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
      - copied unchanged from r17000, trunk/Scribus/scribus/ui/propertywidget_dropcap.cpp
    branches/ScribusOIF/scribus/ui/propertywidget_dropcap.h
      - copied unchanged from r17000, trunk/Scribus/scribus/ui/propertywidget_dropcap.h
    branches/ScribusOIF/scribus/ui/propertywidget_dropcapbase.ui
      - copied unchanged from r17000, trunk/Scribus/scribus/ui/propertywidget_dropcapbase.ui
Modified:
    branches/ScribusOIF/scribus/CMakeLists.txt
    branches/ScribusOIF/scribus/actionmanager.cpp
    branches/ScribusOIF/scribus/canvas.cpp
    branches/ScribusOIF/scribus/canvas.h
    branches/ScribusOIF/scribus/canvasgesture_resize.cpp
    branches/ScribusOIF/scribus/canvasmode_normal.cpp
    branches/ScribusOIF/scribus/fileloader.cpp
    branches/ScribusOIF/scribus/pageitem.cpp
    branches/ScribusOIF/scribus/pageitem_group.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    branches/ScribusOIF/scribus/prefsmanager.cpp
    branches/ScribusOIF/scribus/prefsstructs.h
    branches/ScribusOIF/scribus/scribus.cpp
    branches/ScribusOIF/scribus/scribus.h
    branches/ScribusOIF/scribus/scribusdoc.cpp
    branches/ScribusOIF/scribus/scribusdoc.h
    branches/ScribusOIF/scribus/styles/paragraphstyle.attrdefs.cxx
    branches/ScribusOIF/scribus/text/storytext.cpp
    branches/ScribusOIF/scribus/ui/annot.cpp
    branches/ScribusOIF/scribus/ui/masterpagepalette.cpp
    branches/ScribusOIF/scribus/ui/masterpagepalette.h
    branches/ScribusOIF/scribus/ui/outlinepalette.cpp
    branches/ScribusOIF/scribus/ui/outlinepalette.h
    branches/ScribusOIF/scribus/ui/prefs_guides.cpp
    branches/ScribusOIF/scribus/ui/prefs_guides.h
    branches/ScribusOIF/scribus/ui/prefs_guidesbase.ui
    branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette_text.h
    branches/ScribusOIF/scribus/ui/rulermover.cpp
    branches/ScribusOIF/scribus/ui/smpstylewidget.cpp
    branches/ScribusOIF/scribus/ui/smpstylewidget.h
    branches/ScribusOIF/scribus/ui/smpstylewidget.ui
    branches/ScribusOIF/scribus/ui/smtextstyles.cpp
    branches/ScribusOIF/scribus/ui/smtextstyles.h
    branches/ScribusOIF/scribus/util_math.cpp
    branches/ScribusOIF/scribus/util_math.h
    branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj

Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Thu Nov 24 22:37:33 2011
@@ -135,6 +135,7 @@
   ui/propertywidget_colorbase.ui
   ui/propertywidget_colortransbase.ui
   ui/propertywidget_distancebase.ui
+  ui/propertywidget_dropcapbase.ui
   ui/propertywidget_flopbase.ui
   ui/propertywidget_imagebase.ui
   ui/propertywidget_linebase.ui
@@ -394,6 +395,7 @@
   ui/propertywidget_color.h
   ui/propertywidget_colortrans.h
   ui/propertywidget_distance.h
+  ui/propertywidget_dropcap.h
   ui/propertywidget_flop.h
   ui/propertywidget_group.h
   ui/propertywidget_groupshape.h
@@ -829,6 +831,7 @@
   ui/propertywidget_color.cpp
   ui/propertywidget_colortrans.cpp
   ui/propertywidget_distance.cpp
+  ui/propertywidget_dropcap.cpp
   ui/propertywidget_flop.cpp
   ui/propertywidget_image.cpp
   ui/propertywidget_group.cpp

Modified: branches/ScribusOIF/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/actionmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/actionmanager.cpp (original)
+++ branches/ScribusOIF/scribus/actionmanager.cpp Thu Nov 24 22:37:33 2011
@@ -165,10 +165,8 @@
 	connect( (*scrActions)["PrintPreview"], SIGNAL(triggered()), mainWindow, SLOT(printPreview()) );
 	connect( (*scrActions)["fileSave"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSave()) );
 	connect( (*scrActions)["fileSaveAs"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSaveAs()) );
-//	connect( (*scrActions)["fileDocSetup"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup()) );
-	connect( (*scrActions)["fileDocSetup150"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup150()) );
-//	connect( (*scrActions)["filePreferences"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefsOrg()) );
-	connect( (*scrActions)["filePreferences150"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefs150Org()) );
+	connect( (*scrActions)["fileDocSetup150"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup()) );
+	connect( (*scrActions)["filePreferences150"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefsOrg()) );
 	connect( (*scrActions)["fileRevert"], SIGNAL(triggered()), mainWindow, SLOT(slotFileRevert()) );
 	connect( (*scrActions)["fileCollect"], SIGNAL(triggered()), mainWindow, SLOT(fileCollect()) );
 	connect( (*scrActions)["fileQuit"], SIGNAL(triggered()), mainWindow, SLOT(slotFileQuit()) );
@@ -1163,7 +1161,6 @@
 	connect( (*scrActions)["itemsUnWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UnWeld()) );
 	connect( (*scrActions)["itemWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_Weld()) );
 	connect( (*scrActions)["itemEditWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_EditWeld()) );
-
 }
 
 void ActionManager::disconnectNewViewActions()
@@ -1924,7 +1921,7 @@
 		<< "itemTransform" 
 		<< "itemDelete" 
 		<< "itemGroup" 
-		<< "itemUngroup" 
+		<< "itemUngroup"
 		<< "itemLock" 
 		<< "itemLockSize" 
 		<< "itemImageIsVisible" 

Modified: branches/ScribusOIF/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/canvas.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvas.cpp (original)
+++ branches/ScribusOIF/scribus/canvas.cpp Thu Nov 24 22:37:33 2011
@@ -981,12 +981,10 @@
 	ScLayer layer;
 	layer.isViewable = false;
 	layer.ID = 0;
-	
-//	Tsetup = tim.elapsed();
+
 	if (!m_doc->masterPageMode())
 	{
 		drawBackgroundPageOutlines(painter, clipx, clipy, clipw, cliph);
-//		Toutlines= tim.elapsed();
 		if (m_viewMode.viewAsPreview)
 		{
 			FPointArray PoLine;
@@ -997,51 +995,90 @@
 			painter->beginLayer(1.0, 0);
 		
 		m_viewMode.linkedFramesToShow.clear();
-		if ((m_doc->guidesPrefs().guidePlacement) && (!m_viewMode.viewAsPreview))
-		{
-			drawGuides(painter, clipx, clipy, clipw, cliph);
-		}
-		int layerCount = m_doc->layerCount();
-		for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
-		{
-			m_doc->Layers.levelToLayer(layer, layerLevel);
-			for (uint a = 0; a < docPagesCount; ++a)
-			{
-				DrawMasterItems(painter, m_doc->Pages->at(a), layer, QRect(clipx, clipy, clipw, cliph));
-			}
-			DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
-		}
+		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
+		if (!m_viewMode.viewAsPreview)
+			DrawPageBorder(painter, clip);
+		int renderStackCount = m_doc->guidesPrefs().renderStackOrder.count();
+		for (int r = 0; r < renderStackCount; r++)
+		{
+			int ri = m_doc->guidesPrefs().renderStackOrder[r];
+			if (ri == 0)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageMargins(painter, clip);			// drawing stack id = 0
+			}
+			else if (ri == 1)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageBaselineGrid(painter, clip);	// drawing stack id = 1
+			}
+			else if (ri == 2)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageGrid(painter, clip);			// drawing stack id = 2
+			}
+			else if (ri == 3)
+			{
+				if (!m_viewMode.viewAsPreview)
+					DrawPageGuides(painter, clip);			// drawing stack id = 3
+			}
+			else if (ri == 4)
+			{
+				int layerCount = m_doc->layerCount();	// drawing stack id = 4
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					m_doc->Layers.levelToLayer(layer, layerLevel);
+					for (uint a = 0; a < docPagesCount; ++a)
+					{
+						DrawMasterItems(painter, m_doc->Pages->at(a), layer, QRect(clipx, clipy, clipw, cliph));
+					}
+					DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
+				}
+			}
+		}
+		if (!m_viewMode.viewAsPreview)
+			DrawPageIndicator(painter, clip);
 		painter->endLayer();
-//		Tcontents = tim.elapsed();
-		if ((!m_doc->guidesPrefs().guidePlacement) && (!m_viewMode.viewAsPreview))
-		{
-			drawGuides(painter, clipx, clipy, clipw, cliph);
-		}
 	}
 	else // masterPageMode
 	{			
 		m_viewMode.linkedFramesToShow.clear();
 		drawBackgroundMasterpage(painter, clipx, clipy, clipw, cliph);
-		
-//		Tbackground = tim.elapsed();
 		painter->beginLayer(1.0, 0);
-		int layerCount = m_doc->layerCount();
-		for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
-		{
-			m_doc->Layers.levelToLayer(layer, layerLevel);
-			DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
-		}
+		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
+		DrawPageBorder(painter, clip, true);
+		int renderStackCount = m_doc->guidesPrefs().renderStackOrder.count();
+		for (int r = 0; r < renderStackCount; r++)
+		{
+			int ri = m_doc->guidesPrefs().renderStackOrder[r];
+			if (ri == 0)
+			{
+				DrawPageMargins(painter, clip, true);			// drawing stack id = 0
+			}
+			else if (ri == 1)
+			{
+				DrawPageBaselineGrid(painter, clip, true);	// drawing stack id = 1
+			}
+			else if (ri == 2)
+			{
+				DrawPageGrid(painter, clip, true);			// drawing stack id = 2
+			}
+			else if (ri == 3)
+			{
+				DrawPageGuides(painter, clip, true);			// drawing stack id = 3
+			}
+			else if (ri == 4)
+			{
+				int layerCount = m_doc->layerCount();	// drawing stack id = 4
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					m_doc->Layers.levelToLayer(layer, layerLevel);
+					DrawPageItems(painter, layer, QRect(clipx, clipy, clipw, cliph));
+				}
+			}
+		}
+		DrawPageIndicator(painter, clip, true);
 		painter->endLayer();
-//		Tcontents = tim.elapsed();
-		
-		double x = m_doc->scratch()->Left * m_viewMode.scale;
-		double y = m_doc->scratch()->Top * m_viewMode.scale;
-		double w = m_doc->currentPage()->width() * m_viewMode.scale;
-		double h = m_doc->currentPage()->height() * m_viewMode.scale;
-		QRectF drawRect = QRectF(x, y, w+5, h+5);
-		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
-		if ((!m_doc->guidesPrefs().guidePlacement) && (drawRect.intersects(QRect(clipx, clipy, clipw, cliph))))
-			DrawPageMarks(painter, m_doc->currentPage(), QRect(clipx, clipy, clipw, cliph));
 	}
 	if (((m_doc->m_Selection->count() != 0) || (m_viewMode.linkedFramesToShow.count() != 0))  && (!m_viewMode.viewAsPreview))
 	{
@@ -1603,12 +1640,10 @@
 		painter->setBrush(QColor(128,128,128));
 		MarginStruct pageBleeds;
 		m_doc->getBleeds(m_doc->currentPage(), pageBleeds);
-//		painter->beginLayer(1.0, 0);
 		painter->setAntialiasing(false);
 		painter->setPen(Qt::black, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 		{
-//			painter->drawRect(m_doc->scratch.Left - bleedLeft+5 / m_viewMode.scale, m_doc->scratch.Top - bleedTop+5 / m_viewMode.scale, m_doc->currentPage()->width() + bleedLeft + bleedRight, m_doc->currentPage()->height() + bleedBottom + bleedTop);
 			if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
 				painter->drawRect(m_doc->scratch()->Left - pageBleeds.Left+5, m_doc->scratch()->Top - pageBleeds.Top+5, m_doc->currentPage()->width() + pageBleeds.Left + pageBleeds.Right, m_doc->currentPage()->height() + pageBleeds.Bottom + pageBleeds.Top);
 			painter->setBrush(m_doc->paperColor());
@@ -1616,16 +1651,12 @@
 		}
 		else
 		{
-//			painter->drawRect(m_doc->scratch.Left+5 / m_viewMode.scale, m_doc->scratch.Top+5 / m_viewMode.scale, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 			if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
 				painter->drawRect(m_doc->scratch()->Left+5, m_doc->scratch()->Top+5, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 			painter->setBrush(m_doc->paperColor());
 			painter->drawRect(m_doc->scratch()->Left, m_doc->scratch()->Top, m_doc->currentPage()->width(), m_doc->currentPage()->height());
 		}
 		painter->setAntialiasing(true);
-		if (m_doc->guidesPrefs().guidePlacement)
-			DrawPageMarks(painter, m_doc->currentPage(), QRect(clipx, clipy, clipw, cliph));
-//		painter->endLayer();
 	}
 }
 
@@ -1636,13 +1667,11 @@
  */
 void Canvas::drawBackgroundPageOutlines(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
 {
-// 	qDebug()<<"Canvas::drawBackgroundPageOutlines"<< clipx<< clipy<< clipw<<cliph;
 	uint docPagesCount=m_doc->Pages->count();
 	if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow && !m_viewMode.viewAsPreview)
 	{
 		painter->setBrush(QColor(128,128,128));
 		painter->setAntialiasing(false);
-//		painter->beginLayer(1.0, 0);
 		painter->setPen(Qt::black, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		ScPage *actPg;
 		MarginStruct pageBleeds;
@@ -1671,7 +1700,6 @@
 					blw2 += pageBleeds.Left + pageBleeds.Right;
 					blh2 += pageBleeds.Bottom + pageBleeds.Top;
 				}
-//				painter->drawRect(blx2 + 5 /* m_viewMode.scale */, bly2 + 5 /* m_viewMode.scale */, blw2, blh2);
 				painter->drawRect(blx2 + 5, bly2 + 5, blw2, blh2);
 				if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 				{
@@ -1681,7 +1709,6 @@
 				}
 			}
 		}
-//		painter->endLayer();
 		painter->setAntialiasing(true);
 	}
 	painter->setFillMode(ScPainter::Solid);
@@ -1714,7 +1741,6 @@
 			painter->setFillMode(ScPainter::Solid);
 			painter->setPen(Qt::black, 0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			painter->setAntialiasing(false);
-//			painter->beginLayer(1.0, 0);
 			painter->setLineWidth(0.0);
 			painter->setBrush(m_doc->paperColor());
 			if (!m_viewMode.viewAsPreview)
@@ -1729,7 +1755,6 @@
 			}
 			else
 				painter->drawRect(x, y, w, h);
-//			painter->endLayer();
 			painter->setAntialiasing(true);
 		}
 	}
@@ -1765,43 +1790,67 @@
 	}
 }
 
-
-void Canvas::drawGuides(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
-{
-	uint docPagesCount=m_doc->Pages->count();
-	ScPage *actPg;
-	for (uint a = 0; a < docPagesCount; ++a)
-	{
-		actPg = m_doc->Pages->at(a);
-		double x = actPg->xOffset() * m_viewMode.scale;
-		double y = actPg->yOffset() * m_viewMode.scale;
-		double w = actPg->width() * m_viewMode.scale;
-		double h = actPg->height() * m_viewMode.scale;
-		QRectF drawRect = QRectF(x, y, w+5, h+5);
-		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
-		if (drawRect.intersects(QRectF(clipx, clipy, clipw, cliph)))
-			DrawPageMarks(painter, m_doc->Pages->at(a), QRect(clipx, clipy, clipw, cliph));
-	}				
-}
-
-
 /**
-  draws guides, margins, grid and baseline grid
- */
-void Canvas::DrawPageMarks(ScPainter *p, ScPage *page, QRect clip)
+  draws page border
+  */
+void Canvas::DrawPageBorderSub(ScPainter *p, ScPage *page)
 {
 	p->save();
 	p->setAntialiasing(false);
 	p->translate(page->xOffset(), page->yOffset());
 	double lineWidth = 1.0 / m_viewMode.scale;
-	double pageHeight=page->height();
-	double pageWidth=page->width();
+	double pageHeight = page->height();
+	double pageWidth = page->width();
 	p->setFillMode(ScPainter::None);
 	p->setStrokeMode(ScPainter::Solid);
-
 	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	p->drawRect(0, 0, pageWidth, pageHeight);
-	//Draw the margins
+	p->setAntialiasing(true);
+	p->restore();
+}
+
+void Canvas::DrawPageBorder(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageBorderSub(p, page);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+				DrawPageBorderSub(p, page);
+		}
+	}
+}
+
+/**
+  draws margins
+ */
+void Canvas::DrawPageMarginsGridSub(ScPainter *p, ScPage *page)
+{
+	p->save();
+	p->setAntialiasing(false);
+	p->translate(page->xOffset(), page->yOffset());
+	double lineWidth = 1.0 / m_viewMode.scale;
+	double pageHeight = page->height();
+	double pageWidth = page->width();
+	p->setFillMode(ScPainter::None);
+	p->setStrokeMode(ScPainter::Solid);
+	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	if (m_doc->guidesPrefs().marginsShown)
 	{
 		p->setPen(m_doc->guidesPrefs().marginColor);
@@ -1815,22 +1864,110 @@
 			p->drawRect(pageWidth - page->Margins.Right, page->Margins.Top, page->Margins.Right, pageHeight-page->Margins.Top);
 			p->setFillMode(ScPainter::None);
 		}
-//		p->setPen(m_doc->guidesPrefs().margColor);
 		p->setFillMode(ScPainter::None);
 		p->drawRect(page->Margins.Left, page->Margins.Top, pageWidth - page->Margins.Left - page->Margins.Right, pageHeight - page->Margins.Top - page->Margins.Bottom);
-//		p->drawLine(FPoint(0, page->Margins.Top), FPoint(pageWidth, page->Margins.Top));
-//		p->drawLine(FPoint(0, pageHeight - page->Margins.Bottom), FPoint(pageWidth, pageHeight - page->Margins.Bottom));
-//		p->drawLine(FPoint(page->Margins.Left, 0), FPoint(page->Margins.Left, pageHeight));
-//		p->drawLine(FPoint(pageWidth - page->Margins.Right, 0), FPoint(pageWidth - page->Margins.Right, pageHeight));
-	}
-	//Draw the baseline grid
+	}
+	p->setAntialiasing(true);
+	p->restore();
+}
+
+void Canvas::DrawPageMargins(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageMarginsGridSub(p, page);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+				DrawPageMarginsGridSub(p, page);
+		}
+	}
+}
+
+/**
+  draws baseline grid
+ */
+void Canvas::DrawPageBaselineGridSub(ScPainter *p, ScPage *page)
+{
+	p->save();
+	p->setAntialiasing(false);
+	p->translate(page->xOffset(), page->yOffset());
+	double lineWidth = 1.0 / m_viewMode.scale;
+	double pageHeight = page->height();
+	double pageWidth = page->width();
+	p->setFillMode(ScPainter::None);
+	p->setStrokeMode(ScPainter::Solid);
+	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	if (m_doc->guidesPrefs().baselineGridShown)
 	{
 		p->setPen(m_doc->guidesPrefs().baselineGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		for (double yg = m_doc->guidesPrefs().offsetBaselineGrid; yg < pageHeight; yg += m_doc->guidesPrefs().valueBaselineGrid)
 			p->drawLine(FPoint(0, yg), FPoint(pageWidth, yg));
 	}
-	//Draw the grid lines
+	p->setAntialiasing(true);
+	p->restore();
+}
+
+void Canvas::DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageBaselineGridSub(p, page);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+				DrawPageBaselineGridSub(p, page);
+		}
+	}
+}
+
+/**
+  draws grid
+ */
+void Canvas::DrawPageGridSub(ScPainter *p, ScPage *page, QRectF clip)
+{
+	p->save();
+	FPointArray PoLine;
+	getClipPathForPages(&PoLine);
+	p->beginLayer(1.0, 0, &PoLine);
+	p->setAntialiasing(false);
+	p->translate(page->xOffset(), page->yOffset());
+	double lineWidth = 1.0 / m_viewMode.scale;
+	double pageHeight = page->height();
+	double pageWidth = page->width();
+	p->setFillMode(ScPainter::None);
+	p->setStrokeMode(ScPainter::Solid);
+	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	if (m_doc->guidesPrefs().gridShown)
 	{
 		double lowerBx = qMax(clip.x() / m_viewMode.scale + m_doc->minCanvasCoordinate.x() - page->xOffset(), 0.0);
@@ -1839,51 +1976,200 @@
 		double highBy = qMin(lowerBy + clip.height() / m_viewMode.scale, pageHeight);
 		if (m_viewMode.scale > 0.49)
 		{
-			double i,start;
-			i = m_doc->guidesPrefs().majorGridSpacing;
-			p->setPen(m_doc->guidesPrefs().majorGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-			start=floor(lowerBy/i);
-			start*=i;
-			for (double b = start; b <= highBy; b+=i)
-			{
-				p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
-			}
-			start=floor(lowerBx/i);
-			start*=i;
-			for (double b = start; b <= highBx; b+=i)
-			{
-				p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
-			}
-			i = m_doc->guidesPrefs().minorGridSpacing;
-			p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
-			start=floor(lowerBy/i);
-			start*=i;
-			for (double b = start; b <= highBy; b+=i)
-			{
-				p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
-			}
-			start=floor(lowerBx/i);
-			start*=i;
-			for (double b = start; b <= highBx; b+=i)
-			{
-				p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
-			}
-		}
-	}
-	//Draw the guides
+			if (m_doc->guidesPrefs().gridType == 0)
+			{
+				double i,start;
+				i = m_doc->guidesPrefs().majorGridSpacing;
+				p->setPen(m_doc->guidesPrefs().majorGridColor, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				start = floor(lowerBy / i);
+				start *= i;
+				for (double b = start; b <= highBy; b+=i)
+				{
+					p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+				}
+				start=floor(lowerBx/i);
+				start*=i;
+				for (double b = start; b <= highBx; b+=i)
+				{
+					p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+				}
+				i = m_doc->guidesPrefs().minorGridSpacing;
+				p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
+				start = floor(lowerBy / i);
+				start *= i;
+				for (double b = start; b <= highBy; b+=i)
+				{
+					p->drawLine(FPoint(qMax(lowerBx, 0.0), b), FPoint(qMin(pageWidth, highBx), b));
+				}
+				start=floor(lowerBx/i);
+				start*=i;
+				for (double b = start; b <= highBx; b+=i)
+				{
+					p->drawLine(FPoint(b, qMax(lowerBy, 0.0)), FPoint(b, qMin(pageHeight, highBy)));
+				}
+			}
+			else if (m_doc->guidesPrefs().gridType == 1)
+			{
+				double i, startX, startY;
+				i = m_doc->guidesPrefs().minorGridSpacing;
+				p->setPen(m_doc->guidesPrefs().minorGridColor, 3.0 / m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+				startY = floor(lowerBy / i);
+				startY *= i;
+				startX = floor(lowerBx / i);
+				startX *= i;
+				for (double b = startY; b <= highBy; b += i)
+				{
+					for (double bb = startX; bb <= highBx; bb += i)
+					{
+						p->drawLine(FPoint(bb, b), FPoint(bb, b));
+					}
+				}
+				i = m_doc->guidesPrefs().majorGridSpacing;
+				p->setPen(m_doc->guidesPrefs().minorGridColor, lineWidth * 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				startY = floor(lowerBy / i);
+				startY *= i;
+				startX = floor(lowerBx / i);
+				startX *= i;
+				for (double b = startY; b <= highBy; b += i)
+				{
+					for (double bb = startX; bb <= highBx; bb += i)
+					{
+						p->drawLine(FPoint(bb - 4, b), FPoint(bb + 4, b));
+						p->drawLine(FPoint(bb, b - 4), FPoint(bb, b + 4));
+					}
+				}
+			}
+		}
+	}
+	p->setAntialiasing(true);
+	p->endLayer();
+	p->restore();
+}
+
+void Canvas::DrawPageGrid(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageGridSub(p, page, clip);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+				DrawPageGridSub(p, page, clip);
+		}
+	}
+}
+
+/**
+  draws guides
+ */
+void Canvas::DrawPageGuidesSub(ScPainter *p, ScPage *page)
+{
+	p->save();
+	p->setAntialiasing(false);
+	p->translate(page->xOffset(), page->yOffset());
+	double lineWidth = 1.0 / m_viewMode.scale;
+	p->setFillMode(ScPainter::None);
+	p->setStrokeMode(ScPainter::Solid);
+	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 	if (m_doc->guidesPrefs().guidesShown)
 		page->guides.drawPage(p, m_doc, lineWidth);
-	if (m_doc->currentPage() == page)
-	{
-		p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.pageBorderColor, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		p->drawRect(0, 0, pageWidth, pageHeight);
-	}
 	p->setAntialiasing(true);
-
 	p->restore();
 }
 
-
+void Canvas::DrawPageGuides(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageGuidesSub(p, page);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+			drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+			if (drawRect.intersects(clip))
+				DrawPageGuidesSub(p, page);
+		}
+	}
+}
+
+/**
+  draws actual page indicator frame
+ */
+void Canvas::DrawPageIndicatorSub(ScPainter *p, ScPage *page)
+{
+	p->save();
+	p->setAntialiasing(false);
+	p->translate(page->xOffset(), page->yOffset());
+	double lineWidth = 1.0 / m_viewMode.scale;
+	double pageHeight = page->height();
+	double pageWidth = page->width();
+	p->setFillMode(ScPainter::None);
+	p->setStrokeMode(ScPainter::Solid);
+	p->setPen(Qt::black, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.pageBorderColor, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	p->drawRect(0, 0, pageWidth, pageHeight);
+	p->setAntialiasing(true);
+	p->restore();
+}
+
+void Canvas::DrawPageIndicator(ScPainter *p, QRectF clip, bool master)
+{
+	if (master)
+	{
+		ScPage *page = m_doc->currentPage();
+		double x = m_doc->scratch()->Left * m_viewMode.scale;
+		double y = m_doc->scratch()->Top * m_viewMode.scale;
+		double w = page->width() * m_viewMode.scale;
+		double h = page->height() * m_viewMode.scale;
+		QRectF drawRect = QRectF(x, y, w+5, h+5);
+		drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+		if (drawRect.intersects(clip))
+			DrawPageIndicatorSub(p, page);
+	}
+	else
+	{
+		uint docPagesCount = m_doc->Pages->count();
+		for (uint a = 0; a < docPagesCount; ++a)
+		{
+			ScPage *page = m_doc->Pages->at(a);
+			if (page == m_doc->currentPage())
+			{
+				QRectF drawRect = QRectF(page->xOffset() * m_viewMode.scale, page->yOffset() * m_viewMode.scale, page->width() * m_viewMode.scale + 5, page->height() * m_viewMode.scale + 5);
+				drawRect.translate(-m_doc->minCanvasCoordinate.x() * m_viewMode.scale, -m_doc->minCanvasCoordinate.y() * m_viewMode.scale);
+				if (drawRect.intersects(clip))
+					DrawPageIndicatorSub(p, page);
+			}
+		}
+	}
+}
 
 /**
   draws the links between textframe chains.

Modified: branches/ScribusOIF/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/canvas.h
==============================================================================
--- branches/ScribusOIF/scribus/canvas.h (original)
+++ branches/ScribusOIF/scribus/canvas.h Thu Nov 24 22:37:33 2011
@@ -28,6 +28,7 @@
 //#include <QDebug>
 #include <QPolygon>
 #include <QRect>
+#include <QRectF>
 #include <QWidget>
 
 #include "scribusapi.h"
@@ -212,7 +213,18 @@
 	void setupEditHRuler(PageItem * item, bool forceAndReset = false);
 	
 private:
-	void DrawPageMarks(ScPainter *p, ScPage* page, QRect clip);
+	void DrawPageBorderSub(ScPainter *p, ScPage *page);
+	void DrawPageBorder(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageMarginsGridSub(ScPainter *p, ScPage *page);
+	void DrawPageMargins(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageBaselineGridSub(ScPainter *p, ScPage *page);
+	void DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageGridSub(ScPainter *p, ScPage *page, QRectF clip);
+	void DrawPageGrid(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageGuidesSub(ScPainter *p, ScPage *page);
+	void DrawPageGuides(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageIndicatorSub(ScPainter *p, ScPage *page);
+	void DrawPageIndicator(ScPainter *p, QRectF clip, bool master = false);
 	void drawLinkFrameLine(ScPainter* painter, FPoint &start, FPoint &end);
 	void PaintSizeRect(QRect neu);
 	void PaintSizeRect(QPolygon neu);
@@ -233,7 +245,6 @@
 	void drawContents(QPainter *p, int clipx, int clipy, int clipw, int cliph);
 	void drawBackgroundMasterpage(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
 	void drawBackgroundPageOutlines(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
-	void drawGuides(ScPainter* painter, int clipx, int clipy, int clipw, int cliph);
 	void drawFrameLinks(ScPainter* painter);
 	void drawControls(QPainter* p);
 	void drawControlsMovingItemsRect(QPainter* pp);

Modified: branches/ScribusOIF/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/canvasgesture_resize.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasgesture_resize.cpp (original)
+++ branches/ScribusOIF/scribus/canvasgesture_resize.cpp Thu Nov 24 22:37:33 2011
@@ -311,7 +311,14 @@
 				}
 			}
 		}
+		double oldX = currItem->xPos();
+		double oldY = currItem->yPos();
 		currItem->setXYPos(newBounds.x() + m_extraX, newBounds.y() + m_extraY);
+		if (currItem->Parent != 0)	// part of a group
+		{
+			currItem->gXpos += currItem->xPos() - oldX;
+			currItem->gYpos += currItem->yPos() - oldY;
+		}
 		currItem->setWidth(newBounds.width() - m_extraWidth);
 		currItem->setHeight(newBounds.height() - m_extraHeight);
 		currItem->updateClip();
@@ -405,7 +412,7 @@
 		qp = rotation.inverted().map(qp);
 		docPoint = FPoint(qp.x(), qp.y());
 	}
-	
+
 	// adjust bounds vertically
 	switch (m_handle)
 	{

Modified: branches/ScribusOIF/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/canvasmode_normal.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_normal.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_normal.cpp Thu Nov 24 22:37:33 2011
@@ -307,7 +307,7 @@
 			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
 		}
 		enableGuideGesture |= (frameResizeHandle == Canvas::OUTSIDE);
-		enableGuideGesture |= ((!m_doc->guidesPrefs().guidePlacement) && (frameResizeHandle == Canvas::INSIDE));
+		enableGuideGesture |= ((m_doc->guidesPrefs().renderStackOrder.indexOf(3) > m_doc->guidesPrefs().renderStackOrder.indexOf(4)) && (frameResizeHandle == Canvas::INSIDE));
 		if (enableGuideGesture)
 		{
 			if (!guideMoveGesture)
@@ -1134,7 +1134,7 @@
 	QRectF mpo(m_mouseCurrentPoint.x()-grabRadius, m_mouseCurrentPoint.y()-grabRadius, grabRadius*2, grabRadius*2);
 	m_doc->nodeEdit.deselect();
 
-	if(!m_doc->guidesPrefs().guidePlacement) // guides are on foreground and want to be processed first
+	if (m_doc->guidesPrefs().renderStackOrder.indexOf(3) > m_doc->guidesPrefs().renderStackOrder.indexOf(4)) // guides are on foreground and want to be processed first
 	{
 		if ((m_doc->guidesPrefs().guidesShown) && (m_doc->OnPage(MxpS, MypS) != -1))
 		{

Modified: branches/ScribusOIF/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/fileloader.cpp
==============================================================================
--- branches/ScribusOIF/scribus/fileloader.cpp (original)
+++ branches/ScribusOIF/scribus/fileloader.cpp Thu Nov 24 22:37:33 2011
@@ -407,6 +407,7 @@
 		vg.charStyle().setFont((*currDoc->AllFonts)[tmpf]);
 		vg.charStyle().setFontSize(qRound(ScCLocale::toDoubleC(pg.attribute("FONTSIZE"), 12.0) * 10.0));
 		vg.setHasDropCap(static_cast<bool>(pg.attribute("DROP", "0").toInt()));
+		vg.setDcCharStyleName(pg.attribute("DROPCHSTYLE", ""));
 		vg.setDropCapLines(pg.attribute("DROPLIN", "2").toInt());
 		vg.setDropCapOffset(ScCLocale::toDoubleC(pg.attribute("DROPDIST"), 0.0));
 		vg.charStyle().setFeatures(static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt()).featureList());

Modified: branches/ScribusOIF/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/pageitem.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem.cpp Thu Nov 24 22:37:33 2011
@@ -5563,6 +5563,8 @@
 		}
 		result.translate(ite->xPos(), ite->yPos());
 		result.rotate(ite->rotation());
+		if (ite == this)
+			return result;
 		if (ite->isGroup())
 			result.scale(ite->width() / ite->groupWidth, ite->height() / ite->groupHeight);
 		for (int aa = 0; aa < itList.count(); aa++)
@@ -5570,6 +5572,8 @@
 			ite = itList.at(aa);
 			result.translate(ite->gXpos, ite->gYpos);
 			result.rotate(ite->rotation());
+			if (ite == this)
+				return result;
 			if (ite->isGroup())
 				result.scale(ite->width() / ite->groupWidth, ite->height() / ite->groupHeight);
 		}

Modified: branches/ScribusOIF/scribus/pageitem_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/pageitem_group.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_group.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem_group.cpp Thu Nov 24 22:37:33 2011
@@ -178,6 +178,27 @@
 				embedded->DrawObj(p, QRectF());
 				embedded->isEmbedded = false;
 				p->restore();
+				if (m_Doc->guidesPrefs().framesShown)
+				{
+					p->save();
+					double x = embedded->xPos();
+					double y = embedded->yPos();
+					embedded->setXYPos(embedded->gXpos, embedded->gYpos, true);
+					embedded->DrawObj_Decoration(p);
+					embedded->setXYPos(x, y, true);
+					p->restore();
+				}
+				if (m_Doc->layerOutline(LayerID))
+				{
+					p->save();
+					p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+					p->setFillMode(ScPainter::None);
+					p->setBrushOpacity(1.0);
+					p->setPenOpacity(1.0);
+					p->setupPolygon(&PoLine);
+					p->strokePath();
+					p->restore();
+				}
 			}
 			for (int em = 0; em < groupItemList.count(); ++em)
 			{
@@ -211,27 +232,6 @@
 			}
 			p->endLayer();
 			p->restore();
-			if (m_Doc->layerOutline(LayerID))
-			{
-				p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-				p->setFillMode(ScPainter::None);
-				p->setBrushOpacity(1.0);
-				p->setPenOpacity(1.0);
-				p->setupPolygon(&PoLine);
-				p->strokePath();
-			}
-			if (m_Doc->guidesPrefs().framesShown)
-			{
-				for (int em = 0; em < groupItemList.count(); ++em)
-				{
-					PageItem* embedded = groupItemList.at(em);
-					double x = embedded->xPos();
-					double y = embedded->yPos();
-					embedded->setXYPos(embedded->gXpos, embedded->gYpos, true);
-					embedded->DrawObj_Decoration(p);
-					embedded->setXYPos(x, y, true);
-				}
-			}
 		}
 		else
 		{

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Thu Nov 24 22:37:33 2011
@@ -801,6 +801,9 @@
 		m_Doc->guidesPrefs().linkShown = prefsManager->appPrefs.guidesPrefs.linkShown;
 		m_Doc->guidesPrefs().showPic = true;
 		m_Doc->guidesPrefs().showControls = false;
+		m_Doc->guidesPrefs().renderStackOrder.clear();
+		m_Doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+		m_Doc->guidesPrefs().gridType = 0;
 // 		DoFonts.clear();
 		m_Doc->itemToolPrefs().textSize=qRound(ScCLocale::toDoubleC(dc.attribute("DSIZE")) * 10);
 		Defont=dc.attribute("DFONT");

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Nov 24 22:37:33 2011
@@ -947,7 +947,12 @@
 		doc->guidesPrefs().guideColor = QColor(attrs.valueAsString("GuideC"));
 	if (attrs.hasAttribute("BaseC"))
 		doc->guidesPrefs().baselineGridColor  = QColor(attrs.valueAsString("BaseC"));
-	doc->guidesPrefs().guidePlacement   = attrs.valueAsBool("BACKG", true);
+	doc->guidesPrefs().renderStackOrder.clear();
+	if (attrs.valueAsBool("BACKG", true))
+		doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+	else
+		doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
+	doc->guidesPrefs().gridType = 0;
 	doc->guidesPrefs().guideRad = attrs.valueAsDouble("GuideRad", 10.0);
 	doc->guidesPrefs().grabRadius  = attrs.valueAsInt("GRAB", 4);
 }

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Thu Nov 24 22:37:33 2011
@@ -424,7 +424,12 @@
 		if (dc.hasAttribute("BaseC"))
 			m_Doc->guidesPrefs().baselineGridColor = QColor(dc.attribute("BaseC"));
 		m_Doc->setMarginColored(static_cast<bool>(dc.attribute("RANDF", "0").toInt()));
-		m_Doc->guidesPrefs().guidePlacement = static_cast<bool>(dc.attribute("BACKG", "1").toInt());
+		m_Doc->guidesPrefs().renderStackOrder.clear();
+		if (static_cast<bool>(dc.attribute("BACKG", "1").toInt()))
+			m_Doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+		else
+			m_Doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
+		m_Doc->guidesPrefs().gridType = 0;
 		m_Doc->guidesPrefs().guideRad = ScCLocale::toDoubleC(dc.attribute("GuideRad"), 10.0);
 		m_Doc->guidesPrefs().grabRadius  = dc.attribute("GRAB", "4").toInt();
 		if (dc.hasAttribute("currentProfile"))

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Nov 24 22:37:33 2011
@@ -1969,7 +1969,27 @@
 		doc->guidesPrefs().guideColor = QColor(attrs.valueAsString("GuideC"));
 	if (attrs.hasAttribute("BaseC"))
 		doc->guidesPrefs().baselineGridColor  = QColor(attrs.valueAsString("BaseC"));
-	doc->guidesPrefs().guidePlacement   = attrs.valueAsBool("BACKG", true);
+	if (attrs.hasAttribute("BACKG"))
+	{
+		doc->guidesPrefs().renderStackOrder.clear();
+		if (attrs.valueAsBool("BACKG", true))
+			doc->guidesPrefs().renderStackOrder << 0 << 1 << 2 << 3 << 4;
+		else
+			doc->guidesPrefs().renderStackOrder << 4 << 0 << 1 << 2 << 3;
+	}
+	if (attrs.hasAttribute("renderStack"))
+	{
+		doc->guidesPrefs().renderStackOrder.clear();
+		QString renderStack = attrs.valueAsString("renderStack", "0 1 2 3 4");
+		ScTextStream fp(&renderStack, QIODevice::ReadOnly);
+		QString val;
+		while (!fp.atEnd())
+		{
+			fp >> val;
+			doc->guidesPrefs().renderStackOrder << val.toInt();
+		}
+	}
+	doc->guidesPrefs().gridType = attrs.valueAsInt("GridType", 0);
 	doc->guidesPrefs().guideRad = attrs.valueAsDouble("GuideRad", 10.0);
 	doc->guidesPrefs().grabRadius  = attrs.valueAsInt("GRAB", 4);
 }
@@ -2360,6 +2380,10 @@
 	static const QString DROP("DROP");
 	if (attrs.hasAttribute(DROP))
 		newStyle.setHasDropCap(static_cast<bool>(attrs.valueAsInt(DROP)));
+
+	static const QString DROPCHSTYLE("DROPCHSTYLE");
+	if (attrs.hasAttribute(DROPCHSTYLE))
+		newStyle.setDcCharStyleName(attrs.valueAsString(DROPCHSTYLE));
 
 	static const QString DROPLIN("DROPLIN");
 	if (attrs.hasAttribute(DROPLIN))

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Thu Nov 24 22:37:33 2011
@@ -331,8 +331,14 @@
 	docu.writeAttribute("MAJORC",m_Doc->guidesPrefs().majorGridColor.name());
 	docu.writeAttribute("GuideC", m_Doc->guidesPrefs().guideColor.name());
 	docu.writeAttribute("BaseC", m_Doc->guidesPrefs().baselineGridColor.name());
-//	docu.writeAttribute("GuideZ", m_Doc->guidesPrefs().guideRad);
-	docu.writeAttribute("BACKG", static_cast<int>(m_Doc->guidesPrefs().guidePlacement));
+	QString renderStack = "";
+	int renderStackCount = m_Doc->guidesPrefs().renderStackOrder.count();
+	for (int r = 0; r < renderStackCount; r++)
+	{
+		renderStack += QString("%1 ").arg(m_Doc->guidesPrefs().renderStackOrder[r]);
+	}
+	docu.writeAttribute("renderStack", renderStack.trimmed());
+	docu.writeAttribute("GridType", m_Doc->guidesPrefs().gridType);
 	docu.writeAttribute("PAGEC",m_Doc->paperColor().name());
 	docu.writeAttribute("MARGC",m_Doc->guidesPrefs().marginColor.name());
 	docu.writeAttribute("RANDF", static_cast<int>(m_Doc->marginColored()));
@@ -608,6 +614,8 @@
 		docu.writeAttribute("NACH", style.gapAfter());
 	if ( ! style.isInhHasDropCap())
 		docu.writeAttribute("DROP", static_cast<int>(style.hasDropCap()));
+	if ( ! style.isInhDcCharStyleName())
+		docu.writeAttribute("DROPCHSTYLE", style.dcCharStyleName());
 	if ( ! style.isInhDropCapLines())
 		docu.writeAttribute("DROPLIN", style.dropCapLines());
 	if ( ! style.isInhDropCapOffset())

Modified: branches/ScribusOIF/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/prefsmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/prefsmanager.cpp (original)
+++ branches/ScribusOIF/scribus/prefsmanager.cpp Thu Nov 24 22:37:33 2011
@@ -50,6 +50,7 @@
 #include "scpaths.h"
 #include "scribuscore.h"
 #include "scribusstructs.h"
+#include "sctextstream.h"
 #include "ui/modetoolbar.h"
 #include "util_color.h"
 #include "util_file.h"
@@ -181,6 +182,8 @@
 	appPrefs.guidesPrefs.marginColor = QColor(Qt::blue);
 	appPrefs.guidesPrefs.guideColor = QColor(Qt::darkBlue);
 	appPrefs.guidesPrefs.baselineGridColor = QColor(Qt::lightGray);
+	appPrefs.guidesPrefs.renderStackOrder << 0 << 1 << 2 << 3 << 4;
+	appPrefs.guidesPrefs.gridType = 0;
 	appPrefs.typoPrefs.valueSuperScript = 33;
 	appPrefs.typoPrefs.scalingSuperScript = 66;
 	appPrefs.typoPrefs.valueSubScript = 33;
@@ -258,7 +261,6 @@
 	appPrefs.itemToolPrefs.imageFillColorShade = 100;
 	appPrefs.itemToolPrefs.imageScaleX = 1;
 	appPrefs.itemToolPrefs.imageScaleY = 1;
-	appPrefs.guidesPrefs.guidePlacement = true;
 	appPrefs.docSetupPrefs.docUnitIndex = 0;
 	appPrefs.itemToolPrefs.polyCorners = 4;
 	appPrefs.itemToolPrefs.polyFactor = 0.5;
@@ -1338,7 +1340,15 @@
 	deGuides.setAttribute("MarginColor",appPrefs.guidesPrefs.marginColor.name());
 	deGuides.setAttribute("BaselineGridColor", appPrefs.guidesPrefs.baselineGridColor.name());
 	deGuides.setAttribute("ObjectToGuideSnapRadius", ScCLocale::toQStringC(appPrefs.guidesPrefs.guideRad));
-	deGuides.setAttribute("GuidePlacement", static_cast<int>(appPrefs.guidesPrefs.guidePlacement));
+	QString renderStack = "";
+	int renderStackCount = appPrefs.guidesPrefs.renderStackOrder.count();
+	for (int r = 0; r < renderStackCount; r++)
+	{
+		renderStack += QString("%1 ").arg(appPrefs.guidesPrefs.renderStackOrder[r]);
+	}
+	renderStack = renderStack.trimmed();
+	deGuides.setAttribute("renderStack", renderStack);
+	deGuides.setAttribute("GridType", appPrefs.guidesPrefs.gridType);
 	deGuides.setAttribute("ShowGrid", static_cast<int>(appPrefs.guidesPrefs.gridShown));
 	deGuides.setAttribute("BaselineGridDistance", ScCLocale::toQStringC(appPrefs.guidesPrefs.valueBaselineGrid));
 	deGuides.setAttribute("BaselineGridOffset", ScCLocale::toQStringC(appPrefs.guidesPrefs.offsetBaselineGrid));
@@ -1969,7 +1979,27 @@
 			appPrefs.guidesPrefs.majorGridSpacing  = ScCLocale::toDoubleC(dc.attribute("MajorGridSpacing"), 100.0);
 			appPrefs.guidesPrefs.minorGridColor = QColor(dc.attribute("MinorGridColor"));
 			appPrefs.guidesPrefs.majorGridColor = QColor(dc.attribute("MajorGridColor"));
-			appPrefs.guidesPrefs.guidePlacement = static_cast<bool>(dc.attribute("GuidePlacement", "1").toInt());
+			if (dc.hasAttribute("GuidePlacement"))
+			{
+				appPrefs.guidesPrefs.renderStackOrder.clear();
+				if (static_cast<bool>(dc.attribute("GuidePlacement", "1").toInt()))
+					appPrefs.guidesPrefs.renderStackOrder << 0 << 1 << 2 << 3 << 4;
+				else
+					appPrefs.guidesPrefs.renderStackOrder << 4 << 0 << 1 << 2 << 3;
+			}
+			if (dc.hasAttribute("renderStack"))
+			{
+				appPrefs.guidesPrefs.renderStackOrder.clear();
+				QString renderStack = dc.attribute("renderStack", "0 1 2 3 4");
+				ScTextStream fp(&renderStack, QIODevice::ReadOnly);
+				QString val;
+				while (!fp.atEnd())
+				{
+					fp >> val;
+					appPrefs.guidesPrefs.renderStackOrder << val.toInt();
+				}
+			}
+			appPrefs.guidesPrefs.gridType = dc.attribute("GridType", "0").toInt();
 			appPrefs.guidesPrefs.gridShown = static_cast<bool>(dc.attribute("ShowGrid", "0").toInt());
 			if (dc.hasAttribute("GuideC"))
 				appPrefs.guidesPrefs.guideColor = QColor(dc.attribute("GuideC"));

Modified: branches/ScribusOIF/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/prefsstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/prefsstructs.h (original)
+++ branches/ScribusOIF/scribus/prefsstructs.h Thu Nov 24 22:37:33 2011
@@ -134,7 +134,15 @@
 //Guides
 struct GuidesPrefs
 {
-	bool guidePlacement; //! Placement of guides, in front or behind
+	QList<int> renderStackOrder;
+	// render stack id 0 = PageMargins
+	// render stack id 1 = BaselineGrid
+	// render stack id 2 = Grid
+	// render stack id 3 = Guides
+	// render stack id 4 = Items
+	int gridType;
+	// type 0 lines
+	// type 1 crosses and dots
 
 	int grabRadius;
 	double guideRad;

Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Thu Nov 24 22:37:33 2011
@@ -599,6 +599,7 @@
 	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(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
+	connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
 //	connect(propertiesPalette, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles()));
@@ -1683,7 +1684,6 @@
 	bookmarkPalette->hide();
 	layerPalette->hide();
 	pagePalette->hide();
-//	measurementPalette->hide();
 	docCheckerPalette->hide();
 	undoPalette->hide();
 	alignDistributePalette->hide();
@@ -1797,7 +1797,7 @@
 	delete dia;
 	mainWindowStatusLabel->setText( tr("Ready"));
 	if (docSet)
-		slotDocSetup150();
+		slotDocSetup();
 }
 
 bool ScribusMainWindow::slotFileNew()
@@ -1847,7 +1847,7 @@
 	}
 	delete dia;
 	if (docSet)
-		slotDocSetup150();
+		slotDocSetup();
 	return retVal;
 }
 
@@ -1855,82 +1855,6 @@
 ScribusDoc *ScribusMainWindow::newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
 {
 	return doFileNew(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, columnCount, autoTextFrames, pageArrangement, unitIndex, firstPageLocation, orientation, firstPageNumber, defaultPageSize, requiresGUI, pageCount, showView, marginPreset);
-	/* TODO CB finish later this week.
-	if (HaveDoc)
-		doc->OpenNodes = outlinePalette->buildReopenVals();
-	MarginStruct margins(topMargin, leftMargin, bottomMargin, rightMargin);
-	DocPagesSetup pagesSetup(pageArrangement, firstPageLocation, firstPageNumber, orientation, autoTextFrames, columnDistance, columnCount);
-	QString newDocName(tr("Document")+"-"+QString::number(DocNr));
-	doc = new ScribusDoc(newDocName, unitindex, pagesize, margins, pagesSetup);
-		doc->setLoading(true);
-	doc->setup(unitIndex, pageArrangement, firstPageLocation, orientation, firstPageNumber, defaultPageSize, newDocName);
-	HaveDoc++;
-	DocNr++;
-	if (ScCore->haveCMS() && doc->CMSSettings.CMSinUse)
-		recalcColors();
-	//CB NOTE should be all done now
-	doc->setPage(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, columnCount, autoTextFrames, pageArrangement);
-	doc->setMasterPageMode(false);
-	doc->addMasterPage(0, CommonStrings::masterPageNormal);
-	int createCount=qMax(pageCount,1);
-	for (int i = 0; i < createCount; ++i)
-		doc->addPage(i, CommonStrings::masterPageNormal, true);
-	doc->addSection();
-	doc->setFirstSectionFromFirstPageNumber();
-	doc->setModified(false);
-	doc->OpenNodes.clear();
-	actionManager->disconnectNewDocActions();
-	actionManager->connectNewDocActions(doc);
-	//<<View and window code
-	ScribusWin* w = new ScribusWin(mdiArea, doc);
-	w->setMainWindow(this);
-	if (view!=NULL)
-	{
-		actionManager->disconnectNewViewActions();
-		disconnect(view, SIGNAL(signalGuideInformation(int, double)), alignDistributePalette, SLOT(setGuide(int, double)));
-	}
-	view = new ScribusView(w, this, doc);
-	doc->setCurrentPage(doc->Pages->at(0));
-	doc->setGUI(this, view);
-	doc->setLoading(false);
-	//run after setGUI to set up guidepalette ok
-
-	view->setScale(prefsManager->displayScale());
-	actionManager->connectNewViewActions(view);
-	alignDistributePalette->setDoc(doc);
-	docCheckerPalette->clearErrorList();
-	w->setView(view);
-	ActWin = w;
-	doc->WinHan = w;
-	w->setCentralWidget(view);
-	doc->connectDocSignals(); //Must be before the first reformpages
-	view->reformPages(true);
-	//>>
-
-	connect(undoManager, SIGNAL(undoRedoDone()), view, SLOT(DrawNew()));
-	//connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
-	connect(view, SIGNAL(signalGuideInformation(int, double)), alignDistributePalette, SLOT(setGuide(int, double)));
-	//	connect(w, SIGNAL(SaveAndClose()), this, SLOT(DoSaveClose()));
-
-	//Independent finishing tasks after doc setup
-	if (showView)
-	{
-		if ( mdiArea->windowList().isEmpty() )
-			w->showMaximized();
-		else
-			w->show();
-		view->show();
-	}
-	connect(w, SIGNAL(AutoSaved()), this, SLOT(slotAutoSaved()));
-	connect(ScCore->fileWatcher, SIGNAL(fileChanged(QString)), doc, SLOT(updatePict(QString)));
-	connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString)), doc, SLOT(removePict(QString)));
-	scrActions["fileSave"]->setEnabled(false);
-	undoManager->switchStack(doc->DocName);
-	styleManager->currentDoc(doc);
-	tocGenerator->setDoc(doc);
-
-	return doc;
-	*/
 }
 
 ScribusDoc *ScribusMainWindow::doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount, bool showView, int marginPreset)
@@ -4357,7 +4281,6 @@
 		//CB Hyphenating now emits doc changed, plus we change lang as appropriate
 		if (doc->docHyphenator->AutoCheck)
 			doc->itemSelection_DoHyphenate();
-			//doc->docHyphenator->slotHyphenate(doc->m_Selection->itemAt(0));
 		view->DrawNew();
 		//slotDocCh();
 	}
@@ -5798,8 +5721,6 @@
 			pagePalette->show();
 		if (palettesStatus[6])
 			bookmarkPalette->show();
-//		if (palettesStatus[7])
-//			measurementPalette->show();
 		if (palettesStatus[9])
 			docCheckerPalette->show();
 		setPagePalette(palettesStatus[5]);
@@ -5813,7 +5734,6 @@
 		palettesStatus[4] = layerPalette->isVisible();
 		palettesStatus[5] = pagePalette->isVisible();
 		palettesStatus[6] = bookmarkPalette->isVisible();
-//		palettesStatus[7] = measurementPalette->isVisible();
 		palettesStatus[8] = undoPalette->isVisible();
 		palettesStatus[9] = docCheckerPalette->isVisible();
 		propertiesPalette->hide();
@@ -5822,7 +5742,6 @@
 		bookmarkPalette->hide();
 		pagePalette->hide();
 		layerPalette->hide();
-//		measurementPalette->hide();
 		docCheckerPalette->hide();
 		setPagePalette(false);
 		setUndoPalette(false);
@@ -5840,27 +5759,7 @@
 	undoPalette->setPaletteShown(visible);
 	scrActions["toolsActionHistory"]->setChecked(visible);
 }
-/*
-void ScribusMainWindow::togglePropertiesPalette()
-{
-	palettesStatus[0] = false;
-}
-
-void ScribusMainWindow::toggleOutlinePalette()
-{
-	palettesStatus[0] = false;
-}
-
-void ScribusMainWindow::toggleScrapbookPalette()
-{
-	palettesStatus[0] = false;
-}
-
-void ScribusMainWindow::toggleLayerPalette()
-{
-	palettesStatus[0] = false;
-}
-*/
+
 void ScribusMainWindow::setPagePalette(bool visible)
 {
 	if (!visible)
@@ -5875,12 +5774,6 @@
 	setPagePalette(!pagePalette->isVisible());
 	palettesStatus[0] = false;
 }
-/*
-void ScribusMainWindow::toggleBookmarkPalette()
-{
-	palettesStatus[0] = false;
-}
-*/
 
 void ScribusMainWindow::toggleUndoPalette()
 {
@@ -7050,41 +6943,6 @@
 	}
 // 	slotDocCh();
 }
-
-/* CB: unused in 135 without the colours menu
-void ScribusMainWindow::setCSMenu()
-{
-	QString la = CommonStrings::tr_NoneColor;
-	int lb = 100;
-	PageItem *currItem;
-	if (doc->m_Selection->count() != 0)
-	{
-		currItem = doc->m_Selection->itemAt(0);
-		if ((currItem->asTextFrame()) || (currItem->asPathText()))
-		{
-			if ((doc->appMode == modeEdit) && (currItem->itemText.length() != 0))
-			{
-				la = currItem->itemText.charStyle(qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillColor();
-				lb = qRound(currItem->itemText.charStyle(qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillShade());
-			}
-			else
-			{
-				la = currItem->itemText.defaultStyle().charStyle().fillColor();
-				lb = qRound(currItem->itemText.defaultStyle().charStyle().fillShade());
-			}
-		}
-		else
-		{
-			la = currItem->fillColor();
-			lb = qRound(currItem->fillShade());
-		}
-	}
-	if (la == CommonStrings::None)
-		la = CommonStrings::tr_NoneColor;
-	if (scrActions[QString("shade%1").arg(lb)])
-		scrActions[QString("shade%1").arg(lb)]->setChecked(true);
-}
-*/
 
 #if 0
 //CB still called from SE
@@ -7509,6 +7367,76 @@
 	delete dia;
 }
 
+void ScribusMainWindow::editItemsFromOutlines(PageItem *ite)
+{
+	if (ite->locked())
+		return;
+	if (doc->m_Selection->count() != 0)
+	{
+		if (doc->m_Selection->itemAt(0) != ite)
+		{
+			if (ite->isGroup())
+				selectItemsFromOutlines(ite, true);
+			else
+				selectItemsFromOutlines(ite, false);
+		}
+	}
+	if (ite->asLatexFrame())
+	{
+		if (ite->imageShown())
+			view->requestMode(modeEdit);
+	}
+#ifdef HAVE_OSG
+	else if (ite->asOSGFrame())
+		view->requestMode(submodeEditExternal);
+#endif
+	else if ((ite->itemType() == PageItem::Polygon) || (ite->itemType() == PageItem::PolyLine) || (ite->itemType() == PageItem::Group) || (ite->itemType() == PageItem::ImageFrame) || (ite->itemType() == PageItem::PathText))
+	{
+		if (ite->itemType() == PageItem::ImageFrame)
+		{
+			if (ite->Pfile.isEmpty())
+				view->requestMode(submodeLoadPic);
+			else if (!ite->PictureIsAvailable)
+				view->requestMode(submodeStatusPic);
+			else if (ite->imageShown())
+				view->requestMode(modeEdit);
+		}
+		else if (ite->itemType() == PageItem::TextFrame)
+			view->requestMode(modeEdit);
+		else
+		{
+			view->requestMode(modeEditClip);
+			scrActions["itemUngroup"]->setEnabled(false);
+			propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
+		}
+	}
+	else if (ite->itemType() == PageItem::TextFrame)
+	{
+		if (ite->isAnnotation())
+		{
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			view->requestMode(submodeAnnotProps);
+		}
+		else if (doc->appMode != modeEdit)
+		{
+			view->requestMode(modeEdit);
+		}
+	}
+	else if (ite->asSymbolFrame())
+	{
+		if (!doc->symbolEditMode())
+			view->requestMode(submodeEditSymbol);
+	}
+	else if (ite->asArc())
+		view->requestMode(modeEditArc);
+	else if (ite->asRegularPolygon())
+		view->requestMode(modeEditPolygon);
+	else if (ite->asSpiral())
+		view->requestMode(modeEditSpiral);
+	else if (ite->asTable())
+		view->requestMode(modeEditTable);
+}
+
 void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite, bool single)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)
@@ -7546,53 +7474,6 @@
 	}
 }
 
-void ScribusMainWindow::selectItemsFromOutlines(int Page, int Item, bool single)
-{
-	if (HaveDoc && doc->appMode == modeEditClip)
-		view->requestMode(submodeEndNodeEdit);
-	activateWindow();
-	view->Deselect(true);
-	if ((Page != -1) && (Page != static_cast<int>(doc->currentPage()->pageNr())))
-		view->GotoPage(Page);
-	doc->m_Selection->delaySignalsOn();
-	view->SelectItemNr(Item, true, single);
-	doc->m_Selection->delaySignalsOff();
-	doc->m_Selection->connectItemToGUI();
-	if (doc->m_Selection->count() != 0)
-	{
-		PageItem *currItem = doc->m_Selection->itemAt(0);
-	 // jjsa 23-05-2004 added for centering of rotated objects
-	 	double rotation=currItem->rotation();
-		if ( rotation != 0.0 )
-		{
-			double MPI180=1.0/(180.0*M_PI);
-			double y1 = sin(rotation*MPI180) * currItem->width();
-			double x1 = cos(rotation*MPI180) * currItem->width();
-			double y2 = sin((rotation+90.0)*MPI180) * currItem->height();
-			double x2 = cos((rotation+90.0)*MPI180) * currItem->height();
-			double mx = currItem->xPos() + ((x1 + x2)/2.0);
-			double my = currItem->yPos() + ((y1 + y2)/2.0);
-//			double viewScale=view->scale();
-//			if ((qRound((currItem->xPos() + qMax(x1, x2)) * viewScale) > view->contentsWidth()) ||
-//				(qRound((currItem->yPos() + qMax(y1, y2)) * viewScale) > view->contentsHeight()))
-//				view->resizeContents(qMax(qRound((currItem->xPos() + qMax(x1, x2)) * viewScale),
-//									view->contentsWidth()),
-//									qMax(qRound((currItem->yPos() + qMax(y1, y2)) * viewScale), view->contentsHeight()));
-			view->SetCCPo(mx, my);
-		}
-		else
-		{
-//			double viewScale=view->scale();
-//			if ((qRound((currItem->xPos() + currItem->width()) * viewScale) > view->contentsWidth()) ||
-//				(qRound((currItem->yPos() + currItem->height()) * viewScale) > view->contentsHeight())
-//				)
-//				view->resizeContents(qMax(qRound((currItem->xPos() + currItem->width()) * viewScale), view->contentsWidth()),
-//									 qMax(qRound((currItem->yPos() + currItem->height()) * viewScale), view->contentsHeight()));
-			view->SetCCPo(currItem->xPos() + currItem->width() / 2.0, currItem->yPos() + currItem->height() / 2.0);
-		}
-	}
-}
-
 void ScribusMainWindow::selectPagesFromOutlines(int Page)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)
@@ -7603,117 +7484,8 @@
 		return;
 	view->GotoPage(Page);
 }
-/*
-void ScribusMainWindow::prefsOrg(Preferences *dia)
-{
-	//reset the appMode so we restore our tools shortcuts
-	QString oldUILanguage = prefsManager->uiLanguage();
-	QString oldUIStyle    = prefsManager->guiStyle();
-	QString oldMonitorProfile = ScCore->monitorProfile.productDescription();
-	bool    oldShowPageShadow = prefsManager->showPageShadow();
-	int     oldUIFontSize     = prefsManager->guiFontSize();
-	double  oldDisplayScale   = prefsManager->displayScale();
-	int     oldImageQuality   = prefsManager->applicationPrefs()->itemToolPrefs.imageLowResType;
-
-	dia->updatePreferences();
-	DocDir = prefsManager->documentDir();
-//		scrapbookPalette->rebuildView();
-//		scrapbookPalette->AdjustMenu();
-	QString newUILanguage = prefsManager->uiLanguage();
-	if (oldUILanguage != newUILanguage || ScQApp->currGUILanguage()!=newUILanguage)
-		ScQApp->changeGUILanguage(newUILanguage);
-	QString newUIStyle = prefsManager->guiStyle();
-	if (oldUIStyle != newUIStyle)
-	{
-		if (newUIStyle.isEmpty())
-			qApp->setStyle(prefsManager->guiSystemStyle());
-		else
-			qApp->setStyle(QStyleFactory::create(newUIStyle));
-		// Plain wrong, a style may set a palette different from the standard palette
-		// Eg : Windows XP and Windows Vista styles
-		// qApp->setPalette(qApp->style()->standardPalette());
-	}
-	int newUIFontSize = prefsManager->guiFontSize();
-	if (oldUIFontSize != newUIFontSize)
-	{
-		QFont apf = qApp->font();
-		apf.setPointSize(prefsManager->appPrefs.uiPrefs.applicationFontSize);
-		qApp->setFont(apf);
-	}
-	propertiesPalette->textPal->Fonts->RebuildList(0);
-	ScCore->getCMSProfiles(false);
-	ScCore->recheckGS();
-	prefsManager->applyLoadedShortCuts();
-
-	QString newMonitorProfile = prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile;
-	if (oldMonitorProfile != newMonitorProfile)
-	{
-		bool success = false;
-		if (ScCore->MonitorProfiles.contains(newMonitorProfile))
-		{
-			QString profilePath = ScCore->MonitorProfiles[newMonitorProfile];
-			ScColorProfile newProfile = ScCore->defaultEngine.openProfileFromFile(profilePath);
-			if (!newProfile.isNull())
-			{
-				ScCore->monitorProfile = newProfile;
-				success = true;
-			}
-		}
-		if (!success)
-		{
-			prefsManager->appPrefs.colorPrefs.DCMSset.DefaultMonitorProfile = oldMonitorProfile;
-			QString message = tr("An error occurred while opening monitor profile.\nFormer monitor profile will be used." );
-			if (ScCore->usingGUI())
-				QMessageBox::warning(this, CommonStrings::trWarning, message, QMessageBox::Ok, 0, 0);
-			else
-				qWarning( "%s", message.toLocal8Bit().data() );
-		}
-	}
-
-	int newImageQuality = prefsManager->appPrefs.itemToolPrefs.imageLowResType;
-	if (oldImageQuality != newImageQuality)
-		view->previewQualitySwitcher->setCurrentIndex(newImageQuality);
-
-	if (prefsManager->appPrefs.uiPrefs.useTabs)
-		mdiArea->setViewMode(QMdiArea::TabbedView);
-	else
-		mdiArea->setViewMode(QMdiArea::SubWindowView);
-	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
-	bool shadowChanged = oldShowPageShadow != prefsManager->showPageShadow();
-	if (!windows.isEmpty())
-	{
-		int windowCount=static_cast<int>(windows.count());
-		for ( int i = 0; i < windowCount; ++i )
-		{
-			QWidget* w = windows.at(i)->widget();
-			ScribusWin* scw = (ScribusWin*) w;
-			if (oldDisplayScale != prefsManager->displayScale())
-			{
-				int x = qRound(qMax(scw->view()->contentsX() / scw->view()->scale(), 0.0));
-				int y = qRound(qMax(scw->view()->contentsY() / scw->view()->scale(), 0.0));
-				int w = qRound(qMin(scw->view()->visibleWidth() / scw->view()->scale(), scw->doc()->currentPage()->width()));
-				int h = qRound(qMin(scw->view()->visibleHeight() / scw->view()->scale(), scw->doc()->currentPage()->height()));
-				scw->view()->rememberOldZoomLocation(w / 2 + x,h / 2 + y);
-				scw->view()->zoom((scw->view()->scale() / oldDisplayScale) * prefsManager->displayScale());
-			}
-			if (shadowChanged)
-				scw->view()->DrawNew();
-		}
-	}
-
-	prefsManager->SavePrefs();
-}
 
 void ScribusMainWindow::slotPrefsOrg()
-{
-	slotSelect();
-
-	Preferences dia(this);
-	if (dia.exec()==QDialog::Accepted)
-		prefsOrg(&dia);
-}
-*/
-void ScribusMainWindow::slotPrefs150Org()
 {
 	QString oldMonitorProfile(ScCore->monitorProfile.productDescription());
 	slotSelect();
@@ -7812,72 +7584,7 @@
 	}
 }
 
-/*
-void ScribusMainWindow::docSetup(ReformDoc* dia)
-{
-	slotChangeUnit(dia->getSelectedUnit(), false);
-	dia->updateDocumentSettings();
-	if (dia->imageResolutionChanged())
-	{
-		setStatusBarInfoText( tr("Updating Images"));
-		mainWindowProgressBar->reset();
-		qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
-		qApp->processEvents();
-		doc->recalcPicturesRes(true);
-		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-		setStatusBarInfoText("");
-		mainWindowProgressBar->reset();
-		view->previewQualitySwitcher->blockSignals(true);
-		view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
-		view->previewQualitySwitcher->blockSignals(false);
-	}
-	propertiesPalette->textPal->Fonts->RebuildList(doc);
-	scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
-	scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);
-	scrActions["viewShowFrames"]->setChecked(doc->guidesPrefs().framesShown);
-	scrActions["viewShowLayerMarkers"]->setChecked(doc->guidesPrefs().layerMarkersShown);
-	scrActions["viewShowGrid"]->setChecked(doc->guidesPrefs().gridShown);
-	scrActions["viewShowGuides"]->setChecked(doc->guidesPrefs().guidesShown);
-	scrActions["viewShowColumnBorders"]->setChecked(doc->guidesPrefs().colBordersShown);
-	scrActions["viewShowBaseline"]->setChecked(doc->guidesPrefs().baselineGridShown);
-	scrActions["viewShowImages"]->setChecked(doc->guidesPrefs().showPic);
-	scrActions["viewShowTextChain"]->setChecked(doc->guidesPrefs().linkShown);
-	scrActions["viewShowTextControls"]->setChecked(doc->guidesPrefs().showControls);
-	scrActions["viewShowRulers"]->setChecked(doc->guidesPrefs().rulersShown);
-	scrActions["viewRulerMode"]->setChecked(doc->guidesPrefs().rulerMode);
-	scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
-	view->cmsToolbarButton->setChecked(doc->HasCMS);
-	//doc emits changed() via this
-	doc->setMasterPageMode(true);
-	view->reformPages();
-	doc->setMasterPageMode(false);
-//	doc->setLoading(true);
-//	uint pageCount=doc->DocPages.count();
-//	for (uint c=0; c<pageCount; ++c)
-//		Apply_MasterPage(doc->DocPages.at(c)->MPageNam, c, false);
-//	doc->setLoading(false);
-	view->reformPages();
-	view->GotoPage(doc->currentPage()->pageNr());
-	view->DrawNew();
-	propertiesPalette->imagePal->showCMSOptions();
-	pagePalette->rebuildPages();
-}
-
-bool ScribusMainWindow::slotDocSetup()
-{
-	bool ret = false;
-	ReformDoc* dia = new ReformDoc(this, doc);
-	Q_CHECK_PTR(dia);
-	if (dia->exec())
-	{
-		docSetup(dia);
-		ret = true;
-	}
-	delete dia;
-	return ret;
-}
-*/
-void ScribusMainWindow::slotDocSetup150()
+void ScribusMainWindow::slotDocSetup()
 {
 	if (!doc)
 		return;

Modified: branches/ScribusOIF/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/scribus.h
==============================================================================
--- branches/ScribusOIF/scribus/scribus.h (original)
+++ branches/ScribusOIF/scribus/scribus.h Thu Nov 24 22:37:33 2011
@@ -89,7 +89,6 @@
 class PropertiesPalette;
 class PropertiesPalette_Content;
 class PropertiesPalette_Frame;
-//class ReformDoc;
 class ScToolBar;
 class ScrAction;
 class ScribusDoc;
@@ -226,7 +225,6 @@
 	AlignDistributePalette *alignDistributePalette;
 	StoryEditor* storyEditor;
 	StoryEditor* CurrStED;
-// 	QMap<QString,QString> Sprachen; // <language not translated, file name>
 	QMdiArea *mdiArea;
 	ScribusWin* ActWin;
 	QClipboard *ClipB;
@@ -264,14 +262,11 @@
 	void DelBookMark(PageItem *ite);
 	void BookMarkTxT(PageItem *ite);
 	void StoreBookmarks();
-	//void setItemFillTransparency(double t);
-	//void setItemLineTransparency(double t);
 	void setStatusBarMousePosition(double xp, double yp);
 	void setStatusBarTextPosition(double base, double xp);
 	void setTempStatusBarText(const QString &text);
 	void setStatusBarInfoText(QString newText);
 	bool DoFileClose();
-	//bool DoSaveClose();
 	void windowsMenuAboutToShow();
 	//! \brief Handle the Extras menu for its items availability.
 	void extrasMenuAboutToShow();
@@ -281,15 +276,12 @@
 	void windowsMenuActivated(int id);
 	void UnDoAction();
 	void RedoAction();
-	//void doHyphenate();
-	//void doDeHyphenate();
 	void slotTest();
 	void slotTest2();
 	void PutScrap(int scID);
 	void PutToPatterns();
 	void changeLayer(int);
 	void showLayer();
-	//void LayerRemove(int l, bool dl = false);
 	void ManageJava();
 	void editSelectedSymbolStart();
 	void editSymbolStart(QString temp);
@@ -365,7 +357,6 @@
 	void SelectAllOnLayer();
 	void deselectAll();
 	void ClipChange();
-	//void clearContents();
 	/** \brief shows an about dialog*/
 	void slotHelpAbout();
 	void slotHelpAboutPlugins();
@@ -413,15 +404,8 @@
 	void ToggleColumnBorders();
 	void ToggleRulers();
 	void ToggleRulerMode();
-	/* Schaltet Masspalette ein/aus */
-	//void togglePropertiesPalette();
-	/* Schaltet Uebersichtspalette ein/aus*/
-	//void toggleOutlinePalette();
-	//void toggleScrapbookPalette();
-	//void toggleLayerPalette();
 	void togglePagePalette();
 	void setPagePalette(bool visible);
-	//void toggleBookmarkPalette();
 	void toggleUndoPalette();
 	void setUndoPalette(bool visible);
 	void toggleCheckPal();
@@ -450,17 +434,12 @@
 	void SetNewFont(const QString& nf);
 	/** Setz die Zeichensatzgroesse */
 	void setItemFSize(int id);
-	/** Farbeditor */
-//	void slotEditColors();
 	/** Color Replacement */
 	void slotReplaceColors();
 	/** Style Manager */
 
-	//CB: void setCSMenu();
 	/** Erzeugt einen Rahmen */
 	void MakeFrame(int f, int c, double *vals);
-	//** Loescht ein Element */
-	//void DeleteObjekt();
 	/** Duplicate current item */
 	void duplicateItem();
 	/** Multiple duplicate current item*/
@@ -475,8 +454,8 @@
 	void setNewParStyle(const QString& name);
 	void setNewCharStyle(const QString& name);
 	void setAlignmentValue(int a);
+	void editItemsFromOutlines(PageItem *ite);
 	void selectItemsFromOutlines(PageItem *ite, bool single = false);
-	void selectItemsFromOutlines(int ScPage, int Item, bool single = false);
 	void selectPagesFromOutlines(int ScPage);
 	void doPrintPreview();
 	void printPreview();
@@ -514,33 +493,18 @@
 	void setUndoMode(bool isObjectSpecific);
 	//! \brief Apply a Lorem Ipsum to the each item in a selection
 	void insertSampleText();
-	//void sendToLayer(int layerNumber);
 	void updateItemLayerList();
 	void updateColorLists();
-	/*! \brief Apply changes from ReformDoc dialog.
-	It's called from this->slotDocSetup() or from ReformDoc directly.
-	\param dia a reference to the ReformDoc dialog */
-//	void docSetup(ReformDoc* dia);
-	/*! \brief Apply changes from Preferences dialog.
-	It's called from this->slotPrefsOrg() or from Preferences directly.
-	\param dia a reference to the Preferences dialog */
-//	void prefsOrg(Preferences* dia);
 	/*! \brief Change Preferences dialog.
 	See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
-//	void slotPrefsOrg();
-	void slotPrefs150Org();
+	void slotPrefsOrg();
 	/** \brief Refromat the document when user click "OK" in ReformDoc dialog.
 	See docSetup() for more info. */
-//	bool slotDocSetup();
-	void slotDocSetup150();
+	void slotDocSetup();
 	//! \brief Insert a frame friendly dialog
 	void slotInsertFrame();
 	//! \brief Transform an item
 	void slotItemTransform();
-//	//! \brief manages the documents patterns
-//	void managePatterns();
-	//! \brief manages the documents gradients
-//	void manageGradients();
 	//! \brief manages paints
 	void managePaints();
 	//! \brief enable or disable the unicode actions and their menus

Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Thu Nov 24 22:37:33 2011
@@ -5074,6 +5074,14 @@
 		// If no or page owner is incorrect, recompute page owner
 		currItem->OwnPage = OnPage(currItem);
  	}
+
+	// #10379: Scribus crash when opening .sla document
+	// OwnPage is not meaningful for inline frame
+	for (int i = 0; i < FrameItems.count(); ++i)
+	{
+		currItem = FrameItems.at(i);
+		currItem->OwnPage = -1;
+ 	}
 }
 
 
@@ -12194,13 +12202,6 @@
 	return retw;
 }
 
-/*
-void ScribusDoc::RotateItem(double angle, int ite)
-{
-	RotateItem(angle, Items->at(ite));
-}
-*/
-
 void ScribusDoc::RotateItem(double angle, PageItem *currItem)
 {
 	if (currItem->locked())
@@ -12270,13 +12271,6 @@
 	MoveItem(-mxc, -myc, currItem, fromMP);
 }
 
-/*
-bool ScribusDoc::SizeItem(double newX, double newY, int ite, bool fromMP, bool DoUpdateClip, bool redraw)
-{
-	return SizeItem(newX, newY, Items->at(ite), fromMP, DoUpdateClip, redraw);
-}
-*/
-
 bool ScribusDoc::SizeItem(double newX, double newY, PageItem *pi, bool fromMP, bool DoUpdateClip, bool redraw)
 {
 	PageItem *currItem = pi;
@@ -12419,13 +12413,6 @@
 	return true;
 }
 
-/*
-bool ScribusDoc::MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP, bool constrainRotation)
-{
-	PageItem *currItem = Items->at(ite);
-	return MoveSizeItem(newX, newY, currItem, fromMP, constrainRotation);
-}
-*/
 bool ScribusDoc::MoveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP, bool constrainRotation)
 {
 	QRectF oldR(currItem->getBoundingRect());
@@ -12552,8 +12539,6 @@
 	currItem->updateGradientVectors();
 	currItem->Sizing = siz;
 }
-
-
 
 void ScribusDoc::moveGroup(double x, double y, bool fromMP, Selection* customSelection)
 {
@@ -13183,9 +13168,7 @@
 			}
 			if ((currItem->width() != currItem->groupWidth) || (currItem->height() != currItem->groupHeight))
 				scaleGroup(currItem->width() / currItem->groupWidth, currItem->height() / currItem->groupHeight, true, &tempSelection, true);
-			QTransform ma;
-			ma.translate(currItem->xPos(), currItem->yPos());
-			ma.rotate(currItem->rotation());
+			QTransform ma = currItem->getTransform();
 			FPoint n;
 			for (int a = 0; a < tempSelection.count(); ++a)
 			{
@@ -13254,6 +13237,58 @@
 		m_ScMW->HaveNewSel(itemSelection->itemAt(0)->itemType());
 		regionsChanged()->update(QRectF(x-5, y-5, w+10, h+10));
 	}
+}
+
+void ScribusDoc::addToGroup(PageItem* group, PageItem* item)
+{
+	QTransform groupTrans = group->getTransform();
+	QTransform itemTrans = item->getTransform();
+	QPointF grPos = groupTrans.map(QPointF(0, 0));
+	QPointF itPos = itemTrans.map(QPointF(0, 0));
+	double gRot = getRotationDFromMatrix(groupTrans);
+	groupTrans.scale(group->width() / group->groupWidth, group->height() / group->groupHeight);
+	double grScXi = 1.0;
+	double grScYi = 1.0;
+	getScaleFromMatrix(groupTrans, grScXi, grScYi);
+	QTransform mm;
+	mm.rotate(gRot);
+	mm.scale(1.0 / grScXi, 1.0 / grScYi);
+	QLineF d = QLineF(0.0, 0.0, itPos.x() - grPos.x(), itPos.y() - grPos.y());
+	d = mm.map(d);
+	item->gXpos = d.p2().x();
+	item->gYpos = d.p2().y();
+	SizeItem(item->width() * (1.0 / grScXi), item->height() * (1.0 / grScYi), item, false, true, false);
+	if (item->Parent != NULL)
+		item->Parent->groupItemList.removeAll(item);
+	else
+		Items->removeAll(item);
+	item->Parent = group;
+	item->rotateBy(gRot);
+	item->setLineWidth(item->lineWidth() / qMax(grScXi, grScYi));
+	item->setImageXScale(item->imageXScale() / grScXi);
+	item->setImageYScale(item->imageYScale() / grScYi);
+}
+
+void ScribusDoc::removeFromGroup(PageItem* item)
+{
+	if (item->Parent == NULL)
+		return;
+	PageItem* group = item->Parent;
+	QTransform itemTrans = item->getTransform();
+	QTransform groupTrans = group->getTransform();
+	QPointF itPos = itemTrans.map(QPointF(0, 0));
+	double grScXi = 1.0;
+	double grScYi = 1.0;
+	getScaleFromMatrix(itemTrans, grScXi, grScYi);
+	double gRot = getRotationDFromMatrix(groupTrans);
+	SizeItem(item->width() * grScXi, item->height() * grScYi, item, false, true, false);
+	item->setXYPos(itPos.x(), itPos.y(), true);
+	item->rotateBy(-gRot);
+	group->groupItemList.removeAll(item);
+	item->Parent = NULL;
+	item->setLineWidth(item->lineWidth() * qMax(grScXi, grScYi));
+	item->setImageXScale(item->imageXScale() * grScXi);
+	item->setImageYScale(item->imageYScale() * grScYi);
 }
 
 void ScribusDoc::itemSelection_UniteItems(Selection* /*customSelection*/)

Modified: branches/ScribusOIF/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/scribusdoc.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.h (original)
+++ branches/ScribusOIF/scribus/scribusdoc.h Thu Nov 24 22:37:33 2011
@@ -975,6 +975,8 @@
 	void groupObjectsToItem(PageItem* groupItem, QList<PageItem*> &itemList);
 	const 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);
 	void itemSelection_convertItemsTo(const PageItem::ItemType newType, Selection* restoredSelection=0, Selection* customSelection=0);
 
 	void itemSelection_ApplyParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0, bool rmDirectFormatting = false);
@@ -1057,12 +1059,9 @@
 	bool ApplyGuides(double *x, double *y);
 	bool ApplyGuides(FPoint* point);
 	bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false);
-//	void RotateItem(double win, int ite);
 	void RotateItem(double win, PageItem *currItem);
 	void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false);
-//	bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
 	bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
-//	bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false);
 	bool MoveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP = false, bool constrainRotation = false);
 	void AdjustItemSize(PageItem *currItem, bool includeGroup = false, bool moveInGroup = true);
 	void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0);

Modified: branches/ScribusOIF/scribus/styles/paragraphstyle.attrdefs.cxx
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/styles/paragraphstyle.attrdefs.cxx
==============================================================================
--- branches/ScribusOIF/scribus/styles/paragraphstyle.attrdefs.cxx (original)
+++ branches/ScribusOIF/scribus/styles/paragraphstyle.attrdefs.cxx Thu Nov 24 22:37:33 2011
@@ -39,4 +39,5 @@
 ATTRDEF(int, keepLinesEnd, KeepLinesEnd, 0)
 ATTRDEF(bool, keepWithNext, KeepWithNext, false)
 ATTRDEF(bool, keepTogether, KeepTogether, false)
+ATTRDEF(QString, dcCharStyleName, DcCharStyleName,"")
 

Modified: branches/ScribusOIF/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/text/storytext.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/storytext.cpp (original)
+++ branches/ScribusOIF/scribus/text/storytext.cpp Thu Nov 24 22:37:33 2011
@@ -484,8 +484,8 @@
 
 	data->insertObject(InlineFrame(ob), pos);
 	ob->isEmbedded = true;   // this might not be enough...
-}
-
+	ob->OwnPage = -1; // #10379: OwnPage is not meaningful for inline object
+}
 
 int StoryText::length() const
 {

Modified: branches/ScribusOIF/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/annot.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/annot.cpp (original)
+++ branches/ScribusOIF/scribus/ui/annot.cpp Thu Nov 24 22:37:33 2011
@@ -877,7 +877,7 @@
 	LayoutFN1c->setSpacing( 5 );
 	LayoutFN1c->setMargin( 0 );
 	Format0c = new QComboBox(DateGroup);
-	QString tmp_form[] = {"m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "dd/mm/yy", "dd/mm/yyyy", "yy-mm-dd",
+	QString tmp_form[] = {"m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "dd/mm/yy", "dd/mm/yyyy", "dd.mm.yyyy", "yy-mm-dd",
 	                    "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM", "yyyy-mm-dd"};
 	size_t array_form = sizeof(tmp_form) / sizeof(*tmp_form);
 	/* PFJ - 28/02/04 - Altered from uint to int and var name */
@@ -1469,6 +1469,8 @@
 		tmp = "dd-MMM-yy";
 	if (ds == "dd/mm/yy")
 		tmp = "dd/MM/yy";
+	if (ds == "dd.mm.yyyy")
+		tmp = "dd.MM.yyyy";
 	if (ds == "dd/mm/yyyy")
 		tmp = "dd/MM/yyyy";
 	if (ds == "yy-mm-dd")

Modified: branches/ScribusOIF/scribus/ui/masterpagepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/masterpagepalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/masterpagepalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/masterpagepalette.cpp Thu Nov 24 22:37:33 2011
@@ -33,12 +33,7 @@
 #include "selection.h"
 #include "util_icon.h"
 
-MasterPagesPalette::MasterPagesPalette( QWidget* parent, ScribusDoc *pCurrentDoc, ScribusView *pCurrentView, QString masterPageName)
-#if QT_VERSION >= 0x040500
-	: QDialog( parent, Qt::Tool | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
-#else
-	: QDialog( parent, Qt::Tool | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint | Qt::WindowType(0x08000000))
-#endif
+MasterPagesPalette::MasterPagesPalette( QWidget* parent, ScribusDoc *pCurrentDoc, ScribusView *pCurrentView, QString masterPageName) : ScrPaletteBase( parent, "MasterPages", false, 0 )
 {
 	setAttribute(Qt::WA_DeleteOnClose);
 	setModal(false);
@@ -112,6 +107,7 @@
 void MasterPagesPalette::closeEvent(QCloseEvent *closeEvent)
 {
 	emit finished();
+	hide();
 	closeEvent->accept();
 }
 

Modified: branches/ScribusOIF/scribus/ui/masterpagepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/masterpagepalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/masterpagepalette.h (original)
+++ branches/ScribusOIF/scribus/ui/masterpagepalette.h Thu Nov 24 22:37:33 2011
@@ -7,8 +7,6 @@
 #ifndef MUSTERPAGES_H
 #define MUSTERPAGES_H
 
-#include <QDialog>
-
 class QCloseEvent;
 class QHBoxLayout;
 class QListWidget;
@@ -17,13 +15,14 @@
 class QVBoxLayout;
 
 #include "scribusapi.h"
+#include "scrpalettebase.h"
 class ScribusDoc;
 class ScribusView;
 
 
 /*! \brief A dialog to manage/edit Master Pages
 */
-class SCRIBUS_API MasterPagesPalette : public QDialog
+class SCRIBUS_API MasterPagesPalette : public ScrPaletteBase
 {
 	Q_OBJECT
 

Modified: branches/ScribusOIF/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/outlinepalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/outlinepalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/outlinepalette.cpp Thu Nov 24 22:37:33 2011
@@ -88,16 +88,13 @@
 		id = idxs.at(0);
 	if (id.isValid())
 		it = itemFromIndex(id);
-	QTreeWidgetItem *oldParent = it->parent();
-	QTreeWidgetItem *oldPageParent = NULL;
-	OutlineTreeItem *itemP = (OutlineTreeItem*)oldParent;
-	if (itemP->type == 5)		// old Parent is a Layer
-	{
-		oldPageParent = it->parent()->parent();
-		haveLayers = true;
-	}
-	else
-		oldPageParent = it->parent();
+	OutlineTreeItem *itemPar = (OutlineTreeItem*)it->parent();
+	while (itemPar->type != 2)
+	{
+		if (itemPar->type == 5)
+			haveLayers = true;
+		itemPar = (OutlineTreeItem*)itemPar->parent();
+	}
 	QTreeWidget::dropEvent(e);
 	if (it != NULL)
 	{
@@ -105,96 +102,112 @@
 		if (item != NULL)
 		{
 			OutlineTreeItem *itemPl = (OutlineTreeItem*)it->parent();
-			OutlineTreeItem *itemPar = (OutlineTreeItem*)oldPageParent;
 			OutlineTreeItem *itemPg;
 			if (itemPl->type == 5)
 			{
 				itemPg = (OutlineTreeItem*)it->parent()->parent();
 			}
-			else
+			else if (itemPl->type == 2)
 			{
 				itemPg = (OutlineTreeItem*)it->parent();
 				if (haveLayers)
 				{
-					itemPl = (OutlineTreeItem*)itemBelow(itemPg);
+					itemPl = (OutlineTreeItem*)itemPg->child(0);
 					itemPg->removeChild(it);
 					itemPl->addChild(it);
 				}
 			}
-			if (itemPl->childCount() > 1)
-			{
-				if (itemAbove(it) != NULL)		// do we have a pageitem above us
-				{
-					OutlineTreeItem *itemAb = (OutlineTreeItem*)itemAbove(it);
-					if ((itemAb->type == 1) || (itemAb->type == 3) || (itemAb->type == 4))
-					{
+			else
+			{
+				itemPg = (OutlineTreeItem*)it->parent();
+				while (itemPg->type != 2)
+				{
+					itemPg = (OutlineTreeItem*)itemPg->parent();
+				}
+			}
+			if (itemPl->indexOfChild(it) != itemPl->childCount() - 1)
+			{
+				OutlineTreeItem *itemBe = (OutlineTreeItem*)itemPl->child(itemPl->indexOfChild(it) + 1);
+				if ((itemBe->type == 1) || (itemBe->type == 3) || (itemBe->type == 4))
+				{
+					if (item->PageItemObject->Parent == NULL)
 						item->DocObject->Items->takeAt(item->DocObject->Items->indexOf(item->PageItemObject));
-						int d = item->DocObject->Items->indexOf(itemAb->PageItemObject);
-						item->DocObject->Items->insert(d, item->PageItemObject);
+					else
+						item->DocObject->removeFromGroup(item->PageItemObject);
+					if (itemBe->PageItemObject->Parent == NULL)
+					{
+						int d = item->DocObject->Items->indexOf(itemBe->PageItemObject);
+						item->DocObject->Items->insert(d+1, item->PageItemObject);
 						if (itemPl->type == 5)
 							item->PageItemObject->setLayer(itemPl->LayerID);
 						double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
 						double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
 						item->PageItemObject->setXYPos(xx, yy);
-						item->DocObject->setModified(true);
-						item->PageItemObject->setRedrawBounding();
-						item->DocObject->scMW()->showLayer();
-						item->DocObject->scMW()->closeActiveWindowMasterPageEditor();
-						if (item->PageItemObject->isGroup())
-						{
-							item->DocObject->GroupOnPage(item->PageItemObject);
-							item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, false);
-						}
+					}
+					else
+					{
+						PageItem* group = itemBe->PageItemObject->Parent;
+						int d = group->groupItemList.indexOf(itemBe->PageItemObject);
+						double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
+						double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
+						item->PageItemObject->setXYPos(xx, yy);
+						item->DocObject->addToGroup(group, item->PageItemObject);
+						group->groupItemList.insert(d, item->PageItemObject);
+						item->PageItemObject->setLayer(group->LayerID);
+					}
+					item->PageItemObject->setRedrawBounding();
+					item->DocObject->setModified(true);
+					item->DocObject->scMW()->showLayer();
+					item->DocObject->scMW()->closeActiveWindowMasterPageEditor();
+					if (item->PageItemObject->isGroup())
+					{
+						item->DocObject->GroupOnPage(item->PageItemObject);
+						item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, false);
+					}
+					else
+					{
+						item->PageItemObject->OwnPage = item->DocObject->OnPage(item->PageItemObject);
+						item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, true);
+					}
+					QList<QTreeWidgetItem*> selList;
+					selList.append(it);
+					selectItems(selList);
+				}
+			}
+			else
+			{
+		//		itemPl->insertChild(0, itemPl->takeChild(itemPl->indexOfChild(it)));
+				if ((itemPl->type == 2) || (itemPl->type == 5))
+				{
+					if (item->PageItemObject->Parent != NULL)
+					{
+						item->DocObject->removeFromGroup(item->PageItemObject);
+						item->DocObject->Items->append(item->PageItemObject);
+					}
+					if (itemPl->type == 5)
+						item->PageItemObject->setLayer(itemPl->LayerID);
+					double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
+					double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
+					item->PageItemObject->setXYPos(xx, yy);
+				}
+				else
+				{
+					OutlineTreeItem *itemBe = (OutlineTreeItem*)it->parent();
+					if ((itemBe->type == 1) || (itemBe->type == 3) || (itemBe->type == 4))
+					{
+						if (item->PageItemObject->Parent == NULL)
+							item->DocObject->Items->takeAt(item->DocObject->Items->indexOf(item->PageItemObject));
 						else
-						{
-							item->PageItemObject->OwnPage = item->DocObject->OnPage(item->PageItemObject);
-							item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, true);
-						}
-						QList<QTreeWidgetItem*> selList;
-						selList.append(it);
-						selectItems(selList);
-					}
-					else if (itemBelow(it) != NULL)
-					{
-						OutlineTreeItem *itemBe = (OutlineTreeItem*)itemBelow(it);
-						if ((itemBe->type == 1) || (itemBe->type == 3) || (itemBe->type == 4))
-						{
-							item->DocObject->Items->takeAt(item->DocObject->Items->indexOf(item->PageItemObject));
-							int d = item->DocObject->Items->indexOf(itemBe->PageItemObject);
-							item->DocObject->Items->insert(d+1, item->PageItemObject);
-							if (itemPl->type == 5)
-								item->PageItemObject->setLayer(itemPl->LayerID);
-							double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
-							double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
-							item->PageItemObject->setXYPos(xx, yy);
-							item->PageItemObject->setRedrawBounding();
-							item->DocObject->setModified(true);
-							item->DocObject->scMW()->showLayer();
-							item->DocObject->scMW()->closeActiveWindowMasterPageEditor();
-							if (item->PageItemObject->isGroup())
-							{
-								item->DocObject->GroupOnPage(item->PageItemObject);
-								item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, false);
-							}
-							else
-							{
-								item->PageItemObject->OwnPage = item->DocObject->OnPage(item->PageItemObject);
-								item->DocObject->scMW()->selectItemsFromOutlines(item->PageItemObject, true);
-							}
-							QList<QTreeWidgetItem*> selList;
-							selList.append(it);
-							selectItems(selList);
-						}
-					}
-				}
-			}
-			else
-			{
-				if (itemPl->type == 5)
-					item->PageItemObject->setLayer(itemPl->LayerID);
-				double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
-				double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
-				item->PageItemObject->setXYPos(xx, yy);
+							item->DocObject->removeFromGroup(item->PageItemObject);
+						PageItem* group = itemBe->PageItemObject;
+						double xx = item->PageItemObject->xPos() - itemPar->PageObject->xOffset() + itemPg->PageObject->xOffset();
+						double yy = item->PageItemObject->yPos() - itemPar->PageObject->yOffset() + itemPg->PageObject->yOffset();
+						item->PageItemObject->setXYPos(xx, yy);
+						item->DocObject->addToGroup(group, item->PageItemObject);
+						group->groupItemList.append(item->PageItemObject);
+						item->PageItemObject->setLayer(group->LayerID);
+					}
+				}
 				item->PageItemObject->setRedrawBounding();
 				item->DocObject->setModified(true);
 				item->DocObject->scMW()->showLayer();
@@ -420,6 +433,7 @@
 	connect(reportDisplay, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotDoRename(QTreeWidgetItem*, int)));
 	connect(filterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(filterTree(const QString&)));
 //	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
+	connect(reportDisplay, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(slotDoubleClick(QTreeWidgetItem*, int)));
 }
 
 void OutlinePalette::setMainWindow(ScribusMainWindow *mw)
@@ -892,7 +906,7 @@
 	connect(reportDisplay, SIGNAL(itemSelectionChanged()), this, SLOT(slotMultiSelect()));
 }
 
-void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int col)
+void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int)
 {
 	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
 		return;
@@ -935,6 +949,31 @@
 			break;
 	}
 	selectionTriggered = false;
+}
+
+void OutlinePalette::slotDoubleClick(QTreeWidgetItem* ite, int)
+{
+	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
+		return;
+	OutlineTreeItem *item = (OutlineTreeItem*)ite;
+	PageItem *pgItem = NULL;
+	switch (item->type)
+	{
+		case 1:
+			if (!currDoc->masterPageMode())
+				emit selectMasterPage(item->PageItemObject->OnMasterPage);
+			pgItem = item->PageItemObject;
+			emit editElementByItem(pgItem);
+			break;
+		case 3:
+		case 4:
+			pgItem = item->PageItemObject;
+			m_MainWindow->closeActiveWindowMasterPageEditor();
+			emit editElementByItem(pgItem);
+			break;
+		default:
+			break;
+	}
 }
 
 void OutlinePalette::BuildTree(bool storeVals)
@@ -979,7 +1018,7 @@
 				object->type = 3;
 				object->setText(0, pgItem->itemName());
 				setItemIcon(object, pgItem);
-				object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+				object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 			}
 			else
 			{
@@ -990,7 +1029,7 @@
 				object->type = 3;
 				object->setText(0, pgItem->itemName());
 				object->setIcon( 0, groupIcon );
-				object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+				object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 				parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->Pages->at(0));
 			}
 		}
@@ -1020,7 +1059,7 @@
 						object->type = 1;
 						object->setText(0, pgItem->itemName());
 						setItemIcon(object, pgItem);
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 					}
 					else
 					{
@@ -1031,7 +1070,7 @@
 						object->type = 1;
 						object->setText(0, pgItem->itemName());
 						object->setIcon( 0, groupIcon );
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						parseSubGroup(object, &pgItem->groupItemList, 1, currDoc->MasterPages.at(a));
 					}
 				}
@@ -1083,7 +1122,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 						}
 						else
 						{
@@ -1094,7 +1133,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->DocPages.at(a));
 						}
 					}
@@ -1118,7 +1157,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 						}
 						else
 						{
@@ -1129,7 +1168,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->DocPages.at(a));
 						}
 					}
@@ -1179,7 +1218,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						}
 						else
 						{
@@ -1190,7 +1229,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 4, NULL);
 						}
 					}
@@ -1212,7 +1251,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						}
 						else
 						{
@@ -1223,7 +1262,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 4, NULL);
 						}
 					}
@@ -1288,8 +1327,10 @@
 			grp->type = itemType;
 			grp->setText(0, pgItem->itemName());
 			setItemIcon(grp, pgItem);
-			grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-//			grp->setFlags(Qt::ItemIsEnabled);
+			if (itemType == 3)
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+			else
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 		}
 		else
 		{
@@ -1300,8 +1341,10 @@
 			grp->type = itemType;
 			grp->setText(0, pgItem->itemName());
 			grp->setIcon( 0, groupIcon );
-			grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-//			grp->setFlags(Qt::ItemIsEnabled);
+			if (itemType == 3)
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
+			else
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 			parseSubGroup(grp, &pgItem->groupItemList, itemType, a);
 		}
 	}

Modified: branches/ScribusOIF/scribus/ui/outlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/outlinepalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/outlinepalette.h (original)
+++ branches/ScribusOIF/scribus/ui/outlinepalette.h Thu Nov 24 22:37:33 2011
@@ -84,6 +84,7 @@
 signals:
 	void ToggleAllPalettes();
 	void selectElementByItem(PageItem *, bool);
+	void editElementByItem(PageItem *);
 	void selectPage(int);
 	void selectMasterPage(QString);
 
@@ -92,6 +93,7 @@
 	void slotDoRename(QTreeWidgetItem* ite, int col);
 	void slotMultiSelect();
 	void slotSelect(QTreeWidgetItem* ite, int col);
+	void slotDoubleClick(QTreeWidgetItem* ite, int col);
 protected:
 	void filterTree();
 	void clearPalette();

Modified: branches/ScribusOIF/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/prefs_guides.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_guides.cpp (original)
+++ branches/ScribusOIF/scribus/ui/prefs_guides.cpp Thu Nov 24 22:37:33 2011
@@ -11,18 +11,27 @@
 #include "scribusdoc.h"
 #include "scrspinbox.h"
 #include "units.h"
+#include "util_icon.h"
 
 Prefs_Guides::Prefs_Guides(QWidget* parent, ScribusDoc* doc)
 	: Prefs_Pane(parent)
 {
 	setupUi(this);
 	languageChange();
+	buttonUp->setIcon(loadIcon("16/go-up.png"));
+	buttonUp->setEnabled(false);
+	buttonDown->setIcon(loadIcon("16/go-down.png"));
+	buttonDown->setEnabled(false);
 
 	connect(guideColorPushButton, SIGNAL(clicked()), this, SLOT(changeGuideColor()));
 	connect(marginColorPushButton, SIGNAL(clicked()), this, SLOT(changeMarginColor()));
 	connect(majorGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeMajorColor()));
 	connect(minorGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeMinorColor()));
 	connect(baselineGridColorPushButton, SIGNAL(clicked()), this, SLOT(changeBaselineColor()));
+	connect(buttonUp, SIGNAL(clicked()), this, SLOT(moveUp()));
+	connect(buttonDown, SIGNAL(clicked()), this, SLOT(moveDown()));
+	connect(guidePlacementListBox, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(select(QListWidgetItem*)));
+	connect(visibilityGridCheckBox, SIGNAL(clicked()), this, SLOT(gridClicked()));
 }
 
 Prefs_Guides::~Prefs_Guides()
@@ -31,13 +40,31 @@
 
 void Prefs_Guides::languageChange()
 {
-	int i=guidePlacementComboBox->currentIndex();
-	guidePlacementComboBox->clear();
-	guidePlacementComboBox->addItem( tr ("In the Background") );
-	guidePlacementComboBox->addItem( tr ("In the Foreground") );
-	guidePlacementComboBox->setCurrentIndex(i<0?0:i);
-
-	guidePlacementComboBox->setToolTip( tr( "Place guides in front of or behind objects on the page" ) );
+	guidePlacementListBox->clear();
+	int renderStackCount = renderStackOrder.count();
+	for (int r = renderStackCount - 1; r > -1; r--)
+	{
+		QListWidgetItem *item;
+		int it = renderStackOrder[r];
+		if (it == 4)
+			item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
+		else if (it == 3)
+			item = new QListWidgetItem( tr("Guides"), guidePlacementListBox);
+		else if (it == 2)
+			item = new QListWidgetItem( tr("Grid"), guidePlacementListBox);
+		else if (it == 1)
+			item = new QListWidgetItem( tr("Baseline Grid"), guidePlacementListBox);
+		else if (it == 0)
+			item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
+		item->setData(Qt::UserRole, it);
+		item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	}
+	int grTy = gridTypeCombo->currentIndex();
+	gridTypeCombo->clear();
+	gridTypeCombo->addItem( tr("Lines"));
+	gridTypeCombo->addItem( tr("Crosses and Dots"));
+	gridTypeCombo->setCurrentIndex(grTy);
+	guidePlacementListBox->setToolTip( tr( "Place guides in front of or behind objects on the page" ) );
 	minorGridSpacingSpinBox->setToolTip( tr( "Distance between the minor grid lines" ) );
 	majorGridSpacingSpinBox->setToolTip( tr( "Distance between the major grid lines" ) );
 	guideSnapDistanceSpinBox->setToolTip(  "<qt>" + tr( "Distance within which an object will snap to your placed guides. After setting this you will need to restart Scribus to set this setting." ) + "</qt>");
@@ -72,7 +99,26 @@
 	int docUnitIndex = prefsData->docSetupPrefs.docUnitIndex;
 	unitChange(docUnitIndex);
 	double unitRatio = unitGetRatioFromIndex(docUnitIndex);
-	guidePlacementComboBox->setCurrentIndex(prefsData->guidesPrefs.guidePlacement ?0:1);
+	renderStackOrder = prefsData->guidesPrefs.renderStackOrder;
+	guidePlacementListBox->clear();
+	int renderStackCount = renderStackOrder.count();
+	for (int r = renderStackCount - 1; r > -1; r--)
+	{
+		QListWidgetItem *item;
+		int it = renderStackOrder[r];
+		if (it == 4)
+			item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
+		else if (it == 3)
+			item = new QListWidgetItem( tr("Guides"), guidePlacementListBox);
+		else if (it == 2)
+			item = new QListWidgetItem( tr("Grid"), guidePlacementListBox);
+		else if (it == 1)
+			item = new QListWidgetItem( tr("BaselineGrid"), guidePlacementListBox);
+		else if (it == 0)
+			item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
+		item->setData(Qt::UserRole, it);
+		item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	}
 	guideSnapDistanceSpinBox->setValue(prefsData->guidesPrefs.guideRad);
 	guideGrabRadiusSpinBox->setValue(prefsData->guidesPrefs.grabRadius);
 	visibilityGuidesCheckBox->setChecked(prefsData->guidesPrefs.guidesShown);
@@ -80,6 +126,7 @@
 	visibilityGridCheckBox->setChecked(prefsData->guidesPrefs.gridShown);
 	visibilityBaselineGridCheckBox->setChecked(prefsData->guidesPrefs.baselineGridShown);
 
+	gridTypeCombo->setCurrentIndex(prefsData->guidesPrefs.gridType);
 	majorGridSpacingSpinBox->setValue(prefsData->guidesPrefs.majorGridSpacing * unitRatio);
 	minorGridSpacingSpinBox->setValue(prefsData->guidesPrefs.minorGridSpacing * unitRatio);
 	baselineGridSpacingSpinBox->setValue(prefsData->guidesPrefs.valueBaselineGrid);
@@ -111,11 +158,12 @@
 	colorBaselineGrid = prefsData->guidesPrefs.baselineGridColor;
 	baselineGridColorPushButton->setText( QString::null );
 	baselineGridColorPushButton->setIcon(pm);
+	gridTypeCombo->setEnabled(visibilityGridCheckBox->isChecked());
 }
 
 void Prefs_Guides::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
-	prefsData->guidesPrefs.guidePlacement=(guidePlacementComboBox->currentIndex()==0);
+	prefsData->guidesPrefs.renderStackOrder = renderStackOrder;
 	prefsData->guidesPrefs.guideRad=guideSnapDistanceSpinBox->value();
 	prefsData->guidesPrefs.grabRadius=guideGrabRadiusSpinBox->value();
 	prefsData->guidesPrefs.guidesShown=visibilityGuidesCheckBox->isChecked();
@@ -132,6 +180,7 @@
 	prefsData->guidesPrefs.majorGridColor=colorMajorGrid;
 	prefsData->guidesPrefs.minorGridColor=colorMinorGrid;
 	prefsData->guidesPrefs.baselineGridColor=colorBaselineGrid;
+	prefsData->guidesPrefs.gridType = gridTypeCombo->currentIndex();
 }
 
 void Prefs_Guides::changeMajorColor()
@@ -194,3 +243,75 @@
 	}
 }
 
+void Prefs_Guides::changeRenderStack()
+{
+	renderStackOrder.clear();
+	for (int a = 0; a < guidePlacementListBox->count(); a++)
+	{
+		renderStackOrder.prepend(guidePlacementListBox->item(a)->data(Qt::UserRole).toInt());
+	}
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+	{
+		buttonUp->setEnabled(false);
+		buttonDown->setEnabled(true);
+	}
+	else if (curr == guidePlacementListBox->count() - 1)
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(false);
+	}
+	else
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(true);
+	}
+}
+
+void Prefs_Guides::moveUp()
+{
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+		return;
+	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
+	guidePlacementListBox->insertItem(curr-1, it);
+	guidePlacementListBox->setCurrentItem(it);
+	changeRenderStack();
+}
+
+void Prefs_Guides::moveDown()
+{
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == static_cast<int>(guidePlacementListBox->count())-1)
+		return;
+	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
+	guidePlacementListBox->insertItem(curr+1, it);
+	guidePlacementListBox->setCurrentItem(it);
+	changeRenderStack();
+}
+
+void Prefs_Guides::select(QListWidgetItem* item)
+{
+	guidePlacementListBox->setCurrentItem(item);
+	int curr = guidePlacementListBox->currentRow();
+	if (curr == 0)
+	{
+		buttonUp->setEnabled(false);
+		buttonDown->setEnabled(true);
+	}
+	else if (curr == guidePlacementListBox->count() - 1)
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(false);
+	}
+	else
+	{
+		buttonUp->setEnabled(true);
+		buttonDown->setEnabled(true);
+	}
+}
+
+void Prefs_Guides::gridClicked()
+{
+	gridTypeCombo->setEnabled(visibilityGridCheckBox->isChecked());
+}

Modified: branches/ScribusOIF/scribus/ui/prefs_guides.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/prefs_guides.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_guides.h (original)
+++ branches/ScribusOIF/scribus/ui/prefs_guides.h Thu Nov 24 22:37:33 2011
@@ -34,6 +34,11 @@
 		virtual void changeBaselineColor();
 		virtual void changeGuideColor();
 		virtual void changeMarginColor();
+		virtual void changeRenderStack();
+		virtual void moveUp();
+		virtual void moveDown();
+		virtual void select(QListWidgetItem* item);
+		virtual void gridClicked();
 
 	protected:
 		QColor colorGuides;
@@ -41,6 +46,7 @@
 		QColor colorMajorGrid;
 		QColor colorMinorGrid;
 		QColor colorBaselineGrid;
+		QList<int> renderStackOrder;
 };
 
 #endif // PREFS_GUIDES_H

Modified: branches/ScribusOIF/scribus/ui/prefs_guidesbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/prefs_guidesbase.ui
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_guidesbase.ui (original)
+++ branches/ScribusOIF/scribus/ui/prefs_guidesbase.ui Thu Nov 24 22:37:33 2011
@@ -37,86 +37,206 @@
       <attribute name="title">
        <string>Placement</string>
       </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <layout class="QFormLayout" name="formLayout">
-         <property name="formAlignment">
-          <set>Qt::AlignHCenter|Qt::AlignTop</set>
-         </property>
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Placement:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QComboBox" name="guidePlacementComboBox">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>Snap Distance:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="ScrSpinBox" name="guideSnapDistanceSpinBox">
-           <property name="suffix">
-            <string> px</string>
-           </property>
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>1000</number>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>Grab Radius:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="ScrSpinBox" name="guideGrabRadiusSpinBox">
-           <property name="suffix">
-            <string> px</string>
-           </property>
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>1000</number>
-           </property>
-          </widget>
+      <layout class="QVBoxLayout" name="verticalLayout_7">
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Placement:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line_3">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QListWidget" name="guidePlacementListBox">
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>200</height>
+            </size>
+           </property>
+           <property name="dragDropMode">
+            <enum>QAbstractItemView::NoDragDrop</enum>
+           </property>
+           <property name="layoutMode">
+            <enum>QListView::SinglePass</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <item>
+            <widget class="QLabel" name="label_5">
+             <property name="text">
+              <string>Foreground</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_5">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>18</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout">
+             <property name="sizeConstraint">
+              <enum>QLayout::SetMinimumSize</enum>
+             </property>
+             <item>
+              <widget class="QPushButton" name="buttonUp">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="buttonDown">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_6">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_6">
+             <property name="text">
+              <string>Background</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <item>
+            <layout class="QGridLayout" name="gridLayout">
+             <item row="0" column="0">
+              <widget class="QLabel" name="label_4">
+               <property name="text">
+                <string>Snap Distance:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="0" column="1">
+              <widget class="ScrSpinBox" name="guideSnapDistanceSpinBox">
+               <property name="suffix">
+                <string> px</string>
+               </property>
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000</number>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="0">
+              <widget class="QLabel" name="label_3">
+               <property name="text">
+                <string>Grab Radius:</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="1">
+              <widget class="ScrSpinBox" name="guideGrabRadiusSpinBox">
+               <property name="suffix">
+                <string> px</string>
+               </property>
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_3">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Expanding</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
          </item>
         </layout>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_3">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
        </item>
        <item>
         <widget class="QLabel" name="label_7">
@@ -139,49 +259,63 @@
         </widget>
        </item>
        <item>
-        <layout class="QFormLayout" name="formLayout_3">
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::FieldsStayAtSizeHint</enum>
-         </property>
-         <item row="0" column="1">
-          <widget class="ScrSpinBox" name="majorGridSpacingSpinBox"/>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="minorGridSpacingLabel">
-           <property name="text">
-            <string>Minor Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="ScrSpinBox" name="minorGridSpacingSpinBox"/>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="baselineGridSpacingLabel">
-           <property name="text">
-            <string>Baseline Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="ScrSpinBox" name="baselineGridSpacingSpinBox"/>
-         </item>
-         <item row="0" column="0">
-          <widget class="QLabel" name="majorGridSpacingLabel">
-           <property name="text">
-            <string>Major Grid Spacing:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="0">
-          <widget class="QLabel" name="baselineGridOffsetLabel">
-           <property name="text">
-            <string>Baseline Grid Offset:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="1">
-          <widget class="ScrSpinBox" name="baselineGridOffsetSpinBox"/>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <layout class="QGridLayout" name="gridLayout_2">
+           <item row="0" column="0">
+            <widget class="QLabel" name="majorGridSpacingLabel">
+             <property name="text">
+              <string>Major Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="ScrSpinBox" name="majorGridSpacingSpinBox"/>
+           </item>
+           <item row="1" column="0">
+            <widget class="QLabel" name="minorGridSpacingLabel">
+             <property name="text">
+              <string>Minor Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="ScrSpinBox" name="minorGridSpacingSpinBox"/>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="baselineGridSpacingLabel">
+             <property name="text">
+              <string>Baseline Grid Spacing:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="ScrSpinBox" name="baselineGridSpacingSpinBox"/>
+           </item>
+           <item row="3" column="0">
+            <widget class="QLabel" name="baselineGridOffsetLabel">
+             <property name="text">
+              <string>Baseline Grid Offset:</string>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="ScrSpinBox" name="baselineGridOffsetSpinBox"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
          </item>
         </layout>
        </item>
@@ -220,11 +354,61 @@
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="visibilityGridCheckBox">
-         <property name="text">
-          <string>Page Grid</string>
-         </property>
-        </widget>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <widget class="QCheckBox" name="visibilityGridCheckBox">
+           <property name="text">
+            <string>Page Grid</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>15</width>
+             <height>5</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_8">
+           <property name="text">
+            <string>Type:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="gridTypeCombo">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="frame">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
        </item>
        <item>
         <widget class="QCheckBox" name="visibilityBaselineGridCheckBox">

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_text.cpp Thu Nov 24 22:37:33 2011
@@ -19,6 +19,7 @@
 #include "propertiespalette_utils.h"
 #include "propertywidget_advanced.h"
 #include "propertywidget_distance.h"
+#include "propertywidget_dropcap.h"
 #include "propertywidget_flop.h"
 #include "propertywidget_optmargins.h"
 #include "propertywidget_orphans.h"
@@ -75,6 +76,9 @@
 	orphanBox = new PropertyWidget_Orphans(textTree);
 	orphanItem = textTree->addWidget( tr("Orphans and Widows"), orphanBox);
 
+	dropcapsBox = new PropertyWidget_DropCap(textTree);
+	dropcapsItem = textTree->addWidget( tr("Drop Cap"), dropcapsBox);
+
 	distanceWidgets = new PropertyWidget_Distance(textTree);
     distanceItem = textTree->addWidget( tr("Columns & Text Distances"), distanceWidgets);
 
@@ -154,6 +158,7 @@
 	flopBox->setDoc(m_doc);
 	optMargins->setDoc(m_doc);
 	orphanBox->setDoc(m_doc);
+	dropcapsBox->setDoc(m_doc);
 	pathTextWidgets->setDoc(m_doc);
 
 	fonts->RebuildList(m_doc);
@@ -186,6 +191,7 @@
 	flopBox->setDoc(0);
 	optMargins->setDoc(0);
 	orphanBox->setDoc(0);
+	dropcapsBox->setDoc(0);
 	pathTextWidgets->setDoc(0);
 
 	m_haveItem = false;
@@ -264,7 +270,10 @@
 	/*if (updateFlags & reqColorsUpdate)
 		updateColorList();*/
 	if (updateFlags & reqCharStylesUpdate)
+	{
 		charStyleCombo->updateFormatList();
+		dropcapsBox->updateCharStyles();
+	}
 	if (updateFlags & reqParaStylesUpdate)
 		paraStyleCombo->updateFormatList();
 	if (updateFlags & reqDefFontListUpdate)
@@ -275,6 +284,7 @@
 	{
 		paraStyleCombo->setDoc(m_haveDoc ? m_doc : 0);
 		charStyleCombo->setDoc(m_haveDoc ? m_doc : 0);
+		dropcapsBox->setDoc(m_haveDoc ? m_doc : 0);
 	}
 }
 
@@ -311,6 +321,7 @@
 		flopItem->setHidden(true);
 		distanceItem->setHidden(true);
 		orphanItem->setHidden(true);
+		dropcapsItem->setHidden(true);
 		pathTextItem->setHidden(false);
 	}
 	else if (m_item->asTextFrame())
@@ -318,6 +329,7 @@
 		flopItem->setHidden(false);
 		distanceItem->setHidden(false);
 		orphanItem->setHidden(false);
+		dropcapsItem->setHidden(false);
 		pathTextItem->setHidden(true);
 	}
 	else
@@ -325,6 +337,7 @@
 		flopItem->setHidden(false);
 		distanceItem->setHidden(false);
 		orphanItem->setHidden(false);
+		dropcapsItem->setHidden(false);
 		pathTextItem->setHidden(true);
 	}
 
@@ -360,6 +373,7 @@
 	flopBox->unitChange();
 	optMargins->unitChange();
 	pathTextWidgets->unitChange();
+	dropcapsBox->unitChange();
 
 	m_haveItem = tmp;
 }
@@ -464,6 +478,7 @@
 	colorWidgets->updateStyle(newCurrent);
 	optMargins->updateStyle(newCurrent);
 	orphanBox->updateStyle (newCurrent);
+	dropcapsBox->updateStyle(newCurrent);
 
 	displayFontFace(charStyle.font().scName());
 	displayFontSize(charStyle.fontSize());
@@ -481,11 +496,14 @@
 void PropertiesPalette_Text::updateCharStyles()
 {
 	charStyleCombo->updateFormatList();
+	dropcapsBox->updateCharStyles();
 }
 
 void PropertiesPalette_Text::updateParagraphStyles()
 {
 	paraStyleCombo->updateFormatList();
+	charStyleCombo->updateFormatList();
+	dropcapsBox->updateCharStyles();
 }
 
 void PropertiesPalette_Text::updateTextStyles()

Modified: branches/ScribusOIF/scribus/ui/propertiespalette_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/propertiespalette_text.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette_text.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette_text.h Thu Nov 24 22:37:33 2011
@@ -25,6 +25,7 @@
 class PageItem;
 class PropertyWidget_Advanced;
 class PropertyWidget_Distance;
+class PropertyWidget_DropCap;
 class PropertyWidget_Flop;
 class PropertyWidget_OptMargins;
 class PropertyWidget_Orphans;
@@ -132,7 +133,10 @@
 
 	PropertyWidget_Orphans* orphanBox;
 	QTreeWidgetItem* orphanItem;
-	
+
+	PropertyWidget_DropCap* dropcapsBox;
+	QTreeWidgetItem* dropcapsItem;
+
 	PropertyWidget_PathText* pathTextWidgets;
 	QTreeWidgetItem* pathTextItem;
 

Modified: branches/ScribusOIF/scribus/ui/rulermover.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/rulermover.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/rulermover.cpp (original)
+++ branches/ScribusOIF/scribus/ui/rulermover.cpp Thu Nov 24 22:37:33 2011
@@ -33,6 +33,8 @@
 #include "canvasgesture_rulermove.h"
 #include "scribusview.h"
 #include "scribusdoc.h"
+#include "scraction.h"
+#include "scribus.h"
 
 #include "util_icon.h"
 
@@ -80,6 +82,7 @@
 		QMenu *pmen2 = NULL;
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		pmen->addAction( tr("Reset Rulers"), this, SLOT(resetRulers()));
+		pmen->addAction(currView->Doc->scMW()->scrActions["viewRulerMode"]);
 		if (currView->Doc->guidesPrefs().rulerMode)
 		{
 			pmen2 = new QMenu();

Modified: branches/ScribusOIF/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/smpstylewidget.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/smpstylewidget.cpp (original)
+++ branches/ScribusOIF/scribus/ui/smpstylewidget.cpp Thu Nov 24 22:37:33 2011
@@ -93,6 +93,7 @@
 	//dropCapsBox->setToolTip(      tr("Enable or disable drop cap"));
 	dropCapLines_->setToolTip(    tr("Drop Cap Lines"));
 	dropCapOffset_->setToolTip(   tr("Drop Cap Offset"));
+	dropCapCharStyleCombo->setToolTip("<qt>" + tr("Choose chracter style or leave blank for use default paragraph style"));
 	alignement_->setToolTip(      tr("Alignment"));
 	tabList_->first_->setToolTip( tr("First Line Indent"));
 	tabList_->left_->setToolTip(  tr("Left Indent"));
@@ -293,6 +294,12 @@
 	lineSpacing_->setEnabled(pstyle->lineSpacingMode() == ParagraphStyle::FixedLineSpacing);
 	dropCapLines_->setEnabled(pstyle->hasDropCap());
 	dropCapOffset_->setEnabled(pstyle->hasDropCap());
+	dropCapCharStyleCombo->setEnabled(pstyle->hasDropCap());
+	dropCapCharStyleCombo->clear();
+	dropCapCharStyleCombo->addItem(tr("No Style"));
+	for (int i =0; i < cstyles.count(); i++)
+		dropCapCharStyleCombo->addItem(cstyles.at(i).name());
+	setCurrentComboItem(dropCapCharStyleCombo, pstyle->dcCharStyleName().isEmpty() ? tr("No Style") : pstyle->dcCharStyleName());
 
 	QFont f(font());
 	f.setBold(true);
@@ -311,7 +318,6 @@
 				parentCombo->addItem(pstyles[i].name());
 		}
 	}
-
 	if (pstyle->isDefaultStyle() || !hasParent_)
 		parentCombo->setCurrentIndex(0);
 	else
@@ -339,7 +345,7 @@
 	{
 		showLineSpacing(pstyles);
 		showSpaceAB(pstyles, unitIndex);
-		showDropCap(pstyles, unitIndex);
+		showDropCap(pstyles, cstyles, unitIndex);
 		showAlignment(pstyles);
 		showOpticalMargin(pstyles);
 		showMinSpace(pstyles);
@@ -433,7 +439,7 @@
 		spaceBelow_->setValue(tmpA);
 }
 
-void SMPStyleWidget::showDropCap(QList<ParagraphStyle*> &pstyles, int unitIndex)
+void SMPStyleWidget::showDropCap(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, int unitIndex)
 {
 	double unitRatio = unitGetRatioFromIndex(unitIndex);
 	parentDropCapButton->hide();
@@ -482,11 +488,17 @@
 		dropCapOffset_->clear();
 	else
 		dropCapOffset_->setValue(dco * unitRatio);
+
+	dropCapCharStyleCombo->clear();
+	dropCapCharStyleCombo->addItem(tr("No Style"));
+	for (int i=0; i < cstyles.count(); i++)
+		dropCapCharStyleCombo->addItem(cstyles.at(i).name());
 
 	connect(dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
 	dropCapsBox->setEnabled(true);
 	dropCapLines_->setEnabled(true);
 	dropCapOffset_->setEnabled(true);
+	dropCapCharStyleCombo->setEnabled(true);
 }
 
 void SMPStyleWidget::showAlignment(QList<ParagraphStyle*> &pstyles)
@@ -820,12 +832,14 @@
 		dropCapsBox->setEnabled(true);
 		dropCapLines_->setEnabled(true);
 		dropCapOffset_->setEnabled(true);
+		dropCapCharStyleCombo->setEnabled(true);
 	}
 	else
 	{
 		dropCapsBox->setEnabled(true);
 		dropCapLines_->setEnabled(false);
 		dropCapOffset_->setEnabled(false);
+		dropCapCharStyleCombo->setEnabled(false);
 	}
 	if (hasParent_)
 		parentDropCapButton->show();

Modified: branches/ScribusOIF/scribus/ui/smpstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/smpstylewidget.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/smpstylewidget.h (original)
+++ branches/ScribusOIF/scribus/ui/smpstylewidget.h Thu Nov 24 22:37:33 2011
@@ -37,7 +37,7 @@
 
 	void showLineSpacing(QList<ParagraphStyle*> &pstyles);
 	void showSpaceAB(QList<ParagraphStyle*> &pstyles, int unitIndex);
-	void showDropCap(QList<ParagraphStyle*> &pstyles, int unitIndex);
+	void showDropCap(QList<ParagraphStyle*> &pstyles, QList<CharStyle> &cstyles, int unitIndex);
 	void showAlignment(QList<ParagraphStyle*> &pstyles);
 	void showOpticalMargin(QList<ParagraphStyle*> &pstyles);
 	void showMinSpace(QList<ParagraphStyle*> &pstyles);

Modified: branches/ScribusOIF/scribus/ui/smpstylewidget.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/smpstylewidget.ui
==============================================================================
--- branches/ScribusOIF/scribus/ui/smpstylewidget.ui (original)
+++ branches/ScribusOIF/scribus/ui/smpstylewidget.ui Thu Nov 24 22:37:33 2011
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>714</width>
-    <height>580</height>
+    <height>599</height>
    </rect>
   </property>
   <layout class="QVBoxLayout">
@@ -257,56 +257,57 @@
               <item>
                <layout class="QHBoxLayout">
                 <item>
-                 <layout class="QVBoxLayout">
-                  <item>
-                   <layout class="QHBoxLayout">
-                    <item>
-                     <widget class="QLabel" name="label">
-                      <property name="text">
-                       <string>&Lines:</string>
-                      </property>
-                      <property name="buddy">
-                       <cstring>dropCapLines_</cstring>
-                      </property>
-                     </widget>
-                    </item>
-                    <item>
-                     <widget class="SMSpinBox" name="dropCapLines_">
-                      <property name="minimum">
-                       <number>2</number>
-                      </property>
-                      <property name="maximum">
-                       <number>20</number>
-                      </property>
-                     </widget>
-                    </item>
-                   </layout>
-                  </item>
-                  <item>
-                   <layout class="QHBoxLayout">
-                    <item>
-                     <widget class="QLabel" name="label_2">
-                      <property name="text">
-                       <string>Distance from Text:</string>
-                      </property>
-                      <property name="buddy">
-                       <cstring>dropCapOffset_</cstring>
-                      </property>
-                     </widget>
-                    </item>
-                    <item>
-                     <widget class="SMScrSpinBox" name="dropCapOffset_">
-                      <property name="minimum">
-                       <number>-3000</number>
-                      </property>
-                      <property name="maximum">
-                       <number>3000</number>
-                      </property>
-                     </widget>
-                    </item>
-                   </layout>
-                  </item>
-                 </layout>
+                 <widget class="QLabel" name="label">
+                  <property name="text">
+                   <string>&Lines:</string>
+                  </property>
+                  <property name="buddy">
+                   <cstring>dropCapLines_</cstring>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="SMSpinBox" name="dropCapLines_">
+                  <property name="minimum">
+                   <number>2</number>
+                  </property>
+                  <property name="maximum">
+                   <number>20</number>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer name="horizontalSpacer_2">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_2">
+                  <property name="text">
+                   <string>Distance from Text:</string>
+                  </property>
+                  <property name="buddy">
+                   <cstring>dropCapOffset_</cstring>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="SMScrSpinBox" name="dropCapOffset_">
+                  <property name="minimum">
+                   <number>-3000</number>
+                  </property>
+                  <property name="maximum">
+                   <number>3000</number>
+                  </property>
+                 </widget>
                 </item>
                 <item>
                  <spacer>
@@ -322,6 +323,16 @@
                  </spacer>
                 </item>
                </layout>
+              </item>
+              <item>
+               <widget class="QLabel" name="dropCapCharStyleComboLabel">
+                <property name="text">
+                 <string>Character Style for Drop Cap:</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="SMScComboBox" name="dropCapCharStyleCombo"/>
               </item>
               <item>
                <widget class="QToolButton" name="parentDropCapButton">

Modified: branches/ScribusOIF/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/smtextstyles.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/smtextstyles.cpp (original)
+++ branches/ScribusOIF/scribus/ui/smtextstyles.cpp Thu Nov 24 22:37:33 2011
@@ -516,6 +516,7 @@
 	connect(pwidget_->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
 	connect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
 	connect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset()));
+	connect(pwidget_->dropCapCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotDropCapCharStyle(const QString&)));
 
 	connect(pwidget_->keepLinesStart, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesStart()));
 	connect(pwidget_->keepLinesEnd, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesEnd()));
@@ -593,6 +594,7 @@
 	disconnect(pwidget_->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
 	disconnect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
 	disconnect(pwidget_->dropCapOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotDropCapOffset()));
+	disconnect(pwidget_->dropCapCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotDropCapCharStyle(const QString&)));
 
 	disconnect(pwidget_->parentCombo, SIGNAL(activated(const QString&)),
 			this, SLOT(slotParentChanged(const QString&)));
@@ -912,6 +914,23 @@
 	}
 }
 
+void SMParagraphStyle::slotDropCapCharStyle(const QString& name)
+{
+	if (pwidget_->dropCapCharStyleCombo->useParentValue())
+		for (int i = 0; i < selection_.count(); ++i)
+			selection_[i]->resetDcCharStyleName();
+	else
+		for (int i = 0; i < selection_.count(); ++i)
+			selection_[i]->setDcCharStyleName(name);
+
+	if (!selectionIsDirty_)
+	{
+		selectionIsDirty_ = true;
+		emit selectionDirty();
+	}
+}
+
+
 void SMParagraphStyle::handleKeepLinesStart()
 {
 	if (pwidget_->keepLinesStart->useParentValue())

Modified: branches/ScribusOIF/scribus/ui/smtextstyles.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/ui/smtextstyles.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/smtextstyles.h (original)
+++ branches/ScribusOIF/scribus/ui/smtextstyles.h Thu Nov 24 22:37:33 2011
@@ -75,6 +75,7 @@
 	void slotDropCap(bool isOn);
 	void slotDropCapLines(int lines);
 	void slotDropCapOffset();
+	void slotDropCapCharStyle(const QString &name);
 	void slotSpaceAbove();
 	void slotSpaceBelow();
 	void slotAlignment();

Modified: branches/ScribusOIF/scribus/util_math.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/util_math.cpp
==============================================================================
--- branches/ScribusOIF/scribus/util_math.cpp (original)
+++ branches/ScribusOIF/scribus/util_math.cpp Thu Nov 24 22:37:33 2011
@@ -447,3 +447,19 @@
 	return value;
 }
 
+double getRotationDFromMatrix(QTransform& matrix)
+{
+	QLineF line = QLineF(0.0, 0.0, 1.0, 0.0);
+	line = matrix.map(line);
+	return line.angle();
+}
+
+void getScaleFromMatrix(QTransform &matrix, double &scX, double &scY)
+{
+	QLineF lineX = QLineF(0.0, 0.0, 1.0, 0.0);
+	QLineF lineY = QLineF(0.0, 0.0, 0.0, 1.0);
+	lineX = matrix.map(lineX);
+	lineY = matrix.map(lineY);
+	scX = lineX.length();
+	scY = lineY.length();
+}

Modified: branches/ScribusOIF/scribus/util_math.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/scribus/util_math.h
==============================================================================
--- branches/ScribusOIF/scribus/util_math.h (original)
+++ branches/ScribusOIF/scribus/util_math.h Thu Nov 24 22:37:33 2011
@@ -17,6 +17,7 @@
 #include <QPolygon>
 #include <QList>
 #include <QPainterPath>
+#include <QLineF>
 
 #include "scribusapi.h"
 
@@ -55,6 +56,12 @@
    \retval double the rotation angle
  */
 double SCRIBUS_API getRotationFromMatrix(QTransform& matrix, double def);
+/*! \brief Get the rotation angle (in degree) from a transformation matrix
+   \param matrix the transformation matrix
+   \retval double the rotation angle
+ */
+double SCRIBUS_API getRotationDFromMatrix(QTransform& matrix);
+void SCRIBUS_API getScaleFromMatrix(QTransform &matrix, double &scX, double &scY);
 
 
 // IMPLEMENTATION

Modified: branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17021&path=/branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj
==============================================================================
--- branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj (original)
+++ branches/ScribusOIF/win32/vc9/scribus-main/Scribus.vcproj Thu Nov 24 22:37:33 2011
@@ -1479,6 +1479,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\ui\propertywidget_dropcap.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\ui\propertywidget_flop.cpp"
 				>
 			</File>
@@ -6370,6 +6374,24 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\ui\propertywidget_dropcap.h"
+				>
+				<FileConfiguration
+					Name="Debug-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release-cairo|Win32"
+					>
+					<Tool
+						Name="moc.exe"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\ui\propertywidget_flop.h"
 				>
 				<FileConfiguration
@@ -9105,6 +9127,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\ui\ui_propertywidget_dropcapbase.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\ui\ui_propertywidget_flopbase.h"
 				>
 			</File>
@@ -10038,6 +10064,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\ui\moc_propertywidget_dropcap.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\ui\moc_propertywidget_flop.cpp"
 				>
 			</File>
@@ -10755,6 +10785,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\scribus\ui\propertywidget_dropcapbase.ui"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\scribus\ui\propertywidget_flopbase.ui"
 				>
 			</File>




More information about the scribus-commit mailing list