Revert "Use textStorageCreationBlock for resetting the text storage (#1874)"

This reverts commit d646d3c753.
This commit is contained in:
Scott Goodson
2016-07-09 23:54:06 -07:00
parent ff7a586eba
commit d83f319fe3

View File

@@ -23,7 +23,6 @@
NSTextContainer *_textContainer;
NSAttributedString *_attributedString;
ASTextKitContextTextStorageCreationBlock _textStorageCreationBlock;
}
#pragma mark - Lifecycle
@@ -35,7 +34,7 @@
constrainedSize:(CGSize)constrainedSize
layoutManagerCreationBlock:(NSLayoutManager * (^)(void))layoutCreationBlock
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
textStorageCreationBlock:(ASTextKitContextTextStorageCreationBlock)textStorageCreationBlock
textStorageCreationBlock:(NSTextStorage * (^)(NSAttributedString *attributedString))textStorageCreationBlock
{
if (self = [super init]) {
@@ -44,7 +43,6 @@
std::lock_guard<std::mutex> l(__static_mutex);
_attributedString = [attributedString copy];
_textStorageCreationBlock = [textStorageCreationBlock copy];
// Create the TextKit component stack with our default configuration.
if (textStorageCreationBlock) {
@@ -81,11 +79,7 @@
- (void)_resetTextStorage
{
if (_textStorageCreationBlock) {
[_textStorage setAttributedString:_textStorageCreationBlock(_attributedString)];
} else {
[_textStorage setAttributedString:_attributedString];
}
[_textStorage setAttributedString:_attributedString];
}
#pragma mark - Setter / Getter