<html>
<head>
<base href="https://bugs.documentfoundation.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Horizontal rules in old documents are broken: only links in the files"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=67208#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Horizontal rules in old documents are broken: only links in the files"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=67208">bug 67208</a>
from <span class="vcard"><a class="email" href="mailto:superpwnzormegaman@gmail.com" title="superpwnzormegaman@gmail.com">superpwnzormegaman@gmail.com</a>
</span></b>
<pre>Hello opensource noob, but (kindoff) experienced c++'er here.
I did the detection part with:
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx
b/xmloff/source/text/XMLTextFrameContext.cxx
index 58ed9b3..0b5e4e8 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -721,6 +721,30 @@ void XMLTextFrameContext_Impl::Create( bool
/*bHRefOrBase64*/ )
GetImport().GetTextImport();
if( !sHRef.isEmpty() )
{
+ /**
+ * BUG: 67208
+ *
+ * in old documents horizontal rulers are shown as links to
+ * nonexisting images.
+ *
+ * In here we replace them with ...
+ */
+ const OUString matchString = OUString("/gallery/rulers/");
+ const sal_Int32 matchLength = matchString.getLength();
+ for(sal_Int32 i = sHRef.getLength() - matchLength; i > 0; i--){
+ if(sHRef.match(matchString, i)){
+ SAL_DEBUG("replace something with something here?");
+ }
+ /*
+ * check to see if we are going deeper than one dir from the
end
+ * of the path, if so stop, because our matching
matchStringing is only
+ * relevant for the last part of the path
+ */
+ if(sHRef[i+matchLength-1] == '/'){
+ i = -1;
+ }
+ }
bool bForceLoad = xTxtImport->IsInsertMode() ||
xTxtImport->IsBlockMode() ||
xTxtImport->IsStylesOnlyMode() ||
But I'm not sure with what I should replace these links.
Also not that this fix will probably break any images that are put into any
"/gallery/rulers/" folder, so this path should probably be as long as possible.
I tried to reduce the chance of these name clashes by starting the search at
the end of the path and going forward up the name untill the first / occurs,
assuming that all these ruler styles are directly in the rulers directory, and
don't have sub directories (am I right in this?).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>