RvHtmlImporter v0.0027 bugs
-
- Posts: 12
- Joined: Mon May 12, 2008 11:29 pm
Thank you very much Sergey. This is working much better than the older HTML import component.
I agree with nicefive about some concern over so many dependencies, but it is working, and all of these add-ons have source code available, so I'm fine with that.
It would be nice in the future (if you're bored ) if this didn't require the THTMLViewer component and if the RvHTMLViewImport was just integrated into RvRichEdit, just like the TRichView HTML exporting capabilities are.
Anyways, I am getting close to finishing my evaluation/testing of the TRichView component and it's looking very likely that I will purchase it.
Thanks again for all the help.
I agree with nicefive about some concern over so many dependencies, but it is working, and all of these add-ons have source code available, so I'm fine with that.
It would be nice in the future (if you're bored ) if this didn't require the THTMLViewer component and if the RvHTMLViewImport was just integrated into RvRichEdit, just like the TRichView HTML exporting capabilities are.
Anyways, I am getting close to finishing my evaluation/testing of the TRichView component and it's looking very likely that I will purchase it.
Thanks again for all the help.
-
- Posts: 12
- Joined: Mon May 12, 2008 11:29 pm
I seem to have found an issue w/the new HTML importer. This may also be some issue w/the HTML exporting of TRichView, but I'm pretty sure it's just an issue on the import side.
When I have make a bulleted list and then export to html I get an HTML like this:
Notice that the margin-left on the bullet list is 24px. When I then import the HTML again, and if I go to the bullets and numbering settings, it says the left indent on the list is 49. So then if I export to HTML again, the margin-left becomes 49px. And then if I import again from HTML the left indent shows 74. So when I export a 3rd time to HTML, the margin-left becomes 74px.
Basically, the margin-left continues increasing every time I export, but the issue seems to be that the HTML importer is increasing the left indent.
Thanks in advance for any help.
When I have make a bulleted list and then export to html I get an HTML like this:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal */
{
font-size: 10pt;
font-family: 'Arial', 'Helvetica', sans-serif;
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
;
}
span.rvts1
{
color: #000000;
}
/* ========== Para Styles ========== */
p,ul,ol /* Left */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1
{
background: #ffffff;
}
.rvps2
{
background: #ffffff;
margin: 0px 0px 0px 20px;
}
--></style>
</head>
<body>
<ul style="text-indent: 0px; margin-left: 24px; list-style-position: outside;">
<li class=rvps1><span class=rvts1>test1</span></li>
<li class=rvps1><span class=rvts1>test2</span></li>
</ul>
</body></html>
Basically, the margin-left continues increasing every time I export, but the issue seems to be that the HTML importer is increasing the left indent.
Thanks in advance for any help.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 12
- Joined: Mon May 12, 2008 11:29 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Open rvHtmlViewImport.pas, find the lines:
and change them too:
Code: Select all
ll.MarkerIndent := sec.ContentLeft;
ll.FirstIndent := 0;
ll.LeftIndent := sec.ContentLeft+20; //TODO width of marker
Code: Select all
ll.MarkerIndent := sec.ContentLeft-24; //TODO width of marker
if ll.MarkerIndent<0 then
ll.MarkerIndent := 0;
ll.FirstIndent := 0;
ll.LeftIndent := sec.ContentLeft;
-
- Posts: 12
- Joined: Mon May 12, 2008 11:29 pm
Thanks for the reply.
This worked, but only after I made some changes:
Notice how I had to subtract the MarkerIndent and LeftIndent by 5.
Anyways, this all seems like a workaround. Shouldn't this shifting by 29 and 5 not be required (I do see it says "TODO width of marker" in the code)?
I will continue with some tests and will let you know if I find any other issues.
This worked, but only after I made some changes:
Code: Select all
ll.MarkerIndent := sec.ContentLeft-29; //TODO width of marker
if ll.MarkerIndent<0 then
ll.MarkerIndent := 0;
ll.FirstIndent := 0;
ll.LeftIndent := sec.ContentLeft-5;
Anyways, this all seems like a workaround. Shouldn't this shifting by 29 and 5 not be required (I do see it says "TODO width of marker" in the code)?
I will continue with some tests and will let you know if I find any other issues.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Why do you need these subtractions?
ll.LeftIndent is exactly the same as sec.ContentLeft - a distance from the left margin to the paragraph text.
ll.MarkerIndent is a distance from the left margin to the marker. Since width of marker is unknown, I assumed that it is 24 pixels.
24 is used because this is the default value for list indents in RichViewActions.
ll.LeftIndent is exactly the same as sec.ContentLeft - a distance from the left margin to the paragraph text.
ll.MarkerIndent is a distance from the left margin to the marker. Since width of marker is unknown, I assumed that it is 24 pixels.
24 is used because this is the default value for list indents in RichViewActions.
-
- Posts: 12
- Joined: Mon May 12, 2008 11:29 pm
If I don't put those subtractions, I get the same issue as before. When I step through that code, sec.ContentLeft is 29, not 24, even though I'm not changing any indent settings. I think I may have found out why this happens.
When I export a TRichView with just a single bullet, I get this HTML:
Notice how the body has 5 pixel margins. That could account for the 5 pixel difference I'm having. Maybe the code we changed needs to account for the body margins?
When I export a TRichView with just a single bullet, I get this HTML:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal */
{
font-size: 10pt;
font-family: 'Arial', 'Helvetica', sans-serif;
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
;
}
/* ========== Para Styles ========== */
p,ul,ol /* Left */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
--></style>
</head>
<body>
<ul style="text-indent: 0px; margin-left: 24px; list-style-position: outside;">
<li>test</li>
</ul>
</body></html>
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, you are right, it appears that ContentLeft includes left margin, when the list is inside the main document.
Unfortunately, when in the list is inside cell, left margin is not included there, and I was not able to find a way to distinguish these cases.
So I tried a different approach, using Indent property of TBlock representing <ul>
A new version is uploaded.
Unfortunately, when in the list is inside cell, left margin is not included there, and I was not able to find a way to distinguish these cases.
So I tried a different approach, using Indent property of TBlock representing <ul>
A new version is uploaded.