VirtualBox

Changeset 60151 in vbox for trunk


Ignore:
Timestamp:
Mar 23, 2016 11:08:54 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt/darwin: make Parfait happy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxCocoaHelper.h

    r55401 r60151  
    3333#include <QVarLengthArray>
    3434
    35 inline NSString *darwinQStringToNSString (const QString &aString)
     35inline NSString *darwinQStringToNSString(const QString &aString)
    3636{
    37     return [reinterpret_cast<const NSString *>(CFStringCreateWithCharacters (0, reinterpret_cast<const UniChar *> (aString.unicode()),
    38                                                                              aString.length())) autorelease];
     37    const UniChar *chars = reinterpret_cast<const UniChar *>(aString.unicode());
     38    CFStringRef str = CFStringCreateWithCharacters(0, chars, aString.length());
     39    return [(NSString*)CFStringCreateMutableCopy(0, 0, str) autorelease];
    3940}
    4041
    41 inline QString darwinNSStringToQString (const NSString *aString)
     42inline QString darwinNSStringToQString(const NSString *aString)
    4243{
    43     CFStringRef str = reinterpret_cast<const CFStringRef> (aString);
     44    CFStringRef str = reinterpret_cast<const CFStringRef>(aString);
    4445    if(!str)
    4546        return QString();
    46     CFIndex length = CFStringGetLength (str);
    47     const UniChar *chars = CFStringGetCharactersPtr (str);
     47    CFIndex length = CFStringGetLength(str);
     48    const UniChar *chars = CFStringGetCharactersPtr(str);
    4849    if (chars)
    49         return QString (reinterpret_cast<const QChar *> (chars), length);
     50        return QString(reinterpret_cast<const QChar *>(chars), length);
    5051
    51     QVarLengthArray<UniChar> buffer (length);
    52     CFStringGetCharacters (str, CFRangeMake (0, length), buffer.data());
    53     return QString (reinterpret_cast<const QChar *> (buffer.constData()), length);
     52    QVarLengthArray<UniChar> buffer(length);
     53    CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data());
     54    return QString(reinterpret_cast<const QChar *>(buffer.constData()), length);
    5455}
    5556
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette