Changeset 259483 in webkit


Ignore:
Timestamp:
Apr 3, 2020 12:50:42 PM (4 years ago)
Author:
ddkilzer@apple.com
Message:

REGRESSION (r8412): Use RetainPtr<> for NSMutableAttributedString in -[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]
<https://webkit.org/b/209980>

Reviewed by Darin Adler.

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
Make use of RetainPtr<>.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259482 r259483  
     12020-04-03  David Kilzer  <ddkilzer@apple.com>
     2
     3        REGRESSION (r8412): Use RetainPtr<> for NSMutableAttributedString in -[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]
     4        <https://webkit.org/b/209980>
     5
     6        Reviewed by Darin Adler.
     7
     8        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     9        (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
     10        Make use of RetainPtr<>.
     11
    1122020-04-03  Kenneth Russell  <kbr@chromium.org>
    213
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r259428 r259483  
    12561256        if (!range)
    12571257            return nil;
    1258         NSMutableAttributedString* attrString = [[NSMutableAttributedString alloc] init];
     1258        auto attrString = adoptNS([[NSMutableAttributedString alloc] init]);
    12591259        TextIterator it(*range);
    12601260        while (!it.atEnd()) {
     
    12661266                String listMarkerText = AccessibilityObject::listMarkerTextForNodeAndPosition(&node, VisiblePosition(createLegacyEditingPosition(it.range().start)));
    12671267                if (!listMarkerText.isEmpty())
    1268                     AXAttributedStringAppendText(attrString, &node, listMarkerText, spellCheck);
    1269                 AXAttributedStringAppendText(attrString, &node, it.text(), spellCheck);
     1268                    AXAttributedStringAppendText(attrString.get(), &node, listMarkerText, spellCheck);
     1269                AXAttributedStringAppendText(attrString.get(), &node, it.text(), spellCheck);
    12701270            } else {
    12711271                Node* replacedNode = it.node();
     
    12821282                    // add the attachment attribute
    12831283                    AccessibilityObject* obj = replacedNode->renderer()->document().axObjectCache()->getOrCreate(replacedNode->renderer());
    1284                     AXAttributeStringSetElement(attrString, NSAccessibilityAttachmentTextAttribute, obj, attrStringRange);
     1284                    AXAttributeStringSetElement(attrString.get(), NSAccessibilityAttachmentTextAttribute, obj, attrStringRange);
    12851285                }
    12861286            }
     
    12881288        }
    12891289
    1290         return [attrString autorelease];
     1290        return attrString.autorelease();
    12911291    });
    12921292}
Note: See TracChangeset for help on using the changeset viewer.