Blob Blame History Raw
Index: src/text/fmt/xp/fp_TextRun.cpp
===================================================================
--- src/text/fmt/xp/fp_TextRun.cpp	(revisión: 27654)
+++ src/text/fmt/xp/fp_TextRun.cpp	(revisión: 27655)
@@ -2779,8 +2779,8 @@
 }
 
 /*!
- * Returns if this run plus the next can be combined to make one contiguous 
- * item
+ * Returns true if this run plus the next can be combined to make 
+ * one contiguous item
  */
 bool fp_TextRun::isOneItem(fp_Run * pNext)
 {
@@ -2790,6 +2790,34 @@
 	UT_DEBUGMSG(("Found %d items \n",I.getItemCount()-1));
 	if(I.getItemCount() <= 2)
 	{
+		//
+		// Now look to see if there is roman text mixed with
+		// Unicode. Can easily happen with numbers or smart quotes
+		//
+		PD_StruxIterator text(getBlock()->getStruxDocHandle(),
+						  getBlockOffset() + fl_BLOCK_STRUX_OFFSET);
+
+		text.setUpperLimit(text.getPosition() + getLength()+ pNext->getLength() - 1);
+		UT_ASSERT_HARMLESS( text.getStatus() == UTIter_OK );
+		bool bFoundRoman = false;
+		bool bFoundUnicode = false;
+		while(text.getStatus() == UTIter_OK)
+	    {
+			UT_UCS4Char c = text.getChar();
+			if(c != ' ' && c <256)
+			{
+				bFoundRoman = true;
+			}
+			else if(c!= ' ' && !UT_isSmartQuotedCharacter(c))
+			{
+				bFoundUnicode = true;
+			}
+			++text;
+		}
+		if(bFoundRoman && bFoundUnicode)
+		{
+			return false;
+		}
 		return true;
 	}
 	return false;
Index: src/af/util/xp/ut_string.cpp
===================================================================
--- src/af/util/xp/ut_string.cpp	(revisión: 27654)
+++ src/af/util/xp/ut_string.cpp	(revisión: 27655)
@@ -802,8 +802,6 @@
 
 bool UT_isSmartQuotedCharacter(UT_UCSChar c)
 {
-	// TODO:  this is anglo-centric; really need a locale argument or
-	// TODO:  something to get smart quote rules for the rest of the world
 	bool result;
 	switch (c)
 	{
@@ -811,6 +809,16 @@
 	case UCS_RQUOTE:
 	case UCS_LDBLQUOTE:
 	case UCS_RDBLQUOTE:
+	case 0x201a:
+	case 0x201e:
+	case 0x2039:
+	case 0x203a:
+	case 0x300c:
+	case 0x300d:
+	case 0x300e:
+	case 0x300f:
+	case '\"':
+	case '\'':
 		result = true;
 		break;
 	default: