r14442 by jghali - #8642 (3rd round): Inconsistent use of gWidth versus Width when laying out lines with inline frames Do some little simplification of the code now that glyph xadvance is set appropriately by PageItem_TextFrame::layout()

scribus-commit scribus-commit at lists.scribus.net
Sun Dec 20 13:55:26 CET 2009


Revision: 14442
Author: jghali
Date: 2009-12-20T01:12:25.870551Z
Commit message: #8642 (3rd round): Inconsistent use of gWidth versus Width when laying out lines with inline frames
Do some little simplification of the code now that glyph xadvance is set appropriately by PageItem_TextFrame::layout()

Changeset: 
M  /trunk/Scribus/scribus/pdflib_core.cpp
M  /trunk/Scribus/scribus/pslib.cpp
M  /trunk/Scribus/scribus/pageitem_textframe.cpp

Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp	(revision 14441)
+++ scribus/pdflib_core.cpp	(revision 14442)
@@ -4765,13 +4765,14 @@
 					setTextCh(ite, PNr, CurX, ls.y, d, tmp, tmp2, &hl2, pstyle, pag);
 				}
 				setTextCh(ite, PNr, CurX, ls.y, d, tmp, tmp2, hl, pstyle, pag);
-				if (hl->ch == SpecialChars::OBJECT)
+				// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
+				/*if (hl->ch == SpecialChars::OBJECT)
 				{
 					InlineFrame& embedded(const_cast<InlineFrame&>(hl->embedded));
 					CurX += (embedded.getItem()->gWidth + embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
 				}
-				else
-					CurX += hl->glyph.wide();
+				else*/
+				CurX += hl->glyph.wide();
 				tabDist = CurX;
 			}
 		}
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 14441)
+++ scribus/pageitem_textframe.cpp	(revision 14442)
@@ -2490,10 +2490,11 @@
 						}
 					}
 				}
-				if (hls->ch == SpecialChars::OBJECT)
+				// Unneeded now that glyph xadvance is set appropriately for inline objects by layout() - JG
+				/*if (hls->ch == SpecialChars::OBJECT)
 					selX += (hls->embedded.getItem()->gWidth + hls->embedded.getItem()->lineWidth()) * hls->glyph.scaleH;
-				else
-					selX += hls->glyph.wide();
+				else*/
+				selX += hls->glyph.wide();
 			}
 			if(!selectedFrame.isNull())
 				sFList << selectedFrame;
@@ -2594,10 +2595,11 @@
 							drawGlyphs(p, charStyle, hl->glyph);
 						p->restore();//RE4
 					}
-					if (hl->ch == SpecialChars::OBJECT)
+					// Unneeded now that glyph xadvance is set appropriately for inline objects by layout() - JG
+					/*if (hl->ch == SpecialChars::OBJECT)
 						CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
-					else
-						CurX += hl->glyph.wide();
+					else*/
+					CurX += hl->glyph.wide();
 				}
 				tabDist = CurX;
 			}
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 14441)
+++ scribus/pslib.cpp	(revision 14442)
@@ -4249,13 +4249,14 @@
 				setTextCh(Doc, ite, CurX, ls.y, gcr, argh, d, &hl2, pstyle, pg, sep, farb, ic, master);
 			}
 			setTextCh(Doc, ite, CurX, ls.y, gcr, argh, d, hl, pstyle, pg, sep, farb, ic, master);
-			if (hl->ch == SpecialChars::OBJECT)
+			// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
+			/*if (hl->ch == SpecialChars::OBJECT)
 			{
 				InlineFrame& embedded(const_cast<InlineFrame&>(hl->embedded));
 				CurX += (embedded.getItem()->gWidth + embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
 			}
-			else
-				CurX += hl->glyph.wide();
+			else*/
+			CurX += hl->glyph.wide();
 			tabDist = CurX;
 		}
 	}




More information about the scribus-commit mailing list