r16085 by jghali - merge trunk revisions up to r16084

scribus-commit scribus-commit at lists.scribus.net
Fri Dec 10 23:07:30 CET 2010


Author: jghali
Date: Fri Dec 10 22:07:30 2010
New Revision: 16085

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16085
Log:
merge trunk revisions up to r16084

Modified:
    branches/ScribusOIF/scribus/CMakeLists.txt
    branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    branches/ScribusOIF/scribus/scribusdoc.cpp
    branches/ScribusOIF/scribus/serializer.cpp
    branches/ScribusOIF/scribus/undogui.cpp

Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16085&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Fri Dec 10 22:07:30 2010
@@ -1028,7 +1028,6 @@
   ${CUPS_LIBRARIES}
   ${FREETYPE_LIBRARIES}
   ${FONTCONFIG_LIBRARIES}
-  ${LCMS_LIBRARIES}
   ${LIBXML2_LIBRARIES}
   ${PYTHON_LIBRARIES}
   ${TIFF_LIBRARIES}
@@ -1070,6 +1069,7 @@
   ${SCRIBUS_PGF_LIB}
   ${SCRIBUS_HARFBUZZ_LIB}
   ${SCRIBUS_FRIBIDI_LIB}
+  ${LCMS_LIBRARIES}
 )
 
 IF(HAVE_PODOFO)

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16085&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 Fri Dec 10 22:07:30 2010
@@ -124,9 +124,16 @@
 	}
 //	if (docBytes.left(16) == "<SCRIBUSUTF8NEW " && docBytes.left(35).contains("Version=\"1.3.4"))
 //		return true;
-	QRegExp regExp("Version=\"1.3.[4-9]");
+	QRegExp regExp134("Version=\"1.3.[4-9]");
+	QRegExp regExp140("Version=\"1.4.[0-9]");
 	int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
-	return startElemPos >= 0 && (regExp.indexIn(docBytes.mid(startElemPos, 64)) >= 0);
+	if (startElemPos >= 0)
+	{
+		bool is134 = ( regExp134.indexIn(docBytes.mid(startElemPos, 64)) >= 0 );
+		bool is140 = ( regExp140.indexIn(docBytes.mid(startElemPos, 64)) >= 0 );
+		return (is134 || is140);
+	}
+	return false;
 }
 
 QString Scribus134Format::readSLA(const QString & fileName)
@@ -146,14 +153,20 @@
 		loadRawText(fileName, docBytes);
 	}
 	QString docText("");
-	QRegExp regExp("Version=\"1.3.[4-9]");
 	int startElemPos = docBytes.left(512).indexOf("<SCRIBUSUTF8NEW ");
-	if (startElemPos >= 0 && (regExp.indexIn(docBytes.mid(startElemPos, 64)) >= 0))
-		docText = QString::fromUtf8(docBytes);
-	else
+	if (startElemPos >= 0)
+	{
+		QRegExp regExp134("Version=\"1.3.[4-9]");
+		QRegExp regExp140("Version=\"1.4.[0-9]");
+		bool is134 = ( regExp134.indexIn(docBytes.mid(startElemPos, 64)) >= 0 );
+		bool is140 = ( regExp140.indexIn(docBytes.mid(startElemPos, 64)) >= 0 );
+		if (is134 || is140)
+			docText = QString::fromUtf8(docBytes);
+		if (docText.endsWith(QChar(10)) || docText.endsWith(QChar(13)))
+			docText.truncate(docText.length()-1);
+	}
+	if (docText.isEmpty())
 		return QString::null;
-	if (docText.endsWith(QChar(10)) || docText.endsWith(QChar(13)))
-		docText.truncate(docText.length()-1);
 	return docText;
 }
 

Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16085&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Fri Dec 10 22:07:30 2010
@@ -1951,10 +1951,13 @@
 			sourceSelection.addItem(itemToCopy);
 		}
 	}
-	Selection targetSelection(Serializer(*this).cloneObjects(sourceSelection));
-	for(int si(0); si < targetSelection.count(); ++si)
-	{
-		targetSelection.itemAt(si)->setLayer(whereToInsert);
+	if (sourceSelection.count() > 0)
+	{
+		Selection targetSelection(Serializer(*this).cloneObjects(sourceSelection));
+		for(int si(0); si < targetSelection.count(); ++si)
+		{
+			targetSelection.itemAt(si)->setLayer(whereToInsert);
+		}
 	}
 }
 

Modified: branches/ScribusOIF/scribus/serializer.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16085&path=/branches/ScribusOIF/scribus/serializer.cpp
==============================================================================
--- branches/ScribusOIF/scribus/serializer.cpp (original)
+++ branches/ScribusOIF/scribus/serializer.cpp Fri Dec 10 22:07:30 2010
@@ -183,8 +183,14 @@
 	UniqueID handler( & outputhandler );
 	handler.beginDoc();
 	handler.begin("SCRIBUSFRAGMENT", attr);
+	
+	if (selection.count() == 0)
+	{
+		handler.end("SCRIBUSFRAGMENT");
+		handler.endDoc();
+		return;
+	}
 	ScribusDoc* doc = selection.itemAt(0)->doc();
-	
 	
 	QMap<QString,int>::Iterator itf;
 	for (itf = doc->UsedFonts.begin(); itf != doc->UsedFonts.end(); ++itf)

Modified: branches/ScribusOIF/scribus/undogui.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16085&path=/branches/ScribusOIF/scribus/undogui.cpp
==============================================================================
--- branches/ScribusOIF/scribus/undogui.cpp (original)
+++ branches/ScribusOIF/scribus/undogui.cpp Fri Dec 10 22:07:30 2010
@@ -529,7 +529,7 @@
 		}
 		setIcon(pixmap);
 	}
-	setText(QString("%1 - %2\n%3").arg(targetName).arg(actionName).arg(actionDescription));
+	setText(tr("%1 - %2\n%3").arg(targetName).arg(actionName).arg(actionDescription));
 }
 
 //void UndoPalette::UndoItem::paint(QPainter *painter)




More information about the scribus-commit mailing list