[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 766
Date       : Tue Apr  4 17:40:59 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/nodetext.cpp
   M /Trunk/XaraLX/Kernel/nodetxtl.cpp
   M /Trunk/XaraLX/wxOil/osrndrgn.cpp

Martin Wuerthner's fixes for convert text to shapes and eor rendering


Diff:
Index: Trunk/XaraLX/Kernel/nodetxtl.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetxtl.cpp	(revision 765)
+++ Trunk/XaraLX/Kernel/nodetxtl.cpp	(revision 766)
@@ -417,7 +417,7 @@
 BOOL TextLine::CreateNodeGroup(NodeGroup** ppNodeGroup, FormatRegion* pFormatRegion, BecomeA* pBecomeA)
 {
 	PORTNOTETRACE("text","TextLine::CreateNodeGroup - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+#ifndef DISABLE_TEXT_RENDERING
 	ERROR2IF(pFormatRegion==NULL,FALSE,"TextChar::CreateNodeGroup() - pFormatRegion==NULL");
 	ERROR2IF(     pBecomeA==NULL,FALSE,"TextChar::CreateNodeGroup() - pBecomeA==NULL");
 	ERROR2IF(  ppNodeGroup==NULL,FALSE,"TextChar::CreateNodeGroup() - ppNodeGroup==NULL");
Index: Trunk/XaraLX/Kernel/nodetext.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetext.cpp	(revision 765)
+++ Trunk/XaraLX/Kernel/nodetext.cpp	(revision 766)
@@ -112,7 +112,7 @@
 
 // Code headers
 #include "app.h"
-#include "becomea.h"
+//#include "becomea.h"
 #include "blobs.h"
 //#include "cameleps.h"
 #include "cliptype.h"
@@ -2109,20 +2109,22 @@
 
 void TextChar::RenderEorDrag(RenderRegion* pRenderRegion)
 {
-PORTNOTE("text", "so far, enabling this crashes when a text object is moved and an EOR display is attempted")
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
-	// Before rendering the character we need to render it's applied *TEXT* attributes
-	// into the render region as EOR drag render regions dosen't maintain an attribute stack
+#if !defined(EXCLUDE_FROM_RALPH) && !defined(DISABLE_TEXT_RENDERING)
+	// Before rendering the character we need to render its applied *TEXT* attributes
+	// into the render region as EOR drag render regions don't maintain an attribute stack
 	CCAttrMap* pAttribMap = new CCAttrMap(30);
-	BOOL FoundAttributes = FindAppliedAttributes(pAttribMap);
+	BOOL FoundAttributes = FALSE;
+	if (pAttribMap)
+		FoundAttributes = FindAppliedAttributes(pAttribMap);
 	
-	if (pAttribMap!=NULL)
+	if (FoundAttributes)
 	{
 		pRenderRegion->SaveContext();
-
 		// Render the text attributes
 		CCAttrMap::iterator pos = pAttribMap->GetStartPosition();
-		while (pos!=NULL)
+		CCAttrMap::iterator	end = pAttribMap->GetEndPosition();
+	
+		while (pos != end)
 		{
 			CCRuntimeClass *pKey;
 			void		   *pVal;
@@ -2131,13 +2133,14 @@
 			if (((NodeAttribute*)pVal)->IsKindOfTextAttribute())
 				((NodeAttribute*)pVal)->Render(pRenderRegion);
 		}
+	}
 
-		// Render the character
-		if (RenderCore(pRenderRegion)==FALSE)
-			InformError();
+	// Render the character
+	if (RenderCore(pRenderRegion)==FALSE)
+		InformError();
 
+	if (FoundAttributes)
 		pRenderRegion->RestoreContext();
-	}
 
 	if (pAttribMap!=NULL) delete pAttribMap;
 #endif
Index: Trunk/XaraLX/wxOil/osrndrgn.cpp
===================================================================
--- Trunk/XaraLX/wxOil/osrndrgn.cpp	(revision 765)
+++ Trunk/XaraLX/wxOil/osrndrgn.cpp	(revision 766)
@@ -7154,6 +7154,8 @@
 	RenderDC->SetTextAlign(OldTextAlign);
 	RenderDC->SetBkMode(OldBKMode);
 	RenderDC->SetTextColor(OldTextColor);
+#elif !defined(DISABLE_TEXT_RENDERING)
+	return RenderRegion::RenderChar(ch, pMatrix);
 #endif
 	return TRUE;
 }


Xara