r15571 by pierremarc - Displays some glyphs on screen

scribus-commit scribus-commit at lists.scribus.net
Mon Oct 18 16:36:23 CEST 2010


Author: pierremarc
Date: Mon Oct 18 14:36:23 2010
New Revision: 15571

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15571
Log:
Displays some glyphs on screen

Modified:
    branches/ScribusOIF/scribus/text/boxes.cpp
    branches/ScribusOIF/scribus/text/boxes.h
    branches/ScribusOIF/scribus/text/glyphstore.cpp
    branches/ScribusOIF/scribus/text/glyphstore.h
    branches/ScribusOIF/scribus/text/legacylayout.cpp
    branches/ScribusOIF/scribus/text/textlayout.cpp

Modified: branches/ScribusOIF/scribus/text/boxes.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/boxes.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/boxes.cpp (original)
+++ branches/ScribusOIF/scribus/text/boxes.cpp Mon Oct 18 14:36:23 2010
@@ -14,6 +14,15 @@
 #include "storytext.h"
 #include "scpainterexbase.h"
 
+#include <QDebug>
+
+
+BoxGroup::BoxGroup(BoxType type):
+		 Box(type),
+		 m_boxes(QList<Box*>())
+{
+	qDebug()<<"Create BoxGroup of Type:"<<type;
+}
 
 QString BoxGroup::toString() const
 {

Modified: branches/ScribusOIF/scribus/text/boxes.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/boxes.h
==============================================================================
--- branches/ScribusOIF/scribus/text/boxes.h (original)
+++ branches/ScribusOIF/scribus/text/boxes.h Mon Oct 18 14:36:23 2010
@@ -92,7 +92,7 @@
 {
 protected:
 	QList<Box*> m_boxes;
-	BoxGroup(BoxType type) : Box(type), m_boxes() {}
+	BoxGroup(BoxType type);
 	
 public:	
 	BoxGroup* asBoxGroup() { return this; }

Modified: branches/ScribusOIF/scribus/text/glyphstore.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/glyphstore.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/glyphstore.cpp (original)
+++ branches/ScribusOIF/scribus/text/glyphstore.cpp Mon Oct 18 14:36:23 2010
@@ -294,4 +294,4 @@
 		s += m_clusterRuns.offset(k);
 	}
 	qDebug() << s << m_clusterRuns.count() << m_clusterOffsets.count();
-}
+}

Modified: branches/ScribusOIF/scribus/text/glyphstore.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/glyphstore.h
==============================================================================
--- branches/ScribusOIF/scribus/text/glyphstore.h (original)
+++ branches/ScribusOIF/scribus/text/glyphstore.h Mon Oct 18 14:36:23 2010
@@ -13,6 +13,7 @@
 #undef NDEBUG
 
 #include <QDebug>
+#include <QHash>
 #include "glyphlayout.h"
 #include "sctextstruct.h"
 #include "text/index.h"
@@ -94,7 +95,7 @@
 	QList<ItemData> m_items;
 	
 	/// fine segmentation: stored as difference between glyphIndex and textPos. If each char has exactly one glyph, all offsets equal 0
-	QList<int> m_clusterOffsets;
+	QHash<int,int> m_clusterOffsets;
 	Index m_clusterRuns;
 	
 	/// returns the offset for glyphIndex

Modified: branches/ScribusOIF/scribus/text/legacylayout.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/legacylayout.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/legacylayout.cpp (original)
+++ branches/ScribusOIF/scribus/text/legacylayout.cpp Mon Oct 18 14:36:23 2010
@@ -129,16 +129,15 @@
 
 	for (int i= 0; i < chars.length(); ++i)
 	{
-		if ((textFlags[i] & TextFlag_ClusterStart) != 0)
-			glyphs.markCluster(item, start + 
-							   i, layout);
+		if ( textFlags[i].testFlag(TextFlag_ClusterStart) )
+			glyphs.markCluster(item, start + i, layout);
 
 		layout->glyph = style.font().char2CMap(chars[i].unicode());
 		
 		if (layout->glyph == 0)
 			qDebug() << "legacyShape: font" << style.font().scName() << "has no glyph for" << chars[i].unicode();
 		double tracking = 0.0;
-		if ( (textFlags[i] & TextFlag_StartOfLine) == 0)
+		if ( !textFlags[i].testFlag(TextFlag_StartOfLine) )
 			tracking = style.fontSize() * style.tracking() / 10000.0;
 		
 		

Modified: branches/ScribusOIF/scribus/text/textlayout.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15571&path=/branches/ScribusOIF/scribus/text/textlayout.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/textlayout.cpp (original)
+++ branches/ScribusOIF/scribus/text/textlayout.cpp Mon Oct 18 14:36:23 2010
@@ -26,14 +26,17 @@
 #include "storytext.h"
 #include "textlayout.h"
 
+#include <QDebug>
+
 
 
 
 TextLayout::TextLayout(StoryText* text, PageItem* frame)
 {
+	qDebug()<<"Create a TextLayout. text:"<<text<<"; frame:"<<frame;
 	m_story = text;
 	m_frame = frame;
-
+	m_layout = new VBox;
 	m_firstInFrame = 0;
 	m_lastInFrame = -1;
 	m_magicX = 0.0;
@@ -59,11 +62,13 @@
 	}
 	*/
 void TextLayout::clear() 
-	{ 
-		m_layout = new VBox(); 
-		m_firstInFrame = 0; 
-		m_lastInFrame = -1; 
-	}
+{
+	if(m_layout)
+		delete m_layout;
+	m_layout = new VBox;
+	m_firstInFrame = 0;
+	m_lastInFrame = -1;
+}
 
 
 const Box* TextLayout::box() const




More information about the scribus-commit mailing list