19 #include "TmLayoutImp.h" |
19 #include "TmLayoutImp.h" |
20 #include <s32mem.h> |
20 #include <s32mem.h> |
21 #include "TmChunkInterp.h" |
21 #include "TmChunkInterp.h" |
22 #include "InlineText.h" |
22 #include "InlineText.h" |
23 #include "frmUtils.h" |
23 #include "frmUtils.h" |
|
24 |
|
25 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "TmLineTraces.h" |
|
28 #endif |
24 |
29 |
25 inline TBool IsSurrogate(TText a) { return 0xD800 == (a & 0xF800); } |
30 inline TBool IsSurrogate(TText a) { return 0xD800 == (a & 0xF800); } |
26 inline TBool IsHighSurrogate(TText a) { return 0xD800 == (a & 0xFC00); } |
31 inline TBool IsHighSurrogate(TText a) { return 0xD800 == (a & 0xFC00); } |
27 inline TBool IsLowSurrogate(TText a) { return 0xDC00 == (a & 0xFC00); } |
32 inline TBool IsLowSurrogate(TText a) { return 0xDC00 == (a & 0xFC00); } |
28 inline TChar JoinSurrogates(TText aHigh, TText aLow) |
33 inline TChar JoinSurrogates(TText aHigh, TText aLow) |
604 |
609 |
605 aStartChar += chunk.iTextLength; |
610 aStartChar += chunk.iTextLength; |
606 if (chunk.iOverlappingChars > 0 && ! chunkInfo.iAtLineEnd && ! chunkInfo.iAtParEnd) |
611 if (chunk.iOverlappingChars > 0 && ! chunkInfo.iAtLineEnd && ! chunkInfo.iAtParEnd) |
607 { |
612 { |
608 aStartChar -= chunk.iOverlappingChars; |
613 aStartChar -= chunk.iOverlappingChars; |
|
614 if (aStartChar < 0) |
|
615 { |
|
616 OstTrace0( TRACE_DUMP, CTMLINE_APPENDCHUNKL, "EInvariant" ); |
|
617 } |
609 __ASSERT_DEBUG(aStartChar >= 0, TmPanic(EInvariant)); |
618 __ASSERT_DEBUG(aStartChar >= 0, TmPanic(EInvariant)); |
610 } |
619 } |
611 |
620 |
612 aStartXPos += chunk.iWidth; |
621 aStartXPos += chunk.iWidth; |
613 |
622 |
987 } |
996 } |
988 |
997 |
989 void CTmLine::WriteInlineTextL(CTmFormatContext& aContext, CTmCode& aCode, TInt aPos, TInt aInlineWidth, TBool aLeadingEdge, TInt aInlineFormat) |
998 void CTmLine::WriteInlineTextL(CTmFormatContext& aContext, CTmCode& aCode, TInt aPos, TInt aInlineWidth, TBool aLeadingEdge, TInt aInlineFormat) |
990 { |
999 { |
991 MTmInlineTextSource* inlineTextApi = (MTmInlineTextSource*)aContext.iSource.GetExtendedInterface(KInlineTextApiExtensionUid); |
1000 MTmInlineTextSource* inlineTextApi = (MTmInlineTextSource*)aContext.iSource.GetExtendedInterface(KInlineTextApiExtensionUid); |
|
1001 if (inlineTextApi==0) |
|
1002 { |
|
1003 OstTrace0( TRACE_DUMP, CTMLINE_WRITEINLINETEXTL, "EInvariant" ); |
|
1004 } |
992 __ASSERT_DEBUG(inlineTextApi!=0,TmPanic(EInvariant)); |
1005 __ASSERT_DEBUG(inlineTextApi!=0,TmPanic(EInvariant)); |
993 |
1006 |
994 TTmDocPos startDocPos(aPos, aLeadingEdge); |
1007 TTmDocPos startDocPos(aPos, aLeadingEdge); |
995 TPtrC inlineText = inlineTextApi->GetInlineText(startDocPos); |
1008 TPtrC inlineText = inlineTextApi->GetInlineText(startDocPos); |
996 TUint8 op2 = TTmInterpreter::EOpInlineText; |
1009 TUint8 op2 = TTmInterpreter::EOpInlineText; |
997 TInt inlineLength = inlineText.Length(); |
1010 TInt inlineLength = inlineText.Length(); |
|
1011 if (inlineLength > TTmInterpreter::EMaxInlineChars) |
|
1012 { |
|
1013 OstTrace0( TRACE_DUMP, DUP1_CTMLINE_WRITEINLINETEXTL, "EInvariant" ); |
|
1014 } |
998 __ASSERT_DEBUG(inlineLength <= TTmInterpreter::EMaxInlineChars,TmPanic(EInvariant)); |
1015 __ASSERT_DEBUG(inlineLength <= TTmInterpreter::EMaxInlineChars,TmPanic(EInvariant)); |
999 if (inlineLength > 1) |
1016 if (inlineLength > 1) |
1000 op2 |= TTmInterpreter::EModCount; |
1017 op2 |= TTmInterpreter::EModCount; |
1001 aCode.AppendByteL(op2); |
1018 aCode.AppendByteL(op2); |
1002 if (inlineLength > 1) |
1019 if (inlineLength > 1) |