nsresult nsLDAPURL::Init(uint32_t aUrlType, int32_t aDefaultPort, const nsACString &aSpec, const char* aOriginCharset, nsIURI *aBaseURI) { if (!mBaseURL) { mBaseURL = do_CreateInstance(NS_STANDARDURL_CONTRACTID); if (!mBaseURL) return NS_ERROR_OUT_OF_MEMORY; } nsresult rv; nsCOMPtr<nsIStandardURL> standardURL(do_QueryInterface(mBaseURL, &rv)); NS_ENSURE_SUCCESS(rv, rv); rv = standardURL->Init(aUrlType, aDefaultPort, aSpec, aOriginCharset, aBaseURI); NS_ENSURE_SUCCESS(rv, rv); // Now get the spec from the mBaseURL in case it was a relative one nsCString spec; rv = mBaseURL->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); return SetSpec(spec); }
void scCachedStyle::Init( TypeSpec& ts ) { if ( ts.ptr() ) { TSGetStyle( ts, *this ); SetSpec( ts ); fTimeStamp = ++scCachedStyle::fCacheTime; fPtConv = (REAL)GetGlyphHeight() / scBaseRLUsystem; fSetConv = (REAL)GetGlyphWidth() / scBaseRLUsystem; InitWidths(); ComputeExtentsnCursor(); } else { TypeSpec nullSpec; SetSpec( nullSpec ); fPtConv = 0; fSetConv = 0; InitWidths(); fTimeStamp = 0; } }