diff options
Diffstat (limited to 'org')
-rw-r--r-- | org/madore/damlengine/TodoWrefAttr.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java index 0a94e0d..7f40959 100644 --- a/org/madore/damlengine/TodoWrefAttr.java +++ b/org/madore/damlengine/TodoWrefAttr.java @@ -31,6 +31,7 @@ public class TodoWrefAttr extends TodoAttr { String wrefMonthStr = wrefMatcher.group(2); String wrefDayStr = wrefMatcher.group(3); String wrefNumberStr = wrefMatcher.group(4); + int wrefNumber = Integer.parseInt(wrefNumberStr); String wrefSupplementStr = wrefMatcher.group(5); String targetFile; String targetStdDir = (ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"); @@ -38,7 +39,7 @@ public class TodoWrefAttr extends TodoAttr { WeblogSummary.EntrySummary esum; // Get entry for target link from weblog summary if ( wsum != null && wsum.entries != null ) - esum = wsum.entries.get(new Integer(wrefNumberStr)); + esum = wsum.entries.get(wrefNumber); else esum = null; // Check consistency if summary was available @@ -49,9 +50,14 @@ public class TodoWrefAttr extends TodoAttr { } // Choose file portion of link target if ( esum != null && esum.doSinglePage != null && ! wrefSupplementStr.equals("") ) { - targetFile = targetStdDir + esum.date + "-" + esum.doSinglePage + ".html"; + if ( ctx.wsc != null && ctx.wsc.sel != null + && ctx.wsc instanceof Context.WeblogSingleSelectionContext + && ((Context.WeblogSingleSelectionContext)ctx.wsc).number == wrefNumber ) + targetFile = ""; + else + targetFile = targetStdDir + esum.date + "-" + esum.doSinglePage + ".html"; } else if ( ctx.wsc != null && ctx.wsc.sel != null - && ctx.wsc.sel.contains(new Integer(wrefNumberStr)) ) { + && ctx.wsc.sel.contains(wrefNumber) ) { targetFile = ""; } else { targetFile = targetStdDir + wrefYearStr + "-" + wrefMonthStr + ".html"; |