trichview.com

trichview.support




Tables disappear when saving (or loading ?)


Return to index


Author

Message

Pascal Jean-Luc

Posted: 07/10/2003 9:29:10


   Dear All,

   I'm a beginner with the TRichView component and I'm designing a Borland

component to edit a RichViewEdit field.

   All my objects are created dynamically with Borland C++ 4. I have no form

at design time.

   The problem I encounter is I can't save Tables (or can't load them ?).

   Saving of text and pictures are ok, but tables disapear when I try to

load them back.

   Users add tables in my RichViewEdit by clipboard paste of Word tables.

   My database field in oracle is LONG RAW.

   Does anyone has any idea about this ?

   Thanks

   Jean-Luc


   // The Rich Text editor

   //

   // RVStyle for TRichViewEdit.

   // Set all styles to Unicode

   FRichViewStyle = new TRVStyle(FEditorPanel);

   for (int index=0; index<FRichViewStyle->TextStyles->Count; index++)

   {  TFontInfo *fontStyle = FRichViewStyle->TextStyles->Items[index];

       fontStyle->Unicode = true;

   }


   // The RichView Editor

   FRichEdit                     = new TRichViewEdit(FEditorPanel);

   FRichEdit->Parent             = FEditorPanel;

   FRichEdit->Align              = alClient;

   FRichEdit->VScrollVisible     = true;

   FRichEdit->HScrollVisible     = true;

   FRichEdit->PopupMenu          = FTextMNU;

   FRichEdit->Ctl3D              = false;

   FRichEdit->Style              = FRichViewStyle;

   FRichEdit->EditorOptions      = TRVEditorOptions() << rvoWantTabs;

   FRichEdit->OnDragDrop         = OnRTFDragDrop;

   FRichEdit->OnDragOver         = OnRTFDragOver;



   FRichEdit->RTFReadProperties->UnicodeMode     = rvruOnlyUnicode;

   FRichEdit->RTFReadProperties->ParaStyleMode   = rvrsAddIfNeeded;

   FRichEdit->RTFReadProperties->TextStyleMode   = rvrsAddIfNeeded;

   FRichEdit->RVFTextStylesReadMode              = rvf_sInsertMerge;

   FRichEdit->RVFParaStylesReadMode              = rvf_sInsertMerge;



   FRichEdit->RVFOptions                         = TRVFOptions() <<

rvfoLoadBack       << rvfoSaveBack

                                                                 <<

rvfoLoadLayout     << rvfoSaveLayout

                                                                 <<

rvfoSaveTextStyles << rvfoSaveParaStyles;



RichView Database Loading :

   FRvfMemoryStream->Clear();


((TBlobField*)(FQueryQRY->FieldByName("rvf_field")))->SaveToStream(FRvfMemor

yStream);


   slipConfigurationRTF->Editor->Clear();

   FRvfMemoryStream->Position = 0;

   slipConfigurationRTF->Editor->InsertRVFFromStream(FRvfMemoryStream, 0);

   slipConfigurationRTF->Editor->Format();


RichView Database Saving :

   FRvfMemoryStream->Clear();

   slipConfigurationRTF->Editor->SaveRVFToStream(FRvfMemoryStream, false);

// SelectionOnly = false

   FRvfMemoryStream->Position = 0;





Powered by ABC Amber Outlook Express Converter