HRESULT __declspec(nothrow) CanvasTextFormat::PropertyGet(T* value, ST const& shadowValue, FN realizedGetter) { return ExceptionBoundary( [&] { CheckInPointer(value); ThrowIfClosed(); if (m_format) SetFrom(value, realizedGetter()); else SetFrom(value, shadowValue); }); }
HRESULT __declspec(nothrow) CanvasTextFormat::PropertyPut(T value, TT* dest, FNV&& validator, void(CanvasTextFormat::*realizer)()) { return ExceptionBoundary( [&] { validator(value); ThrowIfClosed(); if (IsSame(dest, value)) { // Don't do anything if the value we're setting is the same // as the current value. return; } if (!realizer) { // If there's no realizer set then we're going to have to // throw away m_format (ready to be recreated the next time // it is needed) Unrealize(); } // Set the shadow value SetFrom(dest, value); // Realize the value on the dwrite object, if we can if (m_format && realizer) (this->*realizer)(); }); }
NormalizedConstraintSet::StringRange::StringRange( StringPtrType aMemberPtr, const char* aName, const dom::OwningStringOrStringSequenceOrConstrainDOMStringParameters& aOther, bool advanced, nsTArray<MemberPtrType>* aList) : BaseRange((MemberPtrType)aMemberPtr, aName, aList) { if (aOther.IsString()) { if (advanced) { mExact.insert(aOther.GetAsString()); } else { mIdeal.insert(aOther.GetAsString()); } } else if (aOther.IsStringSequence()) { if (advanced) { mExact.clear(); for (auto& str : aOther.GetAsStringSequence()) { mExact.insert(str); } } else { mIdeal.clear(); for (auto& str : aOther.GetAsStringSequence()) { mIdeal.insert(str); } } } else { SetFrom(aOther.GetAsConstrainDOMStringParameters()); } }
TypeSceneLine::TypeSceneLine( TypeSceneItem& from, TypeSceneItem& target , Qt::GlobalColor color ) : QGraphicsLineItem( &from ) { SetFrom( from ); SetTarget( target ); SetColor( color ); }
// length must be >= 0 TThisType& SetLengthDown(position_type length) { _ASSERT(length >= 0); position_type toOpen = GetToOpen(); position_type from = toOpen - length; if ( from > toOpen ) from = GetWholeFrom(); return SetFrom(from); }
CDataToolGeneratedSrc& CDataToolGeneratedSrc::operator= (const CDataToolGeneratedSrc& src) { if(this != &src) { SetFrom(src); } return *this; }
void Wall2D::Read(ifstream &in) { double x, y; in >> x >> y; SetFrom(CCPoint(x, y)); in >> x >> y; SetTo(CCPoint(x,y)); in >> x >> y; SetNormal(CCPoint(x, y)); }
ECode SendReq::constructor( /* [in] */ ArrayOf<Byte>* contentType, /* [in] */ IEncodedStringValue* from, /* [in] */ Int32 mmsVersion, /* [in] */ ArrayOf<Byte>* transactionId) { MultimediaMessagePdu::constructor(); SetMessageType(IPduHeaders::MESSAGE_TYPE_SEND_REQ); SetContentType(contentType); SetFrom(from); SetMmsVersion(mmsVersion); SetTransactionId(transactionId); return NOERROR; }
void BEmailMessage::SendViaAccount(int32 account) { _account_id = account; BMailAccounts accounts; BMailAccountSettings* accountSettings = accounts.AccountByID(_account_id); BString from; if (accountSettings) { from << '\"' << accountSettings->RealName() << "\" <" << accountSettings->ReturnAddress() << '>'; } SetFrom(from); }
NormalizedConstraintSet::DoubleRange::DoubleRange( DoublePtrType aMemberPtr, const char* aName, const dom::OwningDoubleOrConstrainDoubleRange& aOther, bool advanced, nsTArray<MemberPtrType>* aList) : Range<double>((MemberPtrType)aMemberPtr, aName, -std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity(), aList) { if (aOther.IsDouble()) { if (advanced) { mMin = mMax = aOther.GetAsDouble(); } else { mIdeal.emplace(aOther.GetAsDouble()); } } else { SetFrom(aOther.GetAsConstrainDoubleRange()); } }
NormalizedConstraintSet::LongRange::LongRange( LongPtrType aMemberPtr, const char* aName, const dom::OwningLongOrConstrainLongRange& aOther, bool advanced, nsTArray<MemberPtrType>* aList) : Range<int32_t>((MemberPtrType)aMemberPtr, aName, 1 + INT32_MIN, INT32_MAX, // +1 avoids Windows compiler bug aList) { if (aOther.IsLong()) { if (advanced) { mMin = mMax = aOther.GetAsLong(); } else { mIdeal.emplace(aOther.GetAsLong()); } } else { SetFrom(aOther.GetAsConstrainLongRange()); } }
ECode SendReq::constructor() { MultimediaMessagePdu::constructor(); // try { SetMessageType(IPduHeaders::MESSAGE_TYPE_SEND_REQ); SetMmsVersion(IPduHeaders::CURRENT_MMS_VERSION); // FIXME: Content-type must be decided according to whether // SMIL part present. SetContentType(String("application/vnd.wap.multipart.related").GetBytes()); AutoPtr<IEncodedStringValue> p; CEncodedStringValue::New(IPduHeaders::FROM_INSERT_ADDRESS_TOKEN_STR.GetBytes(), (IEncodedStringValue**)&p); SetFrom(p); SetTransactionId(GenerateTransactionId()); // } catch (InvalidHeaderValueException e) { // // Impossible to reach here since all headers we set above are valid. // Log.e(TAG, "Unexpected InvalidHeaderValueException.", e); // throw new RuntimeException(e); // } return NOERROR; }
TThisType& SetOpen(position_type from, position_type toOpen) { return SetFrom(from).SetToOpen(toOpen); }
AABB::AABB(const Sphere &s) { SetFrom(s); }
AABB::AABB(const OBB &obb) { SetFrom(obb); }
OBB::OBB(const AABB &aabb) { SetFrom(aabb); }
CAStreamBasicDescription::CAStreamBasicDescription(const AudioStreamBasicDescription &desc) { SetFrom(desc); }
TThisType& Set(position_type from, position_type to) { return SetFrom(from).SetTo(to); }
static void SetFrom(ABI::Windows::UI::Text::FontWeight* outputValue, ABI::Windows::UI::Text::FontWeight const& value) { SetFrom(&outputValue->Weight, value.Weight); }
int CSipTransaction::Init( CSipMessage* request ) { last_response = NULL; your_instance = NULL; static int itransactionid = 1; CVia* topvia; int i; time_t now; if (request == NULL) return -1; if (request->m_callid == NULL) return -1; if (request->m_callid->number == NULL) return -1; now = time(NULL); birth_time = now; transactionid = itransactionid; itransactionid++; topvia = (CVia*)request->m_listVias.GetAt(0); if (topvia == NULL) goto ti_error_1; i = SetTopVia(topvia); if (i != 0) goto ti_error_1; /* In some situation, some of those informtions might be useless. Mostly, I prefer to keep them in all case for backward compatibility. */ i = SetFrom(request->m_from); if (i != 0) goto ti_error_2; i = SetTo(request->m_to); if (i != 0) goto ti_error_3; i = SetCallId(request->m_callid); if (i != 0) goto ti_error_4; i = SetCseq(request->m_seq); if (i != 0) goto ti_error_5; /* RACE conditions can happen for server transactions */ /* (*transaction)->orig_request = request; */ this->orig_request = NULL; (this)->transactionff = new CFifo; if ((this)->transactionff == NULL) goto ti_error_6; return 0; ti_error_6 : delete ((this)->cseq); ti_error_5 : delete ((this)->callid); ti_error_4 : delete ((this)->to); ti_error_3 : delete ((this)->from); ti_error_2 : delete ((this)->topvia); ti_error_1 : delete (this); return -1; }
CDataToolGeneratedSrc::CDataToolGeneratedSrc(const CDataToolGeneratedSrc& src) { SetFrom(src); }