Anonymous avatar Anonymous committed 1064873

sw34bf04: #i51277#: SwFltStackEntry::MakeRegion:
prevent lots of HintsCheck assertions when importing bugdoc from the issue.

Comments (0)

Files changed (1)

sw/source/filter/ww1/fltshell.cxx

 
 sal_Bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck )
 {
-	// wird ueberhaupt ein Bereich umspannt ??
-	// - ist kein Bereich, dann nicht returnen wenn am Anfang vom Absatz
-	// - Felder aussortieren, koennen keinen Bereich haben !!
-	if (
-	     nMkNode.GetIndex() == nPtNode.GetIndex() && nMkCntnt == nPtCntnt &&
-		 nPtCntnt && RES_TXTATR_FIELD != pAttr->Which()
-	   )
+    // does this range actually contain something?
+    // empty range is allowed if at start of empty paragraph
+    // fields are special: never have range, so leave them
+    SwCntntNode *const pCntntNode(
+        SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode());
+    if ((nMkNode.GetIndex() == nPtNode.GetIndex()) && (nMkCntnt == nPtCntnt)
+        && ((0 != nPtCntnt) || (pCntntNode && (0 != pCntntNode->Len())))
+        && (RES_TXTATR_FIELD != pAttr->Which()))
 	{
 		return sal_False;
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.