Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed indent problem on nested lists

  • Loading branch information...
commit bc23ca8938afe55832bee7a4d95683ab695ea1b8 1 parent cac85c9
Oliver Drobnik authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 Core/Source/DTHTMLElement.m
8 Core/Source/DTHTMLElement.m
View
@@ -444,10 +444,10 @@ - (NSAttributedString *)attributedString
// e.g. last LI needs to inherit the margin-after of the UL
if (self.displayStyle == DTHTMLElementDisplayStyleBlock)
{
- CTParagraphStyleRef paraStyle = (__bridge CTParagraphStyleRef)[tmpString attribute:(id)kCTParagraphStyleAttributeName atIndex:[tmpString length]-1 effectiveRange:NULL];
-
NSRange paragraphRange = [[tmpString string] rangeOfParagraphAtIndex:[tmpString length]-1];
+ CTParagraphStyleRef paraStyle = (__bridge CTParagraphStyleRef)[tmpString attribute:(id)kCTParagraphStyleAttributeName atIndex:paragraphRange.location effectiveRange:NULL];
+
DTCoreTextParagraphStyle *paragraphStyle = [DTCoreTextParagraphStyle paragraphStyleWithCTParagraphStyle:paraStyle];
if (paragraphStyle.paragraphSpacing < self.paragraphStyle.paragraphSpacing)
@@ -455,13 +455,13 @@ - (NSAttributedString *)attributedString
paragraphStyle.paragraphSpacing = self.paragraphStyle.paragraphSpacing;
// make new paragraph style
- paraStyle = [paragraphStyle createCTParagraphStyle];
+ CTParagraphStyleRef newParaStyle = [paragraphStyle createCTParagraphStyle];
// remove old (works around iOS 4.3 leak)
[tmpString removeAttribute:(id)kCTParagraphStyleAttributeName range:paragraphRange];
// set new
- [tmpString addAttribute:(id)kCTParagraphStyleAttributeName value:(__bridge_transfer id)paraStyle range:paragraphRange];
+ [tmpString addAttribute:(id)kCTParagraphStyleAttributeName value:(__bridge_transfer id)newParaStyle range:paragraphRange];
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.