NSData* sysData = [[UIPasteboard generalPasteboard] dataForPasteboardType:sysFormat]; if (!sysData)
{ // Related: gh#5908 throw an exception if the data flavor is nil // If nil is returned, it can mean that the user has selected the // "disallow" option and so we can't access the current clipboard // contents. Also, by throwing an exception, the "allow or disallow" // dialog will display again the next time the user tries to paste. throw UnsupportedFlavorException("Data flavor is nil", static_cast<XTransferable*>(this));
}
sal_Bool SAL_CALL iOSTransferable::isDataFlavorSupported(const DataFlavor& aFlavor)
{ for (sal_Int32 i = 0; i < mFlavorList.getLength(); i++) if (compareDataFlavors(aFlavor, mFlavorList[i])) returntrue;
/* Compares two DataFlavors. Returns true if both DataFlavor have the same media type andthenumberofparameterandallparametervaluesdomatchotherwisefalse isreturned.
*/ bool iOSTransferable::compareDataFlavors(const DataFlavor& lhs, const DataFlavor& rhs)
{ try
{
Reference<XMimeContentType> xLhs(mrXMimeCntFactory->createMimeContentType(lhs.MimeType));
Reference<XMimeContentType> xRhs(mrXMimeCntFactory->createMimeContentType(rhs.MimeType));
if (!xLhs->getFullMediaType().equalsIgnoreAsciiCase(xRhs->getFullMediaType())
|| !cmpAllContentTypeParameter(xLhs, xRhs))
{ returnfalse;
}
} catch (IllegalArgumentException&)
{
OSL_FAIL("Invalid content type detected"); returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.