trichview.com

trichview.support




Unicode, Link, Asian Characters


Return to index


Author

Message

jaepil@splashmedia.co.nz

Posted: 08/03/2004 9:19:18


Hi


I m getting an inconsistent behaviour from my TRichViewEdit where i use

Korean characters with unicode settings.


Most of the time, i can make the link work. But sometimes following occurs.


1) A link that's created for the first time doesn't have the Tag value.

2) When i save the content as RVF file and load it back, content

starting from where the link was, to the end of the document is not

displyed. When i check the actual file i can see the missing part.


Please tell me what i should do to avoid such behaviour.





### I set the TRichViewEdit as shown below.


//-------------------------

RTFReadProperties->UnicodeMode = rvruOnlyUnicode;

Options << rvoTagsArePChars;

//-------------------------



### And RVStyles as below.


//-------------------------

TextNormal

   Unicode = true;

   Jump = false;

TextBold

   Style << fsBold;

   Unicode = true;

   Jump = false;

TextItalic

   Style << fsItalic;

   Unicode = true;

   Jump = false;

TextBold

   Style << fsUnderline;

   Color = clBlue;

   Unicode = true;

   Jump = true;

//-------------------------


### I use ApplyStyleConversion to make link as show below.


//-------------------------

l_TextControl->ApplyStyleConversion(3);

l_TextControl->SetCurrentTag(int(StrNew(URLString.c_str())));

//-------------------------

void __fastcall

TMainForm::TextControlStyleConversion(TCustomRichViewEdit *AControl, int

StyleNo,

     int UserData, bool AppliedToText, int &NewStyleNo)

{

     // Get font info

     TFontInfo *FontInfo = new TFontInfo(NULL);

     FontInfo->Assign(RVStyleText->TextStyles->Items[StyleNo]);


     switch(UserData) {

         case 0:

             // Clear Bold and Italic styles

             FontInfo->Style >> fsBold >> fsItalic;

             break;

         case 1:

             // Add Bold style

             FontInfo->Style << fsBold;

             break;

         case 2:

             // Add Italic style

             FontInfo->Style << fsItalic;

             break;

         case 3:

             // Add Link style

             FontInfo->Style << fsUnderline;

             FontInfo->Jump = true;

             FontInfo->Color = clBlue;

             break;

         case 4:

             // Remove Link style

             FontInfo->Style >> fsUnderline;

             FontInfo->Jump = false;

             FontInfo->Color = clBlack;

             break;

     }


     // Update the style

     NewStyleNo = RVStyleText->TextStyles->FindSuchStyle(StyleNo,

FontInfo, RVAllFontInfoProperties);

     if (NewStyleNo == -1) {

         RVStyleText->TextStyles->Add();

         NewStyleNo = RVStyleText->TextStyles->Count-1;

         RVStyleText->TextStyles->Items[NewStyleNo]->Assign(FontInfo);

         RVStyleText->TextStyles->Items[NewStyleNo]->Standard = false;

     }


     delete FontInfo;

}

//-------------------------



Programer - SplashMedia

http://splashmedia.co.nz





Powered by ABC Amber Outlook Express Converter