示例#1
0
/* ==================================================================== */
BOOL scTextline::TestOffsets( scTextline*				orgTxl,
							  const scStreamChangeInfo& sc )
{
	if ( GetPara() == sc.GetPara() ) {
		if ( GetStartOffset() > sc.GetOffset() )
			return GetStartOffset() - sc.GetLength() == orgTxl->GetStartOffset() &&
				   GetEndOffset() - sc.GetLength()	 == orgTxl->GetEndOffset();
	}	
	return GetStartOffset() == orgTxl->GetStartOffset() && 
		   GetEndOffset()	== orgTxl->GetEndOffset();
}
示例#2
0
// this determines the leading plus paragraph space between this - the
// last line of a paragraph - and the next paragraph
MicroPoint scTextline::ParaLead( scLEADRefData& 	lead,
								 const scFlowDir&	fd )
{
	TypeSpec		prevLeadSpec,
					curLeadSpec;
	MicroPoint		spaceAbove,
					spaceBelow;
	MicroPoint		paraspace;
	scLEADRefData	topPara;
	scLEADRefData	belowPara;

	scContUnit* 	nextPara;
	
	nextPara = GetPara()->GetNext();
	if ( !nextPara )
		return 0;
	
	MaxLead( prevLeadSpec );
	curLeadSpec = nextPara->SpecAtStart();

	if ( fd.IsHorizontal() ) {
		spaceBelow =	scCachedStyle::GetCachedStyle( prevLeadSpec ).GetPtSize();
		spaceAbove =	scCachedStyle::GetCachedStyle( curLeadSpec ).GetPtSize();
	}
	else {
		spaceBelow =	scCachedStyle::GetCachedStyle( prevLeadSpec ).GetSetSize();
		spaceAbove =	scCachedStyle::GetCachedStyle( curLeadSpec ).GetSetSize();
	}
	
	topPara.Set( spaceBelow, fd );	
	belowPara.Set( spaceAbove, fd );	

	paraspace		= scCachedStyle::GetParaSpace( GetPara(), nextPara );
	
	lead.SetBelowLead( topPara.GetBelowLead() );
	lead.SetAboveLead( belowPara.GetAboveLead() );
	lead.SetExternalSpace( paraspace );
	
	return lead.GetLead();
}
示例#3
0
void CHeader::Core(vector<CClassDetail *>& vecDetail)
{
    CClassCont CCont;
    WriteCommit2Include(NeedVector(vecDetail));
    vector<CClassPara> vecPara;
    CClassPara CCfgPara;
    GetPara(vecPara, CCfgPara, vecDetail);
    for (unsigned int uiCount = 0; uiCount < vecPara.size(); ++uiCount) {
        ClassDeclare(vecPara[uiCount]);
    }
    ClassDeclare(CCfgPara, false);
    for (unsigned int uiCount = 0; uiCount < vecPara.size(); ++uiCount) {
        ClassDefine(vecPara[uiCount]);
    }
    ClassDefine(CCfgPara, false);
    Cout << "} // CFG_N\n" << endl;
    Cout <<  CCont.GetMacroEndif() << endl;
}
示例#4
0
/* reposition the line, this line is part of a flex column and it may
 * need repositioning depending on the line rag
 * returns the next line - thus optimizing loop in column a little
 */
void scTextline::Reposition( MicroPoint measure )
{
	MicroPoint	displacement;
	CharRecordP chP;
	scFlowDir	flowDir;
	scMuPoint	transPt( fOrigin );

	flowDir = fColumn->GetFlowdir( );
	
	if ( flowDir.IsHorizontal() ) {
		transPt.x = -transPt.x;
		transPt.y = 0;
	}
	else {
		transPt.x = 0;
		transPt.y = -transPt.y;
	}

	switch ( GetFlexLineAdjustment() &	eRagFlag ) {
		case eRagLeft:
			fOrigin.Translate( transPt );
			fInkExtents.Translate( transPt );
				
			displacement	= measure - fLength;
			if ( flowDir.IsHorizontal() ) {
				fOrigin.Translate( displacement, 0 );
				fInkExtents.Translate( displacement, 0 );
			}
			else {
				fOrigin.Translate( 0, displacement );
				fInkExtents.Translate( 0, displacement );
			}
			break;
			
		case eRagCentered:
			fOrigin.Translate( transPt );
			fInkExtents.Translate( transPt );
		
			displacement	= ( measure - fLength ) / 2;
			if ( flowDir.IsHorizontal() ) {
				fOrigin.Translate( displacement, 0 );
				fInkExtents.Translate( displacement, 0 );
			}
			else {
				fOrigin.Translate( 0, displacement );
				fInkExtents.Translate( 0, displacement );
			}
			break;

		case eRagJustified:
			if ( !Marked( scLASTLINE ) || GetFlexLineAdjustment() & eLastLineJust ) {
				chP = (CharRecordP)GetPara()->GetCharArray().Lock();
				if ( BRKJustify( chP, GetStartOffset(), GetEndOffset(), measure ) )
					Mark( scREPAINT );

				if ( flowDir.IsHorizontal() )
					fInkExtents.x2	= fInkExtents.x1 + measure + fInkExtents.Depth() / 2;
				else 
					fInkExtents.y2	= fInkExtents.y1 + measure + fInkExtents.Width() / 2;
				fLength 	= measure;
				GetPara()->GetCharArray().Unlock();
			}
			break;
		
		case eRagRight:
			break;
	}
}
示例#5
0
/* ==================================================================== */
BOOL scTextline::Compare( scTextline*				orgTxl,
						  const scStreamChangeInfo& streamChange )
{
#if 1
	if ( fPara != orgTxl->GetPara() )
		return false;
		 
	if ( fOrigin != orgTxl->fOrigin )
		return false;
	

	if ( !TestOffsets( orgTxl, streamChange ) )
		return false;

	if ( fVJOffset != orgTxl->fVJOffset )
		return false;

	if ( fMaxLeadSpec != orgTxl->fMaxLeadSpec )
		return false;

	if ( fLength != orgTxl->fLength )
		return false;

	if ( fLineCount != orgTxl->fLineCount )
		return false;

	if ( fInkExtents != orgTxl->fInkExtents )
		return false;

	if ( Marked( scLASTLINE ) != orgTxl->Marked( scLASTLINE ) )
		return false;
				 
	if ( fCursorY1 != orgTxl->fCursorY1 )
		 return false;

	if ( fCursorY2 != orgTxl->fCursorY2 )
		return false;

	if ( fColumn != orgTxl->fColumn )
		return false;

	if ( fLspAdjustment != orgTxl->fLspAdjustment )
		return false;

	return true;
	


#else
	BOOL	notChanged;

	if ( GetPara()					== orgTxl->GetPara()			&&
		 fOrigin					== orgTxl->fOrigin				&&
		 TestOffsets( orgTxl, p, offset, len )						&&		 
		 fVJOffset					== orgTxl->fVJOffset			&&
		 fMaxLeadSpec				== orgTxl->fMaxLeadSpec 		&&
		 fLength					== orgTxl->fLength				&&
		 fLineCount 				== orgTxl->fLineCount			&&
		 fInkExtents				== orgTxl->fInkExtents			&&
		 Marked( scLASTLINE )		== orgTxl->Marked( scLASTLINE ) &&
		 fCursorY1					== orgTxl->fCursorY1			&&
		 fCursorY2					== orgTxl->fCursorY2			&&
		 fColumn					== orgTxl->fColumn				&&
		 fLspAdjustment 			== orgTxl->fLspAdjustment )
				notChanged = true;
	else
		notChanged = false;

	return notChanged;
#endif	
}