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