trichview.support
RE: Detecting Styles |
Author |
Message |
tony |
Posted: 12/04/2002 12:21:08 I do not understand it . The fonts sizes, they are detected fine. The properties SpaceBefore,SpaceAfter they are those that they have changed. A brief example of which I do : my sheet styles. (superstyles.ini) -------------- [super] ParasCount=2 FontsCount=2 ParaStyleName1=Style1 ParaSpaceBefore1=11 ParaSpaceAfter1=11 FontStyleName1=Style1 FontName1=Arial FontJump1=No FontSize1=14 ParaStyleName2=Style2 ParaSpaceAfter2=11 FontStyleName2=Style2 FontName2=Times New Roman FontJump2=No FontCharset2=0 FontBold2=Yes FontUnderline2=Yes ----------------------------- //Now, load superstyles SuperStyles->LoadINI("superstyles.ini"); //load document rve->RTFReadProperties->ParaStyleMode = rvrsAddIfNeeded; rve->RTFReadProperties->TextStyleMode = rvrsAddIfNeeded; rve->LoadRTF("myexample.rtf"); //place caret at start each item int ItemNo=0; int Offs=0; for (int w=0;w<rve->ItemCount;w++){ Offs=rve->GetOffsBeforeItem(ItemNo); rve->SetSelectionBounds(ItemNo,Offs,ItemNo,Offs); TFontInfo *fi = Style->TextStyles->Items[rve->CurTextStyleNo];//fonts current TParaInfo *pi = Style->ParaStyles->Items[rve->CurParaStyleNo];//paragraph current //Now, look for superstyle current style for to identify it. for (int r=0;r<SuperStyle->ParaStyles->Count;r++){ TFontInfo *fiS = SuperStyle->TextStyles->Items[r]; TParaInfo *piS = SuperStyle->ParaStyles->Items[r]; //Wrong if screen fonts changed if ( pi->IsEqual ( piS,TRVParaInfoProperties() ) ){ fi->StyleName = SuperStyle->TextStyles->Items[r]->DisplayName; //find the style // ... } } } You can put an example of like fixing this to me? ciao and Thanks Sergey. Antonio G�mez. M3D. --- He chequeado este email antes de enviarse. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.422 / Virus Database: 237 - Release Date: 20/11/2002 |
Powered by ABC Amber Outlook Express Converter