Hyperlinks not saved
Posted: Tue Oct 17, 2017 5:39 pm
Hello,
I have defined a standard set of styles with style templates. ParaStyle and TextStyle are not saved, to keep the file size as small as possible.
Everything works fine when saving and loading documents, except for hyperlinks:
When I set and hyperlink with the code below, the 'Hyperlink' style template is applied and I can then click the hyperlink on the richview component.
Once saved and reloaded, the hyperlink is read as a Normal style, not Hyperlink style.
The Tag is correctly set, saved and reloaded, but it seems the Hyperlink style and the jump property of the style are not loaded.
Any idea on what is wrong?
My code to set the hyperlink (that works correctly on another software):
rve.ApplyTextStyleTemplate(5, True, True); // style 5 is hyperlink style, both on style templates and text styles. text style jump property is true
rve.ApplyTextStyle(5);
rve.SetItemTag(ItemNo, aurl); // New TRVTag type
Richview options are:
ARichView.UseStyleTemplates := True;
ARichView.RVFParaStylesReadMode := rvf_sInsertMap;
ARichView.RVFTextStylesReadMode := rvf_sInsertMap;
ARichView.RVFOptions := [
rvfoConvUnknownStylesToZero,
rvfoSaveBinary,
// rvfoSaveParaStyles,
// rvfoSaveTextStyles,
rvfoSaveDocProperties,
rvfoSavePicturesBody
];
Many thanks,
Laurent
I have defined a standard set of styles with style templates. ParaStyle and TextStyle are not saved, to keep the file size as small as possible.
Everything works fine when saving and loading documents, except for hyperlinks:
When I set and hyperlink with the code below, the 'Hyperlink' style template is applied and I can then click the hyperlink on the richview component.
Once saved and reloaded, the hyperlink is read as a Normal style, not Hyperlink style.
The Tag is correctly set, saved and reloaded, but it seems the Hyperlink style and the jump property of the style are not loaded.
Any idea on what is wrong?
My code to set the hyperlink (that works correctly on another software):
rve.ApplyTextStyleTemplate(5, True, True); // style 5 is hyperlink style, both on style templates and text styles. text style jump property is true
rve.ApplyTextStyle(5);
rve.SetItemTag(ItemNo, aurl); // New TRVTag type
Richview options are:
ARichView.UseStyleTemplates := True;
ARichView.RVFParaStylesReadMode := rvf_sInsertMap;
ARichView.RVFTextStylesReadMode := rvf_sInsertMap;
ARichView.RVFOptions := [
rvfoConvUnknownStylesToZero,
rvfoSaveBinary,
// rvfoSaveParaStyles,
// rvfoSaveTextStyles,
rvfoSaveDocProperties,
rvfoSavePicturesBody
];
Many thanks,
Laurent